Context
chart.js is a dependency with exactly one use: src/lib/components/ResultsPanel.svelte:3. Everything else charts with uplot, which is smaller and faster. Carrying two charting libraries means two rendering models, two theming paths, and two bundle costs.
Small, self-contained cleanup. Part of #19.
Scope
- Port the chart in
ResultsPanel.svelte (line and bar) to uPlot
- Remove
chart.js from package.json and the lockfile
- Confirm no other import survives:
grep -rn "chart.js\|from 'chart" src/
- Keep theme awareness — the chart must restyle on light/dark switch
Where to look
src/lib/components/MetricChart.svelte is the smallest existing uPlot wrapper; copy its options shape
src/lib/components/logs/LogHistogram.svelte shows uPlot bars
- Theme detection today is
document.documentElement.classList.contains('dark')
Notes
Best picked up after the units and colors modules land, so the port uses the shared formatter and palette instead of inventing a third one. It can be done before them, but then expect a follow-up.
Acceptance criteria
- The results-panel chart renders line and bar the same as before
chart.js is gone from package.json, the lockfile, and node_modules
- The production bundle is measurably smaller
npm run check and npm run build both pass
Context
chart.jsis a dependency with exactly one use:src/lib/components/ResultsPanel.svelte:3. Everything else charts withuplot, which is smaller and faster. Carrying two charting libraries means two rendering models, two theming paths, and two bundle costs.Small, self-contained cleanup. Part of #19.
Scope
ResultsPanel.svelte(line and bar) to uPlotchart.jsfrompackage.jsonand the lockfilegrep -rn "chart.js\|from 'chart" src/Where to look
src/lib/components/MetricChart.svelteis the smallest existing uPlot wrapper; copy its options shapesrc/lib/components/logs/LogHistogram.svelteshows uPlot barsdocument.documentElement.classList.contains('dark')Notes
Best picked up after the units and colors modules land, so the port uses the shared formatter and palette instead of inventing a third one. It can be done before them, but then expect a follow-up.
Acceptance criteria
chart.jsis gone frompackage.json, the lockfile, andnode_modulesnpm run checkandnpm run buildboth pass