Chart Libraries or Build It Yourself: The Routes

Chart Libraries or Build It Yourself: The Routes

D3 or a chart library is a false binary. Five delivery routes, what each buys and charges, and the four questions that decide — without a ranking or a popularity figure.

"D3 or a chart library" is a false binary — D3's scale and shape modules are the layer underneath several of the libraries it is framed against. The real question is how far up the stack you buy, and there are five answers: primitives, grammar-of-graphics, batteries-included engines, performance specialists, and framework-native wrappers. What decides between them is how unusual the chart is, how deep the interaction goes, who maintains it after the author leaves, and which constraints — bundle, license, accessibility, server rendering — quietly rule a route out. Popularity decides nothing, and this guide ranks nothing.

The binary that isn't

The question arrives phrased as a fork in the road. Do we bring in a charting library, or do we do it properly with D3?

The phrasing misreads what D3 is. It is not a charting library that competes with charting libraries; it is a set of independent modules, and the most-downloaded of them (npm, July 2026) are the ones that do not touch the DOM. Its scale module — the functions that map a data value to a visual value, most often a pixel position — and its shape module, which generates path geometry for lines, areas, and arcs, appear as dependencies inside several of the higher-level libraries the fork supposedly asks you to choose instead (as of Nov 2026, npm registry; check the dependency lists of any candidate yourself, since this is the kind of fact that changes quietly).

So the honest reframe is that several of the libraries in the framing sit on the same primitive layer underneath, and the decision is about how much is built on top of it and by whom. That reframe is what makes this decision durable. The routes below are a taxonomy of ownership, and ownership does not go out of fashion. A leaderboard of libraries would be stale before the next major version.

The five routes

RouteWhat it buysWhat it charges
PrimitivesComplete expressiveness — any encoding, any mark, any interaction you can describeEvery line of rendering, interaction, and accessibility is code your team maintains forever
Grammar-of-graphicsEnormous leverage — declare the encoding, the engine derives the drawingA wall the moment the design steps outside the grammar the engine implements
Batteries-included engineA good chart quickly, with interaction, legends, and export in the boxBending it past the options its authors imagined ranges from awkward to impossible
Performance specialistDraw speed for dense series that general engines struggle withNarrow scope — you get the chart it was built for, not the chart you invent
Framework-native wrapperThe best ergonomics inside one framework's component modelYou inherit its assumptions, its abstraction leaks, and its release cadence

Read the table as five positions on one axis — how much of the drawing stack you own — rather than as five products competing for the same job. A team can end up at more than one position across a codebase, and that is not incoherence. A conventional dashboard tile and a bespoke diagnostic visualization have genuinely different answers.

What actually decides the route

Four questions settle it, and none of them is "which is best."

How unusual is the chart? A bar chart, a line chart, a stacked area — these are solved problems in every route, and paying for expressiveness you will not use is one way to end up maintaining a thousand lines of chart code that a configured engine would have drawn identically. The higher routes stop paying at exactly the point where the encoding stops being conventional: a chart with a custom mark, an unusual coordinate system, or an interaction that drives the rest of the page.

How deep is the interaction? A configured tooltip and a built-in zoom are cheap in an engine that ships them. A brush that filters three sibling components, publishes its selection into application state, and animates the transition is where the engine's abstraction starts fighting you, and where the primitives begin to look less expensive than they did.

Who maintains it after the author leaves? This is the question that a bespoke chart must answer and often has no good answer to. A hand-rolled visualization is written once, enthusiastically, by the one person who most wanted to write it. It is then maintained for years by people who did not. The library route is, among other things, a bet that a maintained upstream is cheaper than an unmaintained internal one — and for conventional charts, that bet is often the right one.

Which constraints rule a route out before preference gets a vote? A bundle budget can eliminate a batteries-included engine on a marketing page. A commercial license can eliminate one in a product that must ship on-premises. An accessibility obligation can eliminate any route whose accessibility support is undocumented — and "undocumented" is a verifiable fact, not an opinion. A requirement to render the chart in a scheduled report, where there is no browser at all, eliminates every route that has no server story.

Mixing routes on purpose

A shape production codebases can converge on is not a single route but a deliberate split.

The team owns the data shaping and the scales — the parts that encode domain knowledge, that carry the honesty decisions about baselines and missing values, and that are pure functions worth testing. The drawing, which is commodity work for a conventional chart, is delegated to an engine or a component library. The chart stays yours where the meaning lives and is rented where the pixels live.

The seam that makes this safe is the same one the render-target decision depends on: keep the data-to-pixel layer independent of whatever draws. When the engine is replaced — because it stalled, because the license changed, because the chart outgrew it — the domain logic and its tests survive the swap.

That is the real reason to structure it this way. Every route is a bet on a library, and libraries in this space can stall, change license, or break their APIs. The layered structure is how you make the bet reversible, which is a very different thing from making it correctly.

Reading the landscape without ranking it

You can evaluate any candidate library on evidence you verify yourself, in an afternoon, without trusting anyone's ranking:

  • Does it document accessibility support, in its own documentation, with specifics? Silence here is an answer.
  • Does it document server-side rendering? If a scheduled report is anywhere on the roadmap, this is a hard filter.
  • What is its breaking-change history? Read the releases, not the marketing page.
  • What does it depend on, and how heavy is that in your bundle?
  • What does its issue tracker say about the specific surfaces you need — not in aggregate, but the three that matter for your chart?

Some honest cautions about the current landscape, each of which should be re-checked at the time you are deciding rather than taken from this page (as of Nov 2026). Breaking major versions are common here — several of the most widely used engines (by npm downloads) have shipped one within the last two years, which is worth knowing before you pin a version and walk away. At least one prominent grammar-style library remains pre-1.0, which is not a criticism but is a fact about API stability that belongs in a decision record. And the "library X is dead" claims that circulate in this space can be false: before accepting or repeating an abandonment claim, check the project's own releases and announcements. Slower release cadence is not a deprecation notice.

What this guide will not supply is a popularity figure. Download counts and stars measure adoption of a package, not fit for your chart, and this guide cites no figure for what share of teams use any of these libraries. A route is chosen from your constraints, not from someone else's traffic.

The decision record

Write down four things, and the next maintainer will not have to re-litigate any of them.

The route, and the chart characteristics that chose it — unusualness, interaction depth, maintenance reality.

The surfaces you are inheriting from the library rather than building: interaction, accessibility, export, server rendering. Each one is a promise the library is making on your behalf, and each one should have been verified in its documentation, not assumed.

The constraints that ruled other routes out, so that a future reader does not helpfully "simplify" by reintroducing the option that the license or the bundle budget already eliminated.

And the exit plan. Which layers are yours (scales, shaping, the accessible fallback), what a swap would actually cost, and what signal would trigger one — a stalled upstream, a requirement the route cannot meet, a tenfold growth in data.

Re-open the record when the chart's requirements change. Moving down a route because the chart outgrew an engine is a normal event, not a failure of the original decision. What is a failure is discovering the constraint after the engine has been wired into forty components.

Project Inquiry