Here are the most notable changes available in D3 5.0:
- D3 5.0 now uses Promises instead of asynchronous callbacks to load data. Promises simplify the structure of asynchronous code, especially in modern browsers that support async and await.
- D3 now also uses the Fetch API instead of XMLHttpRequest where the d3-request module has been replaced by d3-fetch.
- D3 5.0 also deprecates and removes the d3-queue module. Developers can use Promise.all to run a batch of asynchronous tasks in parallel, or a helper library such as p-queue to control concurrency.
- D3 no longer provides the d3.schemeCategory20 categorical color schemes. It now includes d3-scale-chromatic, which implements excellent schemes from ColorBrewer, including categorical, diverging, sequential single-hue and sequential multi-hue schemes.
- It also provides implementations of marching squares and density estimation via d3-contour. There are two new d3-selection methods:
- selection.clone for inserting clones of the selected nodes, and
- d3.create for creating detached elements.
- In addition, D3’s package.json no longer pins exact versions of the dependent D3 modules. This fixes an issue with duplicate installs of D3 modules.
As a developer you can be assured that the API has been very stable since the release of 4.0. The only significant breakage will be in adopting modern asynchronous patterns i.e. promises and Fetch.
You can download the latest version from d3.zip.
The latest release can also be linked directly by copying this snippet:
The list of entire changes and code files are available in the release notes.