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.

Banner


Google Reduces Support For Python, Dart And Flutter
01/05/2024

There are many reports that Google has removed people from its Python, Dart and Flutter teams and possibly more. What does this say about relying on Google as a source of technology for your projects? [ ... ]



Google Introduces JPEG Coding Library
15/04/2024

Google has introduced Jpegli, an advanced JPEG coding library that maintains high backward compatibility while offering enhanced capabilities and a 35% compression ratio improvement at high quality co [ ... ]


More News

raspberry pi books

 

Comments




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

Last Updated ( Tuesday, 01 September 2020 )