@opendata-ai/openchart-core 8.0.0-rc.8 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/index.d.ts +461 -56
  2. package/dist/index.js +62 -24
  3. package/dist/index.js.map +1 -1
  4. package/dist/styles.css +1 -1
  5. package/dist/styles.css.map +1 -1
  6. package/package.json +1 -2
  7. package/schema/chart.schema.json +373 -67
  8. package/schema/table.schema.json +35 -1
  9. package/schema/vizspec.schema.json +950 -152
  10. package/src/accessibility/__tests__/alt-text.test.ts +0 -110
  11. package/src/accessibility/__tests__/aria.test.ts +0 -125
  12. package/src/accessibility/alt-text.ts +0 -155
  13. package/src/accessibility/aria.ts +0 -75
  14. package/src/accessibility/index.ts +0 -6
  15. package/src/colors/__tests__/colorblind.test.ts +0 -75
  16. package/src/colors/__tests__/contrast.test.ts +0 -119
  17. package/src/colors/__tests__/palettes.test.ts +0 -74
  18. package/src/colors/colorblind.ts +0 -131
  19. package/src/colors/contrast.ts +0 -143
  20. package/src/colors/index.ts +0 -36
  21. package/src/colors/palettes.ts +0 -206
  22. package/src/helpers/__tests__/deep-merge.test.ts +0 -54
  23. package/src/helpers/__tests__/spec-builders.test.ts +0 -338
  24. package/src/helpers/deep-merge.ts +0 -29
  25. package/src/helpers/spec-builders.ts +0 -479
  26. package/src/index.ts +0 -215
  27. package/src/labels/__tests__/collision.test.ts +0 -310
  28. package/src/labels/collision.ts +0 -249
  29. package/src/labels/index.ts +0 -13
  30. package/src/layout/__tests__/chrome.test.ts +0 -208
  31. package/src/layout/__tests__/text-measure.test.ts +0 -57
  32. package/src/layout/chrome.ts +0 -470
  33. package/src/layout/index.ts +0 -18
  34. package/src/layout/text-measure.ts +0 -404
  35. package/src/layout/text-wrap.ts +0 -93
  36. package/src/locale/__tests__/format.test.ts +0 -606
  37. package/src/locale/format.ts +0 -459
  38. package/src/locale/index.ts +0 -21
  39. package/src/responsive/__tests__/breakpoints.test.ts +0 -146
  40. package/src/responsive/__tests__/metrics.test.ts +0 -52
  41. package/src/responsive/breakpoints.ts +0 -172
  42. package/src/responsive/index.ts +0 -53
  43. package/src/responsive/metrics.ts +0 -299
  44. package/src/schema/__tests__/generated-artifacts.test.ts +0 -42
  45. package/src/schema/__tests__/schema.test.ts +0 -179
  46. package/src/styles/__tests__/reduced-motion-selectors.test.ts +0 -28
  47. package/src/styles/animation.css +0 -208
  48. package/src/styles/base.css +0 -102
  49. package/src/styles/chrome.css +0 -174
  50. package/src/styles/dark.css +0 -44
  51. package/src/styles/graph.css +0 -135
  52. package/src/styles/index.css +0 -28
  53. package/src/styles/keyframes.css +0 -151
  54. package/src/styles/legend.css +0 -18
  55. package/src/styles/reduced-motion.css +0 -67
  56. package/src/styles/series-search.css +0 -153
  57. package/src/styles/sparkline.css +0 -16
  58. package/src/styles/table-animation.css +0 -93
  59. package/src/styles/table.css +0 -398
  60. package/src/styles/token-definitions.ts +0 -199
  61. package/src/styles/tokens.css +0 -156
  62. package/src/styles/tooltip.css +0 -126
  63. package/src/styles/you-draw-it.css +0 -126
  64. package/src/theme/__tests__/dark-mode.test.ts +0 -232
  65. package/src/theme/__tests__/defaults.test.ts +0 -73
  66. package/src/theme/__tests__/resolve.test.ts +0 -277
  67. package/src/theme/dark-mode.ts +0 -258
  68. package/src/theme/defaults.ts +0 -110
  69. package/src/theme/index.ts +0 -8
  70. package/src/theme/presets.ts +0 -64
  71. package/src/theme/resolve.ts +0 -312
  72. package/src/types/__tests__/encoding.test.ts +0 -368
  73. package/src/types/__tests__/gradient.test.ts +0 -95
  74. package/src/types/__tests__/spec.test.ts +0 -499
  75. package/src/types/encoding.ts +0 -280
  76. package/src/types/events.ts +0 -154
  77. package/src/types/index.ts +0 -289
  78. package/src/types/layout.ts +0 -2001
  79. package/src/types/schema-roots.ts +0 -32
  80. package/src/types/spec.ts +0 -2906
  81. package/src/types/table.ts +0 -108
  82. package/src/types/theme.ts +0 -209
package/dist/index.d.ts CHANGED
@@ -31,8 +31,13 @@ declare const HEIGHT_SHORT_MAX = 350;
31
31
  declare function getHeightClass(height: number): HeightClass;
32
32
  /** Label display mode at a given breakpoint. */
33
33
  type LabelMode = 'all' | 'important' | 'none';
34
- /** Legend position at a given breakpoint. */
35
- type LegendPosition = 'top' | 'right' | 'bottom' | 'bottom-right' | 'inline';
34
+ /**
35
+ * Legend position at a given breakpoint. `'top-left'` is a map-only overlay
36
+ * position: the legend floats inside the map area's top-left corner (with its
37
+ * own backdrop) instead of reserving a block of figure height. Charts treat
38
+ * it as the default position.
39
+ */
40
+ type LegendPosition = 'top' | 'top-left' | 'right' | 'bottom' | 'bottom-right' | 'inline';
36
41
  /** Annotation position strategy. */
37
42
  type AnnotationPosition = 'inline' | 'tooltip-only';
38
43
  /** Axis label density (controls tick count reduction). */
@@ -62,7 +67,12 @@ interface LayoutStrategy {
62
67
  *
63
68
  * Compact: minimal chrome, no inline labels, legend on top, reduced axes.
64
69
  * Medium: moderate labels, legend on top, reduced axes.
65
- * Full: all labels, legend on right, full axes.
70
+ * Full: all labels, legend on top, full axes.
71
+ *
72
+ * Legend position is 'top' at every breakpoint: a top legend reads as a key to
73
+ * the chart before the eye reaches the plot, and it keeps the plotting area
74
+ * full-width instead of surrendering a right-hand column. `legend.position`
75
+ * still overrides it per spec.
66
76
  *
67
77
  * Height constraints further reduce chrome and legend when container is short.
68
78
  */
@@ -427,6 +437,29 @@ declare function isGradientDef(value: unknown): value is GradientDef;
427
437
  * overlays that need a flat color.
428
438
  */
429
439
  declare function getRepresentativeColor(fill: string | GradientDef): string;
440
+ /**
441
+ * Configuration for the scatter regression trend line. Passed as the object
442
+ * form of `MarkDef.trendline`.
443
+ */
444
+ interface TrendlineConfig {
445
+ /**
446
+ * Stacking order relative to the point marks. `'below'` (default) draws the
447
+ * line behind the dots; `'above'` draws it on top so it stays visible over a
448
+ * dense cloud.
449
+ */
450
+ layer?: 'above' | 'below';
451
+ /**
452
+ * Stroke color. Defaults to the theme's high-contrast text color so the line
453
+ * reads on both light and dark grounds. Set an explicit CSS color to override.
454
+ */
455
+ stroke?: string;
456
+ /**
457
+ * Stroke width in pixels. Defaults to 1.5. Over a dense cloud with `layer:
458
+ * 'above'`, a heavier line (e.g. 2.5) stays legible where the thin default
459
+ * disappears into the dots.
460
+ */
461
+ strokeWidth?: number;
462
+ }
430
463
  /**
431
464
  * Mark definition object with visual properties.
432
465
  *
@@ -474,7 +507,15 @@ interface MarkDef {
474
507
  endAngle?: number;
475
508
  /** Corner radius for rect/bar marks. 'pill' sets rx to half the bar thickness. */
476
509
  cornerRadius?: number | 'pill';
477
- /** Fixed bar thickness in pixels for bar/column marks. When set, bars are this height (horizontal) or width (vertical), centered within the band. */
510
+ /**
511
+ * Bar/column marks: fixed bar thickness in pixels. When set, bars are this
512
+ * height (horizontal) or width (vertical), centered within the band.
513
+ *
514
+ * Point marks: the dot RADIUS in pixels (default 5, typical 2-12). This is
515
+ * NOT Vega-Lite's point `size`, which is an area in px^2 -- a VL size of
516
+ * 110 corresponds to `size: 6` here (r = sqrt(area / pi)). Validation
517
+ * rejects values above 50 with the conversion.
518
+ */
478
519
  size?: number;
479
520
  /** Whether the mark is filled (vs stroked only). */
480
521
  filled?: boolean;
@@ -496,8 +537,13 @@ interface MarkDef {
496
537
  * suppress it when the chart already carries its own reference line (e.g. a
497
538
  * manual x=y diagonal in a separate layer), which would otherwise produce
498
539
  * two competing diagonals.
540
+ *
541
+ * Pass an object to control stacking order: the line renders `below` the
542
+ * points by default, but a dense scatter (thousands of overlapping dots)
543
+ * fully occludes a line drawn underneath, so `{ layer: 'above' }` lifts the
544
+ * reference line over the cloud.
499
545
  */
500
- trendline?: boolean;
546
+ trendline?: boolean | TrendlineConfig;
501
547
  /**
502
548
  * Horizontal pixel offset from the data anchor. Only meaningful when `type`
503
549
  * is `'text'`. Use it to lift a label clear of the mark it annotates instead
@@ -897,9 +943,13 @@ interface Encoding<TData extends DataRow = DataRow> {
897
943
  */
898
944
  color?: EncodingChannel<TData> | ConditionalValueDef<TData> | ValueDef;
899
945
  /**
900
- * Size channel. Used by point/bubble charts to scale dot area by a quantitative field.
901
- * Accepts a conditional definition to vary size based on data predicates,
902
- * or a bare `{ value }` constant (VL aligned; expanded to `mark.size`).
946
+ * Size channel. Used by point/bubble charts to scale dots by a quantitative
947
+ * field, area-proportionally (sqrt curve). The units are dot RADII in px:
948
+ * `scale.range` defaults to [3, 30] for scatter, and a bare `{ value }`
949
+ * constant expands to `mark.size`, also a radius. This differs from
950
+ * Vega-Lite, where point size is an area in px^2 -- VL-scale values
951
+ * (60-900) are rejected by validation with the conversion.
952
+ * Accepts a conditional definition to vary size based on data predicates.
903
953
  */
904
954
  size?: EncodingChannel<TData> | ConditionalValueDef<TData> | ValueDef;
905
955
  /**
@@ -963,6 +1013,20 @@ interface Encoding<TData extends DataRow = DataRow> {
963
1013
  * per-panel axes.
964
1014
  */
965
1015
  facet?: FacetChannel<TData>;
1016
+ /**
1017
+ * Row facet channel: partitions data into vertically-stacked panels.
1018
+ * Each unique value of the row field produces one panel, arranged in a
1019
+ * single column. Shares the x-axis scale by default; y-axis is independent.
1020
+ * Mutually exclusive with `facet` and `column`.
1021
+ */
1022
+ row?: FacetChannel<TData>;
1023
+ /**
1024
+ * Column facet channel: partitions data into side-by-side panels.
1025
+ * Each unique value of the column field produces one panel, arranged in a
1026
+ * single row. Shares the y-axis scale by default; x-axis is independent.
1027
+ * Mutually exclusive with `facet` and `row`.
1028
+ */
1029
+ column?: FacetChannel<TData>;
966
1030
  }
967
1031
  /** Encoding channel for graph nodes and edges. */
968
1032
  interface GraphEncodingChannel {
@@ -972,13 +1036,40 @@ interface GraphEncodingChannel {
972
1036
  type?: FieldType;
973
1037
  /** Scale configuration. Auto-derived from data if omitted. */
974
1038
  scale?: ScaleConfig;
1039
+ /**
1040
+ * Category ordering for the color domain and legend. Graph channels default
1041
+ * `'ascending'` (VL-aligned, deterministic); `string[]` pins an explicit
1042
+ * order; `null` keeps data order.
1043
+ *
1044
+ * NOTE: chart encoding channels keep data-order — this graph default is a
1045
+ * deliberate divergence this release (see docs/migrating-v8.md).
1046
+ */
1047
+ sort?: 'ascending' | 'descending' | null | string[];
1048
+ /**
1049
+ * Category values to emphasize on load; the rest dim. Mirrors the chart
1050
+ * `encoding.color.highlight` value list. Distinct from the `highlight()`
1051
+ * runtime verb and `interaction.hover.mode`.
1052
+ */
1053
+ highlight?: string | string[];
975
1054
  }
976
1055
  /** Graph-specific encoding mapping visual properties to node/edge data fields. */
977
1056
  interface GraphEncoding {
978
1057
  /** Color mapping for nodes. */
979
1058
  nodeColor?: GraphEncodingChannel;
980
- /** Size mapping for nodes. */
1059
+ /**
1060
+ * Size mapping for nodes. `scale.type` defaults to `'sqrt'` (area-perceptual,
1061
+ * today's behavior); set `scale.type: 'linear'` for a linear radius ramp.
1062
+ * `scale.range` sets the pixel radius extent (default `[3, 12]`).
1063
+ */
981
1064
  nodeSize?: GraphEncodingChannel;
1065
+ /**
1066
+ * Opacity mapping for nodes (VL opacity channel). Quantitative fields map
1067
+ * linearly to `[0.25, 1]`; `scale.range` overrides.
1068
+ *
1069
+ * NOTE: there is deliberately no `edgeOpacity` channel — edge alpha is owned
1070
+ * by the interaction alpha-tier machinery (hover dimming, search).
1071
+ */
1072
+ nodeOpacity?: GraphEncodingChannel;
982
1073
  /** Color mapping for edges. */
983
1074
  edgeColor?: GraphEncodingChannel;
984
1075
  /** Width mapping for edges. */
@@ -987,6 +1078,13 @@ interface GraphEncoding {
987
1078
  edgeStyle?: GraphEncodingChannel;
988
1079
  /** Label field for nodes. */
989
1080
  nodeLabel?: GraphEncodingChannel;
1081
+ /**
1082
+ * Label priority mapping for nodes. Maps a quantitative field to a 0-1
1083
+ * priority range; higher values are shown first as the user zooms in.
1084
+ * Omit to use the default degree-based priority.
1085
+ * `nodeOverrides[id].alwaysShowLabel` still wins as the hard override.
1086
+ */
1087
+ nodeLabelPriority?: GraphEncodingChannel;
990
1088
  }
991
1089
  /** Layout algorithm for graph visualization. */
992
1090
  interface GraphLayoutConfig {
@@ -1007,6 +1105,31 @@ interface GraphLayoutConfig {
1007
1105
  linkStrength?: number;
1008
1106
  /** Whether to apply center force (default true). */
1009
1107
  centerForce?: boolean;
1108
+ /**
1109
+ * Deterministic layout seed. Same spec + seed ⇒ identical settled layout
1110
+ * within a given execution path (worker vs sync parity is not guaranteed).
1111
+ */
1112
+ seed?: number;
1113
+ /**
1114
+ * Repulsion preset (plain-language, no d3 jargon):
1115
+ * `gentle`/`balanced`/`energetic` → chargeStrength −150/−300/−600 and
1116
+ * velocityDecay 0.5/0.4/0.3. A raw `chargeStrength` wins over the preset.
1117
+ */
1118
+ energy?: 'gentle' | 'balanced' | 'energetic';
1119
+ /**
1120
+ * Settle-speed preset: `quick`/`balanced`/`thorough` → alphaDecay
1121
+ * 0.05/0.0228/0.01. Higher = faster cool-down, less final refinement.
1122
+ */
1123
+ settle?: 'quick' | 'balanced' | 'thorough';
1124
+ /**
1125
+ * Headless settle ticks run before the first paint. `true` → 100 ticks under
1126
+ * a 250ms budget; a number sets an explicit tick count; `false` disables.
1127
+ *
1128
+ * Lives in `layout`, NOT `animation`, on purpose: warmup *reduces* motion, so
1129
+ * it must survive `animation: false` (opt-out consumers get less settling
1130
+ * chaos, not more).
1131
+ */
1132
+ warmup?: boolean | number;
1010
1133
  }
1011
1134
  /** Style overrides for a chrome text element. */
1012
1135
  interface ChromeTextStyle {
@@ -1018,6 +1141,14 @@ interface ChromeTextStyle {
1018
1141
  fontFamily?: string;
1019
1142
  /** Text color (CSS color string). */
1020
1143
  color?: string;
1144
+ /**
1145
+ * Maximum number of lines this chrome text may wrap to. Additional lines are
1146
+ * dropped and the last kept line is truncated with an ellipsis. Bounds the
1147
+ * chrome's contribution to layout height at any container width. Applies
1148
+ * whether the font size comes from the theme default or an explicit override.
1149
+ * Caps height only, not horizontal overflow of a single unbreakable word.
1150
+ */
1151
+ maxLines?: number;
1021
1152
  }
1022
1153
  /** A chrome text element with optional style overrides. */
1023
1154
  interface ChromeText {
@@ -1608,6 +1739,20 @@ interface AnimationPhaseConfig {
1608
1739
  /** Stagger config. true = defaults, false = no stagger. Default: true for enter. */
1609
1740
  stagger?: AnimationStagger | boolean;
1610
1741
  }
1742
+ /**
1743
+ * Data-update phase config. Adds `maxMarks` on top of the shared phase
1744
+ * options; the cap is meaningless for enter/exit, which animate via CSS.
1745
+ */
1746
+ interface UpdatePhaseConfig extends AnimationPhaseConfig {
1747
+ /**
1748
+ * Maximum mark count that still runs a tweened data-update transition.
1749
+ * Default: 500. Above the cap the chart swaps instantly instead, because
1750
+ * per-frame SVG attribute writes on thousands of elements drop frames on
1751
+ * low-end devices. Raise it deliberately when the audience is desktop-heavy
1752
+ * and you have measured the frame budget.
1753
+ */
1754
+ maxMarks?: number;
1755
+ }
1611
1756
  /**
1612
1757
  * Full animation config object. Structured as enter/update/exit phases
1613
1758
  * following Vega's encoding set model.
@@ -1616,7 +1761,7 @@ interface AnimationConfig {
1616
1761
  /** Entrance animation when chart first renders. */
1617
1762
  enter?: AnimationPhaseConfig | boolean;
1618
1763
  /** Transition animation when data updates. */
1619
- update?: AnimationPhaseConfig | boolean;
1764
+ update?: UpdatePhaseConfig | boolean;
1620
1765
  /** Exit animation when marks are removed. */
1621
1766
  exit?: AnimationPhaseConfig | boolean;
1622
1767
  /** Delay before annotations animate in (ms after marks). Default: 200. */
@@ -1871,6 +2016,20 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
1871
2016
  transform?: Transform[];
1872
2017
  /** Editorial chrome (title, subtitle, source, etc.). */
1873
2018
  chrome?: Chrome;
2019
+ /**
2020
+ * How chrome height interacts with the container height budget.
2021
+ *
2022
+ * - `'subtract'` (default): the container height is fixed and chrome text
2023
+ * (title/subtitle/source) is subtracted from it, shrinking the plot. This
2024
+ * is the historical behavior.
2025
+ * - `'grow'`: the container height is treated as the *plot* budget, and the
2026
+ * rendered SVG grows taller by the measured chrome height. The plot keeps
2027
+ * its full budget (minus axis/padding overhead) regardless of how many
2028
+ * lines the title wraps to.
2029
+ *
2030
+ * `'grow'` is a no-op for faceted specs in this version.
2031
+ */
2032
+ chromeLayout?: 'subtract' | 'grow';
1874
2033
  /**
1875
2034
  * Top-level title sugar (Vega-Lite aligned). Expanded into `chrome.title`
1876
2035
  * (and `chrome.subtitle` for the object form). `chrome.title` wins when
@@ -1937,7 +2096,12 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
1937
2096
  darkMode?: DarkMode;
1938
2097
  /** Whether to show the tryOpenData.ai watermark. Defaults to true. */
1939
2098
  watermark?: boolean;
1940
- /** Series names to hide from rendering. Hidden series remain in the legend but are visually dimmed. */
2099
+ /**
2100
+ * Series names to hide from rendering by default. This is the authored
2101
+ * persistence target for legend visibility. Runtime legend toggles
2102
+ * (legend-toggle edit events) layer on top of this via ephemeral runtime
2103
+ * sets but never modify it.
2104
+ */
1941
2105
  hiddenSeries?: string[];
1942
2106
  /** Per-series visual overrides, keyed by series name (the color field value). */
1943
2107
  seriesStyles?: Record<string, SeriesStyle>;
@@ -2190,6 +2354,70 @@ interface NodeOverride {
2190
2354
  /** Force label to always show regardless of zoom/priority. */
2191
2355
  alwaysShowLabel?: boolean;
2192
2356
  }
2357
+ /**
2358
+ * Per-phase and per-behavior motion config for a graph.
2359
+ *
2360
+ * DEFAULT-ON semantics (deliberately different from charts, which are opt-in):
2361
+ * omit `animation` → the resolver returns full defaults; `animation: false` →
2362
+ * no choreography (but `layout.warmup` still applies); a per-phase `false`
2363
+ * disables just that phase. Graphs are default-on because physics motion
2364
+ * already exists on load and choreography reduces the chaos.
2365
+ */
2366
+ interface GraphAnimationConfig {
2367
+ /** Node/edge reveal on first render. Default `{ duration: 500, ease: 'smooth', stagger: true }`. */
2368
+ enter?: AnimationPhaseConfig | boolean;
2369
+ /** Data-update enter-fade for newly added marks. Default `{ duration: 300, ease: 'smooth' }`. */
2370
+ update?: AnimationPhaseConfig | boolean;
2371
+ /** Ghost fade-out for removed marks. Default `{ duration: 300, ease: 'smooth' }`. */
2372
+ exit?: AnimationPhaseConfig | boolean;
2373
+ /** Camera flight easing. Default duration `'auto'` (derived from the zoom distance). */
2374
+ camera?: {
2375
+ duration?: number;
2376
+ ease?: AnimationEase;
2377
+ } | boolean;
2378
+ /** Hover emphasis crossfade. Default `{ duration: 150, ease: 'smooth' }`. */
2379
+ hover?: {
2380
+ duration?: number;
2381
+ ease?: AnimationEase;
2382
+ } | boolean;
2383
+ }
2384
+ /**
2385
+ * Graph motion spec.
2386
+ * - omitted → full defaults (default-ON)
2387
+ * - `false` → no choreography (warmup still applies)
2388
+ * - object → per-phase control
2389
+ *
2390
+ * `prefers-reduced-motion` is always respected regardless of this value.
2391
+ */
2392
+ type GraphAnimationSpec = boolean | GraphAnimationConfig;
2393
+ /** Interaction behavior for a graph (hover mode, select-fly, opt-in physics). */
2394
+ interface GraphInteractionConfig {
2395
+ /**
2396
+ * Hover emphasis behavior. `neighbors` (default) lights the hovered node and
2397
+ * its adjacency; `category` lights same-category nodes; `node` lights only the
2398
+ * hovered node; `none` disables. `dimOpacity` (default 0.15) is the node dim
2399
+ * tier. Named `mode` (not `highlight`) to avoid colliding with the three other
2400
+ * meanings of "highlight" (the encoding value list, the `highlight()` verb).
2401
+ */
2402
+ hover?: {
2403
+ mode?: 'neighbors' | 'category' | 'node' | 'none';
2404
+ dimOpacity?: number;
2405
+ };
2406
+ /** Selecting a node flies the camera to it. Default `false`. */
2407
+ select?: {
2408
+ flyTo?: boolean;
2409
+ };
2410
+ /**
2411
+ * Opt-in cursor repulsion (nodes drift away from the pointer). Disabled under
2412
+ * `prefers-reduced-motion` and above the node-count gate.
2413
+ */
2414
+ cursorRepulsion?: boolean | {
2415
+ radius?: number;
2416
+ strength?: number;
2417
+ };
2418
+ /** Opt-in springy node drag (user-initiated; no reduced-motion gate). */
2419
+ springyDrag?: boolean;
2420
+ }
2193
2421
  interface GraphSpec {
2194
2422
  /** Discriminant: always "graph". */
2195
2423
  type: 'graph';
@@ -2211,6 +2439,21 @@ interface GraphSpec {
2211
2439
  theme?: ThemeConfig;
2212
2440
  /** Dark mode behavior. */
2213
2441
  darkMode?: DarkMode;
2442
+ /**
2443
+ * Motion configuration. DEFAULT-ON: omit for full defaults, `false` to opt
2444
+ * out of choreography (layout warmup still applies).
2445
+ */
2446
+ animation?: GraphAnimationSpec;
2447
+ /** Interaction behavior (hover mode, select-fly, opt-in physics). */
2448
+ interaction?: GraphInteractionConfig;
2449
+ /**
2450
+ * Built-in legend. Interactive by default. Set `false` if you render your own
2451
+ * legend, so the built-in filter UI doesn't compete with it.
2452
+ */
2453
+ legend?: boolean | {
2454
+ interactive?: boolean;
2455
+ counts?: boolean;
2456
+ };
2214
2457
  /** Whether to show the tryOpenData.ai watermark. Defaults to true. */
2215
2458
  watermark?: boolean;
2216
2459
  }
@@ -2265,7 +2508,16 @@ interface LayerSpec<TData extends DataRow = DataRow> {
2265
2508
  height?: number;
2266
2509
  /** Accepted for Vega-Lite compatibility and ignored (with a compile warning). */
2267
2510
  $schema?: string;
2268
- /** Annotations on the layered view. */
2511
+ /**
2512
+ * Annotations for the layered chart. When present, these are the
2513
+ * annotations rendered and available for editing. When absent, falls back
2514
+ * to the first leaf layer's annotations. Annotations on second and later
2515
+ * leaf layers are not rendered.
2516
+ *
2517
+ * For edit persistence: the `data-annotation-index` stamped on each
2518
+ * rendered annotation maps to this array (or the first leaf's if this is
2519
+ * unset). Place annotations here for reliable index-based edit matching.
2520
+ */
2269
2521
  annotations?: Annotation[];
2270
2522
  /** Label display configuration. `false` disables all labels, `true` uses defaults. */
2271
2523
  labels?: LabelSpec;
@@ -2281,7 +2533,12 @@ interface LayerSpec<TData extends DataRow = DataRow> {
2281
2533
  watermark?: boolean;
2282
2534
  /** Resolution strategy for shared scales/axes/legends. */
2283
2535
  resolve?: ResolveConfig;
2284
- /** Hidden series names. */
2536
+ /**
2537
+ * Series names to hide from rendering by default. This is the authored
2538
+ * persistence target for legend visibility. Runtime legend toggles
2539
+ * (legend-toggle edit events) layer on top of this via ephemeral runtime
2540
+ * sets but never modify it.
2541
+ */
2285
2542
  hiddenSeries?: string[];
2286
2543
  /** Endpoint labels column, inherited by child layers that don't set their own. */
2287
2544
  endpointLabels?: boolean | EndpointLabelsConfig;
@@ -2422,32 +2679,32 @@ interface TileMapSpec {
2422
2679
  valueFormat?: string;
2423
2680
  }
2424
2681
  /** Supported map projections. */
2425
- type MapProjection = 'albersUsa' | 'mercator' | 'equalEarth' | 'identity';
2682
+ type GeoMapProjection = 'albersUsa' | 'mercator' | 'equalEarth' | 'identity';
2426
2683
  /** Focus target for map camera: feature id(s) to zoom/pan to. */
2427
2684
  /**
2428
2685
  * Fit the point layer's cluster. `true` fits every point; `{ field, value }`
2429
2686
  * fits only the points whose data row has `row[field] === value` (e.g. only the
2430
2687
  * campuses rated "F"), which lets a story pan between sub-clusters.
2431
2688
  */
2432
- type MapPointsFocus = true | {
2689
+ type GeoMapPointsFocus = true | {
2433
2690
  field: string;
2434
2691
  value: string | number;
2435
2692
  };
2436
- type MapFocus = string | number | Array<string | number> | {
2693
+ type GeoMapFocus = string | number | Array<string | number> | {
2437
2694
  features: string | number | Array<string | number>;
2438
2695
  padding?: number;
2439
2696
  } | {
2440
- points: MapPointsFocus;
2697
+ points: GeoMapPointsFocus;
2441
2698
  padding?: number;
2442
2699
  };
2443
2700
  /** Geo configuration for map specs. */
2444
- interface MapGeo {
2701
+ interface GeoMapGeo {
2445
2702
  /** TopoJSON topology object. User imports this from us-atlas, world-atlas, or their own source. */
2446
2703
  features: unknown;
2447
2704
  /** Field in the TopoJSON feature properties to use as the join key. Defaults to 'id'. */
2448
2705
  idField?: string;
2449
2706
  /** Map projection. Defaults to 'albersUsa'. */
2450
- projection?: MapProjection;
2707
+ projection?: GeoMapProjection;
2451
2708
  /**
2452
2709
  * Focus the camera. A feature id (or array) fits those features; `{ features, padding }`
2453
2710
  * adds breathing room; `{ points: true, padding }` fits the points layer's cluster
@@ -2456,10 +2713,10 @@ interface MapGeo {
2456
2713
  * `{ points: { field, value }, padding }` fits only the matching point subset, so a
2457
2714
  * story can pan between sub-clusters. null clears focus from a prior story step.
2458
2715
  */
2459
- focus?: MapFocus | null;
2716
+ focus?: GeoMapFocus | null;
2460
2717
  }
2461
2718
  /** Encoding channels specific to map visualizations. */
2462
- interface MapEncoding {
2719
+ interface GeoMapEncoding {
2463
2720
  /** Join key field in the data. Required for choropleth; optional in basemap-only mode (points layer with empty data). */
2464
2721
  key?: EncodingChannel;
2465
2722
  /** Color encoding (quantitative or nominal). Drives fill color of features. Optional when a points layer is present (basemap-only mode). */
@@ -2468,7 +2725,7 @@ interface MapEncoding {
2468
2725
  tooltip?: EncodingChannel | EncodingChannel[];
2469
2726
  }
2470
2727
  /** Point/symbol layer rendered above choropleth features. */
2471
- interface MapPointsLayer {
2728
+ interface GeoMapPointsLayer {
2472
2729
  /** Tabular data for the points. Independent of the choropleth data join. */
2473
2730
  data: DataRow[];
2474
2731
  /** Field holding longitude (x coordinate). */
@@ -2479,22 +2736,23 @@ interface MapPointsLayer {
2479
2736
  size?: EncodingChannel;
2480
2737
  /** Optional color encoding (nominal or quantitative). Independent scale from choropleth. */
2481
2738
  color?: EncodingChannel;
2482
- /** Tooltip channel(s), same shape as MapEncoding.tooltip. */
2739
+ /** Tooltip channel(s), same shape as GeoMapEncoding.tooltip. */
2483
2740
  tooltip?: EncodingChannel | EncodingChannel[];
2484
- /** Stable id for event callbacks. Data-update transitions for points are not yet supported. */
2741
+ /** Stable id for event callbacks, and the key used to match points across
2742
+ * renders so fill, radius, and position tween on data update. */
2485
2743
  key?: EncodingChannel;
2486
2744
  /** Fill opacity for point circles. Default 0.65. Range 0-1. */
2487
2745
  opacity?: number;
2488
2746
  }
2489
- interface MapSpec {
2747
+ interface GeoMapSpec {
2490
2748
  /** Discriminant: always "map". */
2491
2749
  type: 'map';
2492
2750
  /** Geo configuration: TopoJSON features, join key, and projection. */
2493
- geo: MapGeo;
2751
+ geo: GeoMapGeo;
2494
2752
  /** Tabular data to join to geo features. */
2495
2753
  data: DataRow[];
2496
2754
  /** Encoding channels mapping data fields to visual properties. */
2497
- encoding: MapEncoding;
2755
+ encoding: GeoMapEncoding;
2498
2756
  /** Editorial chrome (title, subtitle, source, byline, footer). */
2499
2757
  chrome?: Chrome;
2500
2758
  /** Legend display configuration. */
@@ -2506,7 +2764,7 @@ interface MapSpec {
2506
2764
  /** Whether to show the tryOpenData.ai watermark. Defaults to true. */
2507
2765
  watermark?: boolean;
2508
2766
  /** Optional point/symbol layer rendered above choropleth features. */
2509
- points?: MapPointsLayer;
2767
+ points?: GeoMapPointsLayer;
2510
2768
  /** Animation configuration for entrance animations. */
2511
2769
  animation?: AnimationSpec;
2512
2770
  /**
@@ -2571,7 +2829,7 @@ interface BarListEncoding {
2571
2829
  * - GraphSpec: has `type: 'graph'`
2572
2830
  * - SankeySpec: has `type: 'sankey'`
2573
2831
  * - TileMapSpec: has `type: 'tilemap'`
2574
- * - MapSpec: has `type: 'map'`
2832
+ * - GeoMapSpec: has `type: 'map'`
2575
2833
  * - BarListSpec: has `type: 'barlist'`
2576
2834
  *
2577
2835
  * Election parliament (hemicycle) charts are `ChartSpec` with `mark:
@@ -2581,7 +2839,7 @@ interface BarListEncoding {
2581
2839
  * for free instead of a second bespoke compile path (see
2582
2840
  * `packages/engine/src/charts/parliament/`).
2583
2841
  */
2584
- type VizSpec = ChartSpec | LayerSpec | TableSpec | GraphSpec | SankeySpec | TileMapSpec | MapSpec | BarListSpec;
2842
+ type VizSpec = ChartSpec | LayerSpec | TableSpec | GraphSpec | SankeySpec | TileMapSpec | GeoMapSpec | BarListSpec;
2585
2843
  /**
2586
2844
  * Chart spec without runtime data, for persistence/storage.
2587
2845
  * Generic: `ChartSpecWithoutData<MyRow>` constrains encoding field names.
@@ -2596,13 +2854,13 @@ type SankeySpecWithoutData = Omit<SankeySpec, 'data'>;
2596
2854
  /** TileMap spec without runtime data, for persistence/storage. */
2597
2855
  type TileMapSpecWithoutData = Omit<TileMapSpec, 'data'>;
2598
2856
  /** Map spec without runtime data, for persistence/storage. */
2599
- type MapSpecWithoutData = Omit<MapSpec, 'data' | 'points'> & {
2600
- points?: Omit<MapPointsLayer, 'data'>;
2857
+ type GeoMapSpecWithoutData = Omit<GeoMapSpec, 'data' | 'points'> & {
2858
+ points?: Omit<GeoMapPointsLayer, 'data'>;
2601
2859
  };
2602
2860
  /** BarList spec without runtime data, for persistence/storage. */
2603
2861
  type BarListSpecWithoutData = Omit<BarListSpec, 'data'>;
2604
2862
  /** Union of data-stripped spec types for persistence/storage. */
2605
- type StoredVizSpec = ChartSpecWithoutData | TableSpecWithoutData | GraphSpecWithoutData | SankeySpecWithoutData | TileMapSpecWithoutData | MapSpecWithoutData | BarListSpecWithoutData;
2863
+ type StoredVizSpec = ChartSpecWithoutData | TableSpecWithoutData | GraphSpecWithoutData | SankeySpecWithoutData | TileMapSpecWithoutData | GeoMapSpecWithoutData | BarListSpecWithoutData;
2606
2864
  /** Logical AND combinator for filter predicates. */
2607
2865
  interface LogicalAnd<T> {
2608
2866
  and: T[];
@@ -2831,8 +3089,8 @@ declare function isSankeySpec(spec: VizSpec | Record<string, unknown>): spec is
2831
3089
  declare function isTileMapSpec(spec: VizSpec | Record<string, unknown>): spec is TileMapSpec;
2832
3090
  /** Check if a spec is a BarListSpec. */
2833
3091
  declare function isBarListSpec(spec: VizSpec | Record<string, unknown>): spec is BarListSpec;
2834
- /** Check if a spec is a MapSpec. */
2835
- declare function isMapSpec(spec: VizSpec | Record<string, unknown>): spec is MapSpec;
3092
+ /** Check if a spec is a GeoMapSpec. */
3093
+ declare function isGeoMapSpec(spec: VizSpec | Record<string, unknown>): spec is GeoMapSpec;
2836
3094
  /** Check if an annotation is a TextAnnotation. */
2837
3095
  declare function isTextAnnotation(annotation: Annotation): annotation is TextAnnotation;
2838
3096
  /** Check if an annotation is a RangeAnnotation. */
@@ -2942,26 +3200,36 @@ type ElementRef = {
2942
3200
  type: 'annotation';
2943
3201
  index: number;
2944
3202
  id?: string;
3203
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
3204
+ path?: string;
2945
3205
  } | {
2946
3206
  type: 'chrome';
2947
3207
  key: ChromeKey;
3208
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
3209
+ path?: string;
2948
3210
  } | {
2949
3211
  type: 'series-label';
2950
3212
  series: string;
3213
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
3214
+ path?: string;
2951
3215
  } | {
2952
3216
  type: 'legend';
3217
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
3218
+ path?: string;
2953
3219
  } | {
2954
3220
  type: 'legend-entry';
2955
3221
  series: string;
2956
3222
  index: number;
3223
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
3224
+ path?: string;
2957
3225
  };
2958
3226
  /** Helper constructors for ergonomic ElementRef creation. */
2959
3227
  declare const elementRef: {
2960
- readonly annotation: (index: number, id?: string) => ElementRef;
2961
- readonly chrome: (key: ChromeKey) => ElementRef;
2962
- readonly seriesLabel: (series: string) => ElementRef;
2963
- readonly legend: () => ElementRef;
2964
- readonly legendEntry: (series: string, index: number) => ElementRef;
3228
+ readonly annotation: (index: number, id?: string, path?: string) => ElementRef;
3229
+ readonly chrome: (key: ChromeKey, path?: string) => ElementRef;
3230
+ readonly seriesLabel: (series: string, path?: string) => ElementRef;
3231
+ readonly legend: (path?: string) => ElementRef;
3232
+ readonly legendEntry: (series: string, index: number, path?: string) => ElementRef;
2965
3233
  };
2966
3234
  /**
2967
3235
  * Discriminated union of all element edit events.
@@ -2976,21 +3244,31 @@ declare const elementRef: {
2976
3244
  */
2977
3245
  type ElementEdit = {
2978
3246
  type: 'annotation';
3247
+ element: ElementRef;
2979
3248
  annotation: TextAnnotation;
2980
3249
  offset: AnnotationOffset;
2981
3250
  } | {
2982
3251
  type: 'annotation-connector';
3252
+ element: ElementRef;
2983
3253
  annotation: TextAnnotation;
2984
3254
  endpoint: 'from' | 'to';
2985
3255
  offset: AnnotationOffset;
2986
3256
  } | {
2987
3257
  type: 'range-label';
3258
+ element: ElementRef;
2988
3259
  annotation: RangeAnnotation;
2989
3260
  labelOffset: AnnotationOffset;
2990
3261
  } | {
2991
3262
  type: 'refline-label';
3263
+ element: ElementRef;
2992
3264
  annotation: RefLineAnnotation;
2993
3265
  labelOffset: AnnotationOffset;
3266
+ } | {
3267
+ type: 'annotation-anchor';
3268
+ element: ElementRef;
3269
+ annotation: TextAnnotation;
3270
+ x: string | number;
3271
+ y: string | number;
2994
3272
  } | {
2995
3273
  type: 'chrome';
2996
3274
  key: ChromeKey;
@@ -3003,10 +3281,21 @@ type ElementEdit = {
3003
3281
  } | {
3004
3282
  type: 'legend';
3005
3283
  offset: AnnotationOffset;
3006
- } | {
3284
+ }
3285
+ /**
3286
+ * Transient legend visibility toggle. Reports the same runtime show/hide
3287
+ * a reader triggers; not persisted by openchart. To author default-hidden
3288
+ * series, set `spec.hiddenSeries` directly. Hosts building spec
3289
+ * persistence should generally not write legend-toggle edits back into
3290
+ * the authored spec. `hidden: true` means the series was just hidden.
3291
+ */
3292
+ | {
3007
3293
  type: 'legend-toggle';
3008
3294
  series: string;
3009
3295
  hidden: boolean;
3296
+ } | {
3297
+ type: 'add';
3298
+ annotation: TextAnnotation;
3010
3299
  } | {
3011
3300
  type: 'delete';
3012
3301
  element: ElementRef;
@@ -3042,6 +3331,14 @@ interface MarkEvent {
3042
3331
  * or ChartProps (React component) to receive interaction callbacks.
3043
3332
  */
3044
3333
  interface ChartEventHandlers {
3334
+ /**
3335
+ * Explicitly enable or disable edit interactions (drag, select, keyboard
3336
+ * delete/edit). When true, the interaction layer is wired even without
3337
+ * onEdit. When false, all edit interactions are suppressed even when
3338
+ * onEdit is provided. When omitted, each interaction block uses its
3339
+ * existing callback-presence gate.
3340
+ */
3341
+ editable?: boolean;
3045
3342
  /** Called when a data mark is clicked. */
3046
3343
  onMarkClick?: (event: MarkEvent) => void;
3047
3344
  /** Called when the mouse enters a data mark. */
@@ -3138,6 +3435,12 @@ interface ResolvedChromeElement {
3138
3435
  y: number;
3139
3436
  /** Maximum width for line wrapping. */
3140
3437
  maxWidth: number;
3438
+ /**
3439
+ * Maximum wrapped lines. When set, the renderer caps the wrapped output to
3440
+ * this many lines and truncates the last kept line with an ellipsis. The
3441
+ * layout height reserved for this element already reflects the cap.
3442
+ */
3443
+ maxLines?: number;
3141
3444
  /** Computed text style. */
3142
3445
  style: TextStyle;
3143
3446
  }
@@ -3746,6 +4049,8 @@ interface LegendEntry {
3746
4049
  active?: boolean;
3747
4050
  /** True for overflow indicator entries ("+N more"). Not interactive. */
3748
4051
  overflow?: boolean;
4052
+ /** Node/edge count for this category (graph legends). Additive; undefined elsewhere. */
4053
+ count?: number;
3749
4054
  }
3750
4055
  /** The encoding channel a legend keys. */
3751
4056
  type LegendChannel = 'color' | 'size';
@@ -3762,8 +4067,9 @@ interface BaseLegendLayout {
3762
4067
  * read them silently pick whichever comes first.
3763
4068
  */
3764
4069
  channel?: LegendChannel;
3765
- /** Where the legend is positioned relative to the chart area. */
3766
- position: 'top' | 'right' | 'bottom' | 'bottom-right' | 'inline';
4070
+ /** Where the legend is positioned relative to the chart area. `'top-left'`
4071
+ * is a map-only overlay position (floats inside the map area). */
4072
+ position: 'top' | 'top-left' | 'right' | 'bottom' | 'bottom-right' | 'inline';
3767
4073
  /** Bounding box for the legend (pixel coordinates). */
3768
4074
  bounds: Rect;
3769
4075
  /** Entry label style. */
@@ -3983,6 +4289,12 @@ interface A11yMetadata {
3983
4289
  altText: string;
3984
4290
  /** Tabular data fallback for screen readers. Each inner array is a row. */
3985
4291
  dataTableFallback: unknown[][];
4292
+ /**
4293
+ * True row count of the underlying data. Only set when `dataTableFallback`
4294
+ * was truncated, so its presence is the signal that rows are missing and the
4295
+ * caption should name the total.
4296
+ */
4297
+ totalRows?: number;
3986
4298
  /** ARIA role for the visualization root element. */
3987
4299
  role: string;
3988
4300
  /** Whether the visualization is keyboard-navigable. */
@@ -4005,6 +4317,12 @@ interface ResolvedAnimationPhase {
4005
4317
  staggerDelay: number;
4006
4318
  /** Stagger ordering. */
4007
4319
  staggerOrder: 'index' | 'value' | 'reverse';
4320
+ /**
4321
+ * Author-set cap on the mark count that still runs a tweened data-update
4322
+ * transition (update phase only). Present only when explicitly set on the
4323
+ * spec — the renderer supplies the default so it can vary by render mode.
4324
+ */
4325
+ maxMarks?: number;
4008
4326
  }
4009
4327
  /** Resolved animation config. A phase is present iff that phase is enabled. */
4010
4328
  interface ResolvedAnimation {
@@ -4093,6 +4411,23 @@ interface YouDrawItYInvert {
4093
4411
  /** Data value at the bottom pixel. */
4094
4412
  bottomData: number;
4095
4413
  }
4414
+ /**
4415
+ * Scale inversion anchors serialized from the engine so the vanilla layer
4416
+ * can convert pixel positions to data-space values without holding d3
4417
+ * scale objects. Generalizes the YouDrawItYInvert pattern to both axes.
4418
+ */
4419
+ interface ScaleInvert {
4420
+ /** For continuous scales: two reference pixel-to-data anchor points. */
4421
+ topPixel: number;
4422
+ bottomPixel: number;
4423
+ topData: number;
4424
+ bottomData: number;
4425
+ /** Scale type so the vanilla layer applies the correct inverse transform. */
4426
+ scaleType?: 'linear' | 'log' | 'pow' | 'sqrt' | 'symlog' | 'time';
4427
+ /** For band/point scales: ordered domain values and their pixel centers. */
4428
+ domain?: (string | number)[];
4429
+ positions?: number[];
4430
+ }
4096
4431
  /**
4097
4432
  * Resolved geometry and config for the "you draw it" interactive format
4098
4433
  * (`youDrawIt`). The vanilla adapter uses this to render the hatched drawing
@@ -4145,6 +4480,7 @@ interface FacetPanelLayout {
4145
4480
  y: number;
4146
4481
  fontSize: number;
4147
4482
  fontWeight: number;
4483
+ textAnchor?: 'start' | 'middle' | 'end';
4148
4484
  };
4149
4485
  }
4150
4486
  /** Layout for a faceted (small-multiples) chart. */
@@ -4157,6 +4493,8 @@ interface FacetLayout {
4157
4493
  columns: number;
4158
4494
  /** Whether scales are shared across panels. */
4159
4495
  sharedScales: boolean;
4496
+ /** How panels are arranged: 'row' (vertical stack), 'column' (horizontal), 'wrap' (grid). */
4497
+ direction: 'row' | 'column' | 'wrap';
4160
4498
  }
4161
4499
  /**
4162
4500
  * ChartLayout: the complete engine output for chart visualizations.
@@ -4231,8 +4569,22 @@ interface ChartLayout {
4231
4569
  crosshair: boolean;
4232
4570
  /** Real text measurement function from the adapter (for accurate SVG text wrapping). */
4233
4571
  measureText?: MeasureTextFn;
4572
+ /** Scale inversion anchors for the x axis. Used by anchor drag to convert pixel to data-space. */
4573
+ xInvert?: ScaleInvert;
4574
+ /** Scale inversion anchors for the y axis. Used by anchor drag to convert pixel to data-space. */
4575
+ yInvert?: ScaleInvert;
4234
4576
  /** Faceted (small-multiples) layout. When present, renderers iterate panels instead of using top-level marks/axes. */
4235
4577
  facet?: FacetLayout;
4578
+ /**
4579
+ * Resolved rendering backend for point marks. Absent means `'svg'`.
4580
+ *
4581
+ * ADVISORY metadata only: it tells the mount and export layers that a canvas
4582
+ * mark layer is worth creating for this layout. The SVG renderer keys solely
4583
+ * on its own `canvasMarks` render option and never reads this field, so a
4584
+ * server-side or export render of a canvas-mode layout still produces
4585
+ * full-fidelity SVG.
4586
+ */
4587
+ markRenderMode?: 'svg' | 'canvas';
4236
4588
  }
4237
4589
  /** A resolved column definition with computed properties. */
4238
4590
  interface ResolvedColumn {
@@ -4648,7 +5000,7 @@ interface CompileWarning {
4648
5000
  context?: Record<string, unknown>;
4649
5001
  }
4650
5002
  /** Resolved focus target for map camera framing. */
4651
- interface MapFocusLayout {
5003
+ interface GeoMapFocusLayout {
4652
5004
  target: {
4653
5005
  x: number;
4654
5006
  y: number;
@@ -4659,7 +5011,7 @@ interface MapFocusLayout {
4659
5011
  ids: Array<string | number>;
4660
5012
  }
4661
5013
  /** A resolved map feature mark with computed SVG path and fill. */
4662
- interface MapFeatureMark {
5014
+ interface GeoMapFeatureMark {
4663
5015
  type: 'map-feature';
4664
5016
  /** SVG path `d` attribute for this feature's shape. */
4665
5017
  path: string;
@@ -4690,7 +5042,7 @@ interface MapFeatureMark {
4690
5042
  centroid: [number, number];
4691
5043
  }
4692
5044
  /** A resolved map point mark with projected coordinates and visual properties. */
4693
- interface MapPointMark {
5045
+ interface GeoMapPointMark {
4694
5046
  type: 'map-point';
4695
5047
  /** Projected center x in map-local coordinates. */
4696
5048
  cx: number;
@@ -4716,7 +5068,7 @@ interface MapPointMark {
4716
5068
  animationIndex: number;
4717
5069
  }
4718
5070
  /** Border paths for the map (interior borders and coastline/outline). */
4719
- interface MapBorders {
5071
+ interface GeoMapBorders {
4720
5072
  /** SVG path `d` for interior borders between features. */
4721
5073
  interiorPath: string;
4722
5074
  /** SVG path `d` for the outer boundary / coastline. */
@@ -4727,23 +5079,23 @@ interface MapBorders {
4727
5079
  outlineStroke: string;
4728
5080
  }
4729
5081
  /**
4730
- * MapLayout: the complete engine output for map visualizations.
5082
+ * GeoMapLayout: the complete engine output for map visualizations.
4731
5083
  *
4732
5084
  * Contains everything an adapter needs to render the map: dimensions,
4733
5085
  * chrome, feature paths, borders, legend, tooltip descriptors, and
4734
5086
  * accessibility metadata.
4735
5087
  */
4736
- interface MapLayout {
5088
+ interface GeoMapLayout {
4737
5089
  /** The map drawing area (after chrome and legend are subtracted). */
4738
5090
  area: Rect;
4739
5091
  /** Resolved chrome text elements with positions and styles. */
4740
5092
  chrome: ResolvedChrome;
4741
5093
  /** Resolved feature marks with paths, fills, and joined data. */
4742
- features: MapFeatureMark[];
5094
+ features: GeoMapFeatureMark[];
4743
5095
  /** Border paths (interior mesh and outline). */
4744
- borders: MapBorders;
5096
+ borders: GeoMapBorders;
4745
5097
  /** Resolved point marks for the symbol layer (empty array if no points layer). */
4746
- pointMarks: MapPointMark[];
5098
+ pointMarks: GeoMapPointMark[];
4747
5099
  /** Categorical legend for the point color channel (null if no point color). */
4748
5100
  pointCategoricalLegend: CategoricalLegendLayout | null;
4749
5101
  /** Continuous legend for the point color channel (null if no point color). */
@@ -4776,7 +5128,7 @@ interface MapLayout {
4776
5128
  height: number;
4777
5129
  };
4778
5130
  /** Resolved focus target for camera framing (null if no focus). */
4779
- focus: MapFocusLayout | null;
5131
+ focus: GeoMapFocusLayout | null;
4780
5132
  }
4781
5133
  /** A resolved bar list row with computed positions and visual properties. */
4782
5134
  interface BarListRowMark {
@@ -4867,6 +5219,14 @@ interface CompileOptions {
4867
5219
  width: number;
4868
5220
  /** Total available height in pixels. */
4869
5221
  height: number;
5222
+ /**
5223
+ * How chrome height interacts with the height budget. Mirrors the spec-level
5224
+ * `chromeLayout`; the engine reads whichever is set (spec wins).
5225
+ *
5226
+ * - `'subtract'` (default): `height` is the fixed total; chrome shrinks the plot.
5227
+ * - `'grow'`: `height` is the plot budget; the SVG grows by the chrome height.
5228
+ */
5229
+ chromeLayout?: 'subtract' | 'grow';
4870
5230
  /** Theme overrides. */
4871
5231
  theme?: ThemeConfig;
4872
5232
  /**
@@ -4877,6 +5237,26 @@ interface CompileOptions {
4877
5237
  * before calling compile. The engine always receives a resolved boolean.
4878
5238
  */
4879
5239
  darkMode?: boolean;
5240
+ /**
5241
+ * Rendering backend for point marks, mirroring vega-embed's `renderer`
5242
+ * embed option: backend choice is host policy, not part of the spec.
5243
+ * High-cardinality scatter plots draw thousands of SVG circles, which is
5244
+ * what makes their entrance and update transitions stutter; a canvas layer
5245
+ * draws the same dots in a handful of batched paint calls.
5246
+ *
5247
+ * - `'auto'` (default): canvas above 1,000 compiled point marks, SVG below.
5248
+ * - `'svg'`: always SVG, whatever the point count.
5249
+ * - `'canvas'`: always canvas, whatever the point count.
5250
+ *
5251
+ * Canvas mode trades per-mark keyboard focus and edit-mode point selection
5252
+ * (the screen-reader data table still carries every row), and draws the
5253
+ * trendline above the dots even when `trendline.layer` is `'below'`.
5254
+ * Tooltips, hover, and click callbacks work the same in both modes.
5255
+ *
5256
+ * Ignored with a console warning for non-point marks, and for faceted,
5257
+ * layered, and sparkline charts.
5258
+ */
5259
+ renderer?: 'auto' | 'svg' | 'canvas';
4880
5260
  /** Whether to show the tryOpenData.ai watermark. Defaults to true. */
4881
5261
  watermark?: boolean;
4882
5262
  /**
@@ -4925,6 +5305,13 @@ interface CompileOptions {
4925
5305
  * different area than the one the axes are rendered in.
4926
5306
  */
4927
5307
  frozenChartArea?: Rect;
5308
+ /**
5309
+ * Marks this compile as one leaf (or the primary spec) of a multi-leaf layer.
5310
+ * Set by compileLayer; callers should not set it. Only consumer today is the
5311
+ * canvas mark-layer resolution, which refuses canvas mode for layered charts
5312
+ * because the layer layout concatenates marks from several compiles.
5313
+ */
5314
+ layered?: boolean;
4928
5315
  }
4929
5316
  /** Extended compile options for table visualizations. */
4930
5317
  interface CompileTableOptions extends CompileOptions {
@@ -5445,12 +5832,20 @@ declare function computeXAxisExtentFromLabels(input: XAxisExtentInput): number;
5445
5832
  */
5446
5833
  declare function maxRotatedLabelWidth(tickAngle: number, tickFontSize: number): number;
5447
5834
  /**
5448
- * Truncate a rotated tick label with an ellipsis so it fits inside the capped
5449
- * reservation. Returns the label unchanged when it already fits.
5835
+ * Truncate a label with an ellipsis so it fits inside an explicit pixel budget.
5836
+ * Returns the label unchanged when it already fits.
5450
5837
  *
5451
5838
  * Binary-search on character count against the real measure function, so it
5452
5839
  * respects proportional fonts rather than assuming a fixed character width.
5453
5840
  */
5841
+ declare function truncateToWidth(label: string, budget: number, fontSize: number, fontWeight: number, measure?: (text: string, fontSize: number, fontWeight?: number) => number): string;
5842
+ /**
5843
+ * Truncate a rotated tick label with an ellipsis so it fits inside the capped
5844
+ * reservation. Returns the label unchanged when it already fits.
5845
+ *
5846
+ * Delegates to `truncateToWidth` with the budget derived from the rotation
5847
+ * geometry, so the binary-search stays in one place.
5848
+ */
5454
5849
  declare function truncateRotatedLabel(label: string, tickAngle: number, tickFontSize: number, tickFontWeight: number, measure?: (text: string, fontSize: number, fontWeight?: number) => number): string;
5455
5850
 
5456
5851
  /**
@@ -5627,12 +6022,22 @@ declare function buildTemporalFormatter(formatStr: string | undefined): ((value:
5627
6022
  * @param data - The data array.
5628
6023
  */
5629
6024
  declare function generateAltText(spec: ChartSpec, data: DataRow[]): string;
6025
+ /**
6026
+ * Maximum number of data rows in the screen-reader table. A 50k-point scatter
6027
+ * would otherwise put 50k hidden rows in the DOM.
6028
+ */
6029
+ declare const MAX_SR_TABLE_ROWS = 1000;
5630
6030
  /**
5631
6031
  * Generate a tabular data fallback for screen readers.
5632
6032
  *
5633
6033
  * Returns a 2D array where the first row is headers and subsequent
5634
6034
  * rows are data values. Only includes fields referenced in the encoding.
5635
6035
  *
6036
+ * Data rows are capped at MAX_SR_TABLE_ROWS (the header row does not count
6037
+ * against the cap). SCOPE: this caps the chart compile path only. Graph,
6038
+ * sankey, tilemap and map build their `dataTableFallback` independently and
6039
+ * stay uncapped.
6040
+ *
5636
6041
  * @param spec - The chart spec.
5637
6042
  * @param data - The data array.
5638
6043
  */
@@ -5885,4 +6290,4 @@ declare const CSS_TOKEN_ROOT_SELECTORS: readonly string[];
5885
6290
  declare const CSS_TOKENS: readonly CssTokenDef[];
5886
6291
  declare function cssTokenDefault(name: string, mode: 'light' | 'dark'): string;
5887
6292
 
5888
- 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 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_PALETTE, 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 ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ChromeThemeOverride, type CircleEncoding, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type CompileWarning, 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 DateGranularity, 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, FOOTNOTE_LINE_HEIGHT, type FacetChannel, type FacetLayout, type FacetPanelLayout, type FieldFormatContext, type FieldPredicate, type FieldRef, type FieldType, type FillPatternType, type FilterPredicate, type FilterTransform, type FlagTableCell, type FoldTransform, GRAPH_ENCODING_RULES, type GradientColorStop, type GradientDef, type GradientLegendLayout, type GradientStop, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphSpec, type GraphSpecWithoutData, type Gridline, HEIGHT_CRAMPED_MAX, HEIGHT_SHORT_MAX, HPAD_COMPACT_FRACTION, HPAD_COMPACT_MIN, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type ImageColumnConfig, type ImageTableCell, 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, type MapBorders, type MapEncoding, type MapFeatureMark, type MapFocus, type MapFocusLayout, type MapGeo, type MapLayout, type MapPointMark, type MapPointsLayer, type MapProjection, type MapSpec, type MapSpecWithoutData, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkType, type MeasureTextFn, type Metric, NARROW_VIEWPORT_MAX, type NodeOverride, type NumberFormatter, OFFSET_STRATEGIES, type OffsetStrategy, type PaginationState, type ParliamentEncoding, type Point, type PointEncoding, type PointMark, type RadialGradient, type RangeAnnotation, type RangeEncoding, 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 ResolvedColumn, type ResolvedFillPattern, type ResolvedLabel, type ResolvedMetricBar, type ResolvedMetricCell, type ResolvedSeriesSearch, type ResolvedTheme, 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 ScaleType, type SequentialPalette, type SeriesSearchConfig, type SeriesStrategy, type SeriesStyle, type SizeLegendCircle, type SizeLegendLayout, type SortByField, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type StoredVizSpec, TICK_LABEL_OFFSET, TICK_LINE_HEIGHT_FACTOR, TOP_PAD_EXTRA_NARROW, TOP_PAD_NARROW_MAX, type TableBuilderOptions, type TableCell, type TableCellBase, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, 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 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 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, buildCompactStepFormatter, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, columnChart, computeChrome, computeFieldFormatContext, computeLabelBounds, computeXAxisExtentFromLabels, contrastRatio, cssTokenDefault, dataTable, deepMergeSpec, defaultNumberFormatter, 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, isGradientDef, isGraphSpec, isLayerSpec, isMapSpec, isOpaqueColor, isRangeAnnotation, isRefLineAnnotation, isSankeySpec, isTableSpec, isTextAnnotation, isTileMapSpec, isValueDef, isYearContext, lineChart, maxRotatedLabelWidth, meetsAA, overlapArea, pickLabelColor, pieChart, resolveCollisions, resolveMarkDef, resolveMarkType, resolveMeasurer, resolveNumberFormatter, resolveSchemeName, resolveTheme, scatterChart, simulateColorBlindness, textAscent, tileMap, truncateRotatedLabel, wire, wrapText };
6293
+ 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 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_PALETTE, 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 ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ChromeThemeOverride, type CircleEncoding, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type CompileWarning, 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 DateGranularity, 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, FOOTNOTE_LINE_HEIGHT, type FacetChannel, type FacetLayout, type FacetPanelLayout, type FieldFormatContext, 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 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_SHORT_MAX, HPAD_COMPACT_FRACTION, HPAD_COMPACT_MIN, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type ImageColumnConfig, type ImageTableCell, 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_SR_TABLE_ROWS, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkType, type MeasureTextFn, type Metric, NARROW_VIEWPORT_MAX, type NodeOverride, type NumberFormatter, OFFSET_STRATEGIES, type OffsetStrategy, type PaginationState, type ParliamentEncoding, type Point, type PointEncoding, type PointMark, type RadialGradient, type RangeAnnotation, type RangeEncoding, 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 ResolvedColumn, type ResolvedFillPattern, type ResolvedLabel, type ResolvedMetricBar, type ResolvedMetricCell, type ResolvedSeriesSearch, type ResolvedTheme, 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 StoredVizSpec, TICK_LABEL_OFFSET, TICK_LINE_HEIGHT_FACTOR, TOP_PAD_EXTRA_NARROW, TOP_PAD_NARROW_MAX, type TableBuilderOptions, type TableCell, type TableCellBase, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, 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 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, buildCompactStepFormatter, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, columnChart, computeChrome, computeFieldFormatContext, computeLabelBounds, computeXAxisExtentFromLabels, contrastRatio, cssTokenDefault, dataTable, deepMergeSpec, defaultNumberFormatter, 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, lineChart, maxRotatedLabelWidth, meetsAA, overlapArea, pickLabelColor, pieChart, resolveCollisions, resolveMarkDef, resolveMarkType, resolveMeasurer, resolveNumberFormatter, resolveSchemeName, resolveTheme, scatterChart, simulateColorBlindness, textAscent, tileMap, truncateRotatedLabel, truncateToWidth, wire, wrapText };