Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sovereign-intelligence/blob/main/docs/archive/drakestapleton.com-old/src/components/VolumeChart.tsx # sovereign-intelligence Front door to Drake Stapleton's sovereign stack. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `sovereign-intelligence / docs / archive / drakestapleton.com-old / src / components / VolumeChart.tsx` 47 lines · 1615 bytes Raw Blame History 1 import { VOLUME } from "../data/portfolio"; 2 3 function fmt(n: number): string { 4 if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`; 5 if (n >= 1000) return `${Math.round(n / 1000)}k`; 6 return String(n); 7 } 8 9 export function VolumeChart() { 10 const { months, added } = VOLUME; 11 const w = 960; 12 const h = 220; 13 const pad = { t: 16, r: 48, b: 28, l: 8 }; 14 const max = Math.max(...added); 15 let run = 0; 16 const cum = added.map((n) => (run += n)); 17 const maxC = cum[cum.length - 1]; 18 const bw = (w - pad.l - pad.r) / added.length; 19 const bars = added.map((n, i) => { 20 const bh = (n / max) * (h - pad.t - pad.b); 21 return { x: pad.l + i * bw + 4, y: h - pad.b - bh, h: bh, n }; 22 }); 23 const line = cum 24 .map((n, i) => { 25 const x = pad.l + i * bw + bw / 2; 26 const y = h - pad.b - (n / maxC) * (h - pad.t - pad.b); 27 return `${i === 0 ? "M" : "L"}${x.toFixed(1)},${y.toFixed(1)}`; 28 }) 29 .join(" "); 30 31 return ( 32 33 {bars.map((b, i) => ( 34 35 ))} 36 37 {months.map((m, i) => ( 38 39 {m} 40 41 ))} 42 43 peak {fmt(max)} · total {fmt(maxC)} 44 45 46 ); 47 }