import problems d3 version 5
See original GitHub issueImporting by:
import legend from 'd3-svg-legend'
returns
export ‘legendColor’ (imported as ‘d3’) was not found in ‘d3’
Also importing the legendtype independently returns this error.
Because I am running d3 v5, I was wondering if this is a version issue or something I can solve myself?
regards Peer
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
import and use d3.parseCsv version 5 - Stack Overflow
After some searching I find https://github.com/d3/d3-dsv and d3.csvParse but this doesn't work as I'm expecting. const c ...
Read more >Unable to import d3 library based on the select method
In the below code, import d3 is not working and the corresponding d3.select function is not working for the d3 version 5.
Read more >Migrating to Version 4 of D3, part 1 | by Kristin Henry - Medium
The new version is full of big changes, and it's not backward compatible. For a full list of changes, go to the source!...
Read more >d3.scaleTime - Observable
D3's time scales operate on JavaScript Date objects. They can represent dates (day, month, year…), as well as hours, minutes, seconds and milliseconds, ......
Read more >d3-drag - npm
You can also download the latest release on GitHub. For vanilla HTML in modern browsers, import d3-drag from Skypack:.
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

In the end there was nothing wrong with my set of webpack rules. I had to attach the d3 plugins to the d3 library like
const d3 = Object.assign(d3Base, { legendColor, lineChunked })I followed the suggestion described in the following article: https://www.giacomodebidda.com/how-to-import-d3-plugins-with-webpack/Problem solved.
Ahhh excellent, thanks for posting the solution!