Trends: one chart area for every metric, Money included, drawn by the shared module
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed
Money was its own tab with its own renderers (renderMoney, renderMoneyCumulative, renderMoneyDaily, renderMoneyLegend), its own period and spend-mode toggles, and its own titles. It is now a metric of Trends like the others: the definitions come from CoOpChart.CHART_METRICS, the chart is drawn by the shared renderChart(), and the Money tab is a shortcut into Trends with that metric selected. Removed: TREND_CONF, trendVal, trendLabel, the four money renderers, the period/spend-mode toggles (the single Period row governs every metric now) — 5.1k chars of duplicate chart code. Added: METRIC_SOURCE (which fetch each metric needs), buildMetricButtons() (buttons rendered from the shared list, so the panel and dashboard describe the same charts in the same order), and the metric-aware renderTrends() that delegates. The daily token-spend view is now the shared "spend" metric — the same numbers the metrics endpoint already served, so nothing is lost by dropping the second source. No caption under the money chart, as before. Harness rewritten for the new path (it drove renderMoney): invariants preserved — 2 cumulative polylines + single-point balance marker, shared tooltip host, legend that IS the definition's series list, 5 ascending ticks with the top clearing the max, 30-day slice. New: every shared metric has a button, and a metric with no source says so instead of drawing another chart. Tests green (page JS, pins, guest guard).
This commit is contained in:
1 parent
79f3f00165
commit
fba50e3f93
5 files changed
+390
-288
No files matched your search
@@ -21,7 +21,7 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
CANONICAL_SHA256 = "a029fd40189acc38b8b218921c56e24e0208c8c8e0ab550a320bbd57449f5fed"
|
||||
CANONICAL_SHA256 = "233c39faa7b40a9827fefd21aeb5505fdfa770833de2decebc8fe8bbbaee1903"
|
||||
SPLICE = 'PAGE_HTML = PAGE_HTML.replace("/*@@CHART_MODULE@@*/", CHART_MODULE_JS)'
|
||||
|
||||
failures = []
|
||||
|
||||
Reference in new issue
Block a user