The benefits of using
- Not only generate the completed D3 library or D3 modules as same as official plans, such as
d3-selection, but also can customize D3 bundler taking one-method as a unit or modifies the prototype of modules.
- Tracking the latest release synchronize with official D3 library.
> npm install d3-v4-bundler> cd d3-v4-bundler
Keep the defualt config line on the top of the
To generate the completed D3(v4) library, whose result will be as same as the latest D3(v4) library that has been published.
To generate a d3 library with some specific modules
To generate a d3 library taking one-method as a unit
Modules && Methods Pattern
To combine modules and methods pattern.
Modules Prototype Modification Pattern
The D3 author gave a demo that showed
a method to customize D3 bundle using Rollup. This demonstrates importing
d3-transition, which modifies
selection.prototype to define
d3-v4-bundler can easily fulfill that propose as well.
3. Bundle the Custom D3
./index.js file, run the command line in
d3-v4-bundler directory as below:
> npm install && npm run build
4. D3 Bundle Output
All the custom D3 Bundle files can be found inside
. ├── d3.js // "umd" format ├── d3.min.js // "umd" format && uglified └── d3.node.js // "cjs" format