@opendata-ai/openchart-core 6.3.0 → 6.5.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.
package/dist/index.d.ts CHANGED
@@ -455,6 +455,8 @@ interface AnnotationOffset {
455
455
  type AnnotationAnchor = 'top' | 'bottom' | 'left' | 'right' | 'auto';
456
456
  /** Base properties shared by all annotation types. */
457
457
  interface AnnotationBase {
458
+ /** Stable identifier for selection and edit callbacks. When provided, edit events include this ID for reliable element matching. */
459
+ id?: string;
458
460
  /** Human-readable label for the annotation. */
459
461
  label?: string;
460
462
  /** Fill color for the annotation element. */
@@ -636,6 +638,53 @@ interface SeriesStyle {
636
638
  /** Opacity override (0-1). */
637
639
  opacity?: number;
638
640
  }
641
+ /**
642
+ * Named easing presets for entrance animations.
643
+ * Uses CSS linear() curves. Named 'ease' (not 'easing') to match Vega convention.
644
+ */
645
+ type AnimationEase = 'smooth' | 'snappy';
646
+ /** Stagger configuration for sequential element reveal. */
647
+ interface AnimationStagger {
648
+ /** Delay between each element in ms. Default: 30 */
649
+ delay?: number;
650
+ /** Ordering strategy. Default: 'index' (DOM order) */
651
+ order?: 'index' | 'value' | 'reverse';
652
+ }
653
+ /**
654
+ * Animation phase config. Follows Vega's enter/update/exit model.
655
+ * Each phase can be true (use defaults) or a config object.
656
+ */
657
+ interface AnimationPhaseConfig {
658
+ /** Duration in ms. Default: 500 for enter. */
659
+ duration?: number;
660
+ /** Easing preset. Default: 'smooth'. */
661
+ ease?: AnimationEase;
662
+ /** Stagger config. true = defaults, false = no stagger. Default: true for enter. */
663
+ stagger?: AnimationStagger | boolean;
664
+ }
665
+ /**
666
+ * Full animation config object. Structured as enter/update/exit phases
667
+ * following Vega's encoding set model.
668
+ *
669
+ * v1 implements enter only. update and exit reserved for v2.
670
+ */
671
+ interface AnimationConfig {
672
+ /** Entrance animation when chart first renders. */
673
+ enter?: AnimationPhaseConfig | boolean;
674
+ /** Transition animation when data updates. Reserved for v2. */
675
+ update?: AnimationPhaseConfig | boolean;
676
+ /** Exit animation when marks are removed. Reserved for v2. */
677
+ exit?: AnimationPhaseConfig | boolean;
678
+ /** Delay before annotations animate in (ms after marks). Default: 200. */
679
+ annotationDelay?: number;
680
+ }
681
+ /**
682
+ * Animation spec property.
683
+ * - true: enable entrance animation with sensible defaults
684
+ * - false/omitted: no animation (current behavior)
685
+ * - AnimationConfig: full control via enter/update/exit phases
686
+ */
687
+ type AnimationSpec = boolean | AnimationConfig;
639
688
  /**
640
689
  * Breakpoint-conditional overrides for chart specs.
641
690
  *
@@ -652,6 +701,8 @@ interface ChartSpecOverride {
652
701
  legend?: LegendConfig;
653
702
  /** Override annotations at this breakpoint. */
654
703
  annotations?: Annotation[];
704
+ /** Override animation at this breakpoint. */
705
+ animation?: AnimationSpec;
655
706
  }
656
707
  /**
657
708
  * Chart specification: the primary input for standard chart types.
@@ -697,6 +748,13 @@ interface ChartSpec {
697
748
  * are shallow-merged into the spec before layout computation.
698
749
  */
699
750
  overrides?: Partial<Record<Breakpoint, ChartSpecOverride>>;
751
+ /**
752
+ * Animation configuration.
753
+ * - true: enable entrance animation with sensible defaults
754
+ * - false/omitted: no animation (current behavior)
755
+ * - AnimationConfig: full control via enter/update/exit phases
756
+ */
757
+ animation?: AnimationSpec;
700
758
  }
701
759
  /**
702
760
  * Table specification: input for data table visualizations.
@@ -731,6 +789,8 @@ interface TableSpec {
731
789
  compact?: boolean;
732
790
  /** Whether the table adapts to container width. Defaults to true. */
733
791
  responsive?: boolean;
792
+ /** Animation configuration for entrance animations. */
793
+ animation?: AnimationSpec;
734
794
  }
735
795
  /** Graph node: must have an id, plus arbitrary data fields. */
736
796
  interface GraphNode {
@@ -832,6 +892,8 @@ interface LayerSpec {
832
892
  resolve?: ResolveConfig;
833
893
  /** Hidden series names. */
834
894
  hiddenSeries?: string[];
895
+ /** Animation configuration. */
896
+ animation?: AnimationSpec;
835
897
  }
836
898
  /**
837
899
  * Top-level visualization spec: union discriminated by structural shape.
@@ -1083,9 +1145,42 @@ declare const GRAPH_ENCODING_RULES: Record<string, GraphChannelRule>;
1083
1145
 
1084
1146
  /** Identifies a specific chrome text element (title, subtitle, source, byline, footer). */
1085
1147
  type ChromeKey = 'title' | 'subtitle' | 'source' | 'byline' | 'footer';
1148
+ /**
1149
+ * Reference to an editable chart element.
1150
+ * Carries enough info to find the element in both the spec and the DOM.
1151
+ * The `annotation` variant uses two-tier identity: `id` (when the consumer provides one)
1152
+ * and `index` (always available, position in the spec's annotations array).
1153
+ */
1154
+ type ElementRef = {
1155
+ type: 'annotation';
1156
+ index: number;
1157
+ id?: string;
1158
+ } | {
1159
+ type: 'chrome';
1160
+ key: ChromeKey;
1161
+ } | {
1162
+ type: 'series-label';
1163
+ series: string;
1164
+ } | {
1165
+ type: 'legend';
1166
+ } | {
1167
+ type: 'legend-entry';
1168
+ series: string;
1169
+ index: number;
1170
+ };
1171
+ /** Helper constructors for ergonomic ElementRef creation. */
1172
+ declare const elementRef: {
1173
+ readonly annotation: (index: number, id?: string) => ElementRef;
1174
+ readonly chrome: (key: ChromeKey) => ElementRef;
1175
+ readonly seriesLabel: (series: string) => ElementRef;
1176
+ readonly legend: () => ElementRef;
1177
+ readonly legendEntry: (series: string, index: number) => ElementRef;
1178
+ };
1086
1179
  /**
1087
1180
  * Discriminated union of all element edit events.
1088
- * Fired by the `onEdit` callback when any editable chart element is repositioned.
1181
+ * Fired by the `onEdit` callback when any editable chart element is modified.
1182
+ * Covers repositioning (drag), deletion (Delete key), and text editing (double-click).
1183
+ * Selection events (onSelect/onDeselect) are separate callbacks, not part of this union.
1089
1184
  */
1090
1185
  type ElementEdit = {
1091
1186
  type: 'annotation';
@@ -1120,6 +1215,14 @@ type ElementEdit = {
1120
1215
  type: 'legend-toggle';
1121
1216
  series: string;
1122
1217
  hidden: boolean;
1218
+ } | {
1219
+ type: 'delete';
1220
+ element: ElementRef;
1221
+ } | {
1222
+ type: 'text-edit';
1223
+ element: ElementRef;
1224
+ oldText: string;
1225
+ newText: string;
1123
1226
  };
1124
1227
  /**
1125
1228
  * Event fired when a user interacts with a data mark (bar, point, line segment, etc.).
@@ -1159,8 +1262,14 @@ interface ChartEventHandlers {
1159
1262
  onAnnotationClick?: (annotation: Annotation, event: MouseEvent) => void;
1160
1263
  /** Called when a text annotation label is dragged to a new position. */
1161
1264
  onAnnotationEdit?: (annotation: TextAnnotation, updatedOffset: AnnotationOffset) => void;
1162
- /** Unified edit callback. Fires for any editable chart element (annotations, chrome, legend, series labels). */
1265
+ /** Unified edit callback. Fires for any spec-modifying edit (repositioning, deletion, text editing). */
1163
1266
  onEdit?: (edit: ElementEdit) => void;
1267
+ /** Fired when an element is selected via click or programmatic select(). */
1268
+ onSelect?: (element: ElementRef) => void;
1269
+ /** Fired when the current element is deselected (click empty, Escape, or new selection replaces old). */
1270
+ onDeselect?: (element: ElementRef) => void;
1271
+ /** Fired when inline text editing commits. Also flows through onEdit as a 'text-edit' event. */
1272
+ onTextEdit?: (element: ElementRef, oldText: string, newText: string) => void;
1164
1273
  }
1165
1274
 
1166
1275
  /**
@@ -1469,6 +1578,8 @@ interface LineMark {
1469
1578
  label?: ResolvedLabel;
1470
1579
  /** Accessibility attributes. */
1471
1580
  aria: MarkAria;
1581
+ /** Index for stagger animation ordering. */
1582
+ animationIndex?: number;
1472
1583
  }
1473
1584
  /**
1474
1585
  * Area mark: a filled region bounded by a top line and a baseline.
@@ -1508,6 +1619,8 @@ interface AreaMark {
1508
1619
  }>;
1509
1620
  /** Accessibility attributes. */
1510
1621
  aria: MarkAria;
1622
+ /** Index for stagger animation ordering. */
1623
+ animationIndex?: number;
1511
1624
  }
1512
1625
  /**
1513
1626
  * Rect mark: a rectangle.
@@ -1537,6 +1650,14 @@ interface RectMark {
1537
1650
  label?: ResolvedLabel;
1538
1651
  /** Accessibility attributes. */
1539
1652
  aria: MarkAria;
1653
+ /** Index for stagger animation ordering. */
1654
+ animationIndex?: number;
1655
+ /** Bar orientation for animation direction. Set by the engine based on encoding. */
1656
+ orient?: 'horizontal' | 'vertical';
1657
+ /** Stacking group key (e.g. category name). Segments sharing this key animate together. */
1658
+ stackGroup?: string;
1659
+ /** Position of this segment within its stack group (0, 1, 2...). Set by engine for stacked bars. */
1660
+ stackPos?: number;
1540
1661
  }
1541
1662
  /**
1542
1663
  * Arc mark: a pie/donut slice.
@@ -1570,6 +1691,8 @@ interface ArcMark {
1570
1691
  label?: ResolvedLabel;
1571
1692
  /** Accessibility attributes. */
1572
1693
  aria: MarkAria;
1694
+ /** Index for stagger animation ordering. */
1695
+ animationIndex?: number;
1573
1696
  }
1574
1697
  /**
1575
1698
  * Point mark: a circle or dot.
@@ -1597,6 +1720,8 @@ interface PointMark {
1597
1720
  label?: ResolvedLabel;
1598
1721
  /** Accessibility attributes. */
1599
1722
  aria: MarkAria;
1723
+ /** Index for stagger animation ordering. */
1724
+ animationIndex?: number;
1600
1725
  }
1601
1726
  /**
1602
1727
  * Text mark: data-positioned text label.
@@ -1628,6 +1753,8 @@ interface TextMarkLayout {
1628
1753
  label?: ResolvedLabel;
1629
1754
  /** Accessibility attributes. */
1630
1755
  aria: MarkAria;
1756
+ /** Index for stagger animation ordering. */
1757
+ animationIndex?: number;
1631
1758
  }
1632
1759
  /**
1633
1760
  * Rule mark: a line segment between two points.
@@ -1655,6 +1782,8 @@ interface RuleMarkLayout {
1655
1782
  data: Record<string, unknown>;
1656
1783
  /** Accessibility attributes. */
1657
1784
  aria: MarkAria;
1785
+ /** Index for stagger animation ordering. */
1786
+ animationIndex?: number;
1658
1787
  }
1659
1788
  /**
1660
1789
  * Tick mark: a short line segment at a data coordinate.
@@ -1680,6 +1809,8 @@ interface TickMarkLayout {
1680
1809
  data: Record<string, unknown>;
1681
1810
  /** Accessibility attributes. */
1682
1811
  aria: MarkAria;
1812
+ /** Index for stagger animation ordering. */
1813
+ animationIndex?: number;
1683
1814
  }
1684
1815
  /** Discriminated union of all mark types. */
1685
1816
  type Mark = LineMark | AreaMark | RectMark | ArcMark | PointMark | TextMarkLayout | RuleMarkLayout | TickMarkLayout;
@@ -1716,6 +1847,8 @@ interface ResolvedLabel {
1716
1847
  interface ResolvedAnnotation {
1717
1848
  /** Original annotation type. */
1718
1849
  type: 'text' | 'range' | 'refline';
1850
+ /** Stable identifier from the spec annotation, for selection/edit callbacks. */
1851
+ id?: string;
1719
1852
  /** Label text (if any). */
1720
1853
  label?: ResolvedLabel;
1721
1854
  /** For range: the highlighted rectangle in pixel coordinates. */
@@ -1795,6 +1928,21 @@ interface A11yMetadata {
1795
1928
  /** Whether the visualization is keyboard-navigable. */
1796
1929
  keyboardNavigable: boolean;
1797
1930
  }
1931
+ /** Resolved entrance animation config with all defaults applied. */
1932
+ interface ResolvedAnimation {
1933
+ /** Whether entrance animation is enabled. */
1934
+ enabled: boolean;
1935
+ /** Duration in ms. */
1936
+ duration: number;
1937
+ /** Easing preset name. */
1938
+ ease: AnimationEase;
1939
+ /** Stagger delay between elements in ms. */
1940
+ staggerDelay: number;
1941
+ /** Stagger ordering. */
1942
+ staggerOrder: 'index' | 'value' | 'reverse';
1943
+ /** Delay before annotations animate in (ms after marks). */
1944
+ annotationDelay: number;
1945
+ }
1798
1946
  /**
1799
1947
  * ChartLayout: the complete engine output for chart visualizations.
1800
1948
  *
@@ -1830,6 +1978,8 @@ interface ChartLayout {
1830
1978
  width: number;
1831
1979
  height: number;
1832
1980
  };
1981
+ /** Resolved animation config. Present only when animation is enabled. */
1982
+ animation?: ResolvedAnimation;
1833
1983
  }
1834
1984
  /** A resolved column definition with computed properties. */
1835
1985
  interface ResolvedColumn {
@@ -1988,6 +2138,8 @@ interface TableLayout {
1988
2138
  };
1989
2139
  /** The resolved theme. */
1990
2140
  theme: ResolvedTheme;
2141
+ /** Resolved animation config. Present only when animation is enabled. */
2142
+ animation?: ResolvedAnimation;
1991
2143
  }
1992
2144
  /** A resolved graph node with computed position and visual properties. */
1993
2145
  interface GraphNodeLayout {
@@ -2634,4 +2786,4 @@ declare function scatterChart(data: DataRow[], x: FieldRef, y: FieldRef, options
2634
2786
  */
2635
2787
  declare function dataTable(data: DataRow[], options?: TableBuilderOptions): TableSpec;
2636
2788
 
2637
- export { type A11yMetadata, type AggregateOp, type Annotation, type AnnotationAnchor, type AnnotationOffset, type AnnotationPosition, type ArcMark, type AreaMark, type AxisConfig, type AxisLabelDensity, type AxisLayout, type AxisTick, BRAND_FONT_SIZE, BRAND_MIN_WIDTH, BRAND_RESERVE_WIDTH, type BarColumnConfig, type BarTableCell, type BinParams, type BinTransform, type Breakpoint, CATEGORICAL_PALETTE, CHART_ENCODING_RULES, CHART_TYPES, type CalculateExpression, type CalculateTransform, type CategoricalPalette, type CategoryColorsConfig, type CategoryTableCell, type CellStyle, type ChannelRule, type ChartBuilderOptions, type ChartEventHandlers, type ChartLayout, type ChartSpec, type ChartSpecOverride, type ChartSpecWithoutData, type ChartType, type Chrome, type ChromeDefaults, type ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type Condition, type ConditionalValueDef, DEFAULT_THEME, DIVERGING_PALETTES, type DarkMode, type DataRow, type DateGranularity, type DivergingPalette, EXTENDED_OFFSET_STRATEGIES, type ElementEdit, type Encoding, type EncodingChannel, type EncodingRule, type FieldPredicate, type FieldRef, type FieldType, type FilterPredicate, type FilterTransform, type FlagTableCell, GRAPH_ENCODING_RULES, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphSpec, type GraphSpecWithoutData, type Gridline, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type ImageColumnConfig, type ImageTableCell, type LabelCandidate, type LabelConfig, type LabelDensity, type LabelMode, type LabelPriority, type LayerSpec, type LayoutStrategy, type LegendConfig, type LegendEntry, type LegendLayout, type LegendPosition, type LineMark, type LogicalAnd, type LogicalNot, type LogicalOr, MARK_DISPLAY_NAMES, MARK_ENCODING_RULES, MARK_TYPES, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkType, type MeasureTextFn, type NodeOverride, OFFSET_STRATEGIES, type OffsetStrategy, type PaginationState, type Point, type PointMark, type RangeAnnotation, type Rect, type RectMark, type RefLineAnnotation, type ResolveConfig, type ResolveMode, type ResolvedAnnotation, type ResolvedChrome, type ResolvedChromeElement, type ResolvedColumn, type ResolvedLabel, type ResolvedTheme, type RuleMarkLayout, SEQUENTIAL_PALETTES, type ScaleConfig, type ScaleType, type SequentialPalette, type SeriesStyle, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type StoredVizSpec, type TableBuilderOptions, type TableCell, type TableCellBase, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, type TextAnnotation, type TextMarkLayout, type TextStyle, type TextTableCell, type Theme, type ThemeChromeDefaults, type ThemeColors, type ThemeConfig, type ThemeFontSizes, type ThemeFontWeights, type ThemeFonts, type ThemeSpacing, type TickMarkLayout, type TimeUnit, type TimeUnitTransform, type TooltipContent, type TooltipField, type Transform, type VizSpec, abbreviateNumber, adaptColorForDarkMode, adaptTheme, areaChart, barChart, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, columnChart, computeChrome, computeLabelBounds, contrastRatio, dataTable, detectCollision, donutChart, dotChart, estimateTextWidth, findAccessibleColor, formatDate, formatNumber, generateAltText, generateAriaLabels, generateDataTable, getBreakpoint, getHeightClass, getLayoutStrategy, inferFieldType, isChartSpec, isConditionalDef, isEncodingChannel, isGraphSpec, isLayerSpec, isRangeAnnotation, isRefLineAnnotation, isTableSpec, isTextAnnotation, lineChart, meetsAA, pieChart, resolveCollisions, resolveMarkDef, resolveMarkType, resolveTheme, scatterChart, simulateColorBlindness };
2789
+ export { type A11yMetadata, type AggregateOp, type AnimationConfig, type AnimationEase, type AnimationPhaseConfig, type AnimationSpec, type AnimationStagger, type Annotation, type AnnotationAnchor, type AnnotationOffset, type AnnotationPosition, type ArcMark, type AreaMark, type AxisConfig, type AxisLabelDensity, type AxisLayout, type AxisTick, BRAND_FONT_SIZE, BRAND_MIN_WIDTH, BRAND_RESERVE_WIDTH, type BarColumnConfig, type BarTableCell, type BinParams, type BinTransform, type Breakpoint, CATEGORICAL_PALETTE, CHART_ENCODING_RULES, CHART_TYPES, type CalculateExpression, type CalculateTransform, type CategoricalPalette, type CategoryColorsConfig, type CategoryTableCell, type CellStyle, type ChannelRule, type ChartBuilderOptions, type ChartEventHandlers, type ChartLayout, type ChartSpec, type ChartSpecOverride, type ChartSpecWithoutData, type ChartType, type Chrome, type ChromeDefaults, type ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type Condition, type ConditionalValueDef, DEFAULT_THEME, DIVERGING_PALETTES, type DarkMode, type DataRow, type DateGranularity, type DivergingPalette, EXTENDED_OFFSET_STRATEGIES, type ElementEdit, type ElementRef, type Encoding, type EncodingChannel, type EncodingRule, type FieldPredicate, type FieldRef, type FieldType, type FilterPredicate, type FilterTransform, type FlagTableCell, GRAPH_ENCODING_RULES, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphSpec, type GraphSpecWithoutData, type Gridline, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type ImageColumnConfig, type ImageTableCell, type LabelCandidate, type LabelConfig, type LabelDensity, type LabelMode, type LabelPriority, type LayerSpec, type LayoutStrategy, type LegendConfig, type LegendEntry, type LegendLayout, type LegendPosition, type LineMark, type LogicalAnd, type LogicalNot, type LogicalOr, MARK_DISPLAY_NAMES, MARK_ENCODING_RULES, MARK_TYPES, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkType, type MeasureTextFn, type NodeOverride, OFFSET_STRATEGIES, type OffsetStrategy, type PaginationState, type Point, type PointMark, type RangeAnnotation, type Rect, type RectMark, type RefLineAnnotation, type ResolveConfig, type ResolveMode, type ResolvedAnimation, type ResolvedAnnotation, type ResolvedChrome, type ResolvedChromeElement, type ResolvedColumn, type ResolvedLabel, type ResolvedTheme, type RuleMarkLayout, SEQUENTIAL_PALETTES, type ScaleConfig, type ScaleType, type SequentialPalette, type SeriesStyle, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type StoredVizSpec, type TableBuilderOptions, type TableCell, type TableCellBase, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, type TextAnnotation, type TextMarkLayout, type TextStyle, type TextTableCell, type Theme, type ThemeChromeDefaults, type ThemeColors, type ThemeConfig, type ThemeFontSizes, type ThemeFontWeights, type ThemeFonts, type ThemeSpacing, type TickMarkLayout, type TimeUnit, type TimeUnitTransform, type TooltipContent, type TooltipField, type Transform, type VizSpec, abbreviateNumber, adaptColorForDarkMode, adaptTheme, areaChart, barChart, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, columnChart, computeChrome, computeLabelBounds, contrastRatio, dataTable, detectCollision, donutChart, dotChart, elementRef, estimateTextWidth, findAccessibleColor, formatDate, formatNumber, generateAltText, generateAriaLabels, generateDataTable, getBreakpoint, getHeightClass, getLayoutStrategy, inferFieldType, isChartSpec, isConditionalDef, isEncodingChannel, isGraphSpec, isLayerSpec, isRangeAnnotation, isRefLineAnnotation, isTableSpec, isTextAnnotation, lineChart, meetsAA, pieChart, resolveCollisions, resolveMarkDef, resolveMarkType, resolveTheme, scatterChart, simulateColorBlindness };
package/dist/index.js CHANGED
@@ -147,6 +147,19 @@ var GRAPH_ENCODING_RULES = {
147
147
  nodeLabel: { required: false, allowedTypes: [] }
148
148
  };
149
149
 
150
+ // src/types/events.ts
151
+ var elementRef = {
152
+ annotation: (index, id) => ({ type: "annotation", index, id }),
153
+ chrome: (key) => ({ type: "chrome", key }),
154
+ seriesLabel: (series) => ({ type: "series-label", series }),
155
+ legend: () => ({ type: "legend" }),
156
+ legendEntry: (series, index) => ({
157
+ type: "legend-entry",
158
+ series,
159
+ index
160
+ })
161
+ };
162
+
150
163
  // src/types/spec.ts
151
164
  function isEncodingChannel(def) {
152
165
  if (!def) return false;
@@ -2749,6 +2762,7 @@ export {
2749
2762
  detectCollision,
2750
2763
  donutChart,
2751
2764
  dotChart,
2765
+ elementRef,
2752
2766
  estimateTextWidth,
2753
2767
  findAccessibleColor,
2754
2768
  formatDate,