By definition, D3.js, or D3, or Data-Driven Documents, is a JavaScript library that uses digital data to drive the creation and control of dynamic and interactive graphical forms which run in web browsers.
What is d3.js
It is a tool for data visualization in W3C-compliant computing, making use of the widely implemented Scalable Vector Graphics, JavaScript, HTML5, and Cascading Style Sheets standards.
In other words, D3 is a JavaScript library for manipulating documents based on data, bringing the data to life using HTML, SVG, and CSS.
How to use d3.js
Unfortunately because D3 is fairly new, there aren’t a lot of documentation and resources available for people that are just starting out. First thing’s first. Let’s add the D3 library to our index.html.
Let’s create some divs and style them blueviolet.
The most important feature of D3 is the ability to bind data easily to web elements. Let’s bind some data to the divs that we created.
Let’s add some transition to the graphs!
Conclusion
And that’s it! We were able to bound data and do some animation with it as well! We used D3 methods like .style, .data, and .transition in order to manipulate data on the DOM. I find D3 fascinating, and I hope you did too! In this day and age where data is the most expensive and valued commodity, it is great to visualize the data in a beautiful and meaningful way.