D3
by Observable, Inc. · Library · also known as D3.js, Data-Driven Documents
Modular JavaScript library for bespoke, data-driven web graphics: scales, axes, shapes, layouts, geo projections, transitions and DOM selections
Overview
D3 (Data-Driven Documents) is a JavaScript library created by Mike Bostock and maintained with Observable under the ISC license. Rather than offering chart types, it provides low-level building blocks: selections that bind data to DOM elements, scales and axes, shape generators for lines, areas and arcs, layouts for hierarchies, forces, chords and treemaps, geographic projections and path generators, color schemes, interpolators, transitions, and zoom, drag and brush behaviors. Developers compose these into SVG or Canvas graphics with complete control over form and interaction, which is why D3 underlies most custom data journalism graphics and many higher-level libraries, including Observable Plot and parts of Vega.
D3 is distributed as ES modules (one package or thirty-odd sub-packages) and runs in browsers, Node.js, Observable notebooks and Observable Framework. The cost of that flexibility is effort: standard charts take far more code than in Plotly or Altair, and knowledge of SVG, the DOM and JavaScript is required. For Python-centric researchers it is usually reached through Observable or a web front end rather than directly.
Capabilities
- Data joins binding arrays to DOM elements
- Scales, axes and color schemes
- Shape generators and hierarchical, force and chord layouts
- Geographic projections and GeoJSON/TopoJSON rendering
- Transitions, zoom, drag and brush interactions
- Modular ES packages usable in browsers and Node.js
Typical workflows
- Custom interactive graphic for a web publication
- Map visualizations with projections and TopoJSON
- Building a higher-level charting component for a web app
Strengths
- Unlimited control over visual form
- Mature, stable and widely documented
- ISC license
Limitations
- Verbose for standard charts
- Requires JavaScript, SVG and DOM knowledge
- No built-in chart types
Prerequisites
- A JavaScript environment (browser, Node.js, Observable)
Who it is for
- Front-end and visualization developers
- Data journalists
Alternatives & comparison
- Leaflet
Lightweight open-source JavaScript library for interactive tile-based web maps with markers, vector layers and a large plugin ecosystem
Open sourceOpen source - MapLibre
Open-source vector-tile map renderers for web (GL JS) and native platforms, forked from Mapbox GL and governed by a community organisation
Open sourceOpen source - Matplotlib
The foundational Python plotting library for static, publication-quality figures with full control over every element, exported to PDF, SVG, PNG and PGF
Open sourceOpen source - Observable
JavaScript data notebooks and the open-source Observable Framework static-site generator for data apps, from the maintainers of D3 and Plot
MixedFreemium - Plotly
MIT-licensed interactive charting libraries for Python (plotly.py), JavaScript (plotly.js) and R, plus the Dash framework for analytical web apps
MixedOpen source - Vega-Altair
Declarative Python visualization library that compiles concise chart specifications to Vega-Lite JSON for interactive, grammar-of-graphics plots
Open sourceOpen source
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensechecked Nov 1, 2026
- Official documentationchecked Nov 1, 2026
- Official sitechecked Nov 1, 2026
- Repositorychecked Nov 1, 2026
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Data visualization
Microsoft Power BI
Microsoft · BI & dashboards
Microsoft's business-intelligence suite: free Windows Power BI Desktop for modeling and reports, and the Power BI service in Microsoft Fabric for sharing
Matplotlib
Matplotlib Development Team (NumFOCUS) · Data visualization
The foundational Python plotting library for static, publication-quality figures with full control over every element, exported to PDF, SVG, PNG and PGF
Tableau
Salesforce · BI & dashboards
Salesforce's visual analytics platform: Tableau Desktop authoring (now with a free edition), Tableau Cloud and Server for sharing, and Tableau Next for CRM analytics