docs(adr-0023): charts and dashboards — d3 + observable plot #170
Reference in New Issue
Block a user
Delete Branch "docs/adr-0023-charts-d3-observable-plot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Records the decision to use D3 + Observable Plot, wrapped in a new
libs/shared/charts/, as the chart toolkit shared byportal-shellandportal-admin. ADR-only — implementation lands as the next chantier(s).This is staged as a 3-PR chantier per the agreed plan:
libs/shared/charts/foundations + 3 starter components (<lib-bar-chart>,<lib-donut-chart>,<lib-stacked-bar-chart>)./auditpage — daily-volume bar + outcome-breakdown donut + event-type-over-time stacked bar.What lands
docs/decisions/0023-charts-d3-observable-plot.mdFull MADR 4.0.0 record. Highlights:
ariaplugin afterthought (ECharts), or narrower vocabulary + brittle dark-mode (Chart.js). Both furthest from the Angular-Signals-zoneless idiom the rest of the workspace runs on._internal/(palette, tabular fallback, SVG<title>/<desc>builders) so every chart inherits WCAG 2.2 AA + AAA-targeted compliance from the lib, not from contributor discipline. Six commitments, each unit-tested per chart component.<lib-*-chart>exposes the same Signal-based input shape ([data],[caption],[description],[ariaLabel],[colorScheme]) regardless of whether Plot or raw D3 powers the rendering.docs/decisions/README.mdADR-0023 added to the index table.
CLAUDE.md0001 → 0023.Notes for the reviewer
libs/shared/charts/next tolibs/shared/ui/._internal/folder for cross-cutting code? Single source of truth for the colour palette and the a11y plumbing. A lint rule (added in PR 2) will ban consumers from importingd3-scale-chromaticdirectly so the colour-blind-safe palette stays the only path.Test plan
docs/decisions/README.mdindex updated in the same change per the ADR conventions.pnpm add -w d3 @observablehq/plot @types/d3,libs/shared/charts/scaffold viapnpm nx g @nx/angular:library --name=shared-charts --directory=libs/shared/charts --standalone=true --unitTestRunner=vitest-analog --tags="scope:shared,type:shared" --no-interactive, then the 3 starter components.What's next
If accepted as-is, PR 2 (lib foundations + 3 starter components) follows. If a reviewer wants to push back on D3-vs-ECharts or on the a11y contract's strictness, this is the right PR to surface that — no implementation has started.