D3 v7: What the Data-Driven Documents Library Actually Commits You To
Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:
At a glance
- What is it?
- D3 is a low-level JavaScript library for building visualizations against SVG, Canvas and HTML. Its value is flexibility, and its cost is that you write the rendering logic yourself.
- Who is it for?
- Adopt D3 when you need a chart or graphic that no existing library produces and you are willing to own the rendering code. Do not adopt it as a default replacement for a charting library, because the README offers no component layer and no default styling.
- Can I use it commercially?
- Yes. ISC is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 111 days ago.
- What is it written in?
- Mainly Shell, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The Problem D3 Solves Is the Last Ten Percent of a Chart
Most charting libraries cover the charts their authors anticipated. The moment a design calls for something outside that set, a bespoke annotation layer, a non-standard axis treatment, a custom interaction, the library either exposes an escape hatch or it does not. D3 takes the opposite position: it exposes primitives and assumes you will assemble them. The README describes this as a low-level approach built on web standards, and that phrase is doing real work. D3 does not hand you a chart. It hands you scales, selections, shape generators and transitions, and you compose them into whatever the design requires.
The audience follows from that. D3 is for engineers and data practitioners who are comfortable writing JavaScript against the DOM and who have a specific graphic in mind that existing tools do not produce. It is also for the authors of those higher-level libraries. The README states that D3 has become a foundational building block of higher-level chart libraries, which is the clearest signal of where it sits in the stack. If you want a bar chart by Friday and nothing unusual about it, D3 is a longer path than the alternatives.
Selections, Data Joins and the Enter-Update-Exit Model
The mechanism the README points at is data-driven rendering. You bind an array to a selection of DOM elements, and D3 reconciles the two. Elements that have no corresponding datum enter the document, elements whose datum changed are updated, and elements whose datum disappeared exit. That reconciliation is the core of the library and the reason it is described as data-driven rather than declarative. You are not describing a chart in configuration. You are describing how a set of elements should correspond to a set of data points.
Because the output targets are web standards, the same data can be rendered as SVG elements, as drawing calls on a Canvas context, or as HTML nodes. The README lists all three. The choice is not cosmetic. SVG gives you inspectable elements that respond to CSS and pointer events, and it degrades as element counts climb. Canvas gives you a single bitmap that stays responsive at high point counts but gives up per-element styling and event handling. D3 supplies generators and scales that work with either, and leaves the trade-off to you.
The repository itself is largely Shell, which is unusual for a JavaScript library and worth noting plainly. It indicates the repository is organised around build, release and tooling scripts, with the library published as a set of packages rather than a single hand-written source tree. Anyone planning to fork or patch D3 should expect to work through that tooling rather than editing a single file.
Installing D3 and the Version You Actually Get
The README does not include an install command. It links to the documentation site, the examples gallery, the releases page and a community page, and that is the extent of the setup material in the repository description. So the concrete instructions have to come from the documentation rather than from the README, and that is a real friction point for a library this widely used. Expect to leave the repository to get started.
The conventional path is npm. The package is published as d3, and the current release line is v7, with v7.9.0 published on 12 March 2024 according to the release list. Installing the umbrella package pulls in the full set of modules. If you only need scales and selections, the modular structure means you can depend on the individual sub-packages instead, which keeps the bundle smaller, though the README does not spell out which sub-package maps to which capability. You will need the documentation for that mapping.
Version choice matters more than it usually does. The release history shows v7.8.4 in April 2023, v7.8.5 in June 2023 and v7.9.0 in March 2024, with nothing listed after that. That is a slow cadence on the v7 line. Whether that reflects a stable API or reduced activity is not something the repository description answers, and you should not infer either from the gap alone.
The Cost of Owning the Rendering Layer
The flexibility is the limitation. Because D3 does not ship chart components, every axis label, tick format, legend, tooltip and responsive breakpoint is code you write and code you maintain. A library that gives you a chart component absorbs that work and constrains your design. D3 does the reverse. For a one-off graphic this is a reasonable trade. For a dashboard with twenty standard charts, you are reimplementing a charting library badly, one chart at a time.
There is a second failure mode around updates. The enter-update-exit model is powerful and easy to get subtly wrong. If the key function you use to match data to elements is unstable, elements are destroyed and recreated on every update, which discards transitions and internal state. The library will not warn you. The visual result is a chart that flickers or an animation that restarts, and the cause is in your key function, not in D3.
Accessibility is a third gap. SVG produced by D3 is a set of shapes with no inherent semantics. A screen reader sees path elements. Adding roles, labels and a text alternative is entirely on the author, and nothing in the README suggests the library does any of it for you. If accessible output is a requirement rather than an afterthought, budget for it explicitly.
D3 Versus Vega-Lite: Imperative Code Against a Declarative Spec
The clearest contrast is with Vega-Lite. Vega-Lite takes a declarative JSON specification describing marks, encodings and data, and compiles that specification into a rendered chart. You describe what the chart is. D3, by contrast, is imperative: you write JavaScript that constructs and updates elements, and you describe how the chart is built. The difference shows up the moment you need behaviour the specification language does not cover. In Vega-Lite you hit the edge of the grammar and either extend it or leave. In D3 there is no grammar to hit, because you were writing the rendering logic from the start.
The trade runs the other way for standard output. A Vega-Lite specification for a grouped bar chart is a short JSON document. The D3 equivalent is a script that sets up scales, axes, a data join and a transition, and that script is yours to debug. Choosing between them is mostly a question of how far your requirements sit from the common case, and how much rendering code your team is prepared to own. D3 is the better answer when the answer is a lot. Vega-Lite is the better answer when it is not.
Licence, Maintenance and What a Fork Implies
D3 is released under the ISC licence, a permissive licence that allows use, modification and redistribution provided the copyright notice and permission notice are retained. That is close to MIT in effect. It is compatible with commercial and closed-source use, and it does not impose a copyleft obligation on your own code. This is a general description of the licence family, not legal advice; if your organisation has specific requirements, have counsel read the actual licence text in the repository.
The maintenance picture is harder to read from the release history. The last push is dated 28 May 2026 and the repository is not archived, so the project is active. But the release list stops at v7.9.0 in March 2024. An active repository with no release in the listed window could mean ongoing work on a future major version, or documentation and tooling changes that do not warrant a release. The repository does not say which.
Upgrade cost on the v7 line looks low, since the patch releases are close together and the major version has held. The risk sits at the next major boundary. D3 has historically reworked its module structure across majors, and the repository's Shell-heavy layout suggests the build and packaging pipeline is where that work happens. Pin your version, read the release notes before moving, and treat a major bump as a migration rather than a routine update.
Who Should Install D3 and Who Should Not
Install D3 if you are building a visualization that does not exist yet, if you need control over the DOM and the drawing surface, or if you are writing a library that other people will use to make charts. The low-level model is the point in those cases, and no higher-level tool will give you the same reach.
Do not install it if your requirement is a set of standard charts rendered consistently, if your team does not want to own rendering code, or if accessibility and responsive behaviour need to come out of the box. In those cases a declarative library is less work and less risk, and D3 will cost you more than it returns.
The thing to verify first is the documentation, not the repository. The README is a signpost to d3js.org, Observable notebooks and the community page, and it contains no install command, no API reference and no worked example. Before you commit, open the documentation site, confirm it matches the version you intend to install, and check that the examples gallery covers the kind of graphic you are building. If your target graphic is not represented there, assume you are writing the rendering logic yourself and plan accordingly.
Editorial conclusion
Adopt D3 when you need a chart or graphic that no existing library produces and you are willing to own the rendering code. Do not adopt it as a default replacement for a charting library, because the README offers no component layer and no default styling. Before committing, check the current version on npm, read the release notes for the API changes between the version you install and the one you were targeting, and confirm whether the project is maintained by the same team as the documentation site you are reading.
Community notes