@opendata-ai/openchart-core 8.9.0 → 9.0.0-rc.1

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.
package/dist/index.d.ts CHANGED
@@ -111,6 +111,121 @@ interface ChromeEconomy {
111
111
  */
112
112
  declare function resolveChromeEconomy(width: number, height: number): ChromeEconomy;
113
113
 
114
+ /** Supplied semantics; the library never invents a measure or uncertainty. */
115
+ interface FieldMetadata {
116
+ /** Explicit imported field type; preserved with the portable document. */
117
+ type?: 'text' | 'number' | 'date';
118
+ /** Identifies an internal, persistent row identity column. */
119
+ role?: 'identity';
120
+ label?: string;
121
+ unit?: string;
122
+ measure?: string;
123
+ provenance?: string;
124
+ /** Percent is encoded 0–100; proportion is encoded 0–1. */
125
+ representation?: 'number' | 'percent' | 'proportion';
126
+ interval?: {
127
+ lower: string;
128
+ upper: string;
129
+ };
130
+ statusField?: string;
131
+ }
132
+ interface DesignDiagnostic {
133
+ code: string;
134
+ severity: 'info' | 'warning' | 'error';
135
+ status: 'failed' | 'uncheckable';
136
+ path: string;
137
+ viewport: {
138
+ width: number;
139
+ height: number;
140
+ };
141
+ message: string;
142
+ origin: 'author' | 'default';
143
+ fix?: SpecPatch;
144
+ }
145
+ /**
146
+ * Atomic edits guarded by the complete source document. `changes` uses the same
147
+ * `EditOp` semantics as `applyEditTransaction`: `set` replaces a value whose
148
+ * parent exists, `add` also creates missing object containers, and `remove`
149
+ * deletes a value.
150
+ */
151
+ interface SpecPatch {
152
+ label: string;
153
+ /** Canonical source snapshot prevents stale fixes overwriting subsequent edits. */
154
+ precondition: string;
155
+ changes: EditOp[];
156
+ }
157
+ type DesignQuestion = 'comparison' | 'change' | 'distribution' | 'composition' | 'geography' | 'relationships';
158
+ interface CompositionRecommendation {
159
+ id: string;
160
+ title: string;
161
+ reason: string;
162
+ tradeoff: string;
163
+ spec: VizSpec;
164
+ }
165
+ interface ObservationIdentity {
166
+ observation: string;
167
+ series?: string;
168
+ persistent: boolean;
169
+ }
170
+ interface ReaderObservation extends ObservationIdentity {
171
+ /** Aggregates are visible groups and never imply a raw-row selection. */
172
+ kind?: 'row' | 'aggregate';
173
+ datum: DataRow;
174
+ previous?: DataRow;
175
+ state: 'visible' | 'filtered';
176
+ }
177
+ interface ReaderSelection {
178
+ preview: ReaderObservation | null;
179
+ pinned: ReaderObservation[];
180
+ announcement: string;
181
+ }
182
+ /** Explicit relationships; aggregate groups never masquerade as raw rows. */
183
+ interface DatasetBinding {
184
+ dataset: string;
185
+ entityField: string;
186
+ kind: 'row' | 'group';
187
+ transform?: string;
188
+ groupMembers?: Record<string, Array<string | number>>;
189
+ }
190
+
191
+ interface GeoColorKeyLayout {
192
+ kind: 'binned' | 'gradient' | 'categorical';
193
+ field: string;
194
+ format?: string;
195
+ activeValue: boolean;
196
+ distribution: boolean;
197
+ /** Exact existing classes. Counts are finite joined observations, never area. */
198
+ classes: Array<{
199
+ index: number;
200
+ color: string;
201
+ lower?: number;
202
+ upper?: number;
203
+ count: number;
204
+ x: number;
205
+ width: number;
206
+ y?: number;
207
+ height?: number;
208
+ }>;
209
+ categories: Array<{
210
+ value: string;
211
+ color: string;
212
+ count: number;
213
+ bounds: Rect;
214
+ }>;
215
+ missing: number;
216
+ bar?: Rect;
217
+ domain?: [number, number];
218
+ clampDomain?: [number, number];
219
+ /** Measured exact-value lines keyed by tagged raw value; A prefix is replaced by the slot. */
220
+ activeLabels?: Record<string, string[]>;
221
+ activeRows: Rect[];
222
+ distributionBounds?: Rect;
223
+ }
224
+ interface GeoColorKeyDescriptor {
225
+ features?: GeoColorKeyLayout;
226
+ points?: GeoColorKeyLayout;
227
+ }
228
+
114
229
  /**
115
230
  * Derived neutral ramp.
116
231
  *
@@ -162,13 +277,6 @@ interface NeutralRamp {
162
277
  */
163
278
  declare function deriveNeutralRamp(text: string, bg: string, isDark?: boolean): NeutralRamp;
164
279
 
165
- /**
166
- * Theme types: color palettes, typography, spacing, and chrome defaults.
167
- *
168
- * Theme is the user-facing partial config (all optional).
169
- * ResolvedTheme is the engine-internal fully resolved version (no optionals).
170
- */
171
-
172
280
  /**
173
281
  * A color token value: either a plain CSS color string, or a light/dark pair.
174
282
  * When a pair is given, the resolver picks the appropriate value based on
@@ -217,12 +325,36 @@ interface ThemeColors {
217
325
  text: string;
218
326
  /** Gridline color. */
219
327
  gridline: string;
328
+ /** Zero-rule ink. Defaults to stronger contrast than ordinary gridlines. */
329
+ gridlineZero?: string;
220
330
  /** Axis line and tick color. */
221
331
  axis: string;
222
332
  /** Annotation fill color. */
223
333
  annotationFill: string;
224
334
  /** Annotation text color. */
225
335
  annotationText: string;
336
+ /** Annotation label color. */
337
+ annotationLabel: string;
338
+ /** Annotation muted color. */
339
+ annotationMuted: string;
340
+ /** Annotation leader color. */
341
+ annotationLeader: string;
342
+ /** Annotation rule color. */
343
+ annotationRule: string;
344
+ /** Annotation rangefill color. */
345
+ annotationRangeFill: string;
346
+ /** Annotation markerfill color. */
347
+ annotationMarkerFill: string;
348
+ /** Annotation plate color. */
349
+ annotationPlate: string;
350
+ /** Missing-data map surface; omission derives from the current neutral ramp. */
351
+ mapNoDataFill?: string;
352
+ /** Missing-data map hatch ink; omission derives from the current neutral ramp. */
353
+ mapNoDataHatch?: string;
354
+ /** Interior geographic borders; omission uses the current mode-specific rule. */
355
+ mapInteriorBorder?: string;
356
+ /** Geographic outline ink; omission uses the current mode-specific rule. */
357
+ mapOutlineBorder?: string;
226
358
  /** Semantic color for positive/up-trend values (e.g. sparkline trend coloring). */
227
359
  positive: string;
228
360
  /** Semantic color for negative/down-trend values (e.g. sparkline trend coloring). */
@@ -248,6 +380,10 @@ interface ThemeFontSizes {
248
380
  small: number;
249
381
  /** Axis tick label font size in pixels. */
250
382
  axisTick: number;
383
+ /** Series-name text in endpoint columns and interior area labels. */
384
+ endpointLabel: number;
385
+ /** Numerical endpoint value text. */
386
+ endpointValue: number;
251
387
  /** KPI metric uppercase label font size in pixels. */
252
388
  metricLabel: number;
253
389
  /** KPI metric primary value font size in pixels. The delta and secondary
@@ -280,6 +416,12 @@ interface ThemeFonts {
280
416
  interface ThemeSpacing {
281
417
  /** Padding inside the visualization container (all sides). */
282
418
  padding: number;
419
+ /** Minimum separation between resolved endpoint label blocks. */
420
+ endpointEntryGap: number;
421
+ /** Gap between the endpoint name and its numerical value. */
422
+ endpointValueGap: number;
423
+ /** Gap between plot bounds and the endpoint column. */
424
+ endpointColumnGap: number;
283
425
  /** Gap between chrome elements (title to subtitle, subtitle to chart, etc.). */
284
426
  chromeGap: number;
285
427
  /** Gap between the last chrome element and the chart area. */
@@ -331,10 +473,11 @@ interface ThemeChromeDefaults {
331
473
  * works with).
332
474
  *
333
475
  * Users provide ThemeConfig (from spec.ts) which is the partial/optional
334
- * version. The theme resolver deep-merges ThemeConfig onto the default Theme
476
+ * version. The theme resolver deep-merges ThemeConfig onto the default theme
335
477
  * to produce a ResolvedTheme.
336
478
  */
337
- interface Theme {
479
+ /** @internal Base structure before runtime color resolution. */
480
+ interface ThemeBase {
338
481
  /** Color palettes. */
339
482
  colors: ThemeColors;
340
483
  /** Typography settings. */
@@ -353,22 +496,14 @@ interface Theme {
353
496
  /** Series color assignment strategy. Default: 'palette' (full categorical). */
354
497
  seriesStrategy: SeriesStrategy;
355
498
  }
356
- /**
357
- * Fully resolved theme with no optional fields.
358
- *
359
- * This is the result of resolveTheme(): the default theme with user
360
- * overrides deep-merged in. Every property is guaranteed to have a value.
361
- * The engine uses ResolvedTheme internally so it never needs null checks.
362
- *
363
- * Structurally identical to Theme (both have all required fields), but
364
- * exists as a separate type for semantic clarity: Theme is the default
365
- * definition, ResolvedTheme is the runtime-resolved instance.
366
- */
367
- interface ResolvedTheme extends Theme {
499
+ /** Fully resolved runtime theme, including color adaptation and token metadata. */
500
+ interface ResolvedTheme extends ThemeBase {
368
501
  /** Colors plus the neutral ramp derived from `text` and `background`. */
369
502
  colors: ResolvedThemeColors;
370
503
  /** Whether dark mode adaptations have been applied to this theme. */
371
504
  isDark: boolean;
505
+ /** Authored theme leaves, retained for CSS overrides and mode adaptation. @internal */
506
+ _authored?: ThemeConfig;
372
507
  /**
373
508
  * Original light/dark token pairs from the user's ThemeConfig. Used
374
509
  * by adaptTheme() to skip algorithmic adaptation for tokens with
@@ -478,8 +613,16 @@ interface ResolvedChrome {
478
613
  byline?: ResolvedChromeElement;
479
614
  footer?: ResolvedChromeElement;
480
615
  brand?: ResolvedChromeElement;
616
+ /** Measured default attribution mark; renderers use its exact size and position. */
617
+ watermark?: ResolvedChromeElement;
618
+ /** Resolved footer composition; independent of temporary interaction state. */
619
+ attributionLayout?: 'inline' | 'stacked';
481
620
  /** Annotation footnotes generated by auto-thinning. Rendered as a numbered list above the source line. */
482
621
  footnotes?: AnnotationFootnote[];
622
+ /** Reserved annotation-note and series-summary band, independent of the current demoted set. */
623
+ noteBandHeight?: number;
624
+ /** Height added by the engine in grow mode; hosts must not add it again. */
625
+ grownHeight?: number;
483
626
  /** Responsive series readout above source/methodology. */
484
627
  seriesSummary?: Array<{
485
628
  key: string;
@@ -517,6 +660,8 @@ interface AxisTick {
517
660
  }
518
661
  /** A single gridline with computed positions. */
519
662
  interface Gridline {
663
+ /** Optional resolved semantic stroke, such as an authored zero guide. */
664
+ color?: string;
520
665
  /** Pixel position along the axis. */
521
666
  position: number;
522
667
  /** Whether this is a major or minor gridline. */
@@ -570,7 +715,10 @@ interface AxisLayout {
570
715
  x: number;
571
716
  y: number;
572
717
  angle?: number;
718
+ textAnchor?: 'start' | 'middle' | 'end';
573
719
  };
720
+ /** Engine-wrapped title lines, used by a measured header band. */
721
+ titleLines?: string[];
574
722
  }
575
723
  /** The four built-in fill pattern shapes for series reinforcement. */
576
724
  type FillPatternType = 'diagonal' | 'dot' | 'crosshatch' | 'vertical';
@@ -699,6 +847,12 @@ interface AreaMark {
699
847
  y: number;
700
848
  datum: Record<string, unknown>;
701
849
  tooltip?: TooltipContent;
850
+ /** False for synthetic pivot rows; geometry does not imply an observed zero. */
851
+ observed?: boolean;
852
+ /** Lower band boundary in pixels; y remains the upper boundary for interactions. */
853
+ yBottom?: number;
854
+ /** Contiguous area segment identity, split by explicit missing observations. */
855
+ segment?: number;
702
856
  }>;
703
857
  /** Accessibility attributes. */
704
858
  aria: MarkAria;
@@ -984,6 +1138,8 @@ type Mark = LineMark | AreaMark | RectMark | ArcMark | PointMark | TextMarkLayou
984
1138
  * The collision engine determines whether labels are visible or demoted to tooltip-only.
985
1139
  */
986
1140
  interface ResolvedLabel {
1141
+ /** Engine-wrapped display lines; text retains the original identity string. */
1142
+ lines?: string[];
987
1143
  /** Label text content. */
988
1144
  text: string;
989
1145
  /** Computed x position. */
@@ -1000,6 +1156,10 @@ interface ResolvedLabel {
1000
1156
  connector?: {
1001
1157
  /** Connector start (at the label). */
1002
1158
  from: Point;
1159
+ /** Engine-resolved quadratic control point; absent in older hand-built layouts. */
1160
+ control?: Point;
1161
+ /** Authored curve displacement, retained for geometry rebuilds. */
1162
+ bend?: number;
1003
1163
  /** Connector end (pulled back from the data point so the line doesn't touch it). */
1004
1164
  to: Point;
1005
1165
  /** Actual data point the connector is calling out. Renderer uses this for the endpoint marker. */
@@ -1009,6 +1169,13 @@ interface ResolvedLabel {
1009
1169
  dx: number;
1010
1170
  dy: number;
1011
1171
  };
1172
+ /**
1173
+ * The target's own value label. The data end stops short of it instead of
1174
+ * striking through it; retained so geometry rebuilds stop at the same label.
1175
+ */
1176
+ targetLabel?: Rect;
1177
+ /** Fixed label attachment for outside-reference gutter leaders; retained during animation. */
1178
+ labelAttachment?: 'left-center';
1012
1179
  /** Connector line color. */
1013
1180
  stroke: string;
1014
1181
  /** Connector style: straight line, curved arrow, or vertical drop-line through the data point. */
@@ -1085,6 +1252,7 @@ interface ResolvedAnnotation {
1085
1252
  * label. Positioned `lineHeight * primaryLineCount + gap` below `label.y`.
1086
1253
  */
1087
1254
  subtitle?: {
1255
+ lines?: string[];
1088
1256
  text: string;
1089
1257
  x: number;
1090
1258
  y: number;
@@ -1101,6 +1269,19 @@ interface ResolvedAnnotation {
1101
1269
  }
1102
1270
  /** A footnote entry generated by annotation auto-thinning. */
1103
1271
  interface AnnotationFootnote {
1272
+ /** Original subtitle, kept separate from the primary text. */
1273
+ subtitle?: string;
1274
+ /** Parsed display runs, one array per wrapped line, including the ordinal. */
1275
+ spans?: Array<Array<{
1276
+ text: string;
1277
+ bold: boolean;
1278
+ }>>;
1279
+ /** Engine-wrapped display lines, including the number; omitted for one-line notes. */
1280
+ lines?: string[];
1281
+ /** Source annotation index, independent of note numbering. */
1282
+ specIndex?: number;
1283
+ /** Authored source ID, when present. */
1284
+ id?: string;
1104
1285
  /** 1-indexed footnote number matching the dot marker on the chart. */
1105
1286
  index: number;
1106
1287
  /** The original annotation text that was demoted. */
@@ -1114,6 +1295,8 @@ interface LegendEntry {
1114
1295
  color: string;
1115
1296
  /** Shape of the swatch (matches the mark type). */
1116
1297
  shape: 'circle' | 'square' | 'line';
1298
+ /** SVG dash pattern for a `line` swatch, matching a strokeDash-encoded series. */
1299
+ strokeDasharray?: string;
1117
1300
  /** Whether this entry is currently highlighted/active. */
1118
1301
  active?: boolean;
1119
1302
  /** True for overflow indicator entries ("+N more"). Not interactive. */
@@ -1141,6 +1324,15 @@ interface BaseLegendLayout {
1141
1324
  position: 'top' | 'top-left' | 'right' | 'bottom' | 'bottom-right' | 'inline';
1142
1325
  /** Bounding box for the legend (pixel coordinates). */
1143
1326
  bounds: Rect;
1327
+ /** Measured static key text in figure coordinates; absent on traditional chart keys. */
1328
+ textRows?: Array<{
1329
+ text: string;
1330
+ x: number;
1331
+ y: number;
1332
+ style: TextStyle;
1333
+ role: 'title' | 'unit' | 'context' | 'midpoint';
1334
+ anchor?: 'start' | 'middle' | 'end';
1335
+ }>;
1144
1336
  /** Entry label style. */
1145
1337
  labelStyle: TextStyle;
1146
1338
  }
@@ -1241,6 +1433,11 @@ interface ContinuousLegendLayout extends BaseLegendLayout {
1241
1433
  mode: 'gradient' | 'binned';
1242
1434
  /** The color bar rectangle (pixel coordinates). */
1243
1435
  bar: Rect;
1436
+ /** Optional measured vertical class rows for geographic side keys. */
1437
+ rangeEntries?: Array<{
1438
+ index: number;
1439
+ bounds: Rect;
1440
+ }>;
1244
1441
  /** Gradient color stops (empty in binned mode). */
1245
1442
  colorStops: GradientColorStop[];
1246
1443
  /** Class swatches, left to right (empty in gradient mode). */
@@ -1337,6 +1534,16 @@ interface SizeLegendLayout extends BaseLegendLayout {
1337
1534
  type LegendLayout = CategoricalLegendLayout | GradientLegendLayout | ContinuousLegendLayout | SizeLegendLayout;
1338
1535
  /** A single resolved endpoint-label entry, fully positioned. */
1339
1536
  interface EndpointLabelEntry {
1537
+ /** Actual observation x in pixels; leaders must not imply a shared final date. */
1538
+ dataX?: number;
1539
+ /** Source observation retained without parsing display text. */
1540
+ source?: {
1541
+ datum: Record<string, unknown>;
1542
+ x: unknown;
1543
+ observed: true;
1544
+ };
1545
+ /** Resolved date qualification for unequal series endpoints. */
1546
+ date?: string;
1340
1547
  /** Series identifier (matches mark.seriesKey). */
1341
1548
  seriesKey: string;
1342
1549
  /** Pre-wrapped label text lines. */
@@ -1345,6 +1552,8 @@ interface EndpointLabelEntry {
1345
1552
  value: string;
1346
1553
  /** Series color. */
1347
1554
  color: string;
1555
+ /** SVG dash pattern of the series line, drawn on the swatch. */
1556
+ strokeDasharray?: string;
1348
1557
  /** True pixel y of the last data point on the line. */
1349
1558
  dataY: number;
1350
1559
  /** Displaced y after the bidirectional collision sweep. */
@@ -1366,6 +1575,16 @@ interface EndpointLabelEntry {
1366
1575
  }
1367
1576
  /** Resolved layout for the endpoint labels column. */
1368
1577
  interface EndpointLabelsLayout {
1578
+ /** Fit-tested, series-name-only labels in stacked bands. */
1579
+ interior?: Array<{
1580
+ seriesKey: string;
1581
+ text: string;
1582
+ x: number;
1583
+ y: number;
1584
+ color: string;
1585
+ width: number;
1586
+ height: number;
1587
+ }>;
1369
1588
  /** Per-series resolved entries. */
1370
1589
  entries: EndpointLabelEntry[];
1371
1590
  /** Bounding box for the column. */
@@ -1405,7 +1624,14 @@ interface TooltipField {
1405
1624
  */
1406
1625
  emphasis?: boolean;
1407
1626
  /** Semantic role. `'total'` is the stack sum row, rendered below a hairline. */
1408
- role?: 'total';
1627
+ role?: 'x' | 'series' | 'value' | 'total';
1628
+ source?: {
1629
+ field: string;
1630
+ channel: string;
1631
+ tooltipIndex?: number;
1632
+ layer?: string;
1633
+ panel?: string;
1634
+ };
1409
1635
  }
1410
1636
  /** Tooltip content descriptor for a data point. */
1411
1637
  interface TooltipContent {
@@ -1556,7 +1782,7 @@ interface ScaleInvert {
1556
1782
  topData: number;
1557
1783
  bottomData: number;
1558
1784
  /** Scale type so the vanilla layer applies the correct inverse transform. */
1559
- scaleType?: 'linear' | 'log' | 'pow' | 'sqrt' | 'symlog' | 'time';
1785
+ scaleType?: 'linear' | 'log' | 'pow' | 'sqrt' | 'symlog' | 'time' | 'utc';
1560
1786
  /** For band/point scales: ordered domain values and their pixel centers. */
1561
1787
  domain?: (string | number)[];
1562
1788
  positions?: number[];
@@ -1874,6 +2100,10 @@ interface TableTotalRow {
1874
2100
  * pagination, sort, search state, and accessibility metadata.
1875
2101
  */
1876
2102
  interface TableLayout {
2103
+ /** Width used to resolve the portable attribution footer. */
2104
+ width?: number;
2105
+ /** Same measurement used for footer wrapping in the compiler. */
2106
+ measureText?: MeasureTextFn;
1877
2107
  /** Resolved chrome text elements. */
1878
2108
  chrome: ResolvedChrome;
1879
2109
  /** Resolved column definitions. */
@@ -1898,11 +2128,6 @@ interface TableLayout {
1898
2128
  striped: boolean;
1899
2129
  /** Totals footer, present only when `totalRow` is enabled. */
1900
2130
  totalRow?: TableTotalRow;
1901
- /**
1902
- * Whether condensed density is active.
1903
- * @deprecated Read `density === 'condensed'` instead.
1904
- */
1905
- compact: boolean;
1906
2131
  /** Accessibility metadata. */
1907
2132
  a11y: {
1908
2133
  caption: string;
@@ -2281,6 +2506,12 @@ interface GeoMapBorders {
2281
2506
  * accessibility metadata.
2282
2507
  */
2283
2508
  interface GeoMapLayout {
2509
+ /** Optional independent geographic viewports; absent on the legacy fast path. */
2510
+ views?: GeoViewLayout[];
2511
+ /** Optional map-only color key presentation; omitted when disabled. */
2512
+ colorKeys?: GeoColorKeyDescriptor;
2513
+ /** Omitted entirely unless geographic labels or callouts are authored. */
2514
+ labels?: GeoLabelsBundle;
2284
2515
  /** The map drawing area (after chrome and legend are subtracted). */
2285
2516
  area: Rect;
2286
2517
  /** Resolved chrome text elements with positions and styles. */
@@ -2297,7 +2528,8 @@ interface GeoMapLayout {
2297
2528
  pointContinuousLegend: ContinuousLegendLayout | null;
2298
2529
  /**
2299
2530
  * Nested-circle size key for the point layer's `size` channel (null when the
2300
- * layer has no size encoding). Drawn bottom-right over the map.
2531
+ * layer has no size encoding). Placed in a measured map corner that avoids
2532
+ * occupied feature/point bounds; bottom-right wins clear or tied candidates.
2301
2533
  */
2302
2534
  pointSizeLegend: SizeLegendLayout | null;
2303
2535
  /** Continuous color legend for quantitative mode (null if hidden or categorical). */
@@ -2425,7 +2657,9 @@ interface CompileOptions {
2425
2657
  * How chrome height interacts with the height budget. Mirrors the spec-level
2426
2658
  * `chromeLayout`; the engine reads whichever is set (spec wins).
2427
2659
  *
2428
- * - `'subtract'` (default): `height` is the fixed total; chrome shrinks the plot.
2660
+ * - omitted: notes and the series summary grow the SVG; title, subtitle, and
2661
+ * source subtract from `height`.
2662
+ * - `'subtract'`: `height` is the fixed total; all chrome shrinks the plot.
2429
2663
  * - `'grow'`: `height` is the plot budget; the SVG grows by the chrome height.
2430
2664
  */
2431
2665
  chromeLayout?: 'subtract' | 'grow';
@@ -2485,35 +2719,6 @@ interface CompileOptions {
2485
2719
  * If not provided, the engine falls back to heuristic estimation.
2486
2720
  */
2487
2721
  measureText?: MeasureTextFn;
2488
- /** Extra pixels to reserve on the right margin for a secondary y-axis. Set by compileLayer when resolve.scale.y is 'independent'. */
2489
- rightAxisReserve?: number;
2490
- /**
2491
- * Extra pixels to reserve below the plot for the auto-thinning footnote list.
2492
- * Chicken-and-egg: thinning needs the chart area to decide what to demote, but
2493
- * the footnotes it produces need space carved out of that same area. compileChart
2494
- * resolves it by compiling once to learn the footnote count, then recompiling with
2495
- * this set. Callers should not set it; it is internal to that second pass.
2496
- */
2497
- footnoteReserve?: number;
2498
- /** Recursion depth of the footnote-reserve convergence pass. Internal to compileChart. */
2499
- footnotePass?: number;
2500
- /** Set after facet height growth to prevent unbounded recursion. Internal to compileFaceted. */
2501
- facetHeightGrown?: boolean;
2502
- /**
2503
- * Use this chart drawing area instead of computing one from chrome, axes,
2504
- * and legend reservations. Set by compileLayer when compiling leaf layers so
2505
- * their marks land in the primary layout's coordinate space; leaf specs lack
2506
- * the layer-level chrome/legend/theme and would otherwise compute a
2507
- * different area than the one the axes are rendered in.
2508
- */
2509
- frozenChartArea?: Rect;
2510
- /**
2511
- * Marks this compile as one leaf (or the primary spec) of a multi-leaf layer.
2512
- * Set by compileLayer; callers should not set it. Only consumer today is the
2513
- * canvas mark-layer resolution, which refuses canvas mode for layered charts
2514
- * because the layer layout concatenates marks from several compiles.
2515
- */
2516
- layered?: boolean;
2517
2722
  }
2518
2723
  /** Extended compile options for table visualizations. */
2519
2724
  interface CompileTableOptions extends CompileOptions {
@@ -2531,6 +2736,186 @@ interface CompileTableOptions extends CompileOptions {
2531
2736
  pageSize?: number;
2532
2737
  }
2533
2738
 
2739
+ /** Portable, measured map-label payload. All coordinates are map-local CSS pixels. */
2740
+
2741
+ interface GeoTextBlock {
2742
+ width: number;
2743
+ height: number;
2744
+ /** Baselines relative to the block's top-left corner. */
2745
+ lines: Array<{
2746
+ text: string;
2747
+ x: number;
2748
+ y: number;
2749
+ style: TextStyle;
2750
+ }>;
2751
+ }
2752
+ interface GeoLabelComponent {
2753
+ index: number;
2754
+ exterior: Point[];
2755
+ holes: Point[][];
2756
+ /** Original SVG nonzero-fill orientation, preserved through normalized storage. */
2757
+ winding?: number;
2758
+ holeWindings?: number[];
2759
+ }
2760
+ interface GeoLabelGeometry {
2761
+ featureId: string;
2762
+ bounds: Rect;
2763
+ canonicalAnchor?: Point;
2764
+ components?: GeoLabelComponent[];
2765
+ vertexCount: number;
2766
+ mode: 'retained' | 'fallback' | 'unresolved';
2767
+ searchLimited?: boolean;
2768
+ captureLimited?: boolean;
2769
+ }
2770
+ interface GeoLabelCandidate {
2771
+ /** Stable tagged identity, distinct from authored callout and entity IDs. */
2772
+ id: string;
2773
+ kind: 'text' | 'callout';
2774
+ anchor: GeoAnchor;
2775
+ text: string;
2776
+ subtitle?: string;
2777
+ priority: number;
2778
+ block: GeoTextBlock;
2779
+ /** Projected point/coordinate anchor; feature anchors use geometryId. */
2780
+ resolvedAnchor?: Point;
2781
+ /** Constant-screen radius of an anchored quantitative symbol. */
2782
+ anchorRadius?: number;
2783
+ geometryId?: string;
2784
+ minZoom?: number;
2785
+ maxZoom?: number;
2786
+ offset?: {
2787
+ dx: number;
2788
+ dy: number;
2789
+ };
2790
+ /** Stable index into the premeasured authored callout note slots. */
2791
+ noteSlot?: number;
2792
+ }
2793
+ interface GeoCalloutNoteSlot {
2794
+ id: string;
2795
+ number: number;
2796
+ bounds: Rect;
2797
+ block: GeoTextBlock;
2798
+ }
2799
+ type GeoLabelVisibility = 'visible' | 'collision' | 'zoom-range' | 'offscreen' | 'unresolved' | 'geometry-budget';
2800
+ interface GeoLabelInventoryEntry {
2801
+ id: string;
2802
+ kind: 'text' | 'callout';
2803
+ anchor: GeoAnchor;
2804
+ text: string;
2805
+ subtitle?: string;
2806
+ visibility: GeoLabelVisibility;
2807
+ presentation: 'label' | 'note' | 'none';
2808
+ limitation?: 'candidate-limit' | 'vertex-limit' | 'search-limit';
2809
+ }
2810
+ interface GeoPlacedLabel {
2811
+ id: string;
2812
+ anchor: Point;
2813
+ bounds: Rect;
2814
+ block: GeoTextBlock;
2815
+ }
2816
+ interface GeoLabelOverlay {
2817
+ diagnostics?: DesignDiagnostic[];
2818
+ labels: GeoPlacedLabel[];
2819
+ leaders: Array<{
2820
+ id: string;
2821
+ from: Point;
2822
+ to: Point;
2823
+ }>;
2824
+ markers: Array<{
2825
+ id: string;
2826
+ anchor: Point;
2827
+ number: number;
2828
+ }>;
2829
+ notes: Array<{
2830
+ id: string;
2831
+ slot: GeoCalloutNoteSlot;
2832
+ }>;
2833
+ inventory: GeoLabelInventoryEntry[];
2834
+ }
2835
+ interface GeoLabelsInput {
2836
+ /** Complete inventory source, including candidates beyond the visual cap. */
2837
+ candidates: GeoLabelCandidate[];
2838
+ geometries: GeoLabelGeometry[];
2839
+ viewport: Rect;
2840
+ obstacles: Rect[];
2841
+ /** Measured screen radius for fallback note markers. */
2842
+ markerRadius?: number;
2843
+ /** Base-map centers with constant-screen quantitative symbol radii. */
2844
+ symbolObstacles?: Array<{
2845
+ center: Point;
2846
+ radius: number;
2847
+ }>;
2848
+ noteSlots: GeoCalloutNoteSlot[];
2849
+ }
2850
+ interface GeoLabelsBundle extends GeoLabelsInput {
2851
+ initialOverlay: GeoLabelOverlay;
2852
+ }
2853
+ interface GeoLabelAffine {
2854
+ k: number;
2855
+ tx: number;
2856
+ ty: number;
2857
+ }
2858
+
2859
+ /** Context geometry uses the primary view's immutable fitted projection. */
2860
+ interface GeoDetailLayer {
2861
+ id: string;
2862
+ features: unknown;
2863
+ objectKey?: string;
2864
+ minZoom: number;
2865
+ maxZoom?: number;
2866
+ /** Assertion that decoded identity coordinates share the primary source plane. */
2867
+ sourcePlane?: string;
2868
+ }
2869
+ interface GeoInset {
2870
+ id: string;
2871
+ label: string;
2872
+ /** Canonical topology feature IDs, independent of the geo.idField data-join field. */
2873
+ featureIds: Array<string | number>;
2874
+ placement: 'bottom-left' | 'bottom-right';
2875
+ width: number;
2876
+ projection?: GeoMapProjection;
2877
+ /** Defaults true; false explicitly duplicates primary feature coverage. */
2878
+ removeFromMain?: boolean;
2879
+ /** Explicit existing points.key values; omission includes no points. */
2880
+ pointIds?: Array<string | number>;
2881
+ }
2882
+ interface GeoProjectionContext {
2883
+ projection: GeoMapProjection;
2884
+ space: 'geographic' | 'source';
2885
+ sourcePlane?: string;
2886
+ objectKey?: string;
2887
+ fitObjectKey?: string;
2888
+ }
2889
+ interface GeoDetailLayerLayout {
2890
+ id: string;
2891
+ minZoom: number;
2892
+ maxZoom?: number;
2893
+ /** Unstyled, context-only paths, already projected into this view. */
2894
+ paths: string[];
2895
+ }
2896
+ /** Each view owns its camera; observation identity deliberately excludes viewId. */
2897
+ interface GeoViewLayout {
2898
+ viewId: string;
2899
+ /** Map-local frame and drawing viewport, including the separately measured label. */
2900
+ frame: Rect;
2901
+ viewport: Rect;
2902
+ labelBounds?: Rect;
2903
+ label?: GeoTextBlock;
2904
+ coverage?: string;
2905
+ /** Everything below is viewport-local, in CSS pixels before camera transform. */
2906
+ mapSize: {
2907
+ width: number;
2908
+ height: number;
2909
+ };
2910
+ features: GeoMapFeatureMark[];
2911
+ borders: GeoMapBorders;
2912
+ pointMarks: GeoMapPointMark[];
2913
+ labels?: GeoLabelsBundle;
2914
+ focus: GeoMapFocusLayout | null;
2915
+ detailLayers: GeoDetailLayerLayout[];
2916
+ projectionContext: GeoProjectionContext;
2917
+ }
2918
+
2534
2919
  /**
2535
2920
  * Table column configuration types.
2536
2921
  *
@@ -2789,7 +3174,7 @@ interface TrendlineConfig {
2789
3174
  * When it's an object, it can include properties like interpolation,
2790
3175
  * point markers, orientation, and more.
2791
3176
  */
2792
- interface MarkDef {
3177
+ interface MarkOptions {
2793
3178
  /** The mark type. */
2794
3179
  type: MarkType;
2795
3180
  /**
@@ -3020,6 +3405,50 @@ interface MarkDef {
3020
3405
  label?: string;
3021
3406
  };
3022
3407
  }
3408
+ /** Shared visual options accepted by every authored mark. */
3409
+ type SharedMarkOptions = Pick<MarkOptions, 'size' | 'filled' | 'opacity' | 'fillOpacity' | 'fill' | 'stroke' | 'strokeWidth' | 'tooltip' | 'clip' | 'fillPattern'>;
3410
+ /**
3411
+ * Authored mark configuration. Each mark accepts only options it understands.
3412
+ * String marks remain shorthand for `{ type: mark }`.
3413
+ * Extend this union with `type CustomMark = MarkDef & { ... }`, not an interface.
3414
+ */
3415
+ type MarkDef = (SharedMarkOptions & {
3416
+ type: 'bar';
3417
+ } & Pick<MarkOptions, 'orient' | 'cornerRadius'>) | (SharedMarkOptions & {
3418
+ type: 'line';
3419
+ } & Pick<MarkOptions, 'point' | 'interpolate'>) | (SharedMarkOptions & {
3420
+ type: 'area';
3421
+ } & Pick<MarkOptions, 'point' | 'interpolate'>) | (SharedMarkOptions & {
3422
+ type: 'point';
3423
+ } & Pick<MarkOptions, 'trendline'>) | (SharedMarkOptions & {
3424
+ type: 'circle';
3425
+ }) | (SharedMarkOptions & {
3426
+ type: 'arc';
3427
+ } & Pick<MarkOptions, 'innerRadius' | 'outerRadius' | 'startAngle' | 'endAngle' | 'centerLabel'>) | (SharedMarkOptions & {
3428
+ type: 'text';
3429
+ } & Pick<MarkOptions, 'dx' | 'dy' | 'align' | 'baseline' | 'fontSize'>) | (SharedMarkOptions & {
3430
+ type: 'rule';
3431
+ }) | (SharedMarkOptions & {
3432
+ type: 'tick';
3433
+ }) | (SharedMarkOptions & {
3434
+ type: 'rect';
3435
+ } & Pick<MarkOptions, 'cornerRadius'>) | (SharedMarkOptions & {
3436
+ type: 'lollipop';
3437
+ }) | (SharedMarkOptions & {
3438
+ type: 'beeswarm';
3439
+ }) | (SharedMarkOptions & {
3440
+ type: 'range';
3441
+ } & Pick<MarkOptions, 'style' | 'colorByDirection'>) | (SharedMarkOptions & {
3442
+ type: 'waffle';
3443
+ } & Pick<MarkOptions, 'units' | 'columns' | 'other' | 'cornerRadius'>) | (SharedMarkOptions & {
3444
+ type: 'calendar';
3445
+ } & Pick<MarkOptions, 'weekStart' | 'cellRadius'>) | (SharedMarkOptions & {
3446
+ type: 'parliament';
3447
+ } & Pick<MarkOptions, 'shape' | 'seatRadius' | 'majorityLine'>) | (SharedMarkOptions & {
3448
+ type: 'histogram';
3449
+ } & Pick<MarkOptions, 'orient' | 'cornerRadius' | 'binCount' | 'normalize'>) | (SharedMarkOptions & {
3450
+ type: 'density';
3451
+ } & Pick<MarkOptions, 'point' | 'interpolate' | 'bandwidth' | 'cumulative' | 'steps'>);
3023
3452
  /** Data field type, following Vega-Lite conventions. */
3024
3453
  type FieldType = 'quantitative' | 'temporal' | 'nominal' | 'ordinal';
3025
3454
  /** Aggregate function applied to a field before encoding. */
@@ -3054,6 +3483,10 @@ interface AxisConfig {
3054
3483
  ticks?: boolean;
3055
3484
  /** Axis position offset in pixels. */
3056
3485
  offset?: number;
3486
+ /** Angle of the title in degrees. A y-axis title at angle 0 and anchor end becomes a header. */
3487
+ titleAngle?: number;
3488
+ /** Position along the axis for the title; omission keeps the centered title. */
3489
+ titleAnchor?: 'start' | 'middle' | 'end';
3057
3490
  /** Padding between axis title and axis. */
3058
3491
  titlePadding?: number;
3059
3492
  /** Padding between tick labels and axis. */
@@ -3385,9 +3818,8 @@ interface Encoding<TData extends DataRow = DataRow> {
3385
3818
  /**
3386
3819
  * Angular position (slice value) for arc marks (pie/donut), the canonical
3387
3820
  * value channel in v8. Waffle and parliament marks accept it too (the same
3388
- * part-to-whole value channel). `y` is still accepted on these marks as a
3389
- * deprecated alias for backward compatibility (a compile warning is emitted
3390
- * and `y` is populated from `theta` internally). Not used by any other mark
3821
+ * part-to-whole value channel). The compiler populates internal `y` from
3822
+ * `theta`; authored `y` aliases are rejected. Not used by any other mark
3391
3823
  * type.
3392
3824
  */
3393
3825
  theta?: EncodingChannel<TData>;
@@ -3589,14 +4021,20 @@ type ConnectorType = 'straight' | 'curve' | 'drop-line';
3589
4021
  interface ConnectorConfig {
3590
4022
  /** Connector style. */
3591
4023
  type: ConnectorType;
3592
- /** Whether to draw an arrowhead at the data-point end. Default: true for curve, false for straight. Drop-line never takes a head. */
4024
+ /** Curve displacement along the chord normal, from -1 to 1. Omitted or zero preserves the automatic curve. Ignored for other connector types. */
4025
+ bend?: number;
4026
+ /** Whether to draw an arrowhead at the data-point end. Default: false for both curve and straight. Drop-line never takes a head. */
3593
4027
  arrow?: boolean;
3594
4028
  }
3595
4029
  /** Style overrides for the dot marker drawn at the data point. */
3596
4030
  interface AnnotationDot {
3597
4031
  /** Circle radius in pixels. Default 4. */
3598
4032
  radius?: number;
3599
- /** Fill color. Defaults to theme background for an "open ring" look. */
4033
+ /**
4034
+ * Fill color. Defaults to `theme.colors.annotationMarkerFill`, which resolves to
4035
+ * the theme's opaque surface. A default dot on an endpoint marker takes the
4036
+ * marker's fill and stroke.
4037
+ */
3600
4038
  fill?: string;
3601
4039
  /** Stroke color. Defaults to the connector's resolved stroke, so marker and leader read as one system. */
3602
4040
  stroke?: string;
@@ -3607,8 +4045,6 @@ interface AnnotationDot {
3607
4045
  interface AnnotationBase {
3608
4046
  /** Stable identifier for selection and edit callbacks. When provided, edit events include this ID for reliable element matching. */
3609
4047
  id?: string;
3610
- /** Human-readable label for the annotation. */
3611
- label?: string;
3612
4048
  /** Fill color for the annotation element. */
3613
4049
  fill?: string;
3614
4050
  /** Stroke color for the annotation element. */
@@ -3645,11 +4081,15 @@ interface TextAnnotation extends AnnotationBase {
3645
4081
  * Used for supporting context (e.g. methodology, source). Newlines in
3646
4082
  * `text` still produce multi-line primary; subtitle is a separate block.
3647
4083
  *
3648
- * Supports the same inline `**bold**` spans as `text`. When a subtitle is
3649
- * present and no `fontWeight` is set, the primary `text` resolves to weight
3650
- * 700 — the lede + context stack.
4084
+ * Supports the same inline `**bold**` spans as `text`. The primary `text`
4085
+ * keeps its own weight (default 400); use `fontWeight` or `**bold**` spans
4086
+ * for a bold lede.
3651
4087
  */
3652
4088
  subtitle?: string;
4089
+ /** Subtitle size in pixels. Default: round(fontSize * 12 / 13). */
4090
+ subtitleFontSize?: number;
4091
+ /** Display wrap width in pixels. Omitted uses min(240, plot width minus twice the padding); null disables wrapping. */
4092
+ maxWidth?: number | null;
3653
4093
  /**
3654
4094
  * Open-ring marker drawn on the data point itself (not on the pulled-back
3655
4095
  * connector tip).
@@ -3675,7 +4115,7 @@ interface TextAnnotation extends AnnotationBase {
3675
4115
  * Connector from label to anchor point.
3676
4116
  * - `true` (default): straight line, no arrow
3677
4117
  * - `'straight'`: straight line, no arrow
3678
- * - `'curve'`: curved arrow with arrowhead
4118
+ * - `'curve'`: curved leader; set arrow: true for an arrowhead
3679
4119
  * - `'drop-line'`: vertical line through the data point's x
3680
4120
  * - `{ type, arrow? }`: object form for explicit arrow control
3681
4121
  * - `false`: no connector
@@ -3710,6 +4150,8 @@ interface TextAnnotation extends AnnotationBase {
3710
4150
  */
3711
4151
  interface RangeAnnotation extends AnnotationBase {
3712
4152
  type: 'range';
4153
+ /** Text drawn with the range band. */
4154
+ label?: string;
3713
4155
  /** Start of the range on the x-axis. */
3714
4156
  x1?: string | number;
3715
4157
  /** End of the range on the x-axis. */
@@ -3732,7 +4174,7 @@ interface RangeAnnotation extends AnnotationBase {
3732
4174
  labelOffset?: AnnotationOffset;
3733
4175
  /** Anchor direction for the range label. */
3734
4176
  labelAnchor?: AnnotationAnchor;
3735
- /** Font size override for the range label (px). Default: 11. */
4177
+ /** Font size override for the range label (px). Default: theme small (12px). */
3736
4178
  fontSize?: number;
3737
4179
  /** Font weight override for the range label. Default: 500. */
3738
4180
  fontWeight?: number;
@@ -3742,14 +4184,10 @@ interface RangeAnnotation extends AnnotationBase {
3742
4184
  * Useful for baselines (zero), targets, or thresholds.
3743
4185
  */
3744
4186
  interface RefLineAnnotation extends AnnotationBase {
3745
- /**
3746
- * Discriminant. `'refline'` is canonical and the only value in the type.
3747
- * `'rule'` (it collides with the `rule` mark type) is still accepted at
3748
- * runtime for backward compatibility -- the spec-sugar pass rewrites it to
3749
- * `'refline'` with a deprecation warning before validation -- but it is not
3750
- * part of this type. Use `'refline'`.
3751
- */
4187
+ /** Reference-line annotation discriminant. Older rule aliases require migrateSpecV8. */
3752
4188
  type: 'refline';
4189
+ /** Text drawn with the reference line. */
4190
+ label?: string;
3753
4191
  /** X-axis value for a vertical reference line. */
3754
4192
  x?: string | number;
3755
4193
  /** Y-axis value for a horizontal reference line. */
@@ -3762,9 +4200,11 @@ interface RefLineAnnotation extends AnnotationBase {
3762
4200
  strokeWidth?: number;
3763
4201
  /** Pixel offset for the reference line label. */
3764
4202
  labelOffset?: AnnotationOffset;
4203
+ /** Screen-space label placement. Outside reserves a right gutter or top lane; omission uses auto unless labelAnchor is authored. */
4204
+ labelPlacement?: 'auto' | 'start' | 'end' | 'outside';
3765
4205
  /** Anchor direction for the reference line label. */
3766
4206
  labelAnchor?: AnnotationAnchor;
3767
- /** Label font size in pixels. Default: 11. */
4207
+ /** Label font size in pixels. Default: theme small (12px). */
3768
4208
  fontSize?: number;
3769
4209
  /** Label font weight. Default: 400. */
3770
4210
  fontWeight?: number;
@@ -3787,8 +4227,7 @@ type Annotation = TextAnnotation | RangeAnnotation | RefLineAnnotation;
3787
4227
  */
3788
4228
  type DarkMode = 'auto' | 'force' | 'off';
3789
4229
  /**
3790
- * Per-element chrome theme override. Pass a plain string (color only,
3791
- * backward-compatible) or an object with full typography control.
4230
+ * Per-element chrome theme typography controls.
3792
4231
  */
3793
4232
  interface ChromeThemeOverride {
3794
4233
  /** Text color. Accepts a TokenValue for light/dark pairs. */
@@ -3836,6 +4275,26 @@ interface ThemeConfig {
3836
4275
  annotationFill?: TokenValue;
3837
4276
  /** Annotation text color. Accepts a TokenValue for light/dark pairs. */
3838
4277
  annotationText?: TokenValue;
4278
+ /** Annotation label color. Accepts a TokenValue light/dark pair. */
4279
+ annotationLabel?: TokenValue;
4280
+ /** Annotation muted color. Accepts a TokenValue light/dark pair. */
4281
+ annotationMuted?: TokenValue;
4282
+ /** Annotation leader color. Accepts a TokenValue light/dark pair. */
4283
+ annotationLeader?: TokenValue;
4284
+ /** Annotation rule color. Accepts a TokenValue light/dark pair. */
4285
+ annotationRule?: TokenValue;
4286
+ /** Annotation rangefill color. Accepts a TokenValue light/dark pair. */
4287
+ annotationRangeFill?: TokenValue;
4288
+ /** Annotation markerfill color. Accepts a TokenValue light/dark pair. */
4289
+ annotationMarkerFill?: TokenValue;
4290
+ /** Annotation plate color. Accepts a TokenValue light/dark pair. */
4291
+ annotationPlate?: TokenValue;
4292
+ /** Optional map missing-data and geographic border ink. */
4293
+ gridlineZero?: TokenValue;
4294
+ mapNoDataFill?: TokenValue;
4295
+ mapNoDataHatch?: TokenValue;
4296
+ mapInteriorBorder?: TokenValue;
4297
+ mapOutlineBorder?: TokenValue;
3839
4298
  /** Semantic color for positive/up-trend values. Accepts a TokenValue for light/dark pairs. */
3840
4299
  positive?: TokenValue;
3841
4300
  /** Semantic color for negative/down-trend values. Accepts a TokenValue for light/dark pairs. */
@@ -3855,14 +4314,17 @@ interface ThemeConfig {
3855
4314
  subtitle?: number;
3856
4315
  /** Body text (tooltips, legend labels). Default: 13. */
3857
4316
  body?: number;
3858
- /** Small text (source line, footer). Default: 11. */
4317
+ /** Small text (source line, footer). Default: 12. */
3859
4318
  small?: number;
3860
- /** Axis tick labels. Default: 11. */
4319
+ /** Axis tick labels. Default: 12. */
3861
4320
  axisTick?: number;
3862
4321
  /** KPI metric uppercase label. Default: 10. */
3863
4322
  metricLabel?: number;
3864
4323
  /** KPI metric primary value. Default: 22. Delta/secondary derive from this. */
3865
4324
  metricValue?: number;
4325
+ /** Series-name and numerical endpoint font sizes in pixels. */
4326
+ endpointLabel?: number;
4327
+ endpointValue?: number;
3866
4328
  };
3867
4329
  /** Font weight overrides. Partial — only specified keys are overridden. */
3868
4330
  weights?: {
@@ -3892,27 +4354,29 @@ interface ThemeConfig {
3892
4354
  xAxisHeight?: number;
3893
4355
  /** Gap in pixels between the x-axis line and tick label text. Increase when larger axisTick fonts sit too close to the axis line. */
3894
4356
  xAxisLabelPadding?: number;
4357
+ /** Endpoint block separation, internal value gap, and plot-to-column gap. */
4358
+ endpointEntryGap?: number;
4359
+ endpointValueGap?: number;
4360
+ endpointColumnGap?: number;
3895
4361
  };
3896
4362
  /** Border radius for chart container and tooltips. */
3897
4363
  borderRadius?: number;
3898
4364
  /**
3899
- * Per-element chrome style overrides. Pass a plain string for color-only
3900
- * (backward-compatible), or a ChromeThemeOverride object for full
3901
- * typography control (color, fontSize, fontWeight, lineHeight).
4365
+ * Per-element chrome typography control (color, fontSize, fontWeight, lineHeight).
3902
4366
  */
3903
4367
  chrome?: {
3904
4368
  /** Eyebrow (kicker) style override. */
3905
- eyebrow?: string | ChromeThemeOverride;
4369
+ eyebrow?: ChromeThemeOverride;
3906
4370
  /** Title style override. */
3907
- title?: string | ChromeThemeOverride;
4371
+ title?: ChromeThemeOverride;
3908
4372
  /** Subtitle style override. */
3909
- subtitle?: string | ChromeThemeOverride;
4373
+ subtitle?: ChromeThemeOverride;
3910
4374
  /** Source/attribution style override. */
3911
- source?: string | ChromeThemeOverride;
4375
+ source?: ChromeThemeOverride;
3912
4376
  /** Byline style override. */
3913
- byline?: string | ChromeThemeOverride;
4377
+ byline?: ChromeThemeOverride;
3914
4378
  /** Footer style override. */
3915
- footer?: string | ChromeThemeOverride;
4379
+ footer?: ChromeThemeOverride;
3916
4380
  };
3917
4381
  /**
3918
4382
  * Editorial rule above the chrome block: a short colored bar (the
@@ -3920,12 +4384,12 @@ interface ThemeConfig {
3920
4384
  */
3921
4385
  rule?: {
3922
4386
  /** Rule color. Accepts a TokenValue for light/dark pairs. */
3923
- color: TokenValue;
4387
+ color?: TokenValue;
3924
4388
  /** Rule length in pixels. */
3925
- width: number;
4389
+ width?: number;
3926
4390
  /** Rule height in pixels. */
3927
- thickness: number;
3928
- };
4391
+ thickness?: number;
4392
+ } | null;
3929
4393
  /**
3930
4394
  * Series color assignment strategy.
3931
4395
  * Default: 'palette' (full categorical palette always, zero visual drift).
@@ -3936,12 +4400,17 @@ interface ThemeConfig {
3936
4400
  * Label density mode controlling how many data labels are shown.
3937
4401
  * - 'all': show every label, skip collision detection
3938
4402
  * - 'auto': show labels with collision detection (default)
3939
- * - 'endpoints': show only first and last per series (useful for line charts)
4403
+ * - 'endpoints': show only first and last per series
4404
+ *
4405
+ * Line and area marks draw no value labels; identify their series with
4406
+ * `endpointLabels` or the legend.
3940
4407
  * - 'none': hide all labels (rely on tooltips and legend)
3941
4408
  */
3942
4409
  type LabelDensity = 'all' | 'auto' | 'endpoints' | 'none';
3943
4410
  /** Label display configuration for chart data labels. */
3944
4411
  interface LabelConfig {
4412
+ /** Placement for bar/column values. Column is only supported for simple horizontal bars. */
4413
+ placement?: 'adaptive' | 'inside' | 'outside' | 'column';
3945
4414
  /** How many labels to show. Defaults to 'auto'. */
3946
4415
  density?: LabelDensity;
3947
4416
  /** Number format override for label values (d3-format string, e.g. ",.0f"). */
@@ -3952,12 +4421,6 @@ interface LabelConfig {
3952
4421
  suffix?: string;
3953
4422
  /** Fixed CSS color for all labels. Overrides the default fill-derived color. */
3954
4423
  color?: string;
3955
- /**
3956
- * Per-series pixel offsets for fine-tuning label positions, keyed by series name.
3957
- * @deprecated Per-series pixel offsets are a workaround for collision bugs
3958
- * now fixed by the layout engine. Will be removed in a future version.
3959
- */
3960
- offsets?: Record<string, AnnotationOffset>;
3961
4424
  /** Font size in pixels for bar/column value labels. */
3962
4425
  fontSize?: number;
3963
4426
  }
@@ -4027,19 +4490,18 @@ type EndpointLabelContent = 'label' | 'value' | 'label value';
4027
4490
  * for multi-series line/area charts. Each entry pairs the series name with its
4028
4491
  * last formatted value, optionally anchored to the line by an open-circle marker.
4029
4492
  *
4030
- * The column is independent of the traditional `legend` and the legacy
4031
- * end-of-line labels. Together with `legend.show`, the three suppression toggles
4032
- * follow this truth table for ≥2-series line/area charts:
4493
+ * The column and traditional legend are independent identification surfaces.
4494
+ * For multi-series line/area charts:
4033
4495
  *
4034
- * | `legend.show` | `endpointLabels` | Traditional legend | Endpoint column | End-of-line labels |
4035
- * |--|--|--|--|--|
4036
- * | unset | unset | hidden (auto-suppressed) | shown (default) | hidden |
4037
- * | true | unset | shown | shown | hidden |
4038
- * | unset | false | shown (auto-suppress revoked) | hidden | hidden |
4039
- * | false | false | hidden | hidden | shown (last-resort) |
4040
- * | true | false | shown | hidden | hidden |
4041
- * | false | true | hidden | shown | hidden |
4042
- * | true | true | shown | shown | hidden |
4496
+ * | `legend.show` | `endpointLabels` | Traditional legend | Endpoint column |
4497
+ * |--|--|--|--|
4498
+ * | unset | unset | hidden | shown |
4499
+ * | true | unset | shown | shown |
4500
+ * | unset | false | shown | hidden |
4501
+ * | false | false | hidden (accessibility warning) | hidden |
4502
+ * | true | false | shown | hidden |
4503
+ * | false | true | hidden | shown |
4504
+ * | true | true | shown | shown |
4043
4505
  *
4044
4506
  * Single-series charts: column is hidden by default (nothing to identify).
4045
4507
  *
@@ -4049,6 +4511,10 @@ type EndpointLabelContent = 'label' | 'value' | 'label value';
4049
4511
  * in `legend/__tests__/suppression.test.ts` enforce every cell.
4050
4512
  */
4051
4513
  interface EndpointLabelsConfig {
4514
+ /** Stacked-area anchor: cumulative boundary or the middle of the band. Default band. */
4515
+ anchor?: 'boundary' | 'band';
4516
+ /** Series identification in the end column or fitted inside stacked bands. */
4517
+ placement?: 'end' | 'interior';
4052
4518
  /** Explicit on/off. When undefined, the chart auto-decides based on series count. */
4053
4519
  show?: boolean;
4054
4520
  /** Maximum number of series before endpoint labels switch to a legend. Default 8. */
@@ -4080,9 +4546,12 @@ interface EndpointLabelsConfig {
4080
4546
  format?: string;
4081
4547
  /** Max wrap width in pixels for long series names. Default 96. */
4082
4548
  width?: number;
4083
- /** Render an open-circle marker on the line at the right edge. Default true. */
4549
+ /**
4550
+ * Render a ring marker centered on the line's end point. Default true. Its
4551
+ * fill defaults to the opaque canvas color so the ring covers the line end.
4552
+ */
4084
4553
  showMarker?: boolean;
4085
- /** Override the marker style. */
4554
+ /** Override the marker style. `fill: 'transparent'` keeps a see-through ring. */
4086
4555
  markerStyle?: {
4087
4556
  fill?: string;
4088
4557
  stroke?: string;
@@ -4116,8 +4585,8 @@ interface SeriesStyle {
4116
4585
  * Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention.
4117
4586
  */
4118
4587
  type AnimationEase = 'smooth' | 'snappy';
4119
- /** Opt-in motion language. `legacy` preserves the v8 tween timing. */
4120
- type AnimationPreset = 'fluid' | 'subtle' | 'legacy';
4588
+ /** Opt-in motion language. */
4589
+ type AnimationPreset = 'fluid' | 'subtle';
4121
4590
  /** Physical spring parameters. Quantitative motion is bounded at critical damping. */
4122
4591
  interface SpringConfig {
4123
4592
  stiffness?: number;
@@ -4133,6 +4602,8 @@ interface AnimationStagger {
4133
4602
  }
4134
4603
  /** Fine-grained responsive behavior configuration. */
4135
4604
  interface ResponsiveConfig {
4605
+ /** Maximum eligible inline callouts below 400px container width; default 1; null is unlimited. Pinned annotations are exempt. */
4606
+ compactAnnotationLimit?: number | null;
4136
4607
  /** Preserve the final temporal boundary before thinning interior ticks. */
4137
4608
  preserveEnd?: boolean;
4138
4609
  /** Move direct series labels into a keyed list when the inline column cannot fit. */
@@ -4218,6 +4689,8 @@ interface ChartSpecOverride {
4218
4689
  chrome?: Chrome;
4219
4690
  /** Override label configuration at this breakpoint. */
4220
4691
  labels?: LabelSpec;
4692
+ /** Override endpoint labels at this breakpoint, including migrated v8 line labels. */
4693
+ endpointLabels?: boolean | EndpointLabelsConfig;
4221
4694
  /** Override legend configuration at this breakpoint. */
4222
4695
  legend?: LegendConfig;
4223
4696
  /** Override annotations at this breakpoint. */
@@ -4255,7 +4728,6 @@ interface Metric {
4255
4728
  * Encoding for arc marks (pie/donut charts).
4256
4729
  * - `theta`: required (quantitative — the canonical slice value channel)
4257
4730
  * - `color`: required (nominal/ordinal — the category)
4258
- * - `y`: deprecated alias for `theta`, accepted for backward compatibility
4259
4731
  */
4260
4732
  interface ArcEncoding<TData extends DataRow = DataRow> extends Encoding<TData> {
4261
4733
  /** Canonical value channel for arc marks (quantitative — the slice value). */
@@ -4343,8 +4815,7 @@ interface RangeEncoding<TData extends DataRow = DataRow> extends Encoding<TData>
4343
4815
  * Encoding for waffle marks (unit grids for part-to-whole counts).
4344
4816
  * - `color`: required (nominal/ordinal, the category)
4345
4817
  * - `theta`: the canonical quantitative share, the same part-to-whole value
4346
- * channel arc marks use. `y` is a deprecated alias, accepted for backward
4347
- * compatibility.
4818
+ * channel arc marks use.
4348
4819
  */
4349
4820
  interface WaffleEncoding<TData extends DataRow = DataRow> extends Encoding<TData> {
4350
4821
  color: EncodingChannel<TData> | ConditionalValueDef<TData>;
@@ -4353,8 +4824,7 @@ interface WaffleEncoding<TData extends DataRow = DataRow> extends Encoding<TData
4353
4824
  * Encoding for parliament marks (hemicycle seat-dot charts).
4354
4825
  * - `color`: required (nominal/ordinal, the party)
4355
4826
  * - `theta`: the canonical quantitative seat count, the same part-to-whole
4356
- * value channel arc/waffle marks use. `y` is a deprecated alias, accepted
4357
- * for backward compatibility.
4827
+ * value channel arc/waffle marks use.
4358
4828
  */
4359
4829
  interface ParliamentEncoding<TData extends DataRow = DataRow> extends Encoding<TData> {
4360
4830
  color: EncodingChannel<TData> | ConditionalValueDef<TData>;
@@ -4462,7 +4932,9 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
4462
4932
  /**
4463
4933
  * How chrome height interacts with the container height budget.
4464
4934
  *
4465
- * - `'subtract'` (default): the container height is fixed and chrome text
4935
+ * - omitted: only notes and the series summary grow the figure; title,
4936
+ * subtitle, and source subtract from the height budget.
4937
+ * - `'subtract'`: the container height is fixed and chrome text
4466
4938
  * (title/subtitle/source) is subtracted from it, shrinking the plot. This
4467
4939
  * is the historical behavior.
4468
4940
  * - `'grow'`: the container height is treated as the *plot* budget, and the
@@ -4470,7 +4942,7 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
4470
4942
  * its full budget (minus axis/padding overhead) regardless of how many
4471
4943
  * lines the title wraps to.
4472
4944
  *
4473
- * `'grow'` is a no-op for faceted specs in this version.
4945
+ * Facets and layers report engine-owned growth once.
4474
4946
  */
4475
4947
  chromeLayout?: 'subtract' | 'grow';
4476
4948
  /**
@@ -4524,7 +4996,7 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
4524
4996
  * - omitted: auto-enable for multi-series line/area charts, hide otherwise.
4525
4997
  *
4526
4998
  * See {@link EndpointLabelsConfig} for the full suppression truth table that
4527
- * relates this flag to `legend.show` and the legacy end-of-line labels.
4999
+ * relates this flag to `legend.show`.
4528
5000
  */
4529
5001
  endpointLabels?: boolean | EndpointLabelsConfig;
4530
5002
  /**
@@ -4535,8 +5007,6 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
4535
5007
  responsive?: boolean | ResponsiveConfig;
4536
5008
  /** Theme configuration overrides. */
4537
5009
  theme?: ThemeConfig;
4538
- /** Dark mode behavior. Defaults to "off". */
4539
- darkMode?: DarkMode;
4540
5010
  /**
4541
5011
  * Whether to show the OpenData watermark. Defaults to true; auto-hides
4542
5012
  * when the container is under 200px tall (the cramped height class) unless
@@ -4654,94 +5124,94 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
4654
5124
  * };
4655
5125
  */
4656
5126
  type ChartSpec<TData extends DataRow = DataRow> = (BaseChartSpec<TData> & {
4657
- mark: 'arc' | (MarkDef & {
5127
+ mark: 'arc' | Extract<MarkDef, {
4658
5128
  type: 'arc';
4659
- });
5129
+ }>;
4660
5130
  encoding: ArcEncoding<TData>;
4661
5131
  }) | (BaseChartSpec<TData> & {
4662
- mark: 'line' | (MarkDef & {
5132
+ mark: 'line' | Extract<MarkDef, {
4663
5133
  type: 'line';
4664
- });
5134
+ }>;
4665
5135
  encoding: LineEncoding<TData>;
4666
5136
  }) | (BaseChartSpec<TData> & {
4667
- mark: 'bar' | (MarkDef & {
5137
+ mark: 'bar' | Extract<MarkDef, {
4668
5138
  type: 'bar';
4669
- });
5139
+ }>;
4670
5140
  encoding: BarEncoding<TData>;
4671
5141
  }) | (BaseChartSpec<TData> & {
4672
- mark: 'area' | (MarkDef & {
5142
+ mark: 'area' | Extract<MarkDef, {
4673
5143
  type: 'area';
4674
- });
5144
+ }>;
4675
5145
  encoding: AreaEncoding<TData>;
4676
5146
  }) | (BaseChartSpec<TData> & {
4677
- mark: 'point' | (MarkDef & {
5147
+ mark: 'point' | Extract<MarkDef, {
4678
5148
  type: 'point';
4679
- });
5149
+ }>;
4680
5150
  encoding: PointEncoding<TData>;
4681
5151
  }) | (BaseChartSpec<TData> & {
4682
- mark: 'circle' | (MarkDef & {
5152
+ mark: 'circle' | Extract<MarkDef, {
4683
5153
  type: 'circle';
4684
- });
5154
+ }>;
4685
5155
  encoding: CircleEncoding<TData>;
4686
5156
  }) | (BaseChartSpec<TData> & {
4687
- mark: 'lollipop' | (MarkDef & {
5157
+ mark: 'lollipop' | Extract<MarkDef, {
4688
5158
  type: 'lollipop';
4689
- });
5159
+ }>;
4690
5160
  encoding: LollipopEncoding<TData>;
4691
5161
  }) | (BaseChartSpec<TData> & {
4692
- mark: 'beeswarm' | (MarkDef & {
5162
+ mark: 'beeswarm' | Extract<MarkDef, {
4693
5163
  type: 'beeswarm';
4694
- });
5164
+ }>;
4695
5165
  encoding: BeeswarmEncoding<TData>;
4696
5166
  }) | (BaseChartSpec<TData> & {
4697
- mark: 'range' | (MarkDef & {
5167
+ mark: 'range' | Extract<MarkDef, {
4698
5168
  type: 'range';
4699
- });
5169
+ }>;
4700
5170
  encoding: RangeEncoding<TData>;
4701
5171
  }) | (BaseChartSpec<TData> & {
4702
- mark: 'waffle' | (MarkDef & {
5172
+ mark: 'waffle' | Extract<MarkDef, {
4703
5173
  type: 'waffle';
4704
- });
5174
+ }>;
4705
5175
  encoding: WaffleEncoding<TData>;
4706
5176
  }) | (BaseChartSpec<TData> & {
4707
- mark: 'text' | (MarkDef & {
5177
+ mark: 'text' | Extract<MarkDef, {
4708
5178
  type: 'text';
4709
- });
5179
+ }>;
4710
5180
  encoding: TextEncoding<TData>;
4711
5181
  }) | (BaseChartSpec<TData> & {
4712
- mark: 'tick' | (MarkDef & {
5182
+ mark: 'tick' | Extract<MarkDef, {
4713
5183
  type: 'tick';
4714
- });
5184
+ }>;
4715
5185
  encoding: TickEncoding<TData>;
4716
5186
  }) | (BaseChartSpec<TData> & {
4717
- mark: 'rect' | (MarkDef & {
5187
+ mark: 'rect' | Extract<MarkDef, {
4718
5188
  type: 'rect';
4719
- });
5189
+ }>;
4720
5190
  encoding: RectEncoding<TData>;
4721
5191
  }) | (BaseChartSpec<TData> & {
4722
- mark: 'rule' | (MarkDef & {
5192
+ mark: 'rule' | Extract<MarkDef, {
4723
5193
  type: 'rule';
4724
- });
5194
+ }>;
4725
5195
  encoding: Encoding<TData>;
4726
5196
  }) | (BaseChartSpec<TData> & {
4727
- mark: 'calendar' | (MarkDef & {
5197
+ mark: 'calendar' | Extract<MarkDef, {
4728
5198
  type: 'calendar';
4729
- });
5199
+ }>;
4730
5200
  encoding: CalendarEncoding<TData>;
4731
5201
  }) | (BaseChartSpec<TData> & {
4732
- mark: 'parliament' | (MarkDef & {
5202
+ mark: 'parliament' | Extract<MarkDef, {
4733
5203
  type: 'parliament';
4734
- });
5204
+ }>;
4735
5205
  encoding: ParliamentEncoding<TData>;
4736
5206
  }) | (BaseChartSpec<TData> & {
4737
- mark: 'histogram' | (MarkDef & {
5207
+ mark: 'histogram' | Extract<MarkDef, {
4738
5208
  type: 'histogram';
4739
- });
5209
+ }>;
4740
5210
  encoding: HistogramEncoding<TData>;
4741
5211
  }) | (BaseChartSpec<TData> & {
4742
- mark: 'density' | (MarkDef & {
5212
+ mark: 'density' | Extract<MarkDef, {
4743
5213
  type: 'density';
4744
- });
5214
+ }>;
4745
5215
  encoding: DensityEncoding<TData>;
4746
5216
  });
4747
5217
  /** Row density for tables. Maps to 40 / 48 / 56px row heights. */
@@ -4769,8 +5239,6 @@ interface TableSpec {
4769
5239
  chrome?: Chrome;
4770
5240
  /** Theme configuration overrides. */
4771
5241
  theme?: ThemeConfig;
4772
- /** Dark mode behavior. */
4773
- darkMode?: DarkMode;
4774
5242
  /** Whether to show the OpenData watermark. Defaults to true. */
4775
5243
  watermark?: boolean;
4776
5244
  /** Enable client-side search/filter. */
@@ -4799,10 +5267,6 @@ interface TableSpec {
4799
5267
  totalRow?: boolean | {
4800
5268
  label?: string;
4801
5269
  };
4802
- /**
4803
- * @deprecated Use `density: 'condensed'`. Still honored, with a warning.
4804
- */
4805
- compact?: boolean;
4806
5270
  /** Whether the table adapts to container width. Defaults to true. */
4807
5271
  responsive?: boolean;
4808
5272
  /** Animation configuration for entrance animations. */
@@ -4940,8 +5404,6 @@ interface GraphSpec {
4940
5404
  annotations?: Annotation[];
4941
5405
  /** Theme configuration overrides. */
4942
5406
  theme?: ThemeConfig;
4943
- /** Dark mode behavior. */
4944
- darkMode?: DarkMode;
4945
5407
  /**
4946
5408
  * Motion configuration. DEFAULT-ON: omit for full defaults, `false` to opt
4947
5409
  * out of choreography (layout warmup still applies).
@@ -5064,12 +5526,16 @@ interface LayerSpec<TData extends DataRow = DataRow> {
5064
5526
  labels?: LabelSpec;
5065
5527
  /** Legend display configuration. */
5066
5528
  legend?: LegendConfig;
5067
- /** Whether the chart adapts to container width. Defaults to true. */
5068
- responsive?: boolean;
5529
+ /**
5530
+ * Responsive behavior for the composed chart, with the same meaning as
5531
+ * `ChartSpec.responsive`: `true`/`false` enables/disables container-width
5532
+ * adaptation, and a `ResponsiveConfig` object gives fine-grained control
5533
+ * (e.g. `{ compactAnnotationLimit: null }`). When omitted, the first leaf
5534
+ * layer's `responsive` applies.
5535
+ */
5536
+ responsive?: boolean | ResponsiveConfig;
5069
5537
  /** Theme configuration overrides. */
5070
5538
  theme?: ThemeConfig;
5071
- /** Dark mode behavior. Defaults to "off". */
5072
- darkMode?: DarkMode;
5073
5539
  /** Whether to show the OpenData watermark. Defaults to true. */
5074
5540
  watermark?: boolean;
5075
5541
  /** Resolution strategy for shared scales/axes/legends. */
@@ -5155,22 +5621,10 @@ interface SankeySpec {
5155
5621
  legend?: LegendConfig;
5156
5622
  /** Theme configuration overrides. */
5157
5623
  theme?: ThemeConfig;
5158
- /** Dark mode behavior. Defaults to "off". */
5159
- darkMode?: DarkMode;
5160
5624
  /** Whether to show the OpenData watermark. Defaults to true. */
5161
5625
  watermark?: boolean;
5162
5626
  /** Animation configuration for entrance animations. */
5163
5627
  animation?: AnimationSpec;
5164
- /**
5165
- * d3-format string applied to flow values in tooltips and ARIA labels.
5166
- * Uses the literal suffix extension: ".0f%" appends "%" to the formatted
5167
- * number (data value 28 renders as "28%"). For currency: "$,.0f" or "$~s".
5168
- * For SI suffixes: "~s" (renders 1000 as "1k"). When not set, values use
5169
- * the default number formatter.
5170
- * @deprecated Use the encoding channel's `format` field instead. This
5171
- * property is expanded into the encoding during compilation.
5172
- */
5173
- valueFormat?: string;
5174
5628
  }
5175
5629
  /** Encoding channels specific to tile map visualizations. */
5176
5630
  interface TileMapEncoding {
@@ -5219,8 +5673,6 @@ interface TileMapSpec {
5219
5673
  legend?: LegendConfig;
5220
5674
  /** Theme configuration overrides. */
5221
5675
  theme?: ThemeConfig;
5222
- /** Dark mode behavior. Defaults to "off". */
5223
- darkMode?: DarkMode;
5224
5676
  /** Whether to show the OpenData watermark. Defaults to true. */
5225
5677
  watermark?: boolean;
5226
5678
  /** Animation configuration for entrance animations. */
@@ -5228,8 +5680,6 @@ interface TileMapSpec {
5228
5680
  /**
5229
5681
  * d3-format string applied to tile values, legend labels, and tooltips.
5230
5682
  * Examples: ".1f" for one decimal, "$,.0f" for currency, "~s" for SI.
5231
- * @deprecated Use the encoding channel's `format` field instead. This
5232
- * property is expanded into the encoding during compilation.
5233
5683
  */
5234
5684
  valueFormat?: string;
5235
5685
  }
@@ -5267,6 +5717,14 @@ interface GeoMapZoomConfig {
5267
5717
  }
5268
5718
  /** Geo configuration for map specs. */
5269
5719
  interface GeoMapGeo {
5720
+ /** Primary topology object; omission retains first-object behavior. */
5721
+ objectKey?: string;
5722
+ /** Fit against this primary-topology object, independent of contextual detail. */
5723
+ fitObjectKey?: string;
5724
+ /** Named assertion of the decoded coordinate plane for identity detail. */
5725
+ sourcePlane?: string;
5726
+ detailLayers?: GeoDetailLayer[];
5727
+ insets?: GeoInset[];
5270
5728
  /** TopoJSON topology object. User imports this from us-atlas, world-atlas, or their own source. */
5271
5729
  features: unknown;
5272
5730
  /** Field in the TopoJSON feature properties to use as the join key. Defaults to 'id'. */
@@ -5296,27 +5754,66 @@ interface GeoMapGeo {
5296
5754
  */
5297
5755
  zoom?: boolean | GeoMapZoomConfig;
5298
5756
  }
5299
- /** Encoding channels specific to map visualizations. */
5300
- interface GeoMapEncoding {
5301
- /** Join key field in the data. Required for choropleth; optional in basemap-only mode (points layer with empty data). */
5302
- key?: EncodingChannel;
5303
- /** Color encoding (quantitative or nominal). Drives fill color of features. Optional when a points layer is present (basemap-only mode). */
5304
- color?: EncodingChannel;
5305
- /** Tooltip encoding (optional). */
5306
- tooltip?: EncodingChannel | EncodingChannel[];
5307
- }
5308
- /** Point/symbol layer rendered above choropleth features. */
5309
- interface GeoMapPointsLayer {
5757
+ /** Explicit map anchor; feature and point identities occupy separate namespaces. */
5758
+ type GeoAnchor = ({
5759
+ kind: 'feature';
5760
+ id: string | number;
5761
+ } | {
5762
+ kind: 'point';
5763
+ id: string | number;
5764
+ } | {
5765
+ kind: 'coordinate';
5766
+ space: 'geographic' | 'source';
5767
+ x: number;
5768
+ y: number;
5769
+ }) & {
5770
+ viewId?: string;
5771
+ layerId?: string;
5772
+ };
5773
+ /** Static authored geographic explanation; plain text, without chart editing semantics. */
5774
+ interface GeoCallout {
5775
+ id: string;
5776
+ anchor: GeoAnchor;
5777
+ text: string;
5778
+ subtitle?: string;
5779
+ priority?: number;
5780
+ minZoom?: number;
5781
+ maxZoom?: number;
5782
+ offset?: {
5783
+ dx: number;
5784
+ dy: number;
5785
+ };
5786
+ maxWidth?: number;
5787
+ }
5788
+ /** Encoding channels specific to map visualizations. */
5789
+ interface GeoMapEncoding {
5790
+ /** Join key field in the data. Required for choropleth; optional in basemap-only mode (points layer with empty data). */
5791
+ key?: EncodingChannel;
5792
+ /** Color encoding (quantitative or nominal). Drives fill color of features. Optional when a points layer is present (basemap-only mode). */
5793
+ color?: EncodingChannel;
5794
+ /** Explicit feature label field, read from its joined row or same-named topology property. */
5795
+ text?: EncodingChannel;
5796
+ /** Higher finite quantitative values win label placement priority. Requires text. */
5797
+ textPriority?: EncodingChannel;
5798
+ /** Tooltip encoding (optional). */
5799
+ tooltip?: EncodingChannel | EncodingChannel[];
5800
+ }
5801
+ /** Point/symbol layer rendered above choropleth features. */
5802
+ interface GeoMapPointsLayer {
5310
5803
  /** Tabular data for the points. Independent of the choropleth data join. */
5311
5804
  data: DataRow[];
5312
5805
  /** Field holding longitude (x coordinate). */
5313
5806
  longitude: EncodingChannel;
5314
5807
  /** Field holding latitude (y coordinate). */
5315
5808
  latitude: EncodingChannel;
5316
- /** Optional quantitative size encoding. Area-proportional: r proportional to sqrt(value). No size legend is rendered in v1; explain the scale in chrome.subtitle if needed. */
5809
+ /** Optional quantitative size encoding. Area-proportional: r proportional to sqrt(value). A proportional size key explains the resolved radius scale. */
5317
5810
  size?: EncodingChannel;
5318
5811
  /** Optional color encoding (nominal or quantitative). Independent scale from choropleth. */
5319
5812
  color?: EncodingChannel;
5813
+ /** Explicit point label field. Requires a unique points.key. */
5814
+ text?: EncodingChannel;
5815
+ /** Quantitative label priority; defaults to the point size value. Requires text. */
5816
+ textPriority?: EncodingChannel;
5320
5817
  /** Tooltip channel(s), same shape as GeoMapEncoding.tooltip. */
5321
5818
  tooltip?: EncodingChannel | EncodingChannel[];
5322
5819
  /** Stable id for event callbacks, and the key used to match points across
@@ -5338,23 +5835,23 @@ interface GeoMapSpec {
5338
5835
  encoding: GeoMapEncoding;
5339
5836
  /** Editorial chrome (title, subtitle, source, byline, footer). */
5340
5837
  chrome?: Chrome;
5838
+ /** Optional static distribution and reader active-value presentation. Both default to false. */
5839
+ colorKey?: {
5840
+ activeValue?: boolean;
5841
+ distribution?: boolean;
5842
+ };
5341
5843
  /** Legend display configuration. */
5342
5844
  legend?: LegendConfig;
5343
5845
  /** Theme configuration overrides. */
5344
5846
  theme?: ThemeConfig;
5345
- /** Dark mode behavior. Defaults to "off". */
5346
- darkMode?: DarkMode;
5347
5847
  /** Whether to show the OpenData watermark. Defaults to true. */
5348
5848
  watermark?: boolean;
5349
5849
  /** Optional point/symbol layer rendered above choropleth features. */
5350
5850
  points?: GeoMapPointsLayer;
5851
+ /** Authored labels with explicit feature, point, or coordinate anchors. */
5852
+ callouts?: GeoCallout[];
5351
5853
  /** Animation configuration for entrance animations. */
5352
5854
  animation?: AnimationSpec;
5353
- /**
5354
- * d3-format string applied to color values in tooltips and legend.
5355
- * @deprecated Use the encoding channel's `format` field instead.
5356
- */
5357
- valueFormat?: string;
5358
5855
  }
5359
5856
  interface BarListSpec {
5360
5857
  /** Discriminant: always "barlist". */
@@ -5376,19 +5873,10 @@ interface BarListSpec {
5376
5873
  chrome?: Chrome;
5377
5874
  /** Theme configuration overrides. */
5378
5875
  theme?: ThemeConfig;
5379
- /** Dark mode behavior. Defaults to "off". */
5380
- darkMode?: DarkMode;
5381
5876
  /** Whether to show the OpenData watermark. Defaults to true. */
5382
5877
  watermark?: boolean;
5383
5878
  /** Animation configuration for entrance animations. */
5384
5879
  animation?: AnimationSpec;
5385
- /**
5386
- * d3-format string applied to bar values and tooltips.
5387
- * Examples: ".1f" for one decimal, "$,.0f" for currency, "~s" for SI.
5388
- * @deprecated Use the encoding channel's `format` field instead. This
5389
- * property is expanded into the encoding during compilation.
5390
- */
5391
- valueFormat?: string;
5392
5880
  }
5393
5881
  /** Encoding channels for a barlist visualization. */
5394
5882
  interface BarListEncoding {
@@ -5728,163 +6216,11 @@ declare function isGeoMapSpec(spec: VizSpec | Record<string, unknown>): spec is
5728
6216
  declare function isTextAnnotation(annotation: Annotation): annotation is TextAnnotation;
5729
6217
  /** Check if an annotation is a RangeAnnotation. */
5730
6218
  declare function isRangeAnnotation(annotation: Annotation): annotation is RangeAnnotation;
5731
- /**
5732
- * Check if an annotation is a RefLineAnnotation. Also accepts the deprecated
5733
- * `'rule'` type at runtime (pre-sugar-expansion input), since `annotation.type`
5734
- * may not yet be narrowed to the canonical `'refline'` form.
5735
- */
6219
+ /** Check if an annotation is a RefLineAnnotation. */
5736
6220
  declare function isRefLineAnnotation(annotation: Annotation): annotation is RefLineAnnotation;
5737
6221
  /** Human-readable display names for mark types (used in alt text, error messages). */
5738
6222
  declare const MARK_DISPLAY_NAMES: Record<MarkType, string>;
5739
6223
 
5740
- /** Supplied semantics; the library never invents a measure or uncertainty. */
5741
- interface FieldMetadata {
5742
- /** Explicit imported field type; preserved with the portable document. */
5743
- type?: 'text' | 'number' | 'date';
5744
- /** Identifies an internal, persistent row identity column. */
5745
- role?: 'identity';
5746
- label?: string;
5747
- unit?: string;
5748
- measure?: string;
5749
- provenance?: string;
5750
- /** Percent is encoded 0–100; proportion is encoded 0–1. */
5751
- representation?: 'number' | 'percent' | 'proportion';
5752
- interval?: {
5753
- lower: string;
5754
- upper: string;
5755
- };
5756
- statusField?: string;
5757
- }
5758
- interface DesignDiagnostic {
5759
- code: string;
5760
- severity: 'info' | 'warning' | 'error';
5761
- status: 'failed' | 'uncheckable';
5762
- path: string;
5763
- viewport: {
5764
- width: number;
5765
- height: number;
5766
- };
5767
- message: string;
5768
- origin: 'author' | 'default';
5769
- fix?: SpecPatch;
5770
- }
5771
- /** Atomic JSON-pointer edits guarded by the complete source document. */
5772
- interface SpecPatch {
5773
- label: string;
5774
- /** Canonical source snapshot prevents stale fixes overwriting subsequent edits. */
5775
- precondition: string;
5776
- changes: Array<{
5777
- path: string;
5778
- value: unknown;
5779
- }>;
5780
- }
5781
- type DesignQuestion = 'comparison' | 'change' | 'distribution' | 'composition' | 'geography' | 'relationships';
5782
- interface CompositionRecommendation {
5783
- id: string;
5784
- title: string;
5785
- reason: string;
5786
- tradeoff: string;
5787
- spec: VizSpec;
5788
- }
5789
- interface ObservationIdentity {
5790
- observation: string;
5791
- series?: string;
5792
- persistent: boolean;
5793
- }
5794
- interface ReaderObservation extends ObservationIdentity {
5795
- /** Aggregates are visible groups and never imply a raw-row selection. */
5796
- kind?: 'row' | 'aggregate';
5797
- datum: DataRow;
5798
- previous?: DataRow;
5799
- state: 'visible' | 'filtered';
5800
- }
5801
- interface ReaderSelection {
5802
- preview: ReaderObservation | null;
5803
- pinned: ReaderObservation[];
5804
- announcement: string;
5805
- }
5806
- /** Explicit relationships; aggregate groups never masquerade as raw rows. */
5807
- interface DatasetBinding {
5808
- dataset: string;
5809
- entityField: string;
5810
- kind: 'row' | 'group';
5811
- transform?: string;
5812
- groupMembers?: Record<string, Array<string | number>>;
5813
- }
5814
-
5815
- /**
5816
- * Per-mark-type encoding validation rules.
5817
- *
5818
- * Defines which encoding channels are required vs optional for each mark type.
5819
- * The engine compiler uses these rules to validate specs at runtime (TypeScript
5820
- * catches compile-time errors; these catch runtime JSON from Claude or APIs).
5821
- */
5822
-
5823
- /** Constraint on what field types are valid for an encoding channel. */
5824
- interface ChannelRule {
5825
- /** Whether this channel is required for the chart type. */
5826
- required: boolean;
5827
- /** Allowed field types. If empty, any field type is accepted. */
5828
- allowedTypes: FieldType[];
5829
- }
5830
- /** Encoding rules for a single chart type: which channels are required/optional. */
5831
- interface EncodingRule {
5832
- x: ChannelRule;
5833
- y: ChannelRule;
5834
- x2?: ChannelRule;
5835
- y2?: ChannelRule;
5836
- color: ChannelRule;
5837
- size: ChannelRule;
5838
- opacity?: ChannelRule;
5839
- strokeDash?: ChannelRule;
5840
- text?: ChannelRule;
5841
- tooltip?: ChannelRule;
5842
- theta?: ChannelRule;
5843
- detail: ChannelRule;
5844
- }
5845
- /**
5846
- * Encoding rules per mark type.
5847
- *
5848
- * Defines which channels are required and what field types they accept.
5849
- * The compiler uses this map to validate user specs at runtime.
5850
- *
5851
- * Key design decisions:
5852
- * - line/area: x is temporal/ordinal (the axis), y is quantitative (the value)
5853
- * - bar: covers both horizontal and vertical orientations, so both axes accept
5854
- * all relevant types. The engine validates the combination later (one axis
5855
- * must be quantitative).
5856
- * - arc: no x axis; y is the value (quantitative), color is the category
5857
- * - circle: y is the category, x is quantitative
5858
- * - point: both axes are quantitative
5859
- * - text/rule: fully optional positioning
5860
- * - tick/rect: both axes required, any type
5861
- * - beeswarm: both axes optional at the channel level; the compiler enforces
5862
- * the combination (exactly one quantitative value axis, the other axis an
5863
- * optional nominal/ordinal lane channel)
5864
- * - waffle: no positional axes; y is the share value (quantitative, with
5865
- * theta accepted as an alias like arc), color is the category
5866
- * - calendar: x is the daily date (temporal), color the per-day value
5867
- * (quantitative); no y channel (the calendar owns its own geometry)
5868
- * - parliament: no positional axes; theta (aliased to y) is the seat count
5869
- * (quantitative), color the party
5870
- */
5871
- declare const MARK_ENCODING_RULES: Record<MarkType, EncodingRule>;
5872
- /** Encoding rule for a single graph visual channel. */
5873
- interface GraphChannelRule {
5874
- /** Whether this channel is required. */
5875
- required: boolean;
5876
- /** Allowed field types. Empty means any type. */
5877
- allowedTypes: FieldType[];
5878
- }
5879
- /**
5880
- * Encoding rules for graph visualizations.
5881
- *
5882
- * All graph encoding channels are optional since a graph can be rendered
5883
- * with just nodes and edges (uniform appearance). Encoding channels add
5884
- * visual differentiation based on data fields.
5885
- */
5886
- declare const GRAPH_ENCODING_RULES: Record<string, GraphChannelRule>;
5887
-
5888
6224
  /**
5889
6225
  * Chart interaction event types.
5890
6226
  *
@@ -5896,6 +6232,23 @@ declare const GRAPH_ENCODING_RULES: Record<string, GraphChannelRule>;
5896
6232
  * mark elements and constructs these typed events from the raw browser events.
5897
6233
  */
5898
6234
 
6235
+ /** A source-addressed durable edit. Paths use escaped RFC 6901 JSON Pointers. */
6236
+ interface EditOp {
6237
+ op: 'set' | 'remove' | 'add';
6238
+ path: string;
6239
+ value?: unknown;
6240
+ /** Preconditions on the nearest authored annotation ancestor. `text` matches a refline/range `label`. */
6241
+ expect?: {
6242
+ id?: string;
6243
+ type?: string;
6244
+ text?: string;
6245
+ };
6246
+ }
6247
+ /** All operations succeed together. Revision is optional host bookkeeping. */
6248
+ interface EditTransaction {
6249
+ revision?: string | number;
6250
+ ops: EditOp[];
6251
+ }
5899
6252
  /** Identifies a specific chrome text element (title, subtitle, source, byline, footer). */
5900
6253
  type ChromeKey = 'title' | 'subtitle' | 'source' | 'byline' | 'footer';
5901
6254
  /**
@@ -5908,111 +6261,35 @@ type ElementRef = {
5908
6261
  type: 'annotation';
5909
6262
  index: number;
5910
6263
  id?: string;
5911
- /** RFC 6901 JSON Pointer to the edited property in the spec. */
6264
+ /** Root-relative RFC 6901 JSON Pointer to the authored object this ref identifies (e.g. `/layer/0/annotations/2`, `/chrome/title`). Always set on refs the chart emits or returns; legend refs point at `/legend`. Edited properties are addressed by `EditOp.path`. */
5912
6265
  path?: string;
6266
+ /** Rendered facet instance; source identity remains index/id/path. */
6267
+ facetInstance?: string;
5913
6268
  } | {
5914
6269
  type: 'chrome';
5915
6270
  key: ChromeKey;
5916
- /** RFC 6901 JSON Pointer to the edited property in the spec. */
5917
- path?: string;
5918
- } | {
5919
- type: 'series-label';
5920
- series: string;
5921
- /** RFC 6901 JSON Pointer to the edited property in the spec. */
6271
+ /** Root-relative RFC 6901 JSON Pointer to the authored object this ref identifies (e.g. `/layer/0/annotations/2`, `/chrome/title`). Always set on refs the chart emits or returns; legend refs point at `/legend`. Edited properties are addressed by `EditOp.path`. */
5922
6272
  path?: string;
5923
6273
  } | {
5924
6274
  type: 'legend';
5925
- /** RFC 6901 JSON Pointer to the edited property in the spec. */
6275
+ /** Root-relative RFC 6901 JSON Pointer to the authored object this ref identifies (e.g. `/layer/0/annotations/2`, `/chrome/title`). Always set on refs the chart emits or returns; legend refs point at `/legend`. Edited properties are addressed by `EditOp.path`. */
5926
6276
  path?: string;
5927
6277
  } | {
5928
6278
  type: 'legend-entry';
5929
6279
  series: string;
5930
6280
  index: number;
5931
- /** RFC 6901 JSON Pointer to the edited property in the spec. */
6281
+ /** Root-relative RFC 6901 JSON Pointer to the authored object this ref identifies (e.g. `/layer/0/annotations/2`, `/chrome/title`). Always set on refs the chart emits or returns; legend refs point at `/legend`. Edited properties are addressed by `EditOp.path`. */
5932
6282
  path?: string;
5933
6283
  };
5934
6284
  /** Helper constructors for ergonomic ElementRef creation. */
5935
6285
  declare const elementRef: {
5936
- readonly annotation: (index: number, id?: string, path?: string) => ElementRef;
6286
+ readonly annotation: (index: number, id?: string, path?: string) => Extract<ElementRef, {
6287
+ type: "annotation";
6288
+ }>;
5937
6289
  readonly chrome: (key: ChromeKey, path?: string) => ElementRef;
5938
- readonly seriesLabel: (series: string, path?: string) => ElementRef;
5939
6290
  readonly legend: (path?: string) => ElementRef;
5940
6291
  readonly legendEntry: (series: string, index: number, path?: string) => ElementRef;
5941
6292
  };
5942
- /**
5943
- * Discriminated union of all element edit events.
5944
- * Fired by the `onEdit` callback when any editable chart element is modified.
5945
- * Covers repositioning (drag), deletion (Delete key), and text editing (double-click).
5946
- * Selection events (onSelect/onDeselect) are separate callbacks, not part of this union.
5947
- *
5948
- * For the `annotation` variant:
5949
- * - `annotation` is the ORIGINAL spec annotation (may have a stale or missing offset)
5950
- * - `offset` is the NEW accumulated position after the drag completes
5951
- * - To persist a drag edit back into your spec: `{ ...edit.annotation, offset: edit.offset }`
5952
- */
5953
- type ElementEdit = {
5954
- type: 'annotation';
5955
- element: ElementRef;
5956
- annotation: TextAnnotation;
5957
- offset: AnnotationOffset;
5958
- } | {
5959
- type: 'annotation-connector';
5960
- element: ElementRef;
5961
- annotation: TextAnnotation;
5962
- endpoint: 'from' | 'to';
5963
- offset: AnnotationOffset;
5964
- } | {
5965
- type: 'range-label';
5966
- element: ElementRef;
5967
- annotation: RangeAnnotation;
5968
- labelOffset: AnnotationOffset;
5969
- } | {
5970
- type: 'refline-label';
5971
- element: ElementRef;
5972
- annotation: RefLineAnnotation;
5973
- labelOffset: AnnotationOffset;
5974
- } | {
5975
- type: 'annotation-anchor';
5976
- element: ElementRef;
5977
- annotation: TextAnnotation;
5978
- x: string | number;
5979
- y: string | number;
5980
- } | {
5981
- type: 'chrome';
5982
- key: ChromeKey;
5983
- text: string;
5984
- offset: AnnotationOffset;
5985
- } | {
5986
- type: 'series-label';
5987
- series: string;
5988
- offset: AnnotationOffset;
5989
- } | {
5990
- type: 'legend';
5991
- offset: AnnotationOffset;
5992
- }
5993
- /**
5994
- * Transient legend visibility toggle. Reports the same runtime show/hide
5995
- * a reader triggers; not persisted by openchart. To author default-hidden
5996
- * series, set `spec.hiddenSeries` directly. Hosts building spec
5997
- * persistence should generally not write legend-toggle edits back into
5998
- * the authored spec. `hidden: true` means the series was just hidden.
5999
- */
6000
- | {
6001
- type: 'legend-toggle';
6002
- series: string;
6003
- hidden: boolean;
6004
- } | {
6005
- type: 'add';
6006
- annotation: TextAnnotation;
6007
- } | {
6008
- type: 'delete';
6009
- element: ElementRef;
6010
- } | {
6011
- type: 'text-edit';
6012
- element: ElementRef;
6013
- oldText: string;
6014
- newText: string;
6015
- };
6016
6293
  /**
6017
6294
  * Event fired when a user interacts with a data mark (bar, point, line segment, etc.).
6018
6295
  *
@@ -6039,14 +6316,6 @@ interface MarkEvent {
6039
6316
  * or ChartProps (React component) to receive interaction callbacks.
6040
6317
  */
6041
6318
  interface ChartEventHandlers {
6042
- /**
6043
- * Explicitly enable or disable edit interactions (drag, select, keyboard
6044
- * delete/edit). When true, the interaction layer is wired even without
6045
- * onEdit. When false, all edit interactions are suppressed even when
6046
- * onEdit is provided. When omitted, each interaction block uses its
6047
- * existing callback-presence gate.
6048
- */
6049
- editable?: boolean;
6050
6319
  /** Called when a data mark is clicked. */
6051
6320
  onMarkClick?: (event: MarkEvent) => void;
6052
6321
  /** Called when the mouse enters a data mark. */
@@ -6062,17 +6331,15 @@ interface ChartEventHandlers {
6062
6331
  */
6063
6332
  onHighlightChange?: (values: string[]) => void;
6064
6333
  /** Called when an annotation element is clicked. */
6065
- onAnnotationClick?: (annotation: Annotation, event: MouseEvent) => void;
6066
- /** Called when a text annotation label is dragged to a new position. */
6067
- onAnnotationEdit?: (annotation: TextAnnotation, updatedOffset: AnnotationOffset) => void;
6334
+ onAnnotationClick?: (annotation: Annotation, event: MouseEvent, element: ElementRef) => void;
6068
6335
  /** Unified edit callback. Fires for any spec-modifying edit (repositioning, deletion, text editing). */
6069
- onEdit?: (edit: ElementEdit) => void;
6336
+ onEdit?: (transaction: EditTransaction) => void;
6337
+ /** Optional source revision, stamped on emitted transactions. */
6338
+ revision?: string | number;
6070
6339
  /** Fired when an element is selected via click or programmatic select(). */
6071
6340
  onSelect?: (element: ElementRef) => void;
6072
6341
  /** Fired when the current element is deselected (click empty, Escape, or new selection replaces old). */
6073
6342
  onDeselect?: (element: ElementRef) => void;
6074
- /** Fired when inline text editing commits. Also flows through onEdit as a 'text-edit' event. */
6075
- onTextEdit?: (element: ElementRef, oldText: string, newText: string) => void;
6076
6343
  /**
6077
6344
  * Fired when a "you draw it" (`youDrawIt`) drawing is revealed (button click
6078
6345
  * or programmatic reveal), with the reader's guess in data coordinates,
@@ -6084,6 +6351,212 @@ interface ChartEventHandlers {
6084
6351
  }>) => void;
6085
6352
  }
6086
6353
 
6354
+ type EditTransactionResult<T> = {
6355
+ ok: true;
6356
+ spec: T;
6357
+ inverse: EditTransaction;
6358
+ } | {
6359
+ ok: false;
6360
+ error: {
6361
+ opIndex: number;
6362
+ path: string;
6363
+ reason: string;
6364
+ };
6365
+ };
6366
+ /**
6367
+ * Apply an ordered transaction to a private copy, returning it only when every
6368
+ * operation validates. The original spec is never mutated, even on failure.
6369
+ * The inverse restores both values and optional containers created by add.
6370
+ */
6371
+ declare function applyEditTransaction<T>(spec: T, tx: EditTransaction): EditTransactionResult<T>;
6372
+
6373
+ /** Escape one RFC 6901 reference token: `~` becomes `~0`, then `/` becomes `~1`. */
6374
+ declare function encodePointerToken(token: string | number): string;
6375
+ /** Build a root-relative JSON Pointer from unescaped tokens. No tokens is the root, `''`. */
6376
+ declare function jsonPointer(...tokens: ReadonlyArray<string | number>): string;
6377
+
6378
+ /**
6379
+ * Per-mark-type encoding validation rules.
6380
+ *
6381
+ * Defines which encoding channels are required vs optional for each mark type.
6382
+ * The engine compiler uses these rules to validate specs at runtime (TypeScript
6383
+ * catches compile-time errors; these catch runtime JSON from Claude or APIs).
6384
+ */
6385
+
6386
+ /** Constraint on what field types are valid for an encoding channel. */
6387
+ interface ChannelRule {
6388
+ /** Whether this channel is required for the chart type. */
6389
+ required: boolean;
6390
+ /** Allowed field types. If empty, any field type is accepted. */
6391
+ allowedTypes: FieldType[];
6392
+ }
6393
+ /** Encoding rules for a single chart type: which channels are required/optional. */
6394
+ interface EncodingRule {
6395
+ x: ChannelRule;
6396
+ y: ChannelRule;
6397
+ x2?: ChannelRule;
6398
+ y2?: ChannelRule;
6399
+ color: ChannelRule;
6400
+ size: ChannelRule;
6401
+ opacity?: ChannelRule;
6402
+ strokeDash?: ChannelRule;
6403
+ text?: ChannelRule;
6404
+ tooltip?: ChannelRule;
6405
+ theta?: ChannelRule;
6406
+ detail: ChannelRule;
6407
+ }
6408
+ /**
6409
+ * Encoding rules per mark type.
6410
+ *
6411
+ * Defines which channels are required and what field types they accept.
6412
+ * The compiler uses this map to validate user specs at runtime.
6413
+ *
6414
+ * Key design decisions:
6415
+ * - line/area: x is temporal/ordinal (the axis), y is quantitative (the value)
6416
+ * - bar: covers both horizontal and vertical orientations, so both axes accept
6417
+ * all relevant types. The engine validates the combination later (one axis
6418
+ * must be quantitative).
6419
+ * - arc: no x axis; y is the value (quantitative), color is the category
6420
+ * - circle: y is the category, x is quantitative
6421
+ * - point: both axes are quantitative
6422
+ * - text/rule: fully optional positioning
6423
+ * - tick/rect: both axes required, any type
6424
+ * - beeswarm: both axes optional at the channel level; the compiler enforces
6425
+ * the combination (exactly one quantitative value axis, the other axis an
6426
+ * optional nominal/ordinal lane channel)
6427
+ * - waffle: no positional axes; y is the share value (quantitative, with
6428
+ * theta accepted as an alias like arc), color is the category
6429
+ * - calendar: x is the daily date (temporal), color the per-day value
6430
+ * (quantitative); no y channel (the calendar owns its own geometry)
6431
+ * - parliament: no positional axes; theta (aliased to y) is the seat count
6432
+ * (quantitative), color the party
6433
+ */
6434
+ declare const MARK_ENCODING_RULES: Record<MarkType, EncodingRule>;
6435
+ /** Encoding rule for a single graph visual channel. */
6436
+ interface GraphChannelRule {
6437
+ /** Whether this channel is required. */
6438
+ required: boolean;
6439
+ /** Allowed field types. Empty means any type. */
6440
+ allowedTypes: FieldType[];
6441
+ }
6442
+ /**
6443
+ * Encoding rules for graph visualizations.
6444
+ *
6445
+ * All graph encoding channels are optional since a graph can be rendered
6446
+ * with just nodes and edges (uniform appearance). Encoding channels add
6447
+ * visual differentiation based on data fields.
6448
+ */
6449
+ declare const GRAPH_ENCODING_RULES: Record<string, GraphChannelRule>;
6450
+
6451
+ interface GeoEntityRef {
6452
+ kind: 'feature' | 'point';
6453
+ id: string | number;
6454
+ canonicalId: string;
6455
+ }
6456
+ interface GeoReaderObservation {
6457
+ entity: GeoEntityRef;
6458
+ observation: string;
6459
+ persistent: boolean;
6460
+ datum: DataRow | null;
6461
+ previous?: DataRow | null;
6462
+ state: 'visible' | 'filtered';
6463
+ }
6464
+ interface GeoReaderSelection {
6465
+ preview: GeoReaderObservation | null;
6466
+ pinned: GeoReaderObservation[];
6467
+ announcement: string;
6468
+ }
6469
+
6470
+ type ReaderDomainValue = {
6471
+ kind: 'string';
6472
+ value: string;
6473
+ } | {
6474
+ kind: 'number';
6475
+ value: number;
6476
+ } | {
6477
+ kind: 'boolean';
6478
+ value: boolean;
6479
+ } | {
6480
+ kind: 'date';
6481
+ value: string;
6482
+ };
6483
+ interface ReaderBindingScope {
6484
+ dataset: string;
6485
+ transform: string;
6486
+ grouping: string[];
6487
+ xField: string;
6488
+ valueField: string;
6489
+ }
6490
+ interface ReaderPanelScope {
6491
+ id: string;
6492
+ facet?: {
6493
+ field: string;
6494
+ values: ReaderDomainValue[];
6495
+ };
6496
+ }
6497
+ interface ReaderSeries {
6498
+ key: string;
6499
+ label: string;
6500
+ color?: string;
6501
+ valueField: string;
6502
+ metadata?: FieldMetadata;
6503
+ }
6504
+ interface ReaderSliceMember {
6505
+ series: ReaderSeries;
6506
+ status: 'observed' | 'no-observation' | 'ambiguous';
6507
+ observations: ReaderObservation[];
6508
+ value?: number;
6509
+ valueStatus?: 'finite' | 'missing' | 'invalid';
6510
+ formattedValue?: string;
6511
+ }
6512
+ interface ReaderSlice {
6513
+ kind: 'slice';
6514
+ key: string;
6515
+ binding: ReaderBindingScope;
6516
+ panel: ReaderPanelScope;
6517
+ x: ReaderDomainValue;
6518
+ xLabel: string;
6519
+ revision: string;
6520
+ members: ReaderSliceMember[];
6521
+ persistent: boolean;
6522
+ state: 'visible' | 'filtered';
6523
+ }
6524
+ interface ReaderSliceSelection {
6525
+ kind: 'slices';
6526
+ preview: ReaderSlice | null;
6527
+ pinned: ReaderSlice[];
6528
+ announcement: string;
6529
+ }
6530
+ interface ReaderChangeMeta {
6531
+ reason: 'user' | 'data' | 'filter' | 'programmatic';
6532
+ }
6533
+ interface ReaderComparisonScope {
6534
+ dataset: string;
6535
+ transform: string;
6536
+ grouping: string[];
6537
+ panelId: string;
6538
+ }
6539
+ interface ReaderComparisonOperand {
6540
+ value: number;
6541
+ metadata?: FieldMetadata;
6542
+ binding: ReaderComparisonScope;
6543
+ }
6544
+ type ReaderComparisonResult = {
6545
+ status: 'comparable';
6546
+ absolute: number;
6547
+ relative?: number;
6548
+ unit: string;
6549
+ relativeUnavailable?: 'zero-baseline' | 'negative-baseline';
6550
+ } | {
6551
+ status: 'unavailable';
6552
+ reason: 'nonfinite' | 'missing-metadata' | 'incompatible-metadata' | 'incompatible-binding';
6553
+ message: string;
6554
+ };
6555
+ interface ReaderSliceIndexOptions {
6556
+ revision: string;
6557
+ binding?: DatasetBinding;
6558
+ }
6559
+
6087
6560
  /**
6088
6561
  * Color blindness simulation and palette distinguishability checks.
6089
6562
  *
@@ -6316,7 +6789,10 @@ declare function adaptForLightLineStroke(color: string): string;
6316
6789
  /**
6317
6790
  * The default theme. All fields are required and fully specified.
6318
6791
  */
6319
- declare const DEFAULT_THEME: Theme;
6792
+ declare const DEFAULT_THEME: ThemeBase;
6793
+
6794
+ /** Deep-merge authored theme layers. Later layers win at each authored leaf. */
6795
+ declare function mergeThemeConfig(base: ThemeConfig | undefined, override: ThemeConfig | undefined): ThemeConfig | undefined;
6320
6796
 
6321
6797
  /**
6322
6798
  * Named theme presets built on the design token system.
@@ -6326,8 +6802,6 @@ declare const DEFAULT_THEME: Theme;
6326
6802
  * onto DEFAULT_THEME, so only the deltas are specified here.
6327
6803
  */
6328
6804
 
6329
- /** Editorial preset: the current default look. Exported for explicit selection. */
6330
- declare const editorial: ThemeConfig;
6331
6805
  /** Essay preset: serif display titles, warmer background, generous spacing. */
6332
6806
  declare const essay: ThemeConfig;
6333
6807
  /** Wire preset: dense, mono numerals, tighter chrome. Dashboard/agency feel. */
@@ -6358,7 +6832,7 @@ declare const broadsheet: ThemeConfig;
6358
6832
  * siblings, the register a monitoring UI wants.
6359
6833
  */
6360
6834
  declare const terminal: ThemeConfig;
6361
- /** Next-generation editorial composition; opt in during v8. */
6835
+ /** @deprecated v9 adopts clarity typography by default. Set its remaining colors explicitly; removed in v10. */
6362
6836
  declare const clarity: ThemeConfig;
6363
6837
  /** Documented v8 typography. This does not freeze the layout engine. */
6364
6838
  declare const legacyEditorial: ThemeConfig;
@@ -6386,7 +6860,7 @@ declare const legacyEditorial: ThemeConfig;
6386
6860
  * @param base - Base theme to merge onto. Defaults to DEFAULT_THEME.
6387
6861
  * @returns A ResolvedTheme with all properties guaranteed.
6388
6862
  */
6389
- declare function resolveTheme(userTheme?: ThemeConfig, base?: Theme): ResolvedTheme;
6863
+ declare function resolveTheme(userTheme?: ThemeConfig, base?: ThemeBase): ResolvedTheme;
6390
6864
 
6391
6865
  /**
6392
6866
  * Chrome layout computation.
@@ -6411,15 +6885,8 @@ declare function resolveTheme(userTheme?: ThemeConfig, base?: Theme): ResolvedTh
6411
6885
  * the last line drifts outside the band that was reserved for it.
6412
6886
  */
6413
6887
  declare const FOOTNOTE_LINE_HEIGHT = 1.3;
6414
- /**
6415
- * Vertical space a footnote list of `count` lines occupies below the plot.
6416
- *
6417
- * Single source of truth, deliberately: the engine reserves this band in the
6418
- * bottom margin, the chrome renderer shifts the source row down by it, and the
6419
- * brand watermark shifts by it too. When those three disagree the footnotes
6420
- * land on top of the watermark, which is exactly the bug this centralizes away.
6421
- */
6422
- declare function footnoteBandHeight(count: number, theme: ResolvedTheme): number;
6888
+ /** Internal compiler arithmetic and compatibility fallback for hand-built layouts. */
6889
+ declare function computeNoteBandHeight(input: number | Pick<ResolvedChrome, 'noteBandHeight' | 'footnotes' | 'seriesSummary'>, theme: ResolvedTheme): number;
6423
6890
  /**
6424
6891
  * Compute resolved chrome layout from a Chrome spec and resolved theme.
6425
6892
  *
@@ -6595,14 +7062,10 @@ declare function axisTitleOffset(maxTickLabelWidth: number, titleFontSize: numbe
6595
7062
  declare const NARROW_VIEWPORT_MAX = 500;
6596
7063
  /** Extra top padding added below NARROW_VIEWPORT_MAX to clear iOS Safari browser chrome. */
6597
7064
  declare const TOP_PAD_EXTRA_NARROW = 10;
6598
- /** @deprecated Use NARROW_VIEWPORT_MAX instead. */
6599
- declare const TOP_PAD_NARROW_MAX = 500;
6600
7065
  /** Gap between category label text and chart edge on narrow viewports (< NARROW_VIEWPORT_MAX). */
6601
7066
  declare const LABEL_GAP_COMPACT = 8;
6602
7067
  /** Gap between category label text and chart edge on standard viewports. */
6603
7068
  declare const LABEL_GAP_DEFAULT = 12;
6604
- /** @deprecated Use NARROW_VIEWPORT_MAX instead. */
6605
- declare const LABEL_GAP_NARROW_MAX = 500;
6606
7069
  /**
6607
7070
  * Width threshold for the medium left-label fraction cap.
6608
7071
  * Sits between medium (400-700) and full (> 700) to prevent wide category labels
@@ -6915,8 +7378,6 @@ interface ChartBuilderOptions {
6915
7378
  responsive?: boolean;
6916
7379
  /** Theme configuration overrides. */
6917
7380
  theme?: ThemeConfig;
6918
- /** Dark mode behavior. */
6919
- darkMode?: DarkMode;
6920
7381
  }
6921
7382
  /** Options for the dataTable builder. */
6922
7383
  interface TableBuilderOptions {
@@ -6928,8 +7389,6 @@ interface TableBuilderOptions {
6928
7389
  chrome?: Chrome;
6929
7390
  /** Theme configuration overrides. */
6930
7391
  theme?: ThemeConfig;
6931
- /** Dark mode behavior. */
6932
- darkMode?: DarkMode;
6933
7392
  /** Enable client-side search/filter. */
6934
7393
  search?: boolean;
6935
7394
  /** Pagination configuration. */
@@ -6938,18 +7397,17 @@ interface TableBuilderOptions {
6938
7397
  };
6939
7398
  /** Stick the first column during horizontal scroll. */
6940
7399
  stickyFirstColumn?: boolean;
6941
- /** Compact mode. */
6942
- compact?: boolean;
7400
+ /** Row density. */
7401
+ density?: TableDensity;
6943
7402
  /** Whether the table adapts to container width. */
6944
7403
  responsive?: boolean;
6945
7404
  }
6946
7405
  /**
6947
7406
  * Infer the encoding field type from data values.
6948
7407
  *
6949
- * Samples up to 20 values from the data array for the given field.
6950
- * - If all sampled values are numbers (or null/undefined), returns "quantitative".
6951
- * - If all sampled string values match ISO date patterns, returns "temporal".
6952
- * - Otherwise returns "nominal".
7408
+ * Samples 50 rows, ignoring nulls; more than 80% numeric or temporal values
7409
+ * establish a type. Numeric strings (including ISO years) are quantitative.
7410
+ * Strings count as temporal only when date-shaped and parseable.
6953
7411
  */
6954
7412
  declare function inferFieldType(data: DataRow[], field: string): FieldType;
6955
7413
  /**
@@ -7059,8 +7517,6 @@ interface TileMapBuilderOptions {
7059
7517
  legend?: LegendConfig;
7060
7518
  /** Theme overrides. */
7061
7519
  theme?: ThemeConfig;
7062
- /** Dark mode setting. */
7063
- darkMode?: DarkMode;
7064
7520
  /** Whether to show the watermark. */
7065
7521
  watermark?: boolean;
7066
7522
  /** Animation configuration. */
@@ -7094,6 +7550,12 @@ declare function tileMap(data: Record<string, number | string | null> | DataRow[
7094
7550
  */
7095
7551
  declare function deepMergeSpec(target: any, source: any): any;
7096
7552
 
7553
+ /** Matches layer compilation's parent-or-first-leaf annotation ownership. */
7554
+ declare function annotationSource(spec: unknown): {
7555
+ annotations: Annotation[];
7556
+ path: string;
7557
+ };
7558
+
7097
7559
  /** Deterministic, bounded motion shared by rendering and timestamp-based export. */
7098
7560
 
7099
7561
  interface MotionPhase {
@@ -7142,4 +7604,4 @@ declare const CSS_TOKEN_ROOT_SELECTORS: readonly string[];
7142
7604
  declare const CSS_TOKENS: readonly CssTokenDef[];
7143
7605
  declare function cssTokenDefault(name: string, mode: 'light' | 'dark'): string;
7144
7606
 
7145
- export { type A11yConfig, type A11yMetadata, ACHROMATIC_RAMP, AXIS_TITLE_GAP, AXIS_TITLE_OFFSET_COMPACT, AXIS_TITLE_OFFSET_DEFAULT, AXIS_TITLE_TRAILING_PAD, type AggregateOp, type AggregateTransform, type AnimationConfig, type AnimationEase, type AnimationPhaseConfig, type AnimationPreset, type AnimationSpec, type AnimationStagger, type Annotation, type AnnotationAnchor, type AnnotationFootnote, type AnnotationOffset, type AnnotationPosition, type ArcEncoding, type ArcMark, type AreaEncoding, type AreaMark, type AxisConfig, type AxisLabelDensity, type AxisLayout, type AxisTick, BRAND_FONT_SIZE, BRAND_MIN_WIDTH, BRAND_RESERVE_WIDTH, BREAKPOINT_COMPACT_MAX, BREAKPOINT_MEDIUM_MAX, type BarColumnConfig, type BarEncoding, type BarListEncoding, type BarListLayout, type BarListRowMark, type BarListSpec, type BarListSpecWithoutData, type BarTableCell, type BaseLegendLayout, type BeeswarmEncoding, type BinParams, type BinTransform, type Breakpoint, CATEGORICAL_EXTENDED_PALETTE, CATEGORICAL_FILL_PALETTE, CATEGORICAL_FILL_PALETTE_DARK, CATEGORICAL_PALETTE, CATEGORICAL_PALETTE_DARK, COMPACT_MAX_X_TICKS, COMPACT_WIDTH, CSS_TOKENS, CSS_TOKEN_ROOT_SELECTORS, type CalculateExpression, type CalculateTransform, type CalendarEncoding, type CategoricalLegendLayout, type CategoricalPalette, type CategoryColorsConfig, type CategoryTableCell, type CellStyle, type ChannelRule, type ChartBuilderOptions, type ChartEventHandlers, type ChartLayout, type ChartSpec, type ChartSpecOverride, type ChartSpecWithoutData, type Chrome, type ChromeDefaults, type ChromeEconomy, type ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ChromeThemeOverride, type CircleEncoding, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type CompileWarning, type CompositionRecommendation, type Condition, type ConditionalValueDef, type ConnectorConfig, type ConnectorType, type ContinuousLegendBin, type ContinuousLegendLayout, type ContinuousLegendTick, type CssTokenDef, DEFAULT_THEME, DIVERGING_PALETTES, type DarkMode, type DataRow, type DatasetBinding, type DateGranularity, type DeltaColumnConfig, type DeltaTableCell, type DensityEncoding, type DensityTransform, type DesignDiagnostic, type DesignQuestion, type Display, type DivergingPalette, EXTENDED_OFFSET_STRATEGIES, type ElementEdit, type ElementRef, type Encoding, type EncodingChannel, type EncodingRule, type EndpointLabelContent, type EndpointLabelEntry, type EndpointLabelsConfig, type EndpointLabelsLayout, FLUID_SPRING, FOOTNOTE_LINE_HEIGHT, type FacetChannel, type FacetLayout, type FacetPanelLayout, type FieldFormatContext, type FieldMetadata, type FieldPredicate, type FieldRef, type FieldType, type FillPatternType, type FilterPredicate, type FilterTransform, type FlagTableCell, type FoldTransform, GRAPH_ENCODING_RULES, type GeoMapBorders, type GeoMapEncoding, type GeoMapFeatureMark, type GeoMapFocus, type GeoMapFocusLayout, type GeoMapGeo, type GeoMapLayout, type GeoMapPointMark, type GeoMapPointsLayer, type GeoMapProjection, type GeoMapSpec, type GeoMapSpecWithoutData, type GeoMapZoomConfig, type GradientColorStop, type GradientDef, type GradientLegendLayout, type GradientStop, type GraphAnimationConfig, type GraphAnimationSpec, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphInteractionConfig, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphSpec, type GraphSpecWithoutData, type Gridline, HEIGHT_CRAMPED_MAX, HEIGHT_MINIMAL_MAX, HEIGHT_NO_GRID_MAX, HEIGHT_SHORT_MAX, HPAD_COMPACT_FRACTION, HPAD_COMPACT_MIN, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type HistogramEncoding, type ImageColumnConfig, type ImageTableCell, type JoinAggregateTransform, LABEL_GAP_COMPACT, LABEL_GAP_DEFAULT, LABEL_GAP_NARROW_MAX, type LabelCandidate, type LabelConfig, type LabelDensity, type LabelMode, type LabelPriority, type LabelSpec, type LayerSpec, type LayoutStrategy, type LegendChannel, type LegendConfig, type LegendEntry, type LegendEntryPosition, type LegendLayout, type LegendPosition, type LineEncoding, type LineMark, type LinearGradient, type LogicalAnd, type LogicalNot, type LogicalOr, type LollipopEncoding, MARK_DISPLAY_NAMES, MARK_ENCODING_RULES, MARK_TYPES, MAX_LEFT_LABEL_FRACTION_COMPACT, MAX_LEFT_LABEL_FRACTION_DEFAULT, MAX_LEFT_LABEL_FRACTION_MEDIUM, MAX_LEFT_LABEL_FRACTION_MEDIUM_MAX, MAX_SPRING_DURATION, MAX_SR_TABLE_ROWS, MOTION_REST_THRESHOLD, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkType, type MeasureTextFn, type Metric, type MotionPhase, type MotionSample, NARROW_VIEWPORT_MAX, type NeutralRamp, type NodeOverride, type NumberFormatter, OFFSET_STRATEGIES, type ObservationIdentity, type OffsetStrategy, type PaginationState, type ParliamentEncoding, type Point, type PointEncoding, type PointMark, type RadialGradient, type RangeAnnotation, type RangeEncoding, type ReaderObservation, type ReaderSelection, type Rect, type RectEncoding, type RectMark, type RefLineAnnotation, type RelativeTimeRef, type ResolveConfig, type ResolveMode, type ResolvedAnimation, type ResolvedAnimationPhase, type ResolvedAnnotation, type ResolvedChrome, type ResolvedChromeElement, type ResolvedChromeRule, type ResolvedColumn, type ResolvedFillPattern, type ResolvedLabel, type ResolvedMetricBar, type ResolvedMetricCell, type ResolvedSeriesSearch, type ResolvedTheme, type ResolvedThemeColors, type ResolvedYouDrawIt, type ResponsiveConfig, type RuleMarkLayout, SEQUENTIAL_PALETTES, SUPPORTED_SCHEME_NAMES, type SankeyEncoding, type SankeyLayout, type SankeyLinkColor, type SankeyLinkMark, type SankeyNodeAlign, type SankeyNodeMark, type SankeySpec, type SankeySpecWithoutData, type ScaleConfig, type ScaleInvert, type ScaleType, type SequentialPalette, type SeriesSearchConfig, type SeriesStrategy, type SeriesStyle, type SizeLegendCircle, type SizeLegendLayout, type SortByField, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type SpecPatch, type SpringConfig, type StoredVizSpec, TICK_LABEL_OFFSET, TICK_LINE_HEIGHT_FACTOR, TOP_PAD_EXTRA_NARROW, TOP_PAD_NARROW_MAX, type TableBuilderOptions, type TableCell, type TableCellBase, type TableDensity, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, type TableTotalRow, type TextAnnotation, type TextEncoding, type TextMarkLayout, type TextStyle, type TextTableCell, type Theme, type ThemeChromeDefaults, type ThemeColors, type ThemeConfig, type ThemeFontSizes, type ThemeFontWeights, type ThemeFonts, type ThemeRule, type ThemeSpacing, type TickEncoding, type TickMarkLayout, type TileMapBuilderOptions, type TileMapEncoding, type TileMapLayout, type TileMapPalette, type TileMapSpec, type TileMapSpecWithoutData, type TileMapTileMark, type TimeUnit, type TimeUnitTransform, type TokenValue, type TooltipContent, type TooltipField, type Transform, type UpdatePhaseConfig, type ValueDef, type VizSpec, type WaffleEncoding, type WindowFieldDef, type WindowOp, type WindowSortField, type WindowTransform, type XAxisExtentInput, X_AXIS_BAND_HEIGHT, X_AXIS_ROTATED_EXTENT_CAP, X_AXIS_TITLE_BAND, X_AXIS_TITLE_BAND_ROTATED, type YouDrawItConfig, type YouDrawItSample, type YouDrawItYInvert, abbreviateNumber, adaptColorForDarkMode, adaptForLightLineStroke, adaptTheme, areaChart, axisTitleOffset, barChart, broadsheet, buildCompactStepFormatter, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, clarity, columnChart, computeChrome, computeFieldFormatContext, computeLabelBounds, computeXAxisExtentFromLabels, contrastRatio, cssTokenDefault, dataTable, deepMergeSpec, defaultNumberFormatter, deriveNeutralRamp, detectCollision, donutChart, dotChart, editorial, elementRef, essay, estimateTextWidth, findAccessibleColor, footnoteBandHeight, formatCurrency, formatDate, formatNumber, formatOrdinal, formatPercent, generateAltText, generateAriaLabels, generateDataTable, getAxisTitleOffset, getBreakpoint, getHeightClass, getLayoutStrategy, getRepresentativeColor, heuristicMeasure, inferFieldType, isAxislessMark, isBarListSpec, isChartSpec, isConditionalDef, isEncodingChannel, isGeoMapSpec, isGradientDef, isGraphSpec, isLayerSpec, isOpaqueColor, isRangeAnnotation, isRefLineAnnotation, isSankeySpec, isTableSpec, isTextAnnotation, isTileMapSpec, isValueDef, isYearContext, legacyEditorial, lineChart, maxRotatedLabelWidth, meetsAA, motionCSS, overlapArea, pickLabelColor, pieChart, resolveChromeEconomy, resolveCollisions, resolveMarkDef, resolveMarkType, resolveMeasurer, resolveNumberFormatter, resolveSchemeName, resolveTheme, sampleMotion, scatterChart, simulateColorBlindness, springDuration, terminal, textAscent, tileMap, truncateRotatedLabel, truncateToWidth, wire, wrapText };
7607
+ export { type A11yConfig, type A11yMetadata, ACHROMATIC_RAMP, AXIS_TITLE_GAP, AXIS_TITLE_OFFSET_COMPACT, AXIS_TITLE_OFFSET_DEFAULT, AXIS_TITLE_TRAILING_PAD, type AggregateOp, type AggregateTransform, type AnimationConfig, type AnimationEase, type AnimationPhaseConfig, type AnimationPreset, type AnimationSpec, type AnimationStagger, type Annotation, type AnnotationAnchor, type AnnotationFootnote, type AnnotationOffset, type AnnotationPosition, type ArcEncoding, type ArcMark, type AreaEncoding, type AreaMark, type AxisConfig, type AxisLabelDensity, type AxisLayout, type AxisTick, BRAND_FONT_SIZE, BRAND_MIN_WIDTH, BRAND_RESERVE_WIDTH, BREAKPOINT_COMPACT_MAX, BREAKPOINT_MEDIUM_MAX, type BarColumnConfig, type BarEncoding, type BarListEncoding, type BarListLayout, type BarListRowMark, type BarListSpec, type BarListSpecWithoutData, type BarTableCell, type BaseLegendLayout, type BeeswarmEncoding, type BinParams, type BinTransform, type Breakpoint, CATEGORICAL_EXTENDED_PALETTE, CATEGORICAL_FILL_PALETTE, CATEGORICAL_FILL_PALETTE_DARK, CATEGORICAL_PALETTE, CATEGORICAL_PALETTE_DARK, COMPACT_MAX_X_TICKS, COMPACT_WIDTH, CSS_TOKENS, CSS_TOKEN_ROOT_SELECTORS, type CalculateExpression, type CalculateTransform, type CalendarEncoding, type CategoricalLegendLayout, type CategoricalPalette, type CategoryColorsConfig, type CategoryTableCell, type CellStyle, type ChannelRule, type ChartBuilderOptions, type ChartEventHandlers, type ChartLayout, type ChartSpec, type ChartSpecOverride, type ChartSpecWithoutData, type Chrome, type ChromeDefaults, type ChromeEconomy, type ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ChromeThemeOverride, type CircleEncoding, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type CompileWarning, type CompositionRecommendation, type Condition, type ConditionalValueDef, type ConnectorConfig, type ConnectorType, type ContinuousLegendBin, type ContinuousLegendLayout, type ContinuousLegendTick, type CssTokenDef, DEFAULT_THEME, DIVERGING_PALETTES, type DarkMode, type DataRow, type DatasetBinding, type DateGranularity, type DeltaColumnConfig, type DeltaTableCell, type DensityEncoding, type DensityTransform, type DesignDiagnostic, type DesignQuestion, type Display, type DivergingPalette, EXTENDED_OFFSET_STRATEGIES, type EditOp, type EditTransaction, type EditTransactionResult, type ElementRef, type Encoding, type EncodingChannel, type EncodingRule, type EndpointLabelContent, type EndpointLabelEntry, type EndpointLabelsConfig, type EndpointLabelsLayout, FLUID_SPRING, FOOTNOTE_LINE_HEIGHT, type FacetChannel, type FacetLayout, type FacetPanelLayout, type FieldFormatContext, type FieldMetadata, type FieldPredicate, type FieldRef, type FieldType, type FillPatternType, type FilterPredicate, type FilterTransform, type FlagTableCell, type FoldTransform, GRAPH_ENCODING_RULES, type GeoAnchor, type GeoCallout, type GeoCalloutNoteSlot, type GeoColorKeyDescriptor, type GeoColorKeyLayout, type GeoDetailLayer, type GeoDetailLayerLayout, type GeoEntityRef, type GeoInset, type GeoLabelAffine, type GeoLabelCandidate, type GeoLabelComponent, type GeoLabelGeometry, type GeoLabelInventoryEntry, type GeoLabelOverlay, type GeoLabelVisibility, type GeoLabelsBundle, type GeoLabelsInput, type GeoMapBorders, type GeoMapEncoding, type GeoMapFeatureMark, type GeoMapFocus, type GeoMapFocusLayout, type GeoMapGeo, type GeoMapLayout, type GeoMapPointMark, type GeoMapPointsLayer, type GeoMapProjection, type GeoMapSpec, type GeoMapSpecWithoutData, type GeoMapZoomConfig, type GeoPlacedLabel, type GeoProjectionContext, type GeoReaderObservation, type GeoReaderSelection, type GeoTextBlock, type GeoViewLayout, type GradientColorStop, type GradientDef, type GradientLegendLayout, type GradientStop, type GraphAnimationConfig, type GraphAnimationSpec, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphInteractionConfig, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphSpec, type GraphSpecWithoutData, type Gridline, HEIGHT_CRAMPED_MAX, HEIGHT_MINIMAL_MAX, HEIGHT_NO_GRID_MAX, HEIGHT_SHORT_MAX, HPAD_COMPACT_FRACTION, HPAD_COMPACT_MIN, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type HistogramEncoding, type ImageColumnConfig, type ImageTableCell, type JoinAggregateTransform, LABEL_GAP_COMPACT, LABEL_GAP_DEFAULT, type LabelCandidate, type LabelConfig, type LabelDensity, type LabelMode, type LabelPriority, type LabelSpec, type LayerSpec, type LayoutStrategy, type LegendChannel, type LegendConfig, type LegendEntry, type LegendEntryPosition, type LegendLayout, type LegendPosition, type LineEncoding, type LineMark, type LinearGradient, type LogicalAnd, type LogicalNot, type LogicalOr, type LollipopEncoding, MARK_DISPLAY_NAMES, MARK_ENCODING_RULES, MARK_TYPES, MAX_LEFT_LABEL_FRACTION_COMPACT, MAX_LEFT_LABEL_FRACTION_DEFAULT, MAX_LEFT_LABEL_FRACTION_MEDIUM, MAX_LEFT_LABEL_FRACTION_MEDIUM_MAX, MAX_SPRING_DURATION, MAX_SR_TABLE_ROWS, MOTION_REST_THRESHOLD, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkType, type MeasureTextFn, type Metric, type MotionPhase, type MotionSample, NARROW_VIEWPORT_MAX, type NeutralRamp, type NodeOverride, type NumberFormatter, OFFSET_STRATEGIES, type ObservationIdentity, type OffsetStrategy, type PaginationState, type ParliamentEncoding, type Point, type PointEncoding, type PointMark, type RadialGradient, type RangeAnnotation, type RangeEncoding, type ReaderBindingScope, type ReaderChangeMeta, type ReaderComparisonOperand, type ReaderComparisonResult, type ReaderComparisonScope, type ReaderDomainValue, type ReaderObservation, type ReaderPanelScope, type ReaderSelection, type ReaderSeries, type ReaderSlice, type ReaderSliceIndexOptions, type ReaderSliceMember, type ReaderSliceSelection, type Rect, type RectEncoding, type RectMark, type RefLineAnnotation, type RelativeTimeRef, type ResolveConfig, type ResolveMode, type ResolvedAnimation, type ResolvedAnimationPhase, type ResolvedAnnotation, type ResolvedChrome, type ResolvedChromeElement, type ResolvedChromeRule, type ResolvedColumn, type ResolvedFillPattern, type ResolvedLabel, type ResolvedMetricBar, type ResolvedMetricCell, type ResolvedSeriesSearch, type ResolvedTheme, type ResolvedThemeColors, type ResolvedYouDrawIt, type ResponsiveConfig, type RuleMarkLayout, SEQUENTIAL_PALETTES, SUPPORTED_SCHEME_NAMES, type SankeyEncoding, type SankeyLayout, type SankeyLinkColor, type SankeyLinkMark, type SankeyNodeAlign, type SankeyNodeMark, type SankeySpec, type SankeySpecWithoutData, type ScaleConfig, type ScaleInvert, type ScaleType, type SequentialPalette, type SeriesSearchConfig, type SeriesStrategy, type SeriesStyle, type SizeLegendCircle, type SizeLegendLayout, type SortByField, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type SpecPatch, type SpringConfig, type StoredVizSpec, TICK_LABEL_OFFSET, TICK_LINE_HEIGHT_FACTOR, TOP_PAD_EXTRA_NARROW, type TableBuilderOptions, type TableCell, type TableCellBase, type TableDensity, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, type TableTotalRow, type TextAnnotation, type TextEncoding, type TextMarkLayout, type TextStyle, type TextTableCell, type ThemeChromeDefaults, type ThemeColors, type ThemeConfig, type ThemeFontSizes, type ThemeFontWeights, type ThemeFonts, type ThemeRule, type ThemeSpacing, type TickEncoding, type TickMarkLayout, type TileMapBuilderOptions, type TileMapEncoding, type TileMapLayout, type TileMapPalette, type TileMapSpec, type TileMapSpecWithoutData, type TileMapTileMark, type TimeUnit, type TimeUnitTransform, type TokenValue, type TooltipContent, type TooltipField, type Transform, type UpdatePhaseConfig, type ValueDef, type VizSpec, type WaffleEncoding, type WindowFieldDef, type WindowOp, type WindowSortField, type WindowTransform, type XAxisExtentInput, X_AXIS_BAND_HEIGHT, X_AXIS_ROTATED_EXTENT_CAP, X_AXIS_TITLE_BAND, X_AXIS_TITLE_BAND_ROTATED, type YouDrawItConfig, type YouDrawItSample, type YouDrawItYInvert, abbreviateNumber, adaptColorForDarkMode, adaptForLightLineStroke, adaptTheme, annotationSource, applyEditTransaction, areaChart, axisTitleOffset, barChart, broadsheet, buildCompactStepFormatter, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, clarity, columnChart, computeChrome, computeFieldFormatContext, computeLabelBounds, computeNoteBandHeight, computeXAxisExtentFromLabels, contrastRatio, cssTokenDefault, dataTable, deepMergeSpec, defaultNumberFormatter, deriveNeutralRamp, detectCollision, donutChart, dotChart, elementRef, encodePointerToken, essay, estimateTextWidth, findAccessibleColor, formatCurrency, formatDate, formatNumber, formatOrdinal, formatPercent, generateAltText, generateAriaLabels, generateDataTable, getAxisTitleOffset, getBreakpoint, getHeightClass, getLayoutStrategy, getRepresentativeColor, heuristicMeasure, inferFieldType, isAxislessMark, isBarListSpec, isChartSpec, isConditionalDef, isEncodingChannel, isGeoMapSpec, isGradientDef, isGraphSpec, isLayerSpec, isOpaqueColor, isRangeAnnotation, isRefLineAnnotation, isSankeySpec, isTableSpec, isTextAnnotation, isTileMapSpec, isValueDef, isYearContext, jsonPointer, legacyEditorial, lineChart, maxRotatedLabelWidth, meetsAA, mergeThemeConfig, motionCSS, overlapArea, pickLabelColor, pieChart, resolveChromeEconomy, resolveCollisions, resolveMarkDef, resolveMarkType, resolveMeasurer, resolveNumberFormatter, resolveSchemeName, resolveTheme, sampleMotion, scatterChart, simulateColorBlindness, springDuration, terminal, textAscent, tileMap, truncateRotatedLabel, truncateToWidth, wire, wrapText };