CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

d3/d3

Scanned commit ca958d4521 dated 2026-05-28 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/d3/d3 ↗ · 168 files · 1.3 MB

D3: Data-Driven Documents D3 (or D3.js) is a free, open-source JavaScript library for visualizing data.

Deep analysis by cli:grok via the grok CLI on 2026-09-22 (359s) — every claim below links to its cited source files.

Overview

d3 7.9.0 is the umbrella package and documentation site for D3 (Data-Driven Documents), Mike Bostock's low-level JavaScript library for bespoke, web-standards visualizations. This repo does not implement the algorithms: src/index.js star-re-exports thirty sibling packages (d3-array through d3-zoom), Rollup builds UMD and ESM bundles, and VitePress renders the d3js.org docs. Consumers import the barrel or a CDN bundle; the site is deployed to GitHub Pages on push to main.

System map

The runtime library boundary is a one-file barrel plus npm dependencies. Rollup turns bundle.js into dist/d3.js, dist/d3.mjs, and dist/d3.min.js. The docs app is VitePress under docs/, with the sidebar declared in docs/.vitepress/config.ts. There is no database or server. GitHub Actions tests on Node 20 with yarn, and the deploy workflow publishes the VitePress build to GitHub Pages after copying historical CDN assets from the sibling repo d3/d3.github.com.

Feature catalog

User-facing surface area is the bundled D3 API, documented module by module, plus the docs site itself. The sidebar groups thirty modules into Visualization, Animation, Interaction, and Data. Getting started covers Observable, ESM and UMD CDN, npm, React, and Svelte. The homepage adds a shuffled Observable gallery, version and star counts, and an Observable promo. Legacy CDN files for retired modules are still copied into the site but are not part of the v7 barrel.

All 13 feature catalog claims →

Data flow

Library data never touches this repo at runtime. An application import resolves to src/index.js, which re-exports the installed d3-* packages. The UMD/CDN path is different: Rollup freezes those same exports into dist, and prebuild.sh copies them into docs/public. The docs site reads markdown, a local volcano JSON, the GitHub API, the Observable gallery module, and jsDelivr atlases, then VitePress writes a static tree.

Behavior traces

Three flows matter: importing the library, building and deploying the site, and rendering a doc example. Import resolution stops at the barrel. The build flow is prepublishOnly, then prebuild.sh, then VitePress. Example charts call scale, axis, and selection helpers in a fixed order inside Vue mounted hooks, and the two Mocha tests walk package.json and the docs tree respectively.

Testing signals

Tests are Mocha plus ESLint, two files, no jsdom component suite and no image snapshots. test/d3-test.js checks that the barrel re-exports every dependency symbol except version. test/docs-test.js checks internal markdown links and anchors. CI on Node 20 runs eslint, the mocha suite, the Rollup build, and the docs build. Algorithm correctness is assumed to be tested in the individual d3-* repositories, which are not present here.

Risk map

The hottest risks are supply-chain and publish footguns, not application auth. Docs build executes a remote Observable module, the site loads a third-party script, and map examples fetch atlases from jsDelivr at view time. prebuild.sh does not fail fast, the test workflow never checks out d3.github.com, and postpublish force-pushes tags if someone publishes. The barrel, sidebar, API index, and prebuild copy list can drift, and this repo has no tests for the actual visualization code.

All 13 risk map claims →

Extension points

New behavior is not plugged in through a runtime plugin host. The extension surfaces are the barrel export list, package.json dependencies (which the parity test treats as the registry), the Rollup output array, the VitePress sidebar, docs/api.md, the prebuild copy table, and Vue components dropped into docs/components and imported from markdown. PlotRender's method prop and the theme enhanceApp hook are the two small dispatch points.

Contributor handoff

Edit the barrel, the docs, and the release wiring. Do not vendor algorithm source into this repo. Read package.json, src/index.js, rollup.config.js, docs/.vitepress/config.ts, and the two tests before changing exports or pages. Use yarn. Build dist before any docs command. Never run the postpublish script unless a human explicitly asked to publish and push tags. The link test is strict about .md suffixes and header slugs.

Languages

LanguageFilesShare of source
Markdown119docs/config
Vue2157%
JavaScript1232%
JSON5docs/config
TypeScript38%
YAML2docs/config
CSS1docs/config
Shell13%

Start reading here

Probable source entrypoint: src/index.js — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (1 files)

Source layout — src/

PathFiles
src/index.js1

Repository structure

Top-level pathFiles
docs/151
.github/3
test/3
src/1

Docs found: README.mddocs/api.mddocs/community.mddocs/d3-array.mddocs/d3-array/add.mddocs/d3-array/bin.mddocs/d3-array/bisect.mddocs/d3-array/blur.mddocs/d3-array/group.mddocs/d3-array/intern.md

Package

package.json — d3 v7.9.0, 40 declared dependencies.

@observablehq/plot@observablehq/runtime@rollup/plugin-json@rollup/plugin-node-resolve@rollup/plugin-terserd3-arrayd3-axisd3-brushd3-chordd3-colord3-contourd3-delaunay

CI & config entrypoints

Structural health signals

Average score 9.2/10 across 36 analyzed source files; 1 hotspot surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history