@opendata-ai/openchart-engine 7.11.0 → 8.0.0-rc.10

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 (160) hide show
  1. package/dist/index.d.ts +124 -14
  2. package/dist/index.js +16254 -9417
  3. package/dist/index.js.map +1 -1
  4. package/package.json +11 -4
  5. package/src/__tests__/__snapshots__/compile-snapshot.test.ts.snap +232 -56
  6. package/src/__tests__/annotation-behavior.test.ts +852 -0
  7. package/src/__tests__/axes.test.ts +50 -3
  8. package/src/__tests__/compile-chart.test.ts +30 -0
  9. package/src/__tests__/compile-footnotes.test.ts +277 -0
  10. package/src/__tests__/compile-layer.test.ts +120 -1
  11. package/src/__tests__/facet.test.ts +144 -0
  12. package/src/__tests__/helpers/invariants.ts +54 -20
  13. package/src/__tests__/known-bugs.test.ts +455 -2
  14. package/src/__tests__/legend.test.ts +69 -4
  15. package/src/__tests__/ranking-recipes.test.ts +260 -0
  16. package/src/__tests__/scales.test.ts +9 -3
  17. package/src/__tests__/series-search.test.ts +92 -0
  18. package/src/__tests__/spec-sugar.test.ts +801 -0
  19. package/src/__tests__/you-draw-it.test.ts +160 -0
  20. package/src/annotations/__tests__/compute.test.ts +207 -92
  21. package/src/annotations/__tests__/geometry.test.ts +66 -0
  22. package/src/annotations/__tests__/resolve-text.test.ts +527 -27
  23. package/src/annotations/__tests__/rich-text.test.ts +91 -0
  24. package/src/annotations/__tests__/thinning.test.ts +148 -0
  25. package/src/annotations/collisions.ts +130 -84
  26. package/src/annotations/compute.ts +83 -85
  27. package/src/annotations/constants.ts +116 -6
  28. package/src/annotations/geometry.ts +228 -77
  29. package/src/annotations/move.ts +135 -0
  30. package/src/annotations/placement.ts +62 -14
  31. package/src/annotations/resolve-range.ts +2 -0
  32. package/src/annotations/resolve-refline.ts +2 -0
  33. package/src/annotations/resolve-text.ts +318 -111
  34. package/src/annotations/rich-text.ts +65 -0
  35. package/src/annotations/thinning.ts +84 -10
  36. package/src/barlist/compile-barlist.ts +16 -6
  37. package/src/charts/_shared/format-label-value.ts +9 -8
  38. package/src/charts/bar/__tests__/compute.test.ts +57 -10
  39. package/src/charts/bar/__tests__/labels.test.ts +5 -4
  40. package/src/charts/bar/compute.ts +2 -6
  41. package/src/charts/bar/index.ts +8 -1
  42. package/src/charts/bar/labels.ts +3 -3
  43. package/src/charts/beeswarm/__tests__/compute.test.ts +280 -0
  44. package/src/charts/beeswarm/__tests__/dodge.test.ts +148 -0
  45. package/src/charts/beeswarm/compute.ts +203 -0
  46. package/src/charts/beeswarm/dodge.ts +155 -0
  47. package/src/charts/beeswarm/index.ts +32 -0
  48. package/src/charts/builtin.ts +12 -1
  49. package/src/charts/calendar/__tests__/compute.test.ts +417 -0
  50. package/src/charts/calendar/compute.ts +319 -0
  51. package/src/charts/calendar/index.ts +32 -0
  52. package/src/charts/column/__tests__/compute.test.ts +21 -7
  53. package/src/charts/column/__tests__/labels.test.ts +76 -1
  54. package/src/charts/column/compute.ts +2 -6
  55. package/src/charts/column/index.ts +10 -2
  56. package/src/charts/column/labels.ts +95 -21
  57. package/src/charts/dot/index.ts +8 -1
  58. package/src/charts/dot/labels.ts +3 -3
  59. package/src/charts/line/__tests__/compute.test.ts +15 -19
  60. package/src/charts/line/area.ts +8 -23
  61. package/src/charts/line/compute.ts +32 -2
  62. package/src/charts/parliament/__tests__/compute.test.ts +411 -0
  63. package/src/charts/parliament/compute.ts +313 -0
  64. package/src/charts/parliament/index.ts +32 -0
  65. package/src/charts/pie/__tests__/compute.test.ts +103 -0
  66. package/src/charts/pie/compute.ts +63 -8
  67. package/src/charts/pie/labels.ts +1 -0
  68. package/src/charts/range/__tests__/compute.test.ts +486 -0
  69. package/src/charts/range/compute.ts +273 -0
  70. package/src/charts/range/index.ts +82 -0
  71. package/src/charts/range/labels.ts +169 -0
  72. package/src/charts/rect/__tests__/compute.test.ts +120 -0
  73. package/src/charts/rect/index.ts +127 -0
  74. package/src/charts/scatter/compute.ts +7 -21
  75. package/src/charts/text/__tests__/compute.test.ts +307 -0
  76. package/src/charts/text/index.ts +44 -7
  77. package/src/charts/tick/__tests__/compute.test.ts +75 -0
  78. package/src/charts/tick/index.ts +7 -4
  79. package/src/charts/utils.ts +5 -3
  80. package/src/charts/waffle/__tests__/compute.test.ts +305 -0
  81. package/src/charts/waffle/compute.ts +197 -0
  82. package/src/charts/waffle/index.ts +31 -0
  83. package/src/compile/__tests__/color-scale-reverse.test.ts +89 -0
  84. package/src/compile/__tests__/data-clip.test.ts +68 -0
  85. package/src/compile/__tests__/fill-patterns.test.ts +154 -0
  86. package/src/compile/__tests__/size-scale.test.ts +108 -0
  87. package/src/compile/color-scale-range.ts +54 -33
  88. package/src/compile/data-clip.ts +21 -6
  89. package/src/compile/fill-patterns.ts +74 -0
  90. package/src/compile/layer.ts +121 -21
  91. package/src/compile/size-scale.ts +141 -0
  92. package/src/compile/spec-sugar.ts +767 -0
  93. package/src/compile/you-draw-it.ts +123 -0
  94. package/src/compile.ts +415 -110
  95. package/src/compiler/__tests__/a11y-warnings.test.ts +148 -0
  96. package/src/compiler/__tests__/fixtures/vl-parity/axis-null.json +19 -0
  97. package/src/compiler/__tests__/fixtures/vl-parity/color-value.json +20 -0
  98. package/src/compiler/__tests__/fixtures/vl-parity/count-aggregate.json +22 -0
  99. package/src/compiler/__tests__/fixtures/vl-parity/data-values.json +19 -0
  100. package/src/compiler/__tests__/fixtures/vl-parity/layer-axis-null.json +14 -0
  101. package/src/compiler/__tests__/fixtures/vl-parity/layer-count.json +34 -0
  102. package/src/compiler/__tests__/fixtures/vl-parity/layer-data-values.json +22 -0
  103. package/src/compiler/__tests__/fixtures/vl-parity/layer-legend-null.json +41 -0
  104. package/src/compiler/__tests__/fixtures/vl-parity/layer-scheme.json +38 -0
  105. package/src/compiler/__tests__/fixtures/vl-parity/layer-sort.json +28 -0
  106. package/src/compiler/__tests__/fixtures/vl-parity/layer-theta.json +28 -0
  107. package/src/compiler/__tests__/fixtures/vl-parity/layer-title.json +30 -0
  108. package/src/compiler/__tests__/fixtures/vl-parity/layer-value-def.json +29 -0
  109. package/src/compiler/__tests__/fixtures/vl-parity/legend-null.json +32 -0
  110. package/src/compiler/__tests__/fixtures/vl-parity/scheme.json +25 -0
  111. package/src/compiler/__tests__/fixtures/vl-parity/sort-by-value.json +19 -0
  112. package/src/compiler/__tests__/fixtures/vl-parity/theta-arc.json +19 -0
  113. package/src/compiler/__tests__/fixtures/vl-parity/title-subtitle.json +21 -0
  114. package/src/compiler/__tests__/fixtures/vl-parity/width-height.json +23 -0
  115. package/src/compiler/__tests__/keys.test.ts +3 -9
  116. package/src/compiler/__tests__/normalize.test.ts +65 -1
  117. package/src/compiler/__tests__/validate-did-you-mean.test.ts +170 -0
  118. package/src/compiler/__tests__/validate-near-miss.test.ts +251 -0
  119. package/src/compiler/__tests__/validate.test.ts +258 -0
  120. package/src/compiler/__tests__/vl-parity.test.ts +68 -0
  121. package/src/compiler/a11y-warnings.ts +110 -0
  122. package/src/compiler/keys.ts +5 -4
  123. package/src/compiler/normalize.ts +151 -7
  124. package/src/compiler/types.ts +11 -0
  125. package/src/compiler/validate.ts +961 -32
  126. package/src/endpoint-labels/__tests__/compute.test.ts +88 -0
  127. package/src/endpoint-labels/compute.ts +40 -12
  128. package/src/endpoint-labels/format.ts +45 -15
  129. package/src/endpoint-labels/predict.ts +50 -36
  130. package/src/format/__tests__/field-format.test.ts +164 -0
  131. package/src/format/field-format.ts +27 -0
  132. package/src/geo/__tests__/compile-map.test.ts +1128 -0
  133. package/src/geo/compile-map.ts +1376 -0
  134. package/src/geo/join.ts +115 -0
  135. package/src/geo/projections.ts +65 -0
  136. package/src/geo/types.ts +26 -0
  137. package/src/graphs/__tests__/compile-graph.test.ts +25 -0
  138. package/src/graphs/compile-graph.ts +27 -18
  139. package/src/index.ts +20 -2
  140. package/src/layout/axes/ticks.ts +59 -10
  141. package/src/layout/axes.ts +35 -6
  142. package/src/layout/dimensions.ts +139 -83
  143. package/src/layout/facet.ts +14 -3
  144. package/src/layout/plan.ts +83 -33
  145. package/src/layout/scales.ts +132 -15
  146. package/src/legend/__tests__/continuous.test.ts +318 -0
  147. package/src/legend/__tests__/size.test.ts +348 -0
  148. package/src/legend/__tests__/suppression.test.ts +17 -1
  149. package/src/legend/compute.ts +123 -16
  150. package/src/legend/continuous.ts +327 -0
  151. package/src/legend/size.ts +407 -0
  152. package/src/legend/suppression.ts +8 -7
  153. package/src/sankey/compile-sankey.ts +31 -19
  154. package/src/tables/format-cells.ts +16 -7
  155. package/src/tilemap/__tests__/compile-tilemap.test.ts +39 -0
  156. package/src/tilemap/compile-tilemap.ts +24 -7
  157. package/src/tooltips/__tests__/compute.test.ts +2 -2
  158. package/src/tooltips/compute.ts +422 -41
  159. package/src/transforms/__tests__/conditional.test.ts +18 -0
  160. package/src/transforms/aggregate.ts +2 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _opendata_ai_openchart_core from '@opendata-ai/openchart-core';
2
- import { LegendLayout, ResolvedChrome, TooltipContent, A11yMetadata, ResolvedTheme, CompileOptions, ChartLayout, LayerSpec, CompileTableOptions, TableLayout, ResolvedAnimationPhase, AnimationSpec, ResolvedAnimation, Point, DataRow, BarListEncoding, ThemeConfig, DarkMode, TileMapEncoding, TileMapPalette, LegendConfig, MarkType, MarkDef, Encoding, ChromeText, Annotation, LabelConfig, Display, ColumnConfig, GraphSpec, GraphEncoding, GraphLayoutConfig, NodeOverride, SankeyEncoding, SankeyNodeAlign, SankeyLinkColor, ScaleType, EncodingChannel, Rect, LayoutStrategy, VizSpec, Mark, BinTransform, CalculateTransform, ConditionalValueDef, FilterPredicate, TimeUnitTransform, Transform } from '@opendata-ai/openchart-core';
3
- export { BarListLayout, BarListSpec, ChartLayout, ChartSpec, CompileOptions, CompileTableOptions, GraphLayout, GraphSpec, LayerSpec, SankeyLayout, SankeySpec, TableLayout, TableSpec, TileMapLayout, TileMapSpec, VizSpec } from '@opendata-ai/openchart-core';
2
+ import { LegendLayout, ResolvedChrome, TooltipContent, A11yMetadata, ResolvedTheme, CompileOptions, ChartLayout, LayerSpec, CompileTableOptions, TableLayout, ResolvedAnimationPhase, AnimationSpec, ResolvedAnimation, Point, DataRow, BarListEncoding, ThemeConfig, DarkMode, MapGeo, MapEncoding, LegendConfig, MapPointsLayer, TileMapEncoding, TileMapPalette, MarkType, MarkDef, Encoding, ChromeText, Annotation, LabelConfig, Display, ColumnConfig, GraphSpec, GraphEncoding, GraphLayoutConfig, NodeOverride, SankeyEncoding, SankeyNodeAlign, SankeyLinkColor, ScaleType, EncodingChannel, FieldFormatContext, Rect, LayoutStrategy, VizSpec, Mark, BinTransform, CalculateTransform, ConditionalValueDef, FilterPredicate, TimeUnitTransform, Transform } from '@opendata-ai/openchart-core';
3
+ export { BarListLayout, BarListSpec, ChartLayout, ChartSpec, CompileOptions, CompileTableOptions, GraphLayout, GraphSpec, LayerSpec, MapLayout, MapSpec, SankeyLayout, SankeySpec, TableLayout, TableSpec, TileMapLayout, TileMapSpec, VizSpec } from '@opendata-ai/openchart-core';
4
4
  import { ScaleLinear, ScaleTime, ScaleLogarithmic, ScalePower, ScaleSymLog, ScaleBand, ScalePoint, ScaleOrdinal, ScaleQuantile, ScaleQuantize, ScaleThreshold } from 'd3-scale';
5
5
 
6
6
  /**
@@ -113,11 +113,12 @@ interface GraphCompilation {
113
113
  * ChartLayout with positions, colors, and marks ready for rendering.
114
114
  *
115
115
  * @param spec - Raw chart spec (validated and normalized internally).
116
- * @param options - Compile options (width, height, theme, darkMode).
116
+ * @param optionsInput - Compile options (width, height, theme, darkMode).
117
+ * Top-level spec width/height, when present, override the option values.
117
118
  * @returns ChartLayout with all computed positions.
118
119
  * @throws Error if spec is invalid or not a chart type.
119
120
  */
120
- declare function compileChart(spec: unknown, options: CompileOptions): ChartLayout;
121
+ declare function compileChart(spec: unknown, optionsInput: CompileOptions): ChartLayout;
121
122
  declare function compileLayer(spec: LayerSpec, options: CompileOptions): ChartLayout;
122
123
  /**
123
124
  * Compile a table spec into a TableLayout.
@@ -171,6 +172,19 @@ declare function compileSankey(spec: unknown, options: CompileOptions): _opendat
171
172
  * @throws Error if spec is invalid or not a tilemap type.
172
173
  */
173
174
  declare function compileTileMap(spec: unknown, options: CompileOptions): _opendata_ai_openchart_core.TileMapLayout;
175
+ /**
176
+ * Compile a map spec into a MapLayout.
177
+ *
178
+ * Takes a raw map spec, validates, normalizes, resolves theme and chrome,
179
+ * projects geo features, joins data, builds feature marks with color fills,
180
+ * and returns a MapLayout ready for rendering.
181
+ *
182
+ * @param spec - Raw map spec (validated and normalized internally).
183
+ * @param options - Compile options (width, height, theme, darkMode).
184
+ * @returns MapLayout with computed positions and visual properties.
185
+ * @throws Error if spec is invalid or not a map type.
186
+ */
187
+ declare function compileMap(spec: unknown, options: CompileOptions): _opendata_ai_openchart_core.MapLayout;
174
188
  /**
175
189
  * Compile a barlist spec into a BarListLayout.
176
190
  *
@@ -232,13 +246,6 @@ declare function clampStaggerDelay(delay: number, elementCount: number): number;
232
246
  * - null/undefined -> null sentinel
233
247
  */
234
248
  declare function serializeKeyValue(v: unknown): string;
235
- /**
236
- * Append occurrence suffixes to duplicate keys, in order.
237
- *
238
- * Only keys that appear more than once get suffixed. Unique keys pass
239
- * through unchanged so keys remain human-readable when possible.
240
- * Uses SOH (\x01) as separator to avoid collisions with real data values.
241
- */
242
249
  declare function dedupeKeys(keys: string[]): string[];
243
250
 
244
251
  /**
@@ -282,6 +289,21 @@ interface NormalizedBarListSpec {
282
289
  valueFormat?: string;
283
290
  }
284
291
 
292
+ interface NormalizedMapSpec {
293
+ type: 'map';
294
+ geo: Required<MapGeo>;
295
+ data: Record<string, unknown>[];
296
+ encoding: MapEncoding;
297
+ chrome: NormalizedChrome;
298
+ legend?: LegendConfig;
299
+ theme: ThemeConfig;
300
+ darkMode: DarkMode;
301
+ watermark: boolean;
302
+ animation?: AnimationSpec;
303
+ valueFormat?: string;
304
+ points?: MapPointsLayer;
305
+ }
306
+
285
307
  /**
286
308
  * Internal normalized tilemap spec type used by the compilation pipeline.
287
309
  *
@@ -356,6 +378,13 @@ interface NormalizedChartSpec {
356
378
  chrome: NormalizedChrome;
357
379
  /** Optional KPI metric cells, passed through unchanged. */
358
380
  metrics?: _opendata_ai_openchart_core.Metric[];
381
+ /**
382
+ * Searchable series highlight config. Present only when `seriesSearch` is
383
+ * enabled AND the spec has a categorical color encoding to search over.
384
+ */
385
+ seriesSearch?: _opendata_ai_openchart_core.SeriesSearchConfig;
386
+ /** Resolved "you draw it" config with defaults filled in. Present only when `youDrawIt` is enabled. */
387
+ youDrawIt?: _opendata_ai_openchart_core.YouDrawItConfig;
359
388
  annotations: Annotation[];
360
389
  /** Normalized label configuration with defaults applied. density, format, and prefix are always set; offsets and color stay optional. */
361
390
  labels: Required<Pick<LabelConfig, 'density' | 'format' | 'prefix'>> & Pick<LabelConfig, 'offsets' | 'color' | 'fontSize' | 'suffix'>;
@@ -374,6 +403,8 @@ interface NormalizedChartSpec {
374
403
  hiddenSeries: string[];
375
404
  /** Per-series visual style overrides. */
376
405
  seriesStyles: Record<string, _opendata_ai_openchart_core.SeriesStyle>;
406
+ /** Author accessibility overrides (alt-text description, aria-hidden opt-out). */
407
+ a11y?: _opendata_ai_openchart_core.A11yConfig;
377
408
  /** Display mode controlling chrome/axes/legend stripping. Defaults to `'full'`. */
378
409
  display: Display;
379
410
  /** Resolve configuration for independent/shared scales in faceted charts. */
@@ -425,7 +456,7 @@ interface NormalizedGraphSpec {
425
456
  watermark: boolean;
426
457
  }
427
458
  /** Discriminated union of all normalized spec types. */
428
- type NormalizedSpec = NormalizedChartSpec | NormalizedTableSpec | NormalizedGraphSpec | NormalizedSankeySpec | NormalizedTileMapSpec | NormalizedBarListSpec;
459
+ type NormalizedSpec = NormalizedChartSpec | NormalizedTableSpec | NormalizedGraphSpec | NormalizedSankeySpec | NormalizedTileMapSpec | NormalizedMapSpec | NormalizedBarListSpec;
429
460
  /** Machine-readable error code for programmatic handling. */
430
461
  type ValidationErrorCode = 'MISSING_FIELD' | 'INVALID_TYPE' | 'INVALID_VALUE' | 'ENCODING_MISMATCH' | 'DATA_FIELD_MISSING' | 'EMPTY_DATA';
431
462
  /** A single validation error with context. */
@@ -509,6 +540,8 @@ interface ResolvedScale {
509
540
  type: ResolvedScaleType;
510
541
  /** The encoding channel this scale was derived from. */
511
542
  channel: EncodingChannel;
543
+ /** Per-field formatting context (extent, allIntegers) from the ORIGINAL data. */
544
+ formatContext?: FieldFormatContext;
512
545
  }
513
546
  /** All resolved scales for a chart. */
514
547
  interface ResolvedScales {
@@ -520,16 +553,66 @@ interface ResolvedScales {
520
553
  defaultColor?: string | _opendata_ai_openchart_core.GradientDef;
521
554
  }
522
555
 
556
+ /** Default font size for annotation labels. */
557
+ declare const DEFAULT_ANNOTATION_FONT_SIZE = 13;
558
+ /** Default line height multiplier for annotation text. */
559
+ declare const DEFAULT_LINE_HEIGHT = 1.3;
560
+ /**
561
+ * Arrowhead length along the tangent. The renderer pulls the connector's line end
562
+ * back by exactly this much so the stroke stops at the open V instead of poking
563
+ * through its tip — a hand-copied duplicate on the vanilla side would silently
564
+ * drift the next time this changes.
565
+ */
566
+ declare const ARROWHEAD_LENGTH = 7;
567
+
523
568
  /**
524
569
  * Geometry utilities for annotation text bounds, connector origins, and offsets.
525
570
  */
526
571
 
572
+ /**
573
+ * Measure one run of text at a given size and weight.
574
+ *
575
+ * Deliberately takes no `fontFamily`: neither implementation could use one.
576
+ * `heuristicMeasure` below is family-blind, and the real canvas measurer gets its
577
+ * family from the `createMeasureText(fontFamily)` closure, not per call -- so a
578
+ * family passed here would be silently dropped while implying the opposite.
579
+ * `style.fontFamily` on a *resolved label* is a different thing: that one is real
580
+ * and gets rendered.
581
+ */
527
582
  type AnnotationMeasureTextFn = (text: string, font: {
528
583
  fontSize: number;
529
584
  fontWeight: number;
530
- fontFamily?: string;
531
585
  }) => number;
532
586
  declare const heuristicMeasure: AnnotationMeasureTextFn;
587
+ /** Arrowhead triangle points: tip + two base corners. */
588
+ interface ArrowheadPoints {
589
+ tip: {
590
+ x: number;
591
+ y: number;
592
+ };
593
+ baseLeft: {
594
+ x: number;
595
+ y: number;
596
+ };
597
+ baseRight: {
598
+ x: number;
599
+ y: number;
600
+ };
601
+ }
602
+
603
+ /**
604
+ * Compute arrowhead triangle geometry at a connector endpoint.
605
+ * Returns the tip (at the endpoint) and two base corners perpendicular to the
606
+ * tangent direction.
607
+ *
608
+ * @param tipX - X coordinate of the arrowhead tip
609
+ * @param tipY - Y coordinate of the arrowhead tip
610
+ * @param tangentX - X component of the tangent direction (toward the tip)
611
+ * @param tangentY - Y component of the tangent direction (toward the tip)
612
+ * @param length - Arrow length along the tangent (default ARROWHEAD_LENGTH)
613
+ * @param halfWidth - Arrow half-width perpendicular to tangent (default ARROWHEAD_HALF_WIDTH)
614
+ */
615
+ declare function computeArrowheadPoints(tipX: number, tipY: number, tangentX: number, tangentY: number, length?: number, halfWidth?: number): ArrowheadPoints;
533
616
 
534
617
  /**
535
618
  * Annotation placement engine: typed obstacles, candidate generation,
@@ -565,11 +648,36 @@ interface AnnotationContext {
565
648
  height: number;
566
649
  };
567
650
  measure: AnnotationMeasureTextFn;
651
+ /** Theme font stack, so annotation text is measured and rendered in the same face. */
652
+ fontFamily?: string;
568
653
  debugPlacement?: boolean;
569
654
  /** When true, annotations that overlap are demoted to footnote markers instead of being hidden. */
570
655
  autoThin?: boolean;
571
656
  }
572
657
 
658
+ /**
659
+ * Inline rich text for annotation labels: `**bold**` spans inside an otherwise
660
+ * regular-weight sentence. This is the NYT/Datawrapper voice — emphasis lands on
661
+ * the key phrase, not on the whole block.
662
+ */
663
+ /** One run of annotation text at a single weight. */
664
+ interface RichSpan {
665
+ text: string;
666
+ bold: boolean;
667
+ }
668
+ /** Weight bold spans are measured and rendered at. */
669
+ declare const BOLD_SPAN_FONT_WEIGHT = 700;
670
+ /**
671
+ * Parse `**bold**` markers in a single line of annotation text.
672
+ *
673
+ * Only matched pairs turn bold; an unmatched `**` renders literally, so specs
674
+ * that legitimately contain asterisks are never mangled. Empty `****` also
675
+ * renders literally (there's nothing to emphasize).
676
+ *
677
+ * The line is expected to be a single line — callers split on `\n` first.
678
+ */
679
+ declare function parseAnnotationSpans(line: string): RichSpan[];
680
+
573
681
  /**
574
682
  * Normalize a validated VizSpec, filling in all defaults.
575
683
  *
@@ -658,6 +766,8 @@ declare function getChartRenderer(type: string): ChartRenderer | undefined;
658
766
  */
659
767
  declare function clearRenderers(): void;
660
768
 
769
+ declare function facetMinHeight(panelCount: number, columns: number): number;
770
+
661
771
  /**
662
772
  * Legend row-wrap geometry.
663
773
  *
@@ -811,4 +921,4 @@ declare function runTimeUnit(data: DataRow[], transform: TimeUnitTransform): Dat
811
921
  */
812
922
  declare function runTransforms(data: DataRow[], transforms: Transform[]): DataRow[];
813
923
 
814
- export { type AnnotationContext, type AnnotationMeasureTextFn, type ChartRenderer, type CompileResult, type CompiledGraphEdge, type CompiledGraphNode, ENTER_DEFAULTS, EXIT_DEFAULTS, type GraphCompilation, type NormalizedBarListSpec, type NormalizedChartSpec, type NormalizedChrome, type NormalizedGraphSpec, type NormalizedSankeySpec, type NormalizedSpec, type NormalizedTableSpec, type NormalizedTileMapSpec, type ObstacleKind, type PlacementObstacle, type SimulationConfig, UPDATE_DEFAULTS, type ValidationError, type ValidationErrorCode, type ValidationResult, buildAreaPath, buildLinePath, clampStaggerDelay, clearRenderers, compile, compileBarList, compileChart, compileGraph, compileLayer, compileSankey, compileTable, compileTileMap, dedupeKeys, evaluatePredicate, getChartRenderer, heuristicMeasure, isConditionalValueDef, legendGap, normalizeSpec, registerChartRenderer, resolveAnimation, resolveConditionalValue, runBin, runCalculate, runFilter, runTimeUnit, runTransforms, serializeKeyValue, validateSpec };
924
+ export { ARROWHEAD_LENGTH, type AnnotationContext, type AnnotationMeasureTextFn, type ArrowheadPoints, BOLD_SPAN_FONT_WEIGHT, type ChartRenderer, type CompileResult, type CompiledGraphEdge, type CompiledGraphNode, DEFAULT_ANNOTATION_FONT_SIZE, DEFAULT_LINE_HEIGHT, ENTER_DEFAULTS, EXIT_DEFAULTS, type GraphCompilation, type NormalizedBarListSpec, type NormalizedChartSpec, type NormalizedChrome, type NormalizedGraphSpec, type NormalizedMapSpec, type NormalizedSankeySpec, type NormalizedSpec, type NormalizedTableSpec, type NormalizedTileMapSpec, type ObstacleKind, type PlacementObstacle, type RichSpan, type SimulationConfig, UPDATE_DEFAULTS, type ValidationError, type ValidationErrorCode, type ValidationResult, buildAreaPath, buildLinePath, clampStaggerDelay, clearRenderers, compile, compileBarList, compileChart, compileGraph, compileLayer, compileMap, compileSankey, compileTable, compileTileMap, computeArrowheadPoints, dedupeKeys, evaluatePredicate, facetMinHeight, getChartRenderer, heuristicMeasure, isConditionalValueDef, legendGap, normalizeSpec, parseAnnotationSpans, registerChartRenderer, resolveAnimation, resolveConditionalValue, runBin, runCalculate, runFilter, runTimeUnit, runTransforms, serializeKeyValue, validateSpec };