use specific D3 ES6 modules?
See original GitHub issueInstead of import * as d3 from 'd3';
we can import the specific D3 functions and/or modules we are using.
This ought to cut down bundle sizes. It’s a big task though!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
es6 module import of d3 4.x fails - Stack Overflow
It turns out d3 uses package.json to allow it to export two formats from a single source, npm itself. To do so, it...
Read more >es6 import syntax example? #20 - d3/d3-collection - GitHub
I think that there's should be an example on the Readme for how to import the library using the es6 import syntax.
Read more >Creating Data Visualization with D3: Using D3 with ES6
D3 : Bar Chart using CSV · JavaScript ES6 Modules · Swift Programming Tutorial for Beginners (Full Tutorial) · Data Layer in Google...
Read more >D3 is now modular - Medium
Modularity means a lot of different things. In the D3 world, it has some specific meaning. Here are some notes from a D3...
Read more >Using and bundling individual D3 modules - Derek Swingley
I tweaked the original to use individual modules via script tags referencing d3js.org. Here's a bl.ock showing that.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have been reading the rollup documentation and plugin system. It has quite a lot of goodies.
It should be possible that in our sources we use specific imports, but for some of the release versions we can rewrite it to d3.
I am currently modifying the stocks sample to use different models - a rollup generated bundle, directly module etc. I will publish these as an experimental PR for our discussion.
As preparation
utils.add
andutils.subtract
need to be updated to not used3[funcName]
to call a function. I will create a separate PR for this.