Difference among d3, d3@5, d3@6, etc.?

Dear all, is there any difference among d3, d3@5, d3@6, etc.?

Yes. When you require d3 with d3 = require('d3'), you will use the last published version of d3 on https://www.npmjs.com/package/d3. Currently it’s the version 6.2.0.

If you use d3 = require('d3@5'), you will specifically use the last published version of d3 in the 5.x.x branch. Same with ‘d3@6’. We generally use this to be sure that a notebook that works today will not suddenly stop working if a breaking change appears in a next version, say d3 7.0.0.

The detail of the versions is here: https://github.com/d3/d3/releases.

1 Like

Thank you very much! So this means we often use d3@5 or d3@6 rather than d3?

Yes, it’s what I do now.

Thank you!