@silverpoint/core 0.2.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/render/round.ts","../src/render/seed.ts","../src/diagnostics/diagnose.ts","../src/scales/util.ts","../src/scales/scales.ts","../src/charts/shared/format.ts","../src/charts/shared/cells.ts","../src/charts/shared/cartesian.ts","../src/charts/shared/polar.ts"],"names":["read","format","at"],"mappings":";;;AAGO,SAAS,OAAO,KAAA,EAAuB;AAC5C,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,KAAA,CAAM,KAAA,GAAQ,GAAG,CAAA,GAAI,GAAA;AAC1C,EAAA,OAAO,MAAA,CAAO,EAAA,CAAG,OAAA,EAAS,EAAE,IAAI,CAAA,GAAI,OAAA;AACtC;AAEA,IAAM,MAAA,GAAS,yCAAA;AAGR,SAAS,cAAc,CAAA,EAAmB;AAC/C,EAAA,OAAO,CAAA,CAAE,OAAA,CAAQ,MAAA,EAAQ,CAAC,KAAA,KAAU,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAC,CAAC,CAAA;AACnE;AAEA,SAAS,UAAU,IAAA,EAAkB;AACnC,EAAA,OAAO;AAAA,IACL,CAAA,EAAG,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA;AAAA,IAChB,CAAA,EAAG,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA;AAAA,IAChB,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,KAAK,CAAA;AAAA,IACxB,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,MAAM;AAAA,GAC5B;AACF;AAEA,SAAS,YAAY,MAAA,EAAwB;AAC3C,EAAA,OAAO,EAAE,GAAG,MAAA,EAAQ,GAAG,aAAA,CAAc,MAAA,CAAO,CAAC,CAAA,EAAE;AACjD;AAEA,SAAS,UAAU,IAAA,EAAkB;AACnC,EAAA,OAAO;AAAA,IAC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geometry, Rect, Stroke, Tile } from '../types';\n\n/** Rounds to 2 decimals, the precision of every emitted coordinate (REQ-002). */\nexport function round2(value: number): number {\n const rounded = Math.round(value * 100) / 100;\n return Object.is(rounded, -0) ? 0 : rounded;\n}\n\nconst NUMBER = /-?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][-+]?\\d+)?/g;\n\n/** Rounds every number inside SVG path data to 2 decimals. */\nexport function roundPathData(d: string): string {\n return d.replace(NUMBER, (token) => String(round2(Number(token))));\n}\n\nfunction roundRect(rect: Rect): Rect {\n return {\n x: round2(rect.x),\n y: round2(rect.y),\n width: round2(rect.width),\n height: round2(rect.height),\n };\n}\n\nfunction roundStroke(stroke: Stroke): Stroke {\n return { ...stroke, d: roundPathData(stroke.d) };\n}\n\nfunction roundTile(tile: Tile): Tile {\n return {\n ...tile,\n width: round2(tile.width),\n height: round2(tile.height),\n angle: round2(tile.angle),\n strokes: tile.strokes.map(roundStroke),\n };\n}\n\n/** Rounds all coordinates of a geometry to 2 decimals, returning a new object (REQ-002). */\nexport function roundGeometry(geometry: Geometry): Geometry {\n return {\n viewBox: roundRect(geometry.viewBox),\n plot: roundRect(geometry.plot),\n strokes: geometry.strokes.map(roundStroke),\n labels: geometry.labels.map((label) => ({ ...label, x: round2(label.x), y: round2(label.y) })),\n hitAreas: geometry.hitAreas.map((hit) => ({\n ...hit,\n x: round2(hit.x),\n y: round2(hit.y),\n ...(hit.box ? { box: roundRect(hit.box) } : {}),\n })),\n defs: geometry.defs.map(roundTile),\n };\n}\n","import type { Seed } from '../types';\n\nconst FNV_OFFSET_BASIS = 0x811c9dc5;\nconst FNV_PRIME = 0x01000193;\n\nfunction utf8Bytes(input: string): number[] {\n const bytes: number[] = [];\n for (const char of input) {\n const code = char.codePointAt(0) ?? 0;\n if (code < 0x80) {\n bytes.push(code);\n } else if (code < 0x800) {\n bytes.push(0xc0 | (code >> 6), 0x80 | (code & 0x3f));\n } else if (code < 0x10000) {\n bytes.push(0xe0 | (code >> 12), 0x80 | ((code >> 6) & 0x3f), 0x80 | (code & 0x3f));\n } else {\n bytes.push(\n 0xf0 | (code >> 18),\n 0x80 | ((code >> 12) & 0x3f),\n 0x80 | ((code >> 6) & 0x3f),\n 0x80 | (code & 0x3f),\n );\n }\n }\n return bytes;\n}\n\n/**\n * 32-bit FNV-1a over the UTF-8 bytes of the input (DD-006).\n *\n * Frozen by SemVer: changing it changes every derived seed, and with it every golden image.\n */\nexport function fnv1a32(input: string): number {\n let hash = FNV_OFFSET_BASIS;\n for (const byte of utf8Bytes(input)) {\n hash ^= byte;\n hash = Math.imul(hash, FNV_PRIME);\n }\n return hash >>> 0;\n}\n\n/** Derives the seed of a chart from its identifier (REQ-003). */\nexport function deriveSeed(id: string): number {\n return fnv1a32(id);\n}\n\n/** `seed ?? derive(id)`, with string seeds hashed and numbers taken as unsigned 32-bit. */\nexport function resolveSeed(seed: Seed | undefined, id: string): number {\n if (seed === undefined) return deriveSeed(id);\n if (typeof seed === 'string') return fnv1a32(seed);\n return Number.isFinite(seed) ? Math.trunc(seed) >>> 0 : 0;\n}\n","/** Stable diagnostic codes, part of the public surface (API Spec §11). */\nexport type SpCode =\n | 'SP001'\n | 'SP002'\n | 'SP003'\n | 'SP004'\n | 'SP005'\n | 'SP006'\n | 'SP007'\n | 'SP008'\n | 'SP009'\n | 'SP010'\n | 'SP011'\n | 'SP012'\n | 'SP013'\n | 'SP014'\n | 'SP015'\n | 'SP016'\n | 'SP017'\n | 'SP018'\n | 'SP019'\n | 'SP020'\n | 'SP021'\n | 'SP022';\n\nexport interface Detail {\n /** The property involved. */\n readonly property: string;\n /** Specifics of this occurrence, appended to what happened. */\n readonly message?: string;\n}\n\ninterface Template {\n readonly req: string;\n readonly what: string;\n readonly todo: string;\n}\n\n/** Thrown by diagnostics of `error` severity. */\nexport class SilverpointError extends Error {\n readonly code: SpCode;\n\n constructor(code: SpCode, message: string) {\n super(message);\n this.name = 'SilverpointError';\n this.code = code;\n }\n}\n\n/** Receives every warning; replaceable so tests and tools can observe diagnostics. */\nexport type DiagnosticSink = (code: SpCode, message: string) => void;\n\nconst consoleSink: DiagnosticSink = (_code, message) => {\n console.warn(message);\n};\n\nlet sink: DiagnosticSink = consoleSink;\nconst reported = new Set<string>();\n\n/**\n * Replaces the warning sink and forgets already reported warnings. Returns a function that\n * restores the console sink.\n * @internal\n */\nexport function __setDiagnosticSink(next: DiagnosticSink | null): () => void {\n sink = next ?? consoleSink;\n reported.clear();\n return () => {\n sink = consoleSink;\n reported.clear();\n };\n}\n\nfunction format(code: SpCode, chart: string, detail: Detail, template: Template): string {\n const specifics = detail.message ? ` ${detail.message}` : '';\n return `[${code}] ${chart}: ${template.what} (\\`${detail.property}\\`).${specifics} ${template.todo}. (${template.req})`;\n}\n\n/** Always shipped: these diagnostics throw in every build (TD §5.4). */\nconst ERRORS: Partial<Record<SpCode, Template>> = {\n SP009: {\n req: 'REQ-097',\n what: 'a scale bound cannot be derived from the data and was not supplied',\n todo: 'Pass the named property explicitly',\n },\n SP012: {\n req: 'REQ-127',\n what: 'the ground does not reach the minimum contrast',\n todo: 'Recompute the palette; colours are not chosen by eye',\n },\n};\n\n/**\n * The single diagnostic channel (TD §5.4). `error` codes always throw; `warn` codes reach\n * the sink only outside production and are stripped from production bundles.\n */\nexport function diagnose(code: SpCode, chart: string, detail: Detail): void {\n const error = ERRORS[code];\n if (error) {\n throw new SilverpointError(code, format(code, chart, detail, error));\n }\n if (process.env.NODE_ENV !== 'production') {\n developmentDiagnose(code, chart, detail);\n }\n}\n\nfunction developmentDiagnose(code: SpCode, chart: string, detail: Detail): void {\n const template = WARNINGS[code];\n if (!template) return;\n const message = format(code, chart, detail, template);\n // SP005 is an error in development and a stripped warning in production (REQ-025).\n if (code === 'SP005') {\n throw new SilverpointError(code, message);\n }\n if (reported.has(message)) return;\n reported.add(message);\n sink(code, message);\n}\n\nconst WARNINGS: Partial<Record<SpCode, Template>> = {\n SP001: {\n req: 'REQ-007',\n what: 'the dataset is empty; the ground\\'s empty state is drawn',\n todo: 'Pass at least one row, or omit `data` to see the demo dataset',\n },\n SP002: {\n req: 'REQ-008',\n what: 'a value cannot be drawn as given (null, not finite, or outside the data contract); it is corrected or omitted',\n todo: 'Check the value against the chart\\'s data contract (Data Model §2)',\n },\n SP003: {\n req: 'REQ-009',\n what: 'the container measures 0 px; the render is deferred',\n todo: 'Give the container a size, or pin `width` and `height`',\n },\n SP004: {\n req: 'REQ-010',\n what: 'the scale domain has zero length; it is expanded with the ground\\'s domainPadding',\n todo: 'Nothing to do if the data is constant; otherwise check the accessor',\n },\n SP005: {\n req: 'REQ-025',\n what: 'more than one element is marked with white heightening; only the first is applied',\n todo: 'Heighten a single element per chart',\n },\n SP006: {\n req: 'REQ-026',\n what: 'the inker is not registered; falling back to NullInker',\n todo: 'Register the inker or fix the ground\\'s `inker` token',\n },\n SP007: {\n req: 'REQ-045',\n what: 'the ground is not registered; falling back to silverpoint',\n todo: 'Call registerGround() before rendering, or fix the name',\n },\n SP008: {\n req: 'REQ-096',\n what: 'the data volume is above the family\\'s threshold',\n todo: 'Aggregate the data before charting it',\n },\n SP010: {\n req: 'REQ-091',\n what: 'the chord ring has more than 12 categories',\n todo: 'Group the smaller categories',\n },\n SP011: {\n req: 'NFR §7',\n what: 'the path byte budget of 40 KB is exceeded',\n todo: \"Use `hatchFill: 'tile'` or a larger hatch gap\",\n },\n SP014: {\n req: 'REQ-204',\n what: 'a dashboard cell spans more columns than the breakpoint has; it is clamped',\n todo: 'Lower the span, or give that breakpoint more columns',\n },\n SP015: {\n req: 'REQ-205',\n what: 'the dashboard layout and its children disagree; unmatched children are placed in source order, span 1',\n todo: 'Give every child a `cell` the layout declares, once',\n },\n SP016: {\n req: 'REQ-217',\n what: 'a chart in a linked dashboard has no field named by `link.key`; it shows no linked mark',\n todo: 'Link on a field every linked chart carries, or leave this chart out of the link',\n },\n SP017: {\n req: 'REQ-324',\n what: 'a value or a range cannot be drawn as given; it is clamped, rounded to its step or defaulted',\n todo: 'Keep the value within `min`..`max` and on `step`, with `min < max` and `step > 0`',\n },\n SP018: {\n req: 'REQ-319',\n what: 'the component has no accessible name: no text content and no `label`',\n todo: 'Give it visible text, or a `label` for an icon-only control',\n },\n SP019: {\n req: 'REQ-325',\n what: 'items share a key, or have none; the first is kept and the later ones are skipped',\n todo: 'Give every item a unique, non-empty `key`',\n },\n SP020: {\n req: 'REQ-437',\n what: 'the hierarchy is invalid (a duplicate or empty `id`, a missing `parent`, a cycle, or several roots); the offending rows are dropped',\n todo: 'Give every row a unique `id` and an existing `parent`, under a single root',\n },\n SP021: {\n req: 'REQ-433',\n what: 'a statistic parameter is invalid; its default is used',\n todo: 'Keep the parameter in its documented range',\n },\n SP022: {\n req: 'REQ-434',\n what: 'a group has too few observations for its statistic; they are drawn as points',\n todo: 'Give the group more observations, or expect it drawn as points',\n },\n SP013: {\n req: 'REQ-032',\n what: 'the @silverpoint/fonts face failed to load; rendering fell back to the system stack',\n todo: 'Install @silverpoint/fonts and import its stylesheet; golden images will not match until then',\n },\n};\n","/**\n * `extent`, `min` and `max` are owned here instead of imported from `d3-array`, which is\n * not in the allowlist (TD §5.3).\n */\n\nexport function min(values: readonly number[]): number | undefined {\n let result: number | undefined;\n for (const value of values) {\n if (Number.isFinite(value) && (result === undefined || value < result)) result = value;\n }\n return result;\n}\n\nexport function max(values: readonly number[]): number | undefined {\n let result: number | undefined;\n for (const value of values) {\n if (Number.isFinite(value) && (result === undefined || value > result)) result = value;\n }\n return result;\n}\n\nexport function extent(values: readonly number[]): [number, number] | undefined {\n const low = min(values);\n const high = max(values);\n return low === undefined || high === undefined ? undefined : [low, high];\n}\n","import { scaleBand, scaleLinear } from 'd3-scale';\nimport { diagnose } from '../diagnostics/diagnose';\n\nexport interface ScaleSite {\n /** Chart name, for diagnostics. */\n readonly chart: string;\n /** Property the domain comes from, for diagnostics. */\n readonly property: string;\n}\n\n/**\n * Expands a zero-length domain by the ground's `domainPadding` instead of dividing by zero\n * (REQ-010). A constant `v` becomes `[v - |v|·p, v + |v|·p]`, or `[-p, p]` around zero — `[0, 2p]`\n * on a zero-based axis, which never shows a value below zero that no datum has.\n */\nexport function expandDomain(\n domain: readonly [number, number],\n padding: number,\n site: ScaleSite,\n /** A zero-based axis (bars, areas): a flat zero domain grows upward only, never below zero. */\n fromZero = false,\n): [number, number] {\n const [low, high] = domain;\n if (low !== high) return [low, high];\n const spread = low === 0 ? padding : Math.abs(low) * padding;\n if (fromZero && low === 0) {\n if (process.env.NODE_ENV !== 'production') {\n diagnose('SP004', site.chart, { property: site.property, message: `Domain [0, 0] became [0, ${2 * spread}].` });\n }\n return [0, 2 * spread];\n }\n if (process.env.NODE_ENV !== 'production') {\n diagnose('SP004', site.chart, {\n property: site.property,\n message: `Domain [${low}, ${high}] became [${low - spread}, ${high + spread}].`,\n });\n }\n return [low - spread, high + spread];\n}\n\nexport interface LinearScale {\n (value: number): number;\n readonly domain: readonly [number, number];\n ticks(count: number): number[];\n}\n\n/** Linear scale over `d3-scale`, with degenerate-domain expansion. */\nexport function linearScale(\n domain: readonly [number, number],\n range: readonly [number, number],\n options: ScaleSite & { readonly padding: number; readonly nice?: boolean; readonly fromZero?: boolean },\n): LinearScale {\n const expanded = expandDomain(domain, options.padding, options, options.fromZero);\n const scale = scaleLinear().domain(expanded).range(range);\n if (options.nice) scale.nice(4);\n const [low, high] = scale.domain() as [number, number];\n const result = ((value: number) => scale(value)) as LinearScale;\n Object.defineProperty(result, 'domain', { value: [low, high] as const });\n (result as { ticks: LinearScale['ticks'] }).ticks = (count) => scale.ticks(count);\n return result;\n}\n\nexport interface BandScale {\n /** Start of the band, or `undefined` for a value outside the domain. */\n (value: string): number | undefined;\n readonly bandwidth: number;\n /** Centre of the band. */\n center(value: string): number | undefined;\n}\n\n/** Band scale over `d3-scale`. */\nexport function bandScale(\n domain: readonly string[],\n range: readonly [number, number],\n options: { readonly paddingInner?: number; readonly paddingOuter?: number } = {},\n): BandScale {\n const scale = scaleBand<string>()\n .domain(domain)\n .range(range)\n .paddingInner(options.paddingInner ?? 0)\n .paddingOuter(options.paddingOuter ?? 0);\n const bandwidth = scale.bandwidth();\n const result = ((value: string) => scale(value)) as BandScale;\n Object.defineProperty(result, 'bandwidth', { value: bandwidth });\n (result as { center: BandScale['center'] }).center = (value) => {\n const start = scale(value);\n return start === undefined ? undefined : start + bandwidth / 2;\n };\n return result;\n}\n","import type { Accessor, Datum } from '../../types';\n\n/** Reads a field through an accessor. */\nexport function read<T>(accessor: Accessor<T>, datum: Datum, index: number): T {\n return typeof accessor === 'function' ? accessor(datum, index) : (datum[accessor] as T);\n}\n\n/** Human name of an accessor, for tables and descriptions. */\nexport function accessorName(accessor: Accessor<unknown>, fallback: string): string {\n return typeof accessor === 'string' ? accessor : fallback;\n}\n\n/** Formatters already built, by locale and options: building one costs more than a label (TD §2). */\nconst FORMATTERS = /* @__PURE__ */ new Map<string, Intl.NumberFormat>();\n/** Distinct locale-and-options pairs kept; past it the cache starts over, so it stays bounded. */\nconst MAX_FORMATTERS = 64;\n\n/** Formats a number with the resolved locale. Formatting lives in the core so both adapters agree. */\nexport function formatNumber(\n value: number,\n locale: string,\n options: Intl.NumberFormatOptions | undefined,\n): string {\n const resolved = options ?? { maximumFractionDigits: 2 };\n // Every option Intl reads, inherited ones included: JSON.stringify sees own properties only.\n const read: string[] = [];\n for (const name in resolved) read.push(`${name}=${JSON.stringify(resolved[name as keyof Intl.NumberFormatOptions])}`);\n const key = `${locale}|${read.sort().join('&')}`;\n let formatter = FORMATTERS.get(key);\n if (!formatter) {\n if (FORMATTERS.size >= MAX_FORMATTERS) FORMATTERS.clear();\n formatter = new Intl.NumberFormat(locale, resolved);\n FORMATTERS.set(key, formatter);\n }\n return formatter.format(value);\n}\n\n/**\n * `formatNumber` with its formatter resolved once, for a column of many values — a table with a\n * row per observation (REQ-445): the same constructor and arguments, so the same text, without\n * rebuilding the cache key for every cell.\n */\nexport function numberFormatter(locale: string, options: Intl.NumberFormatOptions | undefined): (value: number) => string {\n const formatter = new Intl.NumberFormat(locale, options ?? { maximumFractionDigits: 2 });\n return (value) => formatter.format(value);\n}\n\n/** Formats a label that may be a number or free text. */\nexport function formatValue(\n value: unknown,\n locale: string,\n options: Intl.NumberFormatOptions | undefined,\n): string {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? formatNumber(value, locale, options) : '—';\n }\n return value === null || value === undefined ? '—' : String(value);\n}\n\n/**\n * Formats a category — an x value, a time, a stage, a name. A number here is an identifier such as\n * a year, so it is printed without grouping: 2020, never 2,020.\n */\nexport function formatCategory(value: unknown, locale: string): string {\n return formatValue(value, locale, typeof value === 'number' ? { useGrouping: false, maximumFractionDigits: 2 } : undefined);\n}\n\n/** SVG path of a circle, drawn as two arcs so it survives inking as a closed path. */\nexport function circlePath(cx: number, cy: number, r: number): string {\n return `M${cx - r},${cy}A${r},${r},0,1,0,${cx + r},${cy}A${r},${r},0,1,0,${cx - r},${cy}Z`;\n}\n\n/** A change with its sign written out — `+4`, `−8` (U+2212), `0` — so direction never rests on shape alone (REQ-440). */\nexport function signedChange(change: number, format: (value: number) => string): string {\n if (change > 0) return `+${format(change)}`;\n if (change < 0) return `−${format(-change)}`;\n return format(0);\n}\n\n/** Advance of one character at the tick size, as `TICK_CHAR` in cartesian.ts measures it. */\nconst CHAR = 5.2;\n\n/**\n * Text cut with an ellipsis to fit `width` px at the tick size. A name cut on the drawing is still\n * whole in the table and the readout (REQ-121), so nothing is lost to the reader.\n */\nexport function fitText(text: string, width: number): string {\n const fits = Math.max(Math.floor(width / CHAR), 2);\n return text.length > fits ? `${text.slice(0, fits - 1)}…` : text;\n}\n","import { diagnose } from '../../diagnostics/diagnose';\nimport type { Rect, ToneLevel } from '../../types';\n\n/** Closed path of a rectangle, clockwise from its top-left corner. */\nexport function rectPath(rect: Rect): string {\n const { x, y, width, height } = rect;\n return `M${x},${y}H${x + width}V${y + height}H${x}Z`;\n}\n\n/** A rectangle shrunk by `by` on every side, never below zero size. */\nexport function inset(rect: Rect, by: number): Rect {\n return {\n x: rect.x + by,\n y: rect.y + by,\n width: Math.max(rect.width - 2 * by, 0),\n height: Math.max(rect.height - 2 * by, 0),\n };\n}\n\n/** A finite number, or `undefined`. */\nexport function finite(raw: unknown): number | undefined {\n return typeof raw === 'number' && Number.isFinite(raw) ? raw : undefined;\n}\n\n/**\n * Tonal level of a value normalised to 0-1: none at or below 0, then quarters (Data Model §3.4).\n * The tone always repeats a value the chart also prints or draws by length or size (REQ-124).\n */\nexport function toneOf(ratio: number): ToneLevel {\n if (!(ratio > 0)) return 0;\n if (ratio <= 0.25) return 1;\n if (ratio <= 0.5) return 2;\n if (ratio <= 0.75) return 3;\n return 4;\n}\n\n/**\n * Side of a mark, as a share of its slot, per tone: where a value cannot be printed, its size\n * carries the level the tone shows, so it survives `precision` mode (REQ-124). The heatmap's cells\n * when their values do not fit, the density bins always.\n */\nexport const TONE_SCALE: Readonly<Record<ToneLevel, number>> = { 0: 0.4, 1: 0.55, 2: 0.7, 3: 0.85, 4: 1 };\n\n/** A consumer-supplied tone, rounded and held to 0-4. */\nexport function toneLevel(raw: number): ToneLevel {\n return Math.min(Math.max(Math.round(raw), 0), 4) as ToneLevel;\n}\n\n/** A value outside what the chart can draw: it is corrected or dropped, and warned (SP002). */\nexport function warnValue(chart: string, property: string, message: string): void {\n if (process.env.NODE_ENV !== 'production') diagnose('SP002', chart, { property, message });\n}\n\nconst RING_TONES: readonly ToneLevel[] = [1, 2, 3, 4];\n\n/**\n * The tone of sector `index` of `count` around a closed ring: the ramp in turn, and the last sector\n * never repeats the first, its neighbour across 12 o'clock. Tone only repeats what the legend and\n * the printed shares say (REQ-124). Every chart with categories tones them this way — a ring, a\n * waffle, a mosaic, a hierarchy's first level, a network's groups (DD-032, REQ-440).\n */\nexport function ringTone(index: number, count: number): ToneLevel {\n const tone = RING_TONES[index % RING_TONES.length] as ToneLevel;\n if (count > 1 && index === count - 1 && tone === RING_TONES[0]) return RING_TONES[2] as ToneLevel;\n return tone;\n}\n\n/**\n * The tones of a ring's sectors, counted over the drawn ones only: a zero sector is not drawn, so it\n * must not hold a place in the ramp, or two drawn neighbours could share a tone. A zero sector takes\n * the tone its place would have, for its legend swatch.\n */\nexport function ringTones(values: readonly number[]): ToneLevel[] {\n const drawn = values.filter((v) => v > 0).length;\n let k = 0;\n return values.map((v) => (v > 0 ? ringTone(k++, drawn) : ringTone(Math.min(k, Math.max(drawn - 1, 0)), drawn)));\n}\n","import { bandScale, linearScale, type LinearScale } from '../../scales/scales';\nimport { extent } from '../../scales/util';\nimport type { Accessor, Datum, Rect, Stroke, TextLabel, ToneLevel } from '../../types';\nimport { rectPath } from './cells';\nimport { diagnose } from '../../diagnostics/diagnose';\nimport { accessorName, formatNumber, read } from './format';\n\n/** Room under the plot for the category labels. */\nexport const AXIS_BAND = 20;\n/** Room around the plot so a heightened point or a pill end is never clipped. */\nexport const PLOT_INSET = 6;\n/** Minimum horizontal room per category label. */\nconst LABEL_SPACING = 48;\n\n/** The plot of a cartesian chart inside its drawing area: inset, with the axis band below. */\nexport function cartesianPlot(area: Rect): Rect {\n return {\n x: area.x + PLOT_INSET,\n y: area.y + PLOT_INSET,\n width: Math.max(area.width - 2 * PLOT_INSET, 1),\n height: Math.max(area.height - AXIS_BAND - PLOT_INSET, 1),\n };\n}\n\nexport interface SeriesPoint {\n readonly index: number;\n readonly datum: Datum;\n readonly value: number | undefined;\n}\n\nexport interface Series {\n readonly key: string;\n readonly points: readonly SeriesPoint[];\n /** Points whose value is not a finite number. */\n readonly missing: number;\n}\n\n/** Reads one numeric series through an accessor; non-finite values become gaps. */\nexport function readSeries(data: readonly Datum[], accessor: Accessor<number | null | undefined>, fallbackName: string): Series {\n let missing = 0;\n const points = data.map((datum, index) => {\n const raw = read(accessor, datum, index);\n const value = typeof raw === 'number' && Number.isFinite(raw) ? raw : undefined;\n if (value === undefined) missing += 1;\n return { index, datum, value };\n });\n return { key: accessorName(accessor, fallbackName), points, missing };\n}\n\n/** Points per series a cartesian chart draws before it recommends aggregation (API Spec §12). */\nexport const POINTS_PER_SERIES = 500;\n\n/**\n * Warns SP008 when a series runs past the family's ceiling. The series is still drawn in full:\n * the warning recommends aggregation, it never degrades silently (REQ-096).\n */\nexport function checkVolume(chart: string, series: readonly Series[]): void {\n for (const s of series) checkCount(chart, s.key, s.points.length);\n}\n\n/** The same ceiling, for a chart whose points are not read as a `Series`. */\nexport function checkCount(chart: string, property: string, count: number): void {\n if (process.env.NODE_ENV === 'production' || count <= POINTS_PER_SERIES) return;\n diagnose('SP008', chart, { property, message: `${count} points; the ceiling is ${POINTS_PER_SERIES} per series.` });\n}\n\n/** The finite values of a set of series. */\nexport function seriesValues(series: readonly Series[]): number[] {\n return series.flatMap((s) => s.points.flatMap((p) => (p.value === undefined ? [] : [p.value])));\n}\n\nexport interface ValueAxis {\n readonly scale: LinearScale;\n readonly strokes: readonly Stroke[];\n readonly labels: readonly TextLabel[];\n}\n\n/**\n * The vertical value scale of a cartesian chart, niced, with its grid lines and tick labels and\n * the base rule. The domain always reaches zero when `zero` is set, as bars and areas need.\n */\nexport function valueAxis(\n plot: Rect,\n domain: readonly [number, number],\n options: {\n readonly chart: string;\n readonly property: string;\n readonly padding: number;\n readonly locale: string;\n readonly numberFormat: Intl.NumberFormatOptions | undefined;\n readonly zero?: boolean;\n /** Round the domain out to tick values; `true` by default. Pinned bounds pass `false`. */\n readonly nice?: boolean;\n },\n): ValueAxis {\n const bottom = plot.y + plot.height;\n const low = options.zero === false ? domain[0] : Math.min(0, domain[0]);\n const high = options.zero === false ? domain[1] : Math.max(0, domain[1]);\n const scale = linearScale([low, high], [bottom, plot.y], {\n chart: options.chart,\n property: options.property,\n padding: options.padding,\n nice: options.nice !== false,\n fromZero: options.zero !== false,\n });\n const strokes: Stroke[] = [];\n const labels: TextLabel[] = [];\n for (const tick of scale.ticks(4)) {\n const ty = scale(tick);\n if (tick === scale.domain[0]) continue;\n strokes.push({ d: `M${plot.x},${ty}H${plot.x + plot.width}`, role: 'ornament', part: 'grid' });\n labels.push({ x: plot.x, y: ty - 3, text: formatNumber(tick, options.locale, options.numberFormat), kind: 'tick', part: 'axis', anchor: 'start' });\n }\n strokes.push({ d: `M${plot.x},${bottom}H${plot.x + plot.width}`, role: 'ornament', part: 'rule' });\n return { scale, strokes, labels };\n}\n\nexport interface CategoryAxis {\n /** Centre of item `index` along x. */\n at(index: number): number;\n /** Width of one category's band; 0 on a numeric axis. */\n readonly bandwidth: number;\n}\n\n/**\n * Positions along x: a linear scale when every x value is a finite number, otherwise one band per\n * row, whose centre is the item's position.\n */\nexport function categoryAxis(\n xValues: readonly unknown[],\n plot: Rect,\n options: { readonly chart: string; readonly property: string; readonly padding: number; readonly paddingInner?: number; readonly paddingOuter?: number; readonly numeric?: boolean },\n): CategoryAxis {\n const numeric = options.numeric !== false && xValues.length > 0 && xValues.every((v) => typeof v === 'number' && Number.isFinite(v));\n if (numeric) {\n const numbers = xValues as number[];\n const x = linearScale(extent(numbers) ?? [0, 0], [plot.x, plot.x + plot.width], {\n chart: options.chart,\n property: options.property,\n padding: options.padding,\n });\n return { at: (index) => x(numbers[index] ?? 0), bandwidth: 0 };\n }\n const keys = xValues.map((_, index) => String(index));\n const band = bandScale(keys, [plot.x, plot.x + plot.width], { paddingInner: options.paddingInner, paddingOuter: options.paddingOuter });\n return { at: (index) => band.center(String(index)) ?? plot.x, bandwidth: band.bandwidth };\n}\n\n/** Category labels under the plot, thinned so they never crowd: one every `step` items. */\nexport function categoryLabels(texts: readonly string[], at: (index: number) => number, area: Rect, plot: Rect): TextLabel[] {\n const count = texts.length;\n const step = Math.max(1, Math.ceil(count / Math.max(2, Math.floor(plot.width / LABEL_SPACING))));\n const labels: TextLabel[] = [];\n for (let index = 0; index < count; index += step) {\n labels.push({\n x: at(index),\n y: area.y + area.height - 5,\n text: texts[index] ?? '',\n kind: 'tick',\n part: 'axis',\n anchor: index === 0 ? 'start' : 'middle',\n });\n }\n return labels;\n}\n\n/** Height of the legend row at the top of the drawing area: a full line above the top value tick. */\nexport const LEGEND_BAND = 22;\n/** Advance of one character of tick or legend text at the 9.5 px tick size. */\nexport const TICK_CHAR = 5.2;\nconst LEGEND_CHAR = TICK_CHAR;\n\nexport interface LegendEntry {\n readonly name: string;\n readonly part: 'ink' | 'ink-secondary';\n readonly tone?: ToneLevel;\n readonly dash?: 'dotted';\n}\n\n/**\n * A legend row at the top of the area: a swatch drawn like its series — outline, dash and tone —\n * and the series' name. The swatch carries no data, so it is an ornament; the name is what tells\n * the series apart, never the tone alone (REQ-124). Returns the area left below it.\n */\nexport function legend(area: Rect, entries: readonly LegendEntry[]): { area: Rect; strokes: Stroke[]; labels: TextLabel[] } {\n const strokes: Stroke[] = [];\n const labels: TextLabel[] = [];\n let x = area.x + PLOT_INSET;\n for (const entry of entries) {\n const swatch = { x, y: area.y + 4, width: 12, height: 7 };\n strokes.push({ d: rectPath(swatch), role: 'ornament', part: entry.part, ...(entry.tone ? { tone: entry.tone } : {}), ...(entry.dash ? { dash: entry.dash } : {}) });\n labels.push({ x: x + 16, y: area.y + 11, text: entry.name, kind: 'tick', part: 'axis', anchor: 'start' });\n x += 16 + entry.name.length * LEGEND_CHAR + 12;\n }\n return { area: { x: area.x, y: area.y + LEGEND_BAND, width: area.width, height: Math.max(area.height - LEGEND_BAND, 1) }, strokes, labels };\n}\n\n/** A rectangle with fully rounded ends — a pill — as a closed path of lines and arcs. */\nexport function pillPath(rect: Rect): string {\n const { x, y, width, height } = rect;\n const r = Math.min(width, height) / 2;\n if (r <= 0) return `M${x},${y}H${x + width}V${y + height}H${x}Z`;\n return (\n `M${x},${y + r}A${r},${r},0,0,1,${x + r},${y}H${x + width - r}A${r},${r},0,0,1,${x + width},${y + r}` +\n `V${y + height - r}A${r},${r},0,0,1,${x + width - r},${y + height}H${x + r}A${r},${r},0,0,1,${x},${y + height - r}Z`\n );\n}\n\n/**\n * The horizontal value scale of a chart laid out in rows: niced, zero in the domain, with vertical\n * grid lines and tick labels under the plot, and the base rule at zero.\n */\nexport function horizontalValueAxis(\n plot: Rect,\n area: Rect,\n domain: readonly [number, number],\n options: { readonly chart: string; readonly property: string; readonly padding: number; readonly locale: string; readonly numberFormat: Intl.NumberFormatOptions | undefined },\n): ValueAxis {\n const scale = linearScale([Math.min(0, domain[0]), Math.max(0, domain[1])], [plot.x, plot.x + plot.width], {\n chart: options.chart,\n property: options.property,\n padding: options.padding,\n nice: true,\n fromZero: true,\n });\n const strokes: Stroke[] = [];\n const labels: TextLabel[] = [];\n for (const tick of scale.ticks(4)) {\n const tx = scale(tick);\n if (tick !== 0) strokes.push({ d: `M${tx},${plot.y}V${plot.y + plot.height}`, role: 'ornament', part: 'grid' });\n labels.push({ x: tx, y: area.y + area.height - 5, text: formatNumber(tick, options.locale, options.numberFormat), kind: 'tick', part: 'axis', anchor: 'middle' });\n }\n strokes.push({ d: `M${scale(0)},${plot.y}V${plot.y + plot.height}`, role: 'ornament', part: 'rule' });\n return { scale, strokes, labels };\n}\n\n/**\n * Label baselines for points at `ys`, moved apart to at least `gap` and kept within\n * `[top, bottom]`: the labels move, the segments never do (Art. 1).\n */\nexport function spreadLabels(ys: readonly number[], gap: number, top: number, bottom: number): number[] {\n const order = ys.map((y, i) => [y, i] as const).sort((a, b) => a[0] - b[0] || a[1] - b[1]);\n const placed = order.map(([y]) => y);\n for (let k = 0; k < placed.length; k += 1) placed[k] = Math.max(placed[k] as number, k === 0 ? top : (placed[k - 1] as number) + gap);\n for (let k = placed.length - 1; k >= 0; k -= 1) placed[k] = Math.min(placed[k] as number, k === placed.length - 1 ? bottom : (placed[k + 1] as number) - gap);\n const result = new Array<number>(ys.length);\n order.forEach(([, i], k) => {\n result[i] = placed[k] as number;\n });\n return result;\n}\n","import type { Accessor, Datum, Rect, Stroke, TextLabel, ToneLevel } from '../../types';\nimport { diagnose } from '../../diagnostics/diagnose';\nimport { PLOT_INSET } from './cartesian';\nimport { finite, rectPath, warnValue } from './cells';\nimport { accessorName, formatCategory, read } from './format';\n\n/**\n * The polar frame (T-071): a circle centred in the drawing area. Angles are radians measured\n * clockwise from 12 o'clock — d3-shape's convention — so a sweep reads like a clock face.\n */\nexport interface PolarFrame {\n readonly cx: number;\n readonly cy: number;\n /** Largest radius that fits the area's shorter side, inset so no stroke is clipped. */\n readonly radius: number;\n}\n\n/** `labelRoom` keeps a margin around the circle for names printed outside it. */\nexport function polarFrame(area: Rect, labelRoom = 0): PolarFrame {\n return {\n cx: area.x + area.width / 2,\n cy: area.y + area.height / 2,\n radius: Math.max(Math.min(area.width, area.height) / 2 - PLOT_INSET - labelRoom, 1),\n };\n}\n\n/** Room outside a circle for the names printed around it. */\nexport const RIM_LABELS = 14;\n\n/**\n * Names around the rim, one per slot at its middle angle, thinned so no more than `most` are\n * printed; the table and the readout name every slot.\n */\nexport function rimLabels(frame: PolarFrame, entries: readonly { readonly angle: number; readonly text: string }[], most = 24): TextLabel[] {\n const step = Math.max(1, Math.ceil(entries.length / most));\n return entries.filter((_, i) => i % step === 0).map((e) => polarLabel(frame, e.angle, frame.radius + 8, e.text));\n}\n\n/** The point at `angle` on the circle of radius `r`. */\nexport function pointAt(frame: PolarFrame, angle: number, r: number): { x: number; y: number } {\n return { x: frame.cx + r * Math.sin(angle), y: frame.cy - r * Math.cos(angle) };\n}\n\n/** Below this sweep an arc has no extent to draw. */\nconst EPSILON = 1e-9;\n\nconst at = (frame: PolarFrame, angle: number, r: number) => {\n const p = pointAt(frame, angle, r);\n return `${p.x},${p.y}`;\n};\n\n/** An arc command of at most half a turn from the current point to `end` along radius `r`. */\nfunction arcTo(frame: PolarFrame, r: number, end: number, clockwise: boolean): string {\n return `A${r},${r},0,0,${clockwise ? 1 : 0},${at(frame, end, r)}`;\n}\n\n/**\n * An arc along radius `r` from `start` to `end` that never degenerates: past half a turn it is drawn\n * as two halves, so a sweep near a full turn never rounds to an arc that ends where it starts.\n */\nfunction sweep(frame: PolarFrame, r: number, start: number, end: number, clockwise: boolean): string {\n if (Math.abs(end - start) <= Math.PI) return arcTo(frame, r, end, clockwise);\n const middle = (start + end) / 2;\n return arcTo(frame, r, middle, clockwise) + arcTo(frame, r, end, clockwise);\n}\n\n/** An open arc along one radius, from `start` to `end` (clockwise when `end > start`). */\nexport function arcPath(frame: PolarFrame, r: number, start: number, end: number): string {\n if (Math.abs(end - start) < EPSILON || r <= 0) return '';\n return `M${at(frame, start, r)}${sweep(frame, r, start, end, end > start)}`;\n}\n\nexport interface SectorShape {\n readonly inner: number;\n readonly outer: number;\n readonly start: number;\n readonly end: number;\n}\n\n/**\n * A closed ring slice: out along the outer arc, across, and back along the inner arc. With no\n * inner radius it is a wedge from the centre. The arcs are exact SVG arcs, never polylines.\n */\nexport function sectorPath(frame: PolarFrame, shape: SectorShape): string {\n const { inner, outer, start, end } = shape;\n if (Math.abs(end - start) < EPSILON || outer <= 0) return '';\n const clockwise = end > start;\n const outerArc = `M${at(frame, start, outer)}${sweep(frame, outer, start, end, clockwise)}`;\n if (inner <= 0) return `${outerArc}L${frame.cx},${frame.cy}Z`;\n return `${outerArc}L${at(frame, end, inner)}${sweep(frame, inner, end, start, !clockwise)}Z`;\n}\n\n/** Half-width of the band around the poles where a label is centred rather than side-anchored. */\nconst POLE = 0.1;\n\n/** A label on the circle of radius `r` at `angle`, anchored so it reads away from the circle. */\nexport function polarLabel(frame: PolarFrame, angle: number, r: number, text: string, kind: TextLabel['kind'] = 'tick'): TextLabel {\n const p = pointAt(frame, angle, r);\n const side = Math.sin(angle);\n const anchor = side > POLE ? 'start' : side < -POLE ? 'end' : 'middle';\n // Baseline a third of the cap height below the point, so the text sits centred on it.\n return { x: p.x, y: p.y + 3, text, kind, part: 'axis', anchor };\n}\n\nexport interface Sector {\n readonly index: number;\n readonly datum: Datum;\n readonly name: string;\n readonly value: number;\n}\n\n/**\n * Reads a sector series (Data Model §2.2): a value must be finite and `≥ 0` — a negative angle does\n * not exist — or the row is warned `SP002` and dropped; a repeated name is made unique.\n */\nexport function readSectors(\n data: readonly Datum[],\n nameKey: Accessor<string | number>,\n valueKey: Accessor<number | null | undefined>,\n chart: string,\n locale: string,\n): Sector[] {\n const valueName = accessorName(valueKey, 'value');\n const seen = new Map<string, number>();\n const sectors: Sector[] = [];\n data.forEach((datum, index) => {\n const value = finite(read(valueKey, datum, index));\n if (value === undefined || value < 0) {\n warnValue(chart, valueName, `Row ${index} has a ${valueName} of ${String(read(valueKey, datum, index))}; a sector needs a finite value ≥ 0, so it is omitted.`);\n return;\n }\n const given = read(nameKey, datum, index);\n if (given === undefined || given === null || given === '') warnValue(chart, accessorName(nameKey, 'name'), `Row ${index} has no name; it is shown as \"—\".`);\n const raw = formatCategory(given, locale);\n const count = (seen.get(raw) ?? 0) + 1;\n seen.set(raw, count);\n if (count > 1) warnValue(chart, accessorName(nameKey, 'name'), `The name \"${raw}\" repeats; row ${index} is shown as \"${raw} (${count})\".`);\n sectors.push({ index, datum, name: count > 1 ? `${raw} (${count})` : raw, value });\n });\n return sectors;\n}\n\n/** Sectors a polar chart draws before it recommends aggregation (API Spec §12). */\nexport const SECTORS_PER_CHART = 60;\n\n/** Warns SP008 above the polar ceiling; the chart is still drawn in full (REQ-096). */\nexport function checkSectors(chart: string, property: string, count: number): void {\n if (process.env.NODE_ENV === 'production' || count <= SECTORS_PER_CHART) return;\n diagnose('SP008', chart, { property, message: `${count} sectors; the ceiling is ${SECTORS_PER_CHART}.` });\n}\n\n// The ring's tones serve every family with categories (DD-032); they live in cells.ts.\nexport { ringTone, ringTones } from './cells';\n\n/** Height of one legend row. */\nconst LEGEND_ROW = 14;\n\nexport interface SectorLegendEntry {\n readonly name: string;\n readonly share: string;\n readonly tone: ToneLevel;\n}\n\n/**\n * A legend column: a toned swatch (ornament: it carries no data), the sector's name and its share,\n * in the ring's clockwise order. Rows that do not fit end in \"+N more\"; the table lists them all.\n */\nexport function sectorLegend(area: Rect, entries: readonly SectorLegendEntry[]): { strokes: Stroke[]; labels: TextLabel[] } {\n const strokes: Stroke[] = [];\n const labels: TextLabel[] = [];\n const fits = Math.max(Math.floor(area.height / LEGEND_ROW), 1);\n const shown = entries.length > fits ? fits - 1 : entries.length;\n const top = area.y + (area.height - Math.min(entries.length, fits) * LEGEND_ROW) / 2;\n entries.slice(0, shown).forEach((entry, row) => {\n const y = top + row * LEGEND_ROW;\n strokes.push({ d: rectPath({ x: area.x, y: y + 3, width: 9, height: 7 }), role: 'ornament', part: 'ink', tone: entry.tone });\n labels.push({ x: area.x + 14, y: y + 10, text: entry.name, kind: 'tick', part: 'text', anchor: 'start' });\n labels.push({ x: area.x + area.width, y: y + 10, text: entry.share, kind: 'tick', part: 'axis', anchor: 'end' });\n });\n if (shown < entries.length) {\n labels.push({ x: area.x + 14, y: top + shown * LEGEND_ROW + 10, text: `+${entries.length - shown} more`, kind: 'tick', part: 'axis', anchor: 'start' });\n }\n return { strokes, labels };\n}\n"]}
@@ -0,0 +1,170 @@
1
+ import { formatValue, diagnose, roundGeometry } from './chunk-OLYKR5PS.js';
2
+
3
+ // src/render/prng.ts
4
+ function createPrng(seed) {
5
+ let state = seed >>> 0;
6
+ return () => {
7
+ state = state + 1831565813 >>> 0;
8
+ let t = state;
9
+ t = Math.imul(t ^ t >>> 15, t | 1);
10
+ t ^= t + Math.imul(t ^ t >>> 7, t | 61);
11
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
12
+ };
13
+ }
14
+
15
+ // src/charts/shared/dates.ts
16
+ var DAY_MS = 864e5;
17
+ var ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
18
+ function parseIsoDate(iso) {
19
+ const match = ISO_DATE.exec(iso);
20
+ if (!match) return Number.NaN;
21
+ return Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3])) / DAY_MS;
22
+ }
23
+ function isoDate(day) {
24
+ return new Date(day * DAY_MS).toISOString().slice(0, 10);
25
+ }
26
+ function addDays(day, days) {
27
+ return day + days;
28
+ }
29
+ function weekday(day) {
30
+ return ((day + 4) % 7 + 7) % 7;
31
+ }
32
+
33
+ // src/charts/shared/card.ts
34
+ var CARD_PADDING = 16;
35
+ var TITLE_ROW = 20;
36
+ var VALUE_ROW = 52;
37
+ var HEADER_GAP = 8;
38
+ var FOOTER_ROW = 30;
39
+ function cardLayout(props, options) {
40
+ const { width, areaHeight: areaHeight2, chrome, locale } = options;
41
+ if (chrome === "bare") {
42
+ const box = { x: 0, y: 0, width, height: areaHeight2 };
43
+ return { viewBox: box, area: box, strokes: [], labels: [] };
44
+ }
45
+ const labels = [];
46
+ const strokes = [];
47
+ const left = CARD_PADDING;
48
+ const right = width - CARD_PADDING;
49
+ let cursor = CARD_PADDING;
50
+ if (props.title !== void 0 || props.badge !== void 0) {
51
+ const baseline = cursor + 11;
52
+ if (props.title !== void 0) {
53
+ labels.push({ x: left, y: baseline, text: props.title, kind: "title", part: "text", anchor: "start" });
54
+ }
55
+ if (props.badge !== void 0) {
56
+ labels.push({ x: right, y: baseline, text: props.badge, kind: "badge", part: "axis", anchor: "end" });
57
+ }
58
+ cursor += TITLE_ROW;
59
+ }
60
+ if (props.value !== void 0 || props.unit !== void 0) {
61
+ if (props.value !== void 0) {
62
+ labels.push({
63
+ x: left,
64
+ y: cursor + 30,
65
+ text: formatValue(props.value, locale, props.numberFormat),
66
+ kind: "value",
67
+ part: "text",
68
+ anchor: "start"
69
+ });
70
+ }
71
+ if (props.unit !== void 0) {
72
+ labels.push({ x: left, y: cursor + 46, text: props.unit, kind: "unit", part: "axis", anchor: "start" });
73
+ }
74
+ cursor += VALUE_ROW;
75
+ }
76
+ if (cursor > CARD_PADDING) cursor += HEADER_GAP;
77
+ const area = { x: left, y: cursor, width: right - left, height: areaHeight2 };
78
+ cursor += areaHeight2;
79
+ if (props.footerLeft !== void 0 || props.footerRight !== void 0) {
80
+ const ruleY = cursor + 8;
81
+ strokes.push({ d: `M${left},${ruleY}H${right}`, role: "ornament", part: "rule" });
82
+ if (props.footerLeft !== void 0) {
83
+ labels.push({ x: left, y: ruleY + 18, text: props.footerLeft, kind: "footer", part: "axis", anchor: "start" });
84
+ }
85
+ if (props.footerRight !== void 0) {
86
+ labels.push({ x: right, y: ruleY + 18, text: props.footerRight, kind: "footer", part: "axis", anchor: "end" });
87
+ }
88
+ cursor += FOOTER_ROW;
89
+ }
90
+ const height = cursor + CARD_PADDING;
91
+ const inset = 0.5;
92
+ strokes.unshift({
93
+ d: `M${inset},${inset}H${width - inset}V${height - inset}H${inset}Z`,
94
+ role: "ornament",
95
+ part: "rule"
96
+ });
97
+ return { viewBox: { x: 0, y: 0, width, height }, area, strokes, labels };
98
+ }
99
+
100
+ // src/charts/shared/shell.ts
101
+ function modelBase(chart, props, context, fallbackName, table) {
102
+ const { id } = context;
103
+ const name = props.label ?? props.title ?? fallbackName;
104
+ return {
105
+ chart,
106
+ id,
107
+ chrome: props.chrome ?? "card",
108
+ name,
109
+ ids: { title: `${id}-title`, desc: `${id}-desc`, table: `${id}-table` },
110
+ table: { caption: name, ...table },
111
+ dataTable: props.dataTable ?? "hidden"
112
+ };
113
+ }
114
+ function areaHeight(props) {
115
+ return props.height ?? 160;
116
+ }
117
+ function measure(base, props, context) {
118
+ const width = props.width ?? context.width;
119
+ const height = areaHeight(props);
120
+ if (width !== void 0 && width > 0 && height > 0) return { width, height };
121
+ if (width !== void 0 && process.env.NODE_ENV !== "production") {
122
+ diagnose("SP003", base.chart, {
123
+ property: width <= 0 ? "width" : "height",
124
+ message: `Measured ${width} \xD7 ${height} px.`
125
+ });
126
+ }
127
+ const box = { x: 0, y: 0, width: 0, height: 0 };
128
+ return {
129
+ deferred: {
130
+ ...base,
131
+ status: "deferred",
132
+ geometry: { viewBox: box, plot: box, strokes: [], labels: [], hitAreas: [], defs: [] },
133
+ description: props.description ?? base.name
134
+ }
135
+ };
136
+ }
137
+ function emptyModel(base, props, context, frame, datasetEmpty) {
138
+ if (datasetEmpty && process.env.NODE_ENV !== "production") {
139
+ diagnose("SP001", base.chart, { property: "data" });
140
+ }
141
+ const { plot } = frame;
142
+ const strokes = [...frame.strokes];
143
+ if (context.emptyState.rule) {
144
+ strokes.push({ d: `M${plot.x},${plot.y + plot.height}H${plot.x + plot.width}`, role: "ornament", part: "rule" });
145
+ }
146
+ const labels = [
147
+ ...frame.labels,
148
+ {
149
+ x: plot.x + plot.width / 2,
150
+ y: plot.y + plot.height / 2,
151
+ text: context.emptyState.text,
152
+ kind: "empty",
153
+ part: "axis",
154
+ anchor: "middle"
155
+ }
156
+ ];
157
+ return {
158
+ ...base,
159
+ status: "ready",
160
+ description: props.description ?? `${base.name}. ${context.emptyState.text}.`,
161
+ geometry: roundGeometry({ viewBox: frame.viewBox, plot, strokes, labels, hitAreas: [], defs: [] })
162
+ };
163
+ }
164
+ function readyModel(base, description, geometry) {
165
+ return { ...base, status: "ready", description, geometry: roundGeometry({ ...geometry, defs: [] }) };
166
+ }
167
+
168
+ export { addDays, cardLayout, createPrng, emptyModel, isoDate, measure, modelBase, parseIsoDate, readyModel, weekday };
169
+ //# sourceMappingURL=chunk-PD4MD7JU.js.map
170
+ //# sourceMappingURL=chunk-PD4MD7JU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/render/prng.ts","../src/charts/shared/dates.ts","../src/charts/shared/card.ts","../src/charts/shared/shell.ts"],"names":["areaHeight"],"mappings":";;;AAKO,SAAS,WAAW,IAAA,EAA4B;AACrD,EAAA,IAAI,QAAQ,IAAA,KAAS,CAAA;AACrB,EAAA,OAAO,MAAM;AACX,IAAA,KAAA,GAAS,QAAQ,UAAA,KAAgB,CAAA;AACjC,IAAA,IAAI,CAAA,GAAI,KAAA;AACR,IAAA,CAAA,GAAI,KAAK,IAAA,CAAK,CAAA,GAAK,CAAA,KAAM,EAAA,EAAK,IAAI,CAAC,CAAA;AACnC,IAAA,CAAA,IAAK,IAAI,IAAA,CAAK,IAAA,CAAK,IAAK,CAAA,KAAM,CAAA,EAAI,IAAI,EAAE,CAAA;AACxC,IAAA,OAAA,CAAA,CAAS,CAAA,GAAK,CAAA,KAAM,EAAA,MAAS,CAAA,IAAK,UAAA;AAAA,EACpC,CAAA;AACF;;;ACVA,IAAM,MAAA,GAAS,KA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F;AACA,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,MAAA,EAAQ,OAAA;AAAA,IACR,WAAA,EAAa,MAAM,WAAA,IAAe,CAAA,EAAG,KAAK,IAAI,CAAA,EAAA,EAAK,OAAA,CAAQ,UAAA,CAAW,IAAI,CAAA,CAAA,CAAA;AAAA,IAC1E,QAAA,EAAU,aAAA,CAAc,EAAE,OAAA,EAAS,MAAM,OAAA,EAAS,IAAA,EAAM,OAAA,EAAS,MAAA,EAAQ,UAAU,EAAC,EAAG,IAAA,EAAM,IAAI;AAAA,GACnG;AACF;AAGO,SAAS,UAAA,CACd,IAAA,EACA,WAAA,EACA,QAAA,EACY;AACZ,EAAA,OAAO,EAAE,GAAG,IAAA,EAAM,MAAA,EAAQ,SAAS,WAAA,EAAa,QAAA,EAAU,aAAA,CAAc,EAAE,GAAG,QAAA,EAAU,IAAA,EAAM,EAAC,EAAG,CAAA,EAAE;AACrG","file":"chunk-PD4MD7JU.js","sourcesContent":["/**\n * A seeded 32-bit PRNG (mulberry32), for generated demo data (Data Model §4). Owned here rather\n * than imported, so its sequence is frozen by SemVer like the seed derivation (DD-006): changing\n * it changes demo output, which is never a patch.\n */\nexport function createPrng(seed: number): () => number {\n let state = seed >>> 0;\n return () => {\n state = (state + 0x6d2b79f5) >>> 0;\n let t = state;\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4_294_967_296;\n };\n}\n","/**\n * ISO dates as whole days since 1970-01-01, in UTC. Day arithmetic never touches the host's\n * time zone or clock, so server and client agree (REQ-005, REQ-103).\n */\nconst DAY_MS = 86_400_000;\nconst ISO_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\n/** Days since the epoch of an ISO `YYYY-MM-DD` date; `NaN` when it is not one. */\nexport function parseIsoDate(iso: string): number {\n const match = ISO_DATE.exec(iso);\n if (!match) return Number.NaN;\n return Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3])) / DAY_MS;\n}\n\n/** The ISO `YYYY-MM-DD` form of a day number. */\nexport function isoDate(day: number): string {\n return new Date(day * DAY_MS).toISOString().slice(0, 10);\n}\n\nexport function addDays(day: number, days: number): number {\n return day + days;\n}\n\n/** Day of the week in UTC, 0 = Sunday. */\nexport function weekday(day: number): number {\n return (((day + 4) % 7) + 7) % 7;\n}\n","import type { CommonChartProps, Rect, Stroke, TextLabel } from '../../types';\nimport { formatValue } from './format';\n\n/** Inner padding of the card frame. */\nexport const CARD_PADDING = 16;\nconst TITLE_ROW = 20;\nconst VALUE_ROW = 52;\nconst HEADER_GAP = 8;\nconst FOOTER_ROW = 30;\n\nexport interface CardLayout {\n readonly viewBox: Rect;\n /** Where the chart draws; the whole viewBox under `chrome: 'bare'`. */\n readonly area: Rect;\n readonly strokes: readonly Stroke[];\n readonly labels: readonly TextLabel[];\n}\n\n/**\n * Lays out the card frame shared by every chart: title and badge, metric and unit, the drawing\n * area and the footer. Under `chrome: 'bare'` it emits the drawing area and nothing else\n * (REQ-095).\n */\nexport function cardLayout(\n props: CommonChartProps,\n options: {\n readonly width: number;\n readonly areaHeight: number;\n readonly chrome: 'card' | 'bare';\n readonly locale: string;\n },\n): CardLayout {\n const { width, areaHeight, chrome, locale } = options;\n if (chrome === 'bare') {\n const box = { x: 0, y: 0, width, height: areaHeight };\n return { viewBox: box, area: box, strokes: [], labels: [] };\n }\n\n const labels: TextLabel[] = [];\n const strokes: Stroke[] = [];\n const left = CARD_PADDING;\n const right = width - CARD_PADDING;\n let cursor = CARD_PADDING;\n\n if (props.title !== undefined || props.badge !== undefined) {\n const baseline = cursor + 11;\n if (props.title !== undefined) {\n labels.push({ x: left, y: baseline, text: props.title, kind: 'title', part: 'text', anchor: 'start' });\n }\n if (props.badge !== undefined) {\n labels.push({ x: right, y: baseline, text: props.badge, kind: 'badge', part: 'axis', anchor: 'end' });\n }\n cursor += TITLE_ROW;\n }\n\n if (props.value !== undefined || props.unit !== undefined) {\n if (props.value !== undefined) {\n labels.push({\n x: left,\n y: cursor + 30,\n text: formatValue(props.value, locale, props.numberFormat),\n kind: 'value',\n part: 'text',\n anchor: 'start',\n });\n }\n if (props.unit !== undefined) {\n labels.push({ x: left, y: cursor + 46, text: props.unit, kind: 'unit', part: 'axis', anchor: 'start' });\n }\n cursor += VALUE_ROW;\n }\n\n if (cursor > CARD_PADDING) cursor += HEADER_GAP;\n const area = { x: left, y: cursor, width: right - left, height: areaHeight };\n cursor += areaHeight;\n\n if (props.footerLeft !== undefined || props.footerRight !== undefined) {\n const ruleY = cursor + 8;\n strokes.push({ d: `M${left},${ruleY}H${right}`, role: 'ornament', part: 'rule' });\n if (props.footerLeft !== undefined) {\n labels.push({ x: left, y: ruleY + 18, text: props.footerLeft, kind: 'footer', part: 'axis', anchor: 'start' });\n }\n if (props.footerRight !== undefined) {\n labels.push({ x: right, y: ruleY + 18, text: props.footerRight, kind: 'footer', part: 'axis', anchor: 'end' });\n }\n cursor += FOOTER_ROW;\n }\n\n const height = cursor + CARD_PADDING;\n const inset = 0.5;\n strokes.unshift({\n d: `M${inset},${inset}H${width - inset}V${height - inset}H${inset}Z`,\n role: 'ornament',\n part: 'rule',\n });\n\n return { viewBox: { x: 0, y: 0, width, height }, area, strokes, labels };\n}\n","import { diagnose } from '../../diagnostics/diagnose';\nimport { roundGeometry } from '../../render/round';\nimport type {\n ChartModel,\n CommonChartProps,\n DataTable,\n Geometry,\n HitArea,\n RecipeContext,\n Rect,\n Stroke,\n TextLabel,\n} from '../../types';\n\n/** What every chart model shares, before any geometry: identity and the accessible layer. */\nexport type ModelBase = Pick<ChartModel, 'chart' | 'id' | 'chrome' | 'name' | 'ids' | 'table' | 'dataTable'>;\n\n/** The accessible name, ids and table of a chart (REQ-120, REQ-121). */\nexport function modelBase(\n chart: string,\n props: CommonChartProps,\n context: RecipeContext,\n fallbackName: string,\n table: Omit<DataTable, 'caption'>,\n): ModelBase {\n const { id } = context;\n const name = props.label ?? props.title ?? fallbackName;\n return {\n chart,\n id,\n chrome: props.chrome ?? 'card',\n name,\n ids: { title: `${id}-title`, desc: `${id}-desc`, table: `${id}-table` },\n table: { caption: name, ...table },\n dataTable: props.dataTable ?? 'hidden',\n };\n}\n\n/** The drawing-area height a chart asks for: the `height` prop or the default of API Spec §5.1. */\nexport function areaHeight(props: CommonChartProps): number {\n return props.height ?? 160;\n}\n\n/**\n * The width the chart draws at, or a deferred model when the container has no usable size yet:\n * the render waits, and no attribute ever carries `NaN` (REQ-009, SP003).\n */\nexport function measure(\n base: ModelBase,\n props: CommonChartProps,\n context: RecipeContext,\n): { readonly width: number; readonly height: number } | { readonly deferred: ChartModel } {\n const width = props.width ?? context.width;\n const height = areaHeight(props);\n if (width !== undefined && width > 0 && height > 0) return { width, height };\n if (width !== undefined && process.env.NODE_ENV !== 'production') {\n diagnose('SP003', base.chart, {\n property: width <= 0 ? 'width' : 'height',\n message: `Measured ${width} × ${height} px.`,\n });\n }\n const box = { x: 0, y: 0, width: 0, height: 0 };\n return {\n deferred: {\n ...base,\n status: 'deferred',\n geometry: { viewBox: box, plot: box, strokes: [], labels: [], hitAreas: [], defs: [] },\n description: props.description ?? base.name,\n },\n };\n}\n\n/**\n * The ground's empty state inside the drawing area, with no spurious axes and no exception\n * (REQ-007). SP001 is reported only when the dataset itself is empty.\n */\nexport function emptyModel(\n base: ModelBase,\n props: CommonChartProps,\n context: RecipeContext,\n frame: { readonly viewBox: Rect; readonly plot: Rect; readonly strokes: readonly Stroke[]; readonly labels: readonly TextLabel[] },\n datasetEmpty: boolean,\n): ChartModel {\n if (datasetEmpty && process.env.NODE_ENV !== 'production') {\n diagnose('SP001', base.chart, { property: 'data' });\n }\n const { plot } = frame;\n const strokes: Stroke[] = [...frame.strokes];\n if (context.emptyState.rule) {\n strokes.push({ d: `M${plot.x},${plot.y + plot.height}H${plot.x + plot.width}`, role: 'ornament', part: 'rule' });\n }\n const labels: TextLabel[] = [\n ...frame.labels,\n {\n x: plot.x + plot.width / 2,\n y: plot.y + plot.height / 2,\n text: context.emptyState.text,\n kind: 'empty',\n part: 'axis',\n anchor: 'middle',\n },\n ];\n return {\n ...base,\n status: 'ready',\n description: props.description ?? `${base.name}. ${context.emptyState.text}.`,\n geometry: roundGeometry({ viewBox: frame.viewBox, plot, strokes, labels, hitAreas: [], defs: [] }),\n };\n}\n\n/** A drawn chart: its geometry rounded to 2 decimals (REQ-002). */\nexport function readyModel(\n base: ModelBase,\n description: string,\n geometry: Omit<Geometry, 'defs' | 'hitAreas'> & { readonly hitAreas: readonly HitArea[] },\n): ChartModel {\n return { ...base, status: 'ready', description, geometry: roundGeometry({ ...geometry, defs: [] }) };\n}\n"]}
@@ -1,4 +1,5 @@
1
- import { C as CommonChartProps, D as DashboardProps } from './types-D1hjElfL.js';
1
+ import { m as CommonChartProps } from './props-Dq8FC8GG.js';
2
+ import { D as DashboardProps } from './types-B81k-s9_.js';
2
3
 
3
4
  /** One child of a reference dashboard: the catalog chart it holds, by name, and its props. */
4
5
  interface DashboardDemoChild {
package/dist/index.d.ts CHANGED
@@ -1,55 +1,9 @@
1
- import { G as Geometry, C as CommonChartProps, a as Ground, S as Seed, b as Stroke, c as StrokePaint, I as InkMode, T as TextLabel, d as Inker, e as GroundRef, f as SubstrateName, P as ProviderConfig, L as LineChartProps, g as Datum, A as ActiveItem, R as Rect, B as BulletChartProps, h as PyramidChartProps, H as HeatmapChartProps, i as TreemapChartProps, j as SankeyChartProps, k as ActivityGridProps, l as StepChartProps, m as SparklineRowsProps, K as KpiCardProps, n as BarChartProps, o as StackedBarChartProps, p as ComposedChartProps, W as WaterfallChartProps, F as FunnelChartProps, q as DonutChartProps, r as RadarChartProps, s as PolarBarChartProps, t as CoxcombChartProps, u as RadialArcGroupProps, v as RadialRingsProps, w as GaugeArcProps, M as MeterChartProps, x as WindRoseProps, y as ChordRingProps, O as OrbitChartProps, V as VolvelleChartProps, z as CandlestickChartProps, E as AreaChartProps, J as RangeBandChartProps, N as StreamChartProps, Q as ScatterChartProps, U as BubbleChartProps, X as PerBreakpoint, Y as DashboardBreakpoint, Z as DashboardLayout, _ as ResolvedLayout, D as DashboardProps, $ as DashboardModel, a0 as DashboardView, a1 as DashboardCellContext } from './types-D1hjElfL.js';
2
- export { a2 as Accessor, a3 as DashboardCellLayout, a4 as DashboardCellProps, a5 as DashboardLink, a6 as GroundName, a7 as HatchToneSpec, a8 as HitArea, a9 as InkOptions, aa as LabelKind, ab as LineCurve, ac as ResolvedCell, ad as ResolvedSpan, ae as StrokePart, af as StrokeRole, ag as Tile, ah as TonalRamp, ai as ToneLevel, aj as ToneSpec, ak as WeightToneSpec } from './types-D1hjElfL.js';
3
-
4
- /** Tabular alternative of a chart's data, already formatted (REQ-121). */
5
- interface DataTable {
6
- readonly caption: string;
7
- readonly columns: readonly string[];
8
- readonly rows: readonly (readonly string[])[];
9
- }
10
- /** What a recipe needs beyond the props: the resolved environment. */
11
- interface RecipeContext {
12
- /** Resolved instance id. */
13
- readonly id: string;
14
- /** Resolved container width in px; `undefined` while it has not been measured. */
15
- readonly width: number | undefined;
16
- readonly locale: string;
17
- readonly emptyState: Ground['emptyState'];
18
- readonly domainPadding: number;
19
- }
20
- /**
21
- * Everything an adapter renders: the geometry plus the accessible layer. Adapters translate
22
- * it into nodes and compute nothing (Art. 2).
23
- */
24
- interface ChartModel {
25
- readonly chart: string;
26
- readonly id: string;
27
- /** `deferred` while the container has no usable size (REQ-009). */
28
- readonly status: 'ready' | 'deferred';
29
- readonly geometry: Geometry;
30
- readonly chrome: 'card' | 'bare';
31
- /** Accessible name (REQ-120). */
32
- readonly name: string;
33
- /** Description summarising the series (REQ-120). */
34
- readonly description: string;
35
- readonly ids: Readonly<{
36
- title: string;
37
- desc: string;
38
- table: string;
39
- }>;
40
- readonly table: DataTable;
41
- readonly dataTable: 'visible' | 'hidden' | 'none';
42
- }
43
- /** A chart: its display name and the pure function from props to model. */
44
- interface ChartRecipe<P extends CommonChartProps> {
45
- readonly name: string;
46
- build(props: P, context: RecipeContext): ChartModel;
47
- }
48
- /** Imperative handle every adapter exposes, deliberately minimal (API Spec §8.1). */
49
- interface ChartHandle {
50
- getGeometry(): Geometry;
51
- toSVGString(): string;
52
- }
1
+ import { G as Geometry, n as Seed, o as Stroke, p as StrokePaint, q as InkMode, r as TextLabel, s as Inker, t as GroundRef, u as SubstrateName, m as CommonChartProps, v as ProviderConfig, w as LineChartProps, x as Datum, A as ActiveItem, y as Rect, z as BulletChartProps, F as PyramidChartProps, J as HeatmapChartProps, K as TreemapChartProps, O as SankeyChartProps, Q as ActivityGridProps, U as StepChartProps, X as SparklineRowsProps, Y as KpiCardProps, Z as BarChartProps, _ as StackedBarChartProps, $ as ComposedChartProps, a0 as WaterfallChartProps, a1 as FunnelChartProps, a2 as DonutChartProps, a3 as RadarChartProps, a4 as PolarBarChartProps, a5 as CoxcombChartProps, a6 as RadialArcGroupProps, a7 as RadialRingsProps, a8 as GaugeArcProps, a9 as MeterChartProps, aa as WindRoseProps, ab as ChordRingProps, ac as OrbitChartProps, ad as VolvelleChartProps, ae as CandlestickChartProps, af as AreaChartProps, ag as RangeBandChartProps, ah as StreamChartProps, ai as ScatterChartProps, aj as BubbleChartProps } from './props-Dq8FC8GG.js';
2
+ export { ak as Accessor, a as BeeswarmChartProps, B as BoxPlotChartProps, b as BumpChartProps, al as ChartOrientation, C as ConnectedScatterChartProps, j as ContourChartProps, k as DelaunayChartProps, i as DensityBinChartProps, d as DivergingBarChartProps, D as DumbbellChartProps, E as EcdfChartProps, c as ErrorBarChartProps, am as Ground, an as GroundName, ao as HatchToneSpec, H as HistogramChartProps, ap as HitArea, aq as InkOptions, I as IntervalChartProps, ar as LabelKind, as as LineCurve, L as LollipopChartProps, M as MarimekkoChartProps, N as NetworkChartProps, at as NetworkNode, P as ParallelCoordinatesChartProps, g as PolarLineChartProps, h as PolarScatterChartProps, R as RidgelineChartProps, S as SlopeChartProps, e as SquarifiedTreemapProps, au as StrokePart, av as StrokeRole, f as SunburstChartProps, aw as Tile, ax as TonalRamp, ay as ToneLevel, az as ToneSpec, T as TreeChartProps, aA as UiTokens, l as VectorFieldChartProps, V as ViolinChartProps, W as WaffleChartProps, aB as WeightToneSpec } from './props-Dq8FC8GG.js';
3
+ import { a as ChartModel, C as ChartRecipe } from './model-CLhtoG75.js';
4
+ export { b as ChartHandle, D as DataTable, R as RecipeContext } from './model-CLhtoG75.js';
5
+ import { P as PerBreakpoint, a as DashboardBreakpoint, b as DashboardLayout, R as ResolvedLayout, D as DashboardProps, c as DashboardModel, d as DashboardView, e as DashboardCellContext } from './types-B81k-s9_.js';
6
+ export { f as DashboardCellLayout, g as DashboardCellProps, h as DashboardLink, i as ResolvedCell, j as ResolvedSpan } from './types-B81k-s9_.js';
53
7
 
54
8
  /** Rounds to 2 decimals, the precision of every emitted coordinate (REQ-002). */
55
9
  declare function round2(value: number): number;
@@ -186,7 +140,7 @@ declare function toSvgView(model: ChartModel, style: ViewStyle): SvgView;
186
140
  declare function svgString(view: SvgView): string;
187
141
 
188
142
  /** Stable diagnostic codes, part of the public surface (API Spec §11). */
189
- type SpCode = 'SP001' | 'SP002' | 'SP003' | 'SP004' | 'SP005' | 'SP006' | 'SP007' | 'SP008' | 'SP009' | 'SP010' | 'SP011' | 'SP012' | 'SP013' | 'SP014' | 'SP015' | 'SP016';
143
+ type SpCode = 'SP001' | 'SP002' | 'SP003' | 'SP004' | 'SP005' | 'SP006' | 'SP007' | 'SP008' | 'SP009' | 'SP010' | 'SP011' | 'SP012' | 'SP013' | 'SP014' | 'SP015' | 'SP016' | 'SP017' | 'SP018' | 'SP019' | 'SP020' | 'SP021' | 'SP022';
190
144
  interface Detail {
191
145
  /** The property involved. */
192
146
  readonly property: string;
@@ -375,7 +329,8 @@ declare const NAVIGATION_KEYS: readonly string[];
375
329
  * Keyboard traversal of the data points, as a pure function (REQ-122). Right and down move to
376
330
  * the next point of the series, left and up to the previous one, Home and End to its ends,
377
331
  * Escape clears. On a grid — every item carries a `cell` — the arrows move by column and row
378
- * instead. Returns `undefined` for a key that is not a navigation key.
332
+ * instead. A chart with its own model — a hierarchy — gives every item its `moves`, and the keys
333
+ * follow them. Returns `undefined` for a key that is not a navigation key.
379
334
  */
380
335
  declare function stepActive(geometry: Geometry, current: ActiveItem | null, key: string): ActiveItem | null | undefined;
381
336
  /** Readout of an active item, positioned as percentages of the viewBox (REQ-141). */
@@ -622,4 +577,4 @@ declare function linkFrom(key: string, source: string, active: ActiveItem | null
622
577
  */
623
578
  declare function linkedMarks(model: Pick<ChartModel, 'id' | 'chart' | 'geometry' | 'table'>, state: LinkState | null | undefined): readonly string[];
624
579
 
625
- export { ActiveItem, ActivityGridProps, AreaChartProps, type BandScale, BarChartProps, BubbleChartProps, BulletChartProps, CandlestickChartProps, type ChartHandle, type ChartModel, type ChartRecipe, ChordRingProps, CommonChartProps, ComposedChartProps, CoxcombChartProps, DASHBOARD_DEFAULTS, DEFAULTS, DISPLAY_FACE_PROBE, DashboardBreakpoint, DashboardCellContext, DashboardLayout, DashboardModel, DashboardProps, DashboardView, type DataTable, Datum, type Detail, type DiagnosticSink, DonutChartProps, FORCED_PRECISION_QUERY, type FontFaceSetLike, FunnelChartProps, GaugeArcProps, Geometry, Ground, GroundRef, HeatmapChartProps, InkMode, Inker, type InteractionEvent, type InteractionResult, KpiCardProps, LINE_CHART_DEMO, LINE_CHART_DEMO_KEYS, LineChartProps, type LinearScale, type LinkState, MIN_TOUCH_TARGET, MeterChartProps, NAVIGATION_KEYS, NullInker, OrbitChartProps, PATH_BYTE_BUDGET, type PathView, type PatternView, PerBreakpoint, type PointerKind, PolarBarChartProps, ProviderConfig, PyramidChartProps, RadarChartProps, RadialArcGroupProps, RadialRingsProps, RangeBandChartProps, type Readout, type RecipeContext, Rect, type ResolvedConfig, ResolvedLayout, SankeyChartProps, type ScaleSite, ScatterChartProps, Seed, SilverpointError, type SpCode, SparklineRowsProps, StackedBarChartProps, StepChartProps, StreamChartProps, Stroke, StrokePaint, SubstrateName, type SvgView, TextLabel, type TextView, TreemapChartProps, type ViewStyle, VolvelleChartProps, WaterfallChartProps, WindRoseProps, __setDiagnosticSink, activityGrid, addDays, areaChart, bandScale, barChart, breakpointOf, bubbleChart, bulletChart, candlestickChart, cellChartBox, checkTypeface, chordRing, circlePath, composedChart, coxcombChart, createPrng, dashboardView, deriveSeed, diagnose, donutChart, enforceHeightening, expandDomain, extent, fnv1a32, funnelChart, gaugeArc, heatmapChart, inCell, instanceId, isoDate, kpiCard, lineChart, linearScale, linkFrom, linkedItems, linkedMarks, max, meterChart, min, orbitChart, parseGeometry, parseIsoDate, pathBytes, perBreakpoint, polarBarChart, pyramidChart, radarChart, radialArcGroup, radialRings, rangeBandChart, readout, reduceInteraction, registerInker, resolveActive, resolveConfig, resolveDashboard, resolveInker, resolveLayout, resolveSeed, round2, roundGeometry, roundPathData, sameActive, sankeyChart, scatterChart, serializeGeometry, sparklineRows, stackedBarChart, stepActive, stepChart, streamChart, svgString, toSvgPoint, toSvgView, treemapChart, volvelleChart, waterfallChart, weekday, windRose };
580
+ export { ActiveItem, ActivityGridProps, AreaChartProps, type BandScale, BarChartProps, BubbleChartProps, BulletChartProps, CandlestickChartProps, ChartModel, ChartRecipe, ChordRingProps, CommonChartProps, ComposedChartProps, CoxcombChartProps, DASHBOARD_DEFAULTS, DEFAULTS, DISPLAY_FACE_PROBE, DashboardBreakpoint, DashboardCellContext, DashboardLayout, DashboardModel, DashboardProps, DashboardView, Datum, type Detail, type DiagnosticSink, DonutChartProps, FORCED_PRECISION_QUERY, type FontFaceSetLike, FunnelChartProps, GaugeArcProps, Geometry, GroundRef, HeatmapChartProps, InkMode, Inker, type InteractionEvent, type InteractionResult, KpiCardProps, LINE_CHART_DEMO, LINE_CHART_DEMO_KEYS, LineChartProps, type LinearScale, type LinkState, MIN_TOUCH_TARGET, MeterChartProps, NAVIGATION_KEYS, NullInker, OrbitChartProps, PATH_BYTE_BUDGET, type PathView, type PatternView, PerBreakpoint, type PointerKind, PolarBarChartProps, ProviderConfig, PyramidChartProps, RadarChartProps, RadialArcGroupProps, RadialRingsProps, RangeBandChartProps, type Readout, Rect, type ResolvedConfig, ResolvedLayout, SankeyChartProps, type ScaleSite, ScatterChartProps, Seed, SilverpointError, type SpCode, SparklineRowsProps, StackedBarChartProps, StepChartProps, StreamChartProps, Stroke, StrokePaint, SubstrateName, type SvgView, TextLabel, type TextView, TreemapChartProps, type ViewStyle, VolvelleChartProps, WaterfallChartProps, WindRoseProps, __setDiagnosticSink, activityGrid, addDays, areaChart, bandScale, barChart, breakpointOf, bubbleChart, bulletChart, candlestickChart, cellChartBox, checkTypeface, chordRing, circlePath, composedChart, coxcombChart, createPrng, dashboardView, deriveSeed, diagnose, donutChart, enforceHeightening, expandDomain, extent, fnv1a32, funnelChart, gaugeArc, heatmapChart, inCell, instanceId, isoDate, kpiCard, lineChart, linearScale, linkFrom, linkedItems, linkedMarks, max, meterChart, min, orbitChart, parseGeometry, parseIsoDate, pathBytes, perBreakpoint, polarBarChart, pyramidChart, radarChart, radialArcGroup, radialRings, rangeBandChart, readout, reduceInteraction, registerInker, resolveActive, resolveConfig, resolveDashboard, resolveInker, resolveLayout, resolveSeed, round2, roundGeometry, roundPathData, sameActive, sankeyChart, scatterChart, serializeGeometry, sparklineRows, stackedBarChart, stepActive, stepChart, streamChart, svgString, toSvgPoint, toSvgView, treemapChart, volvelleChart, waterfallChart, weekday, windRose };