/** * Population history for the selected server. * * One inline SVG, no charting library: a min–max band, an average line, and a * range switcher. The paths come from `lib/chart.ts`, which is pure and tested. */ import { historyLoading, historyRange, historySeries, setHistoryRange } from "../lib/state"; import { buildChart } from "../lib/chart"; import { HISTORY_RANGES } from "../lib/types"; /** Drawing box. `preserveAspectRatio="none"` stretches it to the panel width. */ const WIDTH = 300; const HEIGHT = 56; export function HistoryChart() { const series = historySeries.value; const loading = historyLoading.value; const range = historyRange.value; const geometry = series ? buildChart(series.points, WIDTH, HEIGHT) : null; return (
{loading ? "Loading history…" : "No recorded history for this range."}
)}