Context
An stx chart component library for ReportsHQ, built on ts-charts (~/Code/Libraries/ts-charts - our complete D3 rewrite: @ts-charts/scale, shape, axis, selection, interpolate, format, ...). No third-party chart libs. Where ts-charts lacks something (e.g. a higher-level chart preset, a missing curve, brush polish), improve it upstream and bun run release:patch.
Read the dataviz skill before writing any chart code, and take its color/mark/interaction discipline seriously - these charts ARE the product.
Scope
resources/components/charts/:LineChart,AreaChart,BarChart(grouped + stacked),DonutChart,BigNumber(value + delta vs comparison),DataTable,FunnelChart,Heatmap- each an.stxcomponent taking the query-engine result shape (#10) plusvizoptions (#9).- Theming from the #3 tokens only: categorical palette defined as chart tokens in
tokens.css(light + dark variants, contrast-checked per the dataviz skill); no hardcoded hex in components. - Axes/formatting via
@ts-charts/axis+@ts-charts/format: adaptive tick density, compact number formats (1.2k, 3.4M), currency-aware when the measure issum(value)with currency. - Interactions: shared hover tooltip (crosshair for time series), legend toggling, keyboard-focusable data summaries for accessibility; respect
usePreferredReducedMotion()- no entrance animation theatrics. - SSR-safe: server renders a real SVG (reports must be crawlable/sharable, #16); client hydrates interactions. Remember the auto-imports rule: TS modules imported by the stx entry must import their own dependencies explicitly.
- Empty/loading/error states per component (skeleton, "no data in range", partial-data notice) - designed, not default-gray.
- A dev-only gallery route rendering every component against fixture data in both themes; this is the review surface for the design pre-flight.
- Component tests on fixture data (rendered SVG structure, formats), not just snapshots.
Acceptance
- Gallery passes the
stacks-design-tastepre-flight in light and dark; seeded demo reports (#9) render through these components with real query results (#10).
Depends on #3, #10. Blocks #12, #13. Part of #1 (M3 Reporting core). Ground rules: see #1.