Charts in this stack are Go functions that return an SVG string, dropped into a
template with @templ.Raw(...). There is no client-side charting library and no
canvas — the server computes geometry and emits markup, the same way the map in
view/usmap.go does. The general builders live in
view/chartrender.go; page-owned ones live beside their view —
view/statusbar.go, view/landing.go (StatesMapSVG, cumulativeSVG —
gf-341/347/354) and view/territory.go (TerritoryMapSVG /
TerritoryStateSVG, Project() pins — gf-364). The shared helpers
(foLabel, hueShift/hueStyle, ff2, scEsc) stay in chartrender.go
and are IMPORTED, never copied.
The thing that makes this stack different from every other charting approach: you
never write a color. No hex, no rgb(), no oklch() literal, no fill="steelblue".
Every stroke and fill is currentColor, and the system.css engine computes that color
from a single number — --fg — that you set on the element or its group. Get this one
idea right and the rest is just coordinate math.
Read references/worked-example.md for a complete, annotated build (the
spend-vs-volume bubble chart: Go builder + renderer data method + templ wiring
- a backend-driven series toggle). ⚠ It is a PATTERN document — its code was swept in gf-33 and is NOT in the tree; the SHIPPED exemplars to copy structure from are view/chartrender.go (cssLayersStackSVG / repoLocStackSVG + the CSSMetricsSection legend in view/admin_dev.templ, live on Admin → Metrics) and view/statusbar.go.