feat: AreaChart, a shared smooth filled graph with a day timeline
Back to our planSummary
A shared graph piece that draws "how much over time" as a smooth curve with a soft fill, a faint baseline, a day timeline and a marker on today's value, replacing the thin, rough Sparkline look.
Details
Part of #1188; chosen design in its comments and the mockups. Native-first check (2026-11-14): the chart system behind Chart (ADR 0018) draws article charts (units, bar, stacked) with a caption and a numbers table; it has no line or area kind, and the existing Sparkline (#1128) is the precedent for a small plain-SVG activity picture outside that system, so this is a UI-kit piece in the same family rather than a new chart kind. The smooth curve is a small pure, tested function (monotone cubic, never dipping under the baseline) in src/platform/lib/, so no chart library is needed. The piece takes the series, the dates for the timeline labels (first, middle, today), a colour tone from theme tokens (done and open each get one) and a text label; it draws on the server with no client JavaScript, in light and dark. A series of zeros is the flat baseline. The numbers are always written by the caller, and the label gives every value to screen readers.
Acceptance criteria
- Not done:
AreaChartdraws the smooth curve, fill, baseline, timeline labels and today's marker from theme tokens only (no colour literals), in light and dark. - Not done: The curve function is tested: it passes through every point, never leaves the plot, and handles empty, one-value, all-zero and flat series.
- Not done: Every graph has an accessible name that lists the values; axe passes; it holds its alignment at the six review widths.
- Not done: Gallery entry, component-set row, the generated component references and the UI kit note change in the same PR.
- Not done: Nothing uses it yet.
Files likely touched
src/platform/ui/AreaChart.tsx and its test, src/platform/lib/ (curve function and test), src/platform/ui/README.md, src/app/(frontend)/dev/gallery/, docs/ui/component-set.md, docs/reference/
Must not touch
The roadmap module, pages, the chart port and its adapters.
Generated by Claude Code, opens in a new tab