D3.JS 5 Adds Promises
D3.JS 5 Adds Promises
Written by Kay Ewbank   
Monday, 26 March 2018

There's a new version of D3.js, the JavaScript library for manipulating documents based on data. The new release adds support for promises instead of asynchronous callbacks to load data.

D3 provides a way to work with 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.

Data can be displayed as bubbles

The main change to the new version of D3 is that it now uses promises rather than asynchronous callbacks to load data. Promises simplify the structure of asynchronous code, especially in modern browsers that support async and await. The change to using promises means D3 now uses the Fetch API instead of XMLHttpRequest. Fetch supports a number of new features, such as streaming responses. These give you access to sections of the data as they are available rather than forcing the app to wait until the entire set of data is generated.

Another change to the new version is that D3 no longer provides the twenty-color categorical color schemes. These could cause problems because their grouped design could falsely imply relationships in the data. When data points share a hue, the user can interpret that as being a group, and changes in lightness can imply order. D3 has changed to use d3-scale-chromatic, which implements schemes from ColorBrewer that the developers describe as 'excellent'. The schemes this provides include categorical, diverging, sequential single-hue and sequential multi-hue schemes. These schemes are available in both discrete and continuous variants.

The final main change in the new version is the addition of implementations of marching squares and density estimation via d3-contour. The implementation includes methods for inserting clones of the selected nodes, and for creating detached elements. Geographic projections now support projection.angle, which has enabled several new polyhedral projections.

d3jslogo 

More Information

D3.js Website

Related Articles

Talking About Languages

D3.js By Example

 

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, FacebookGoogle+ or Linkedin.

Banner


HHVM 3.25 Defaults To PHP7
28/03/2018

Developers from Facebook have released a new version of HHVM, the Hip Hop Virtual Machine. The PHP support in new release has been changed to default to PHP 7 rather than the PHP 5 of the previous ver [ ... ]



Mozilla Makes WebAssembly For The Rest Of Us
16/04/2018

WebAssembly - it's the next big thing. Until now the problem has been that you had to be dedicated, to say the least, to get involved. Now Mozilla has a way that we can all try it out  with WebAs [ ... ]


More News

 
 



Comments




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

Last Updated ( Monday, 26 March 2018 )
 
 

   
Banner
RSS feed of news items only
I Programmer News
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.