The D3.js Library for Data Visualization

By Lillian Pierson

D3.js is an open-source JavaScript library that’s taken the data visualization world by storm since its first release in 2011. It was created (and is maintained) by Mike Bostock — famous data visualization guru and Graphics Editor for the New York Times. You can use this library to create high-quality Data-Driven Documents (D3) in a fraction of the time and with a fraction of the effort required to code in plain (a.k.a., vanilla) JavaScript.

In its essence, D3.js is a collection of classes and functions that, with just a little coding, you can use to execute much longer strings of lower‐]level JavaScript. D3.js calls on only a special class of commands in the JavaScript library — the ones that are typically used in data visualization. You use these commands to do things like draw axes, plot elements, and recalculate ­positions when resizing graphs.

If your goal is to create dynamic web-based data visualizations — visualizations that change in response to user interactions — D3.js is the perfect JavaScript library to use.

If you want users to be able to interact with your data visualization and choose what data to display, then you need to create a dynamic visualization.

With dynamic data visualizations, your users can

  • Interact with the visualization to choose what data to display.

  • See additional data when they hover over or click parts of the visualization.

  • Drill down into deeper levels of related data, to get more detailed views on the parts of the data that are of most interest.

  • Bring up animated visualizations that show changes over time.

  • Choose from a variety of different transitions between views.

The D3.js library is still being developed. With Mike Bostock and countless other users contributing new types of visualizations, the library’s capabilities are expanding on a daily basis. The D3.js design philosophy is rather open-ended. It doesn’t limit you to using predefined, cookie-cutter data visualizations. Rather, this library can accommodate the individual creativity and imagination of each unique user.