Friday, December 27, 2019

Dragging in D3 charting to an Angular application allows for some jQueryesque nastiness.

Import like so:

import * as d3 from 'd3';

 
 

Make a variable:

private host: d3.Selection<any>;

 
 

Then do stuff:

let innerWrapper = this.host.select("#outerWrapper")
   .append("div")
   .attr("id", "innerWrapper")
   .style("max-width", '800px');

No comments:

Post a Comment