One of the main breaking changes between d3 v3 and d3 v4 is that they changed the names of the scale functions. Depending on your use case and your experience with d3, your best solution might be to use v3 rather than v4 in your project.


Check the version of d3 you use and the version of 3d used from the place you took this code. Make sur they matches. You can also find what changed between these versions and update your code accordingly.

Related Query