CodeVetter · Repo Unpack · Extension points
d3/d3
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.
- src/index.js is the module registry. A new public symbol becomes part of the default build only by adding export * from "<package>" there. Order in that file is the order of the thirty current modules and matches package.json dependencies.
- test/d3-test.js treats package.json dependencies as the oracle: every new dependency is imported and its exports (except version) must appear on the umbrella. Removing an export from a dependency upgrade fails this test; adding a dependency without re-exporting it also fails.
- rollup.config.js default export is an array of three configs sharing one input and plugin list. A new bundle format is added by spreading config and overriding output, the same way the ESM and minified UMD entries are added. The terser reserved array is the mangling allowlist.
- themeConfig.sidebar in docs/.vitepress/config.ts is the navigation registry, grouped into Introduction, Visualization, Animation, Interaction, and Data. Nested items use text, link, collapsed, and items. what-is-d3.md walks that same structure to draw the module tree, so a sidebar edit changes both the nav and that diagram.
- docs/api.md is the hand-written symbol index. New documented functions are added as markdown links of the form [name](./d3-<module>/<page>.md#anchor). The docs link test will fail if the target file or anchor does not exist. Explicit anchors are written as {#name} in the markdown and picked up by getAnchors.
- Doc examples are Vue single-file components in docs/components/, imported from markdown via <script setup>. ExampleBlankChart, WorldMap, UsMap, LogoDiagram, PlotRender, and the quadtree helpers are the current set. A new example is a new .vue or .js file plus a markdown import; there is no component manifest.
- PlotRender is a tiny factory: props are options, mark, defer, and method (default "plot"). render() calls Plot[method](options). Markdown can pass :method and :options to select a different Plot entry point without editing the component.
- Theme enhanceApp is the app-wide hook. It currently sets globalThis.d3 and a $dark getter. CustomLayout.vue is where new homepage or navbar slots are attached (home-features-before, home-features-after, nav-bar-content-after). The footer is replaced through the Vite alias from VPFooter.vue to CustomFooter.vue.
- prebuild.sh is the CDN filename registry. Current packages are copied in a fixed pattern from node_modules/<name>/dist/<name>.js to docs/public/<name>.v<major>.js. Adding a module requires a new pair of cp lines plus matching .gitignore entries. Historical names (d3-collection, d3-hexbin, d3-hsv, queue, topojson, colorbrewer) are a frozen list, not generated.
- Vite custom-element predicate tag.startsWith("observable-") is how the external observable-made-by widget is allowed in templates. config.ts head is the registry for global scripts, icons, and the apple-touch icon.
- Markdown pages opt into VitePress features per front matter. docs/index.md sets layout: home, hero, features, and head canonical https://d3js.org. docs/api.md sets next: false and outline: 2. Those front-matter keys are the per-page extension points without editing config.ts.