From 7ac7a0326387012b1aad6ebc692c26b5620289b4 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 12 Nov 2026 19:07:11 +0100 Subject: fix(dashboard): stroke only the top of the chip graphs The CPU, GPU and network graphs stroked their closed area path, so the outline also ran along the bottom edge and up the left side while the history filled. Each series is now a filled area and an open line through the samples, and only the line is stroked. Co-Authored-By: Claude Opus 5.5 --- tests/test_dashboard.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_dashboard.mjs b/tests/test_dashboard.mjs index 2fc19eb..dac4e5b 100644 --- a/tests/test_dashboard.mjs +++ b/tests/test_dashboard.mjs @@ -15,7 +15,7 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import assert from "node:assert/strict"; -import { area, push, spendParts, batteryGlyph, HISTORY } from "../static/dashboard.js"; +import { area, line, push, spendParts, batteryGlyph, HISTORY } from "../static/dashboard.js"; import { busy as printing } from "../static/modules/k1c.js"; import { busy as building } from "../static/modules/sbbuilder.js"; import { busy as live } from "../static/modules/obs.js"; @@ -32,6 +32,11 @@ const d = area([0, 10], 10); assert.match(d, /^M[\d.]+,100 /); assert.match(d, / L120,100 Z$/); assert.ok(d.includes(",12"), "the max sample sits at 12% from the top"); +// line: the same samples, open, so no bottom or side edge is stroked +assert.equal(line([], 10), ""); +const l = line([0, 10], 10); +assert.match(l, /^M[\d.]+,100 L120,12$/); +assert.ok(d.includes(l.slice(1)), "area follows line"); // spendParts: top 3 paid models, then "other" with the rest const models = [5, 4, 3, 2, 1, 0].map((c, i) => ({ model: `m${i}`, cost: c })); -- cgit v1.2.3