A word-sized rounded step trace of the last 7 days and today over the figure's normal band; grey unless off normal the way that needs action.
$ npx shadcn@latest add @highcommand/band-sparklineCopies the source into your project and pulls in what it needs (3 other items). First time? Add the registry to components.json.
A word-sized line (Tufte) over the figure's normal range: the last 7 days and today, drawn as a rounded step trace (one run a day, corners rounded) over the normal range as a lattice band (two hairlines and a fine hatch).
seriesrequiredKeyFigure['series']—The last 7 days and today, oldest first; a point with no value leaves a gap.
bandrequiredKeyFigure['band']—The figure's normal range, drawn as a band behind the line; none draws no band.
tonerequiredStatusColor—Status colour for the line; `neutral` and `on_track` stay grey.
wnumber120Width of the drawing in SVG units (default 120); it stretches to its container.
hnumber18Height of the drawing in SVG units (default 18).
stepPath(runs: Run[], r?: number): stringOne SVG path through `runs` (left to right, contiguous): each run is a horizontal stretch at its y; between runs the line steps vertically at the boundary, with corners of radius `r` (smaller when a step or a run is too short to hold it).
seriesRuns(values: (number | null)[], w: number, y: (v: number) => number, pad?: number): Run[][]Runs for a daily series laid across `w`: one run per point, centred on its slot; a null leaves a gap (it splits the series).
fmtFigure(unit: FigureUnit, v: number | null | undefined, compact?: boolean): stringA figure's number as the strip prints it: counts whole, percentages with one decimal, money through fmtMoney (minor units in; compact: $62,360, $349k, $1.32M).
bandText(f: Pick<KeyFigure, "unit" | "band">): string | null"normal 78–86%", "normal 0", "normal $1.31M–$1.48M".
fmtStripMoney(minor: number, more?: number): stringMoney as the strip prints it, the same rule as fmtMoney's compact form (whole dollars rounded half up; from $100k, "$349k" and "$1.32M"), with `more` extra significant digits: "$1.317M", "$348.6k". Under $100k the figure is already whole dollars.
stripMoney(values: Record<string, number>): Record<string, string>D4: the strip's money figures, keyed by figure. Two that would print the same (AR and AP both "$1.32M") both take one more significant digit ("$1.317M", "$1.318M"), so the strip never shows two different amounts as one. Any two in the strip, not only neighbours: the person can arrange the tiles, so any two can sit side by side.
sinceDelta(f: Pick<KeyFigure, "today" | "hourly">, sinceMs: number): { delta: number; at: number; } | nullThe change since the person left: now against the hourly reading nearest "since you left" (within 45 minutes either side; none further off, never a guess), and when that reading was. Null without one.
fmtDelta(unit: FigureUnit, d: number): string"+3", "−2", "±0"; "+1.2 pt" for a percentage; "+$12,300" or "+$349k" for money (a true minus, as the figures print it).
bandBasis(f: Pick<KeyFigure, "band">): stringWhere the band comes from, said once (tooltips, the explanation panel).
Install this free piece now; the Pro pieces drop in on top of it, in the same app. Pro is $79 once.