D3.js—also called D3 or Data-Driven Documents—is a free, open-source JavaScript library for creating dynamic, data-driven visualizations in web browsers. It combines web standards with a flexible, sometimes pleasantly wordy, approach to chart construction. section 1.5.3
D3.js is especially useful when you need to:
- Create custom browser visualizations using SVG, HTML5, and CSS. section 1.5.3
- Choose only the library components a visualization needs instead of importing everything. section 1.5.3
- Work alongside front-end frameworks such as React or Angular. section 1.5.3
A basic bar chart
A simple fruit-data bar chart can be created in roughly 50 lines of D3.js code. D3 visualizations also appear in web publications such as The New York Times. section 1.5.3
Use the figure to inspect a basic D3.js bar chart built from fruit data. section 1.5.3


