Replace score bars with Google Gauge visualization

This commit is contained in:
Harwinder Sekhon
2026-08-15 11:34:19 -04:00
parent a979dcba4b
commit 5694a1ed0c
3 changed files with 55 additions and 5 deletions
+1 -5
View File
@@ -174,13 +174,9 @@ function renderContext() {
/* ── timeframe cards ──────────────────────────────────────────── */
function scoreBar(label, score) {
const v = Math.max(-100, Math.min(100, score ?? 0));
const pct = Math.abs(v) / 2;
const cls = v >= 0 ? "pos" : "neg";
return `<div class="scorebar">
<span class="lbl">${label}</span>
<div class="track" role="img" aria-label="${label} score ${v.toFixed(1)} of ±100">
<div class="fill ${cls}" style="width:${pct}%"></div>
</div>
<div class="gauge-container" style="height: 160px;" data-label="${label}" data-score="${v}"></div>
<span class="val num">${v >= 0 ? "+" : ""}${v.toFixed(1)}</span>
</div>`;
}