07 — Data
Charts
Hand-rolled SVG is the default: width="100%", a fixed height, a viewBox from the data range. Colors are foreground, muted-foreground and primary, with highlight permitted for one genuine third series when solid-versus-dashed and outline rings are exhausted.
Hand-rolled SVG
Reference forms: timeline strip, differential line, paired curve (solid foreground, dashed muted-foreground), share bars (outline ring, not a hue) and the governed third line, one of the few sanctioned chart uses of Turquoise. Grid lines are muted-foreground at 0.15, the zero axis at 0.4, axis labels mono at 11px.
Observable Plot — the one sanctioned library
When scales, axes, many series or interaction genuinely warrant a library, Observable Plot is the single sanctioned choice. Restyle it to the palette: explicit mark colors (never its default scheme), no color legend, square bars, muted grid marks, mono axes, and highlight reserved for the one genuine third line.
import * as Plot from "https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6/+esm";
const chart = Plot.plot({
width: 640, height: 240,
style: { background: "transparent", color: "var(--foreground)",
fontFamily: "var(--font-mono)", fontSize: "11px" },
x: { label: null }, y: { label: null },
marks: [
Plot.gridY({ stroke: "var(--muted-foreground)", strokeOpacity: 0.15 }),
Plot.ruleY([0], { stroke: "var(--muted-foreground)", strokeOpacity: 0.4 }),
Plot.lineY(data, { x: "t", y: "v", stroke: "var(--foreground)", strokeWidth: 1.5 }),
Plot.lineY(data, { x: "t", y: "u", stroke: "var(--muted-foreground)",
strokeWidth: 1.5, strokeDasharray: "4 3" }),
// Only when a genuine second series needs distinguishing from both lines:
Plot.lineY(data, { x: "t", y: "w", stroke: "var(--highlight)", strokeWidth: 1.5 }),
],
});
Rules
- Explicit palette colors per mark. Never Plot's default color scheme.
- No color legend. Series are told apart by solid versus dashed, fill opacity, or an outline ring.
- Square bars. Muted grid. Axes in the mono label pattern. Tabular figures on every value.
highlightfor a genuine third line only, never a default third color because it is there.- Hand-rolled SVG first; reach for Plot only when complexity earns it.