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/PracticeTimeline.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 / PracticeTimeline.tsx` 224 lines · 7556 bytes Raw Blame History 1 import { useState } from "react"; 2 import { PRACTICE_SNAPSHOT, PRACTICE_TIMELINE } from "../data/practice"; 3 import { HisWords } from "./VoiceMark"; 4 5 type TimelineMetric = "linesAdded" | "commits" | "conversationTokens"; 6 7 const CHARTS: Record< 8 TimelineMetric, 9 { 10 button: string; 11 title: string; 12 subtitle: string; 13 totalLabel: string; 14 source: string; 15 color: string; 16 } 17 > = { 18 linesAdded: { 19 button: "Lines added", 20 title: "Weekly source lines added", 21 subtitle: "Text additions across 94 SHA-deduped project trees I own", 22 totalLabel: "source lines added in the timeline", 23 source: "Git history", 24 color: "#a9462b", 25 }, 26 commits: { 27 button: "Commits", 28 title: "Weekly unique commits", 29 subtitle: "Distinct commit SHAs across the same 94 project trees", 30 totalLabel: "unique commits in the timeline", 31 source: "Git history", 32 color: "#5a4668", 33 }, 34 conversationTokens: { 35 button: "AI conversation", 36 title: "Weekly retained AI conversation tokens", 37 subtitle: "Human and assistant message text from the coding desks I operated", 38 totalLabel: "conversation tokens in the detailed timeline", 39 source: "Claude, Codex, and Grok transcripts", 40 color: "#9a712d", 41 }, 42 }; 43 44 const compactNumber = new Intl.NumberFormat("en-US", { 45 notation: "compact", 46 maximumFractionDigits: 1, 47 }); 48 49 const fullNumber = new Intl.NumberFormat("en-US"); 50 51 const shortDate = new Intl.DateTimeFormat("en-US", { 52 month: "short", 53 year: "2-digit", 54 timeZone: "UTC", 55 }); 56 57 const longDate = new Intl.DateTimeFormat("en-US", { 58 month: "short", 59 day: "numeric", 60 year: "numeric", 61 timeZone: "UTC", 62 }); 63 64 function dateFromWeek(week: string): Date { 65 return new Date(`${week}T00:00:00Z`); 66 } 67 68 function getLabelIndexes(length: number): Set { 69 const count = Math.min(length, 6); 70 const indexes = Array.from({ length: count }, (_, index) => 71 Math.round((index * (length - 1)) / Math.max(count - 1, 1)), 72 ); 73 return new Set(indexes); 74 } 75 76 export function PracticeTimeline() { 77 const [metric, setMetric] = useState("linesAdded"); 78 const chart = CHARTS[metric]; 79 const points = 80 metric === "conversationTokens" 81 ? PRACTICE_TIMELINE.filter((point) => point.conversationTokens > 0) 82 : PRACTICE_TIMELINE; 83 const values = points.map((point) => point[metric]); 84 const maximum = Math.max(...values); 85 const total = values.reduce((sum, value) => sum + value, 0); 86 const peakIndex = values.indexOf(maximum); 87 const peak = points[peakIndex]; 88 const labelIndexes = getLabelIndexes(points.length); 89 90 const width = 1040; 91 const height = 350; 92 const padding = { top: 24, right: 18, bottom: 50, left: 76 }; 93 const innerWidth = width - padding.left - padding.right; 94 const innerHeight = height - padding.top - padding.bottom; 95 const step = innerWidth / points.length; 96 const barWidth = Math.max(3, step * 0.72); 97 const yTicks = [0, 0.25, 0.5, 0.75, 1]; 98 const coverageStart = points[0]?.week ?? PRACTICE_TIMELINE[0].week; 99 100 return ( 101
102
103
104

What I made over time

105

I can see the work accumulate.

106
107
108 {compactNumber.format(total)} 109 {chart.totalLabel} 110
111
112 113
114 {(Object.keys(CHARTS) as TimelineMetric[]).map((key) => ( 115 124 ))} 125
126 127
128
129 {chart.title} 130 {chart.subtitle} 131
132
133 138 {chart.title} 139 140 {`${chart.subtitle}. The peak week is ${longDate.format(dateFromWeek(peak.week))} at ${fullNumber.format(maximum)}.`} 141 142 143 {yTicks.map((tick) => { 144 const y = padding.top + innerHeight - tick * innerHeight; 145 return ( 146 147 155 163 {compactNumber.format(maximum * tick)} 164 165 166 ); 167 })} 168 169 {points.map((point, index) => { 170 const value = point[metric]; 171 const barHeight = maximum === 0 ? 0 : (value / maximum) * innerHeight; 172 const x = padding.left + index * step + (step - barWidth) / 2; 173 const y = padding.top + innerHeight - barHeight; 174 return ( 175 176 184 {`${longDate.format(dateFromWeek(point.week))}: ${fullNumber.format(value)}`} 185 186 {labelIndexes.has(index) && ( 187 195 {shortDate.format(dateFromWeek(point.week))} 196 197 )} 198 199 ); 200 })} 201 202
203
204 205
206

207 Coverage 208 {longDate.format(dateFromWeek(coverageStart))} to {PRACTICE_SNAPSHOT.display} 209

210

211 Peak week 212 {longDate.format(dateFromWeek(peak.week))} · {fullNumber.format(maximum)} 213

214

215 Source 216 {chart.source} 217

218
219

220 The final week covers 10 through 13 August. I keep each measure attached to its own unit and source. 221

222
223 ); 224 }