"use client"; // Mini-Verlaufskurve für die Matrix-Zeilen: der Trend eines Elements über alle Planjahre // auf einen Blick. Die per-Jahr-Werte existieren seit 0.11 (ElementPhaseComputed.yearly) -- // hier werden sie nur gezeichnet, nicht neu gerechnet. Reines SVG, keine Chart-Bibliothek. export function Sparkline({ values, width = 64, height = 16, className = "", }: { values: number[]; width?: number; height?: number; className?: string; }) { if (values.length < 2) return null; const min = Math.min(...values, 0); const max = Math.max(...values, 0); if (max === min) return null; // flache Linie trägt keine Information const pad = 1.5; const x = (i: number) => pad + (i / (values.length - 1)) * (width - 2 * pad); const y = (v: number) => pad + (1 - (v - min) / (max - min)) * (height - 2 * pad); const points = values.map((v, i) => `${x(i).toFixed(1)},${y(v).toFixed(1)}`).join(" "); return ( ); }