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

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
@@ -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). */
@@ -1937,7 +1942,12 @@ interface BaseChartSpec<TData extends DataRow = DataRow> {
1937
1942
  darkMode?: DarkMode;
1938
1943
  /** Whether to show the tryOpenData.ai watermark. Defaults to true. */
1939
1944
  watermark?: boolean;
1940
- /** Series names to hide from rendering. Hidden series remain in the legend but are visually dimmed. */
1945
+ /**
1946
+ * Series names to hide from rendering by default. This is the authored
1947
+ * persistence target for legend visibility. Runtime legend toggles
1948
+ * (legend-toggle edit events) layer on top of this via ephemeral runtime
1949
+ * sets but never modify it.
1950
+ */
1941
1951
  hiddenSeries?: string[];
1942
1952
  /** Per-series visual overrides, keyed by series name (the color field value). */
1943
1953
  seriesStyles?: Record<string, SeriesStyle>;
@@ -2265,7 +2275,16 @@ interface LayerSpec<TData extends DataRow = DataRow> {
2265
2275
  height?: number;
2266
2276
  /** Accepted for Vega-Lite compatibility and ignored (with a compile warning). */
2267
2277
  $schema?: string;
2268
- /** Annotations on the layered view. */
2278
+ /**
2279
+ * Annotations for the layered chart. When present, these are the
2280
+ * annotations rendered and available for editing. When absent, falls back
2281
+ * to the first leaf layer's annotations. Annotations on second and later
2282
+ * leaf layers are not rendered.
2283
+ *
2284
+ * For edit persistence: the `data-annotation-index` stamped on each
2285
+ * rendered annotation maps to this array (or the first leaf's if this is
2286
+ * unset). Place annotations here for reliable index-based edit matching.
2287
+ */
2269
2288
  annotations?: Annotation[];
2270
2289
  /** Label display configuration. `false` disables all labels, `true` uses defaults. */
2271
2290
  labels?: LabelSpec;
@@ -2281,7 +2300,12 @@ interface LayerSpec<TData extends DataRow = DataRow> {
2281
2300
  watermark?: boolean;
2282
2301
  /** Resolution strategy for shared scales/axes/legends. */
2283
2302
  resolve?: ResolveConfig;
2284
- /** Hidden series names. */
2303
+ /**
2304
+ * Series names to hide from rendering by default. This is the authored
2305
+ * persistence target for legend visibility. Runtime legend toggles
2306
+ * (legend-toggle edit events) layer on top of this via ephemeral runtime
2307
+ * sets but never modify it.
2308
+ */
2285
2309
  hiddenSeries?: string[];
2286
2310
  /** Endpoint labels column, inherited by child layers that don't set their own. */
2287
2311
  endpointLabels?: boolean | EndpointLabelsConfig;
@@ -2942,26 +2966,36 @@ type ElementRef = {
2942
2966
  type: 'annotation';
2943
2967
  index: number;
2944
2968
  id?: string;
2969
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
2970
+ path?: string;
2945
2971
  } | {
2946
2972
  type: 'chrome';
2947
2973
  key: ChromeKey;
2974
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
2975
+ path?: string;
2948
2976
  } | {
2949
2977
  type: 'series-label';
2950
2978
  series: string;
2979
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
2980
+ path?: string;
2951
2981
  } | {
2952
2982
  type: 'legend';
2983
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
2984
+ path?: string;
2953
2985
  } | {
2954
2986
  type: 'legend-entry';
2955
2987
  series: string;
2956
2988
  index: number;
2989
+ /** RFC 6901 JSON Pointer to the edited property in the spec. */
2990
+ path?: string;
2957
2991
  };
2958
2992
  /** Helper constructors for ergonomic ElementRef creation. */
2959
2993
  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;
2994
+ readonly annotation: (index: number, id?: string, path?: string) => ElementRef;
2995
+ readonly chrome: (key: ChromeKey, path?: string) => ElementRef;
2996
+ readonly seriesLabel: (series: string, path?: string) => ElementRef;
2997
+ readonly legend: (path?: string) => ElementRef;
2998
+ readonly legendEntry: (series: string, index: number, path?: string) => ElementRef;
2965
2999
  };
2966
3000
  /**
2967
3001
  * Discriminated union of all element edit events.
@@ -2976,21 +3010,31 @@ declare const elementRef: {
2976
3010
  */
2977
3011
  type ElementEdit = {
2978
3012
  type: 'annotation';
3013
+ element: ElementRef;
2979
3014
  annotation: TextAnnotation;
2980
3015
  offset: AnnotationOffset;
2981
3016
  } | {
2982
3017
  type: 'annotation-connector';
3018
+ element: ElementRef;
2983
3019
  annotation: TextAnnotation;
2984
3020
  endpoint: 'from' | 'to';
2985
3021
  offset: AnnotationOffset;
2986
3022
  } | {
2987
3023
  type: 'range-label';
3024
+ element: ElementRef;
2988
3025
  annotation: RangeAnnotation;
2989
3026
  labelOffset: AnnotationOffset;
2990
3027
  } | {
2991
3028
  type: 'refline-label';
3029
+ element: ElementRef;
2992
3030
  annotation: RefLineAnnotation;
2993
3031
  labelOffset: AnnotationOffset;
3032
+ } | {
3033
+ type: 'annotation-anchor';
3034
+ element: ElementRef;
3035
+ annotation: TextAnnotation;
3036
+ x: string | number;
3037
+ y: string | number;
2994
3038
  } | {
2995
3039
  type: 'chrome';
2996
3040
  key: ChromeKey;
@@ -3003,10 +3047,21 @@ type ElementEdit = {
3003
3047
  } | {
3004
3048
  type: 'legend';
3005
3049
  offset: AnnotationOffset;
3006
- } | {
3050
+ }
3051
+ /**
3052
+ * Transient legend visibility toggle. Reports the same runtime show/hide
3053
+ * a reader triggers; not persisted by openchart. To author default-hidden
3054
+ * series, set `spec.hiddenSeries` directly. Hosts building spec
3055
+ * persistence should generally not write legend-toggle edits back into
3056
+ * the authored spec. `hidden: true` means the series was just hidden.
3057
+ */
3058
+ | {
3007
3059
  type: 'legend-toggle';
3008
3060
  series: string;
3009
3061
  hidden: boolean;
3062
+ } | {
3063
+ type: 'add';
3064
+ annotation: TextAnnotation;
3010
3065
  } | {
3011
3066
  type: 'delete';
3012
3067
  element: ElementRef;
@@ -3042,6 +3097,14 @@ interface MarkEvent {
3042
3097
  * or ChartProps (React component) to receive interaction callbacks.
3043
3098
  */
3044
3099
  interface ChartEventHandlers {
3100
+ /**
3101
+ * Explicitly enable or disable edit interactions (drag, select, keyboard
3102
+ * delete/edit). When true, the interaction layer is wired even without
3103
+ * onEdit. When false, all edit interactions are suppressed even when
3104
+ * onEdit is provided. When omitted, each interaction block uses its
3105
+ * existing callback-presence gate.
3106
+ */
3107
+ editable?: boolean;
3045
3108
  /** Called when a data mark is clicked. */
3046
3109
  onMarkClick?: (event: MarkEvent) => void;
3047
3110
  /** Called when the mouse enters a data mark. */
@@ -3762,8 +3825,9 @@ interface BaseLegendLayout {
3762
3825
  * read them silently pick whichever comes first.
3763
3826
  */
3764
3827
  channel?: LegendChannel;
3765
- /** Where the legend is positioned relative to the chart area. */
3766
- position: 'top' | 'right' | 'bottom' | 'bottom-right' | 'inline';
3828
+ /** Where the legend is positioned relative to the chart area. `'top-left'`
3829
+ * is a map-only overlay position (floats inside the map area). */
3830
+ position: 'top' | 'top-left' | 'right' | 'bottom' | 'bottom-right' | 'inline';
3767
3831
  /** Bounding box for the legend (pixel coordinates). */
3768
3832
  bounds: Rect;
3769
3833
  /** Entry label style. */
@@ -4093,6 +4157,23 @@ interface YouDrawItYInvert {
4093
4157
  /** Data value at the bottom pixel. */
4094
4158
  bottomData: number;
4095
4159
  }
4160
+ /**
4161
+ * Scale inversion anchors serialized from the engine so the vanilla layer
4162
+ * can convert pixel positions to data-space values without holding d3
4163
+ * scale objects. Generalizes the YouDrawItYInvert pattern to both axes.
4164
+ */
4165
+ interface ScaleInvert {
4166
+ /** For continuous scales: two reference pixel-to-data anchor points. */
4167
+ topPixel: number;
4168
+ bottomPixel: number;
4169
+ topData: number;
4170
+ bottomData: number;
4171
+ /** Scale type so the vanilla layer applies the correct inverse transform. */
4172
+ scaleType?: 'linear' | 'log' | 'pow' | 'sqrt' | 'symlog' | 'time';
4173
+ /** For band/point scales: ordered domain values and their pixel centers. */
4174
+ domain?: (string | number)[];
4175
+ positions?: number[];
4176
+ }
4096
4177
  /**
4097
4178
  * Resolved geometry and config for the "you draw it" interactive format
4098
4179
  * (`youDrawIt`). The vanilla adapter uses this to render the hatched drawing
@@ -4231,6 +4312,10 @@ interface ChartLayout {
4231
4312
  crosshair: boolean;
4232
4313
  /** Real text measurement function from the adapter (for accurate SVG text wrapping). */
4233
4314
  measureText?: MeasureTextFn;
4315
+ /** Scale inversion anchors for the x axis. Used by anchor drag to convert pixel to data-space. */
4316
+ xInvert?: ScaleInvert;
4317
+ /** Scale inversion anchors for the y axis. Used by anchor drag to convert pixel to data-space. */
4318
+ yInvert?: ScaleInvert;
4234
4319
  /** Faceted (small-multiples) layout. When present, renderers iterate panels instead of using top-level marks/axes. */
4235
4320
  facet?: FacetLayout;
4236
4321
  }
@@ -5885,4 +5970,4 @@ declare const CSS_TOKEN_ROOT_SELECTORS: readonly string[];
5885
5970
  declare const CSS_TOKENS: readonly CssTokenDef[];
5886
5971
  declare function cssTokenDefault(name: string, mode: 'light' | 'dark'): string;
5887
5972
 
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 };
5973
+ 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 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 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 };
package/dist/index.js CHANGED
@@ -187,14 +187,31 @@ var GRAPH_ENCODING_RULES = {
187
187
 
188
188
  // src/types/events.ts
189
189
  var elementRef = {
190
- annotation: (index, id) => ({ type: "annotation", index, id }),
191
- chrome: (key) => ({ type: "chrome", key }),
192
- seriesLabel: (series) => ({ type: "series-label", series }),
193
- legend: () => ({ type: "legend" }),
194
- legendEntry: (series, index) => ({
190
+ annotation: (index, id, path) => ({
191
+ type: "annotation",
192
+ index,
193
+ ...id !== void 0 ? { id } : {},
194
+ ...path !== void 0 ? { path } : {}
195
+ }),
196
+ chrome: (key, path) => ({
197
+ type: "chrome",
198
+ key,
199
+ ...path !== void 0 ? { path } : {}
200
+ }),
201
+ seriesLabel: (series, path) => ({
202
+ type: "series-label",
203
+ series,
204
+ ...path !== void 0 ? { path } : {}
205
+ }),
206
+ legend: (path) => ({
207
+ type: "legend",
208
+ ...path !== void 0 ? { path } : {}
209
+ }),
210
+ legendEntry: (series, index, path) => ({
195
211
  type: "legend-entry",
196
212
  series,
197
- index
213
+ index,
214
+ ...path !== void 0 ? { path } : {}
198
215
  })
199
216
  };
200
217