// Lightweight inline SVG charts for the TechyFuel OS kit (data viz, not icons). function AreaLine({ data, width = 520, height = 160, color = 'var(--blue-600)', fill = 'rgba(37,99,235,0.10)', id = 'al' }) { const max = Math.max(...data) * 1.15, min = Math.min(...data) * 0.85; const pad = 6; const x = i => pad + (i * (width - pad * 2)) / (data.length - 1); const y = v => height - pad - ((v - min) / (max - min)) * (height - pad * 2); const pts = data.map((v, i) => [x(i), y(v)]); const line = pts.map((p, i) => `${i ? 'L' : 'M'}${p[0].toFixed(1)} ${p[1].toFixed(1)}`).join(' '); const area = `${line} L${x(data.length - 1)} ${height - pad} L${x(0)} ${height - pad} Z`; return ( {[0.25, 0.5, 0.75, 1].map(g => )} {pts.map((p, i) => i === pts.length - 1 ? : null)} ); } function Bars({ data, labels, width = 520, height = 160, color = 'var(--blue-500)', highlight = 'var(--blue-600)' }) { const max = Math.max(...data) * 1.1 || 1, pad = 6, gap = 10; const bw = (width - pad * 2 - gap * (data.length - 1)) / data.length; return ( {[0.33, 0.66, 1].map(g => )} {data.map((v, i) => { const h = ((v / max) * (height - 30)); const x = pad + i * (bw + gap); const last = i === data.length - 1; return ( {labels && {labels[i]}} ); })} ); } function Donut({ segments, size = 150, thickness = 22 }) { const total = segments.reduce((s, x) => s + x.value, 0); const r = (size - thickness) / 2, c = 2 * Math.PI * r; let offset = 0; return ( {segments.map((s, i) => { const len = (s.value / total) * c; const el = ; offset += len; return el; })} {total} projects ); } function Spark({ data, width = 100, height = 32, color = 'var(--green-500)' }) { const max = Math.max(...data), min = Math.min(...data); const x = i => (i * width) / (data.length - 1); const y = v => height - ((v - min) / (max - min || 1)) * height; const line = data.map((v, i) => `${i ? 'L' : 'M'}${x(i).toFixed(1)} ${y(v).toFixed(1)}`).join(' '); return ; } Object.assign(window, { AreaLine, Bars, Donut, Spark });