question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import problems d3 version 5

See original GitHub issue

Importing 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ppeercommented, Jun 7, 2019

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.

0reactions
susielucommented, Jun 6, 2019

Ahhh excellent, thanks for posting the solution!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found