Closed zhuyinjing closed 6 years ago
import * as d3Color from 'd3-color'
import * as d3Interpolate from 'd3-interpolate'
import * as d3ScaleChromatic from 'd3-scale-chromatic'
Also, here is a reference for creating your own bundle. Try using StackOverflow for that kind of questions ;-)
Hey all - thanks for a great module. Not seeing the recommended ES6 pattern in the README, I checked for closed issues on a whim and found this.
FWIW, I think this is worth adding after the npm install
instructions there, along with possibly an explanation of why it works like that / why those packages are also required.
I believe the preferred method would look something like this:
import { schemeBlues } from 'd3-scale-chromatic';
Any of the API methods of the form d3.x
from this package can be imported as import { x } from 'd3-scale-chromatic'
.
Way better, thank you @curran
hey . i use Vue.js in my project. and i want to use d3-scale-chromatic in my project. i try
and when i
console.log(d3.interpolateYlGn(0))
it shows error__WEBPACK_IMPORTED_MODULE_0_d3__.interpolateYlGn is not a function
what's wrong with my code? thanks a lot!!!