D3 5.0 is out!

2 min read

D3.js, the popular javascript library is now available in version 5.0. This version D3 5.0, introduces only a few non-backward-compatible changes.

D3.js is a JavaScript library for manipulating documents based on data. D3 combines powerful visualization components and a data-driven approach to DOM manipulation. It helps bring data to life using HTML, SVG, and CSS without restriction to a proprietary framework.

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:
<script src=“https://d3js.org/d3.v5.min.js”></script>

The list of entire changes and code files are available in the release notes.

Content Marketing Editor at Packt Hub. I blog about new and upcoming tech trends ranging from Data science, Web development, Programming, Cloud & Networking, IoT, Security and Game development.


Please enter your comment!
Please enter your name here