D3.JS 6 Adds Iterable Support
Written by Kay Ewbank
Tuesday, 01 September 2020

There's a new version of D3.js, the JavaScript library for manipulating documents based on data. Improvements in D3 v6 include a move to using native collections (Map and Set), as well as the ability to accept iterables.

D3.js is a JavaScript library for manipulating documents based on data using HTML, SVG, and CSS. Its use of standard web techniques avoids the need for a proprietary framework. The library offers data visualization components and a data-driven approach to DOM manipulation. The data display elements can be used to create graphs, interactive graphics, data-based maps, and information dashboards.

[画像:d3jslogo]

This release has adopted ES2015, including support for iterables and collections (Map and Set). ES2015 added the iterable protocol so that objects can be made iterable and capable of being used in a for...of loop. It also introduced new data structures including Map and Set. Maps are collections of keys and values of any type, while Sets are ordered lists of values that contain no duplicates. Instead of being indexed like arrays are, sets are accessed using keys.

[画像:Data can be displayed as bubbles]

Alongside the iterables and collections support, new aggregate functions have been added to replace d3.nest. The new functions are d3.group and d3.rollup, and the developers say they work well with d3-hierarchy and d3-selection. New helpers have been added to d3-array, too, including d3.greatest, d3.quickselect, and d3.fsum.

D3 now passes events directly to listeners, replacing the d3.event global and bringing D3 inline with vanilla JavaScript and most other frameworks. Another improvement is d3-delaunay, which is based on the library for Delaunay triangulation of 2D points. The new function replaces d3-voronoi, and offers dramatic improvements to performance, robustness, and search, according to the development team. Another development based on Delaunay is d3-geo-voronoi for spherical (geographical) data.

Other function improvements include an expanded d3-random that includes a fast linear congruential generator for seeded randomness; d3-chord has new layouts for directed and transposed chord diagrams; and d3-scale adds a new radial scale type.

Finally, more than 450 examples have been updated to D3 v6.

[画像:d3jslogo]

More Information

D3.js Website

Related Articles

D3.JS 5 Adds Promises

D3.js By Example (Book Review)

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


Blockly Moving To Raspberry Pi Foundation
31/10/2025

Blockly is moving to a new home. Having originated as a single-person project at Google in 2011, it is now a vibrant open source project which has moved into robotics as well as being at the heart of [ ... ]



Europe Gets Its Own LLM
10/11/2025

EuroLLM is a fully open-sourced large language model made in Europe and built to support all twenty-four official EU languages.


pico book

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 01 September 2020 )