Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love using d3 to make visualizations, the only bad thing about it is that so many demos and tutorials seem to have been made on v3 which requires some minor adjustments to get the same code working on v4+.


The breaking changes from V3 to V4 was a real problem, imo. A lot of it was the same functionality just reorganized.

A better approach would have been to leave the old code running with stubs to the new method signatures. As it is, if you want to migrate code from V3 to V4, it takes a lot of mostly annoying and tedious work that could have been done once by a little bit of code that calls the new code from the old method signature. Have a d3V3toV4.js translator library in there if you want, but don't make people update years of code to get on the latest versions of the API.


It took me hours to realize that all those beginner tutorials are based on v3 while I included current v5 and nothing worked.

I was litteraly unable to use the current version and went to implement v3 code based on tutorial and demo availability.

To this day I'm still planning to port everything to the current d3 version some time in the future.


so true. I think this is one of the downsides of d3 being so prolific in the past.

all examples on Observable are up-to-date, so searching on here could be useful:

https://observablehq.com

and if you find a bl.ock that you really want to port, this changelog could be helpful:

https://github.com/d3/d3/blob/master/CHANGES.md#changes-in-d...

most of the changes are simple name changes that put the methods directly on `d3`: eg. from `d3.scale.linear()` to `d3.scaleLinear()`




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: