I am trying to import d3 v4 into a typescript project using jspm and systemjs. I can import d3 correctly using this
import * as d3 from 'd3';
This works, and it allows me to make selections, etc. I tried to use the attr function and passed it an object that did not work. I found that d3 v4 includes this as a separate module.
After downloading this d3-selection-multi module with jspm. I am trying to import it into my project like this.
import * as d3 from 'd3';
import 'jspm_packages/npm/d3-selection-multi@1.0.0';
Then I try to use the attrs function, but the console logs the following error
(index): 40 Error: (SystemJS) d3.selectAll (...). data (...). style (...). attrs is not a function (...)
I also get some compilation error that I get all the time, but still they still compile and the code runs
error TS2307: Cannot find module 'd3'
error TS1110: Type expected
- , , ?