Commit Graph
1 Commits
Author SHA1 Message Date
inference-admin e6d27b3775 chart module: add the definition layer — one description of every chart
The two UIs shared only the drawing primitives, so the same five metrics shipped
with different titles AND different kinds (the panel's "Spend per day" was the
dashboard's "What the co-op spent (members + the co-op's own accounts)"), and
Money was a whole separate tab with four renderers of its own.

CHART_METRICS is now the one place a chart is described — id, title, kind
(line|bar|multi), axis rule, value formatter, series — and renderChart() draws any
of them, registering the exact tooltip values and breaking lines at NULLs as
before. Money is a metric like the others (a "multi" chart: cumulative revenue,
cumulative token spend, and the OC balance as a gap before snapshots began).
fmtMoney/fmtMetric/fmtMoneyTick are shared so labels cannot drift.

Each app keeps what legitimately differs: its data source, its toggle classes, its
empty-state markup, its DOM. Nothing identifying belongs in this list.
2026-11-13 20:55:52 +00:00