@opendata-ai/openchart-core 9.3.0 → 9.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
@@ -337,6 +337,8 @@ interface ThemeColors {
337
337
  annotationLabel: string;
338
338
  /** Annotation muted color. */
339
339
  annotationMuted: string;
340
+ /** Color for non-highlighted values. Light default #d4d4d8; dark default the neutral ramp's fgFaint. */
341
+ muted: string;
340
342
  /** Annotation leader color. */
341
343
  annotationLeader: string;
342
344
  /** Annotation rule color. */
@@ -569,6 +571,8 @@ interface CellStyle {
569
571
  }
570
572
  /** A single resolved chrome text element with computed position and style. */
571
573
  interface ResolvedChromeElement {
574
+ /** Makes the text a link. http, https and mailto only; opens in a new tab. */
575
+ href?: string;
572
576
  /** The text content. */
573
577
  text: string;
574
578
  /** X position in the layout coordinate system. */
@@ -1558,6 +1562,8 @@ interface SizeLegendLayout extends BaseLegendLayout {
1558
1562
  type LegendLayout = CategoricalLegendLayout | GradientLegendLayout | ContinuousLegendLayout | SizeLegendLayout;
1559
1563
  /** A single resolved endpoint-label entry, fully positioned. */
1560
1564
  interface EndpointLabelEntry {
1565
+ /** Set on a series that `highlight` mutes; its name, value and date draw in `EndpointLabelsLayout.mutedTextColor`. */
1566
+ muted?: true;
1561
1567
  /** Actual observation x in pixels; leaders must not imply a shared final date. */
1562
1568
  dataX?: number;
1563
1569
  /** Source observation retained without parsing display text. */
@@ -1599,6 +1605,8 @@ interface EndpointLabelEntry {
1599
1605
  }
1600
1606
  /** Resolved layout for the endpoint labels column. */
1601
1607
  interface EndpointLabelsLayout {
1608
+ /** Ink for muted entries' text: the theme's axis tick-label color (4.8:1 on the light canvas, 7.8:1 on dark). */
1609
+ mutedTextColor: string;
1602
1610
  /** Fit-tested, series-name-only labels in stacked bands. */
1603
1611
  interior?: Array<{
1604
1612
  seriesKey: string;
@@ -1918,6 +1926,12 @@ interface ChartLayout {
1918
1926
  marks: Mark[];
1919
1927
  /** Resolved annotations with pixel positions. */
1920
1928
  annotations: ResolvedAnnotation[];
1929
+ /**
1930
+ * Spec indices of annotations that were not drawn because their anchor does not resolve on
1931
+ * the chart's scales (a category not in the domain, an invalid date or number). Excludes notes
1932
+ * skipped at compact widths, demoted to footnotes, or hidden by `responsive: 'hide'`.
1933
+ */
1934
+ unplacedAnnotations: number[];
1921
1935
  /**
1922
1936
  * Primary legend (the color legend). Kept as a singular slot: it is what every
1923
1937
  * existing consumer reads, and a chart's legend is a color legend unless it
@@ -2161,6 +2175,7 @@ interface TableLayout {
2161
2175
  a11y: {
2162
2176
  caption: string;
2163
2177
  summary: string;
2178
+ description: string | null;
2164
2179
  };
2165
2180
  /** The resolved theme. */
2166
2181
  theme: ResolvedTheme;
@@ -3274,7 +3289,10 @@ interface MarkOptions {
3274
3289
  * values, the first drawn to the left. Defaults to false.
3275
3290
  */
3276
3291
  mirror?: boolean;
3277
- /** Inner radius for arc marks. >0 produces a donut, 0 or omitted produces a pie. */
3292
+ /**
3293
+ * Inner radius for arc marks: 0 for a pie; a value below 1 is a fraction of the
3294
+ * outer radius (0.6 = 60%); 1 or more is pixels.
3295
+ */
3278
3296
  innerRadius?: number;
3279
3297
  /** Outer radius for arc marks. */
3280
3298
  outerRadius?: number;
@@ -3534,6 +3552,13 @@ type MarkDef = (SharedMarkOptions & {
3534
3552
  type FieldType = 'quantitative' | 'temporal' | 'nominal' | 'ordinal';
3535
3553
  /** Aggregate function applied to a field before encoding. */
3536
3554
  type AggregateOp = 'count' | 'sum' | 'mean' | 'median' | 'min' | 'max' | 'variance' | 'stdev' | 'distinct' | 'q1' | 'q3';
3555
+ /** A time interval for temporal axis ticks. `quarter` is three months. */
3556
+ type TimeTickInterval = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute';
3557
+ /** A tick every `step` intervals, e.g. `{ interval: 'month', step: 3 }`. `step` defaults to 1. */
3558
+ interface TimeTickStep {
3559
+ interval: TimeTickInterval;
3560
+ step?: number;
3561
+ }
3537
3562
  /** Axis configuration for an encoding channel. */
3538
3563
  interface AxisConfig {
3539
3564
  /** Axis title text. If omitted, the field name is used. */
@@ -3546,6 +3571,11 @@ interface AxisConfig {
3546
3571
  format?: string;
3547
3572
  /** Override tick count. Engine picks a sensible default if omitted. */
3548
3573
  tickCount?: number;
3574
+ /**
3575
+ * Distance between ticks: a number in data units on a quantitative axis, a `TimeTickStep`
3576
+ * on a temporal axis. `values` wins over `tickStep`, which wins over `tickCount`.
3577
+ */
3578
+ tickStep?: number | TimeTickStep;
3549
3579
  /** Whether to show gridlines for this axis. */
3550
3580
  grid?: boolean;
3551
3581
  /** Rotation angle in degrees for tick labels. Common values: -45, -90, 90. */
@@ -3574,7 +3604,9 @@ interface AxisConfig {
3574
3604
  labelPadding?: number;
3575
3605
  /** Color override for axis tick labels and title. Useful in dual-axis charts to match axis color to its series. */
3576
3606
  labelColor?: string;
3577
- /** Literal string appended to every formatted tick label. e.g. "B" gives "$4.5B" when format is "$,.1~f". */
3607
+ /** Text before every tick label, e.g. "$". Also shown before this channel's values in tooltips. */
3608
+ labelPrefix?: string;
3609
+ /** Literal string appended to every formatted tick label. e.g. "B" gives "$4.5B" when format is "$,.1~f". Also shown after this channel's values in tooltips. */
3578
3610
  labelSuffix?: string;
3579
3611
  /** Secondary data field to display alongside each tick label. Renders in lighter weight/color. Only effective on categorical y-axis labels (horizontal bar charts). */
3580
3612
  labelField?: string;
@@ -3595,6 +3627,13 @@ interface ScaleConfig {
3595
3627
  * list of class break values; categorical scales take the value list.
3596
3628
  */
3597
3629
  domain?: number[] | string[];
3630
+ /**
3631
+ * Fixed lower end of a quantitative scale. The upper end still fits the data (with `zero`
3632
+ * and `nice` applied to it). Ignored when `domain` is set; validation rejects both together.
3633
+ */
3634
+ domainMin?: number;
3635
+ /** Fixed upper end of a quantitative scale; the lower end still fits the data. */
3636
+ domainMax?: number;
3598
3637
  /** Scale type override. Usually inferred from field type. */
3599
3638
  type?: ScaleType;
3600
3639
  /** Whether to nice-ify the domain for clean tick values. Defaults to true. */
@@ -3753,7 +3792,7 @@ interface EncodingChannel<TData extends DataRow = DataRow> {
3753
3792
  * - 'ascending': sort domain values ascending (default VL behavior)
3754
3793
  * - 'descending': sort domain values descending
3755
3794
  * - null: use data order (no sorting)
3756
- * - undefined: ascending (VL default)
3795
+ * - undefined: keep data order
3757
3796
  * - 'x' | '-x' | 'y' | '-y': sort by another channel's values ('-' prefix
3758
3797
  * for descending). The VL ranked-bar idiom: `sort: '-y'` orders categories
3759
3798
  * by value, largest first. Resolved into an explicit domain during the
@@ -3761,6 +3800,8 @@ interface EncodingChannel<TData extends DataRow = DataRow> {
3761
3800
  * - string[]: explicit value order. Listed values come first (in the given
3762
3801
  * order); unlisted data values follow in data order.
3763
3802
  * - SortByField: sort by the aggregated values of another field.
3803
+ * On a categorical (band or point) `y`, the first domain value is drawn at the top, so data order and
3804
+ * `sort: '-x'` (largest first) read top to bottom. `scale.reverse` flips it.
3764
3805
  */
3765
3806
  sort?: 'ascending' | 'descending' | null | 'x' | '-x' | 'y' | '-y' | string[] | SortByField;
3766
3807
  /**
@@ -4058,6 +4099,8 @@ interface ChromeTextStyle {
4058
4099
  }
4059
4100
  /** A chrome text element with optional style overrides. */
4060
4101
  interface ChromeText {
4102
+ /** Makes the text a link. http, https and mailto only; opens in a new tab. */
4103
+ href?: string;
4061
4104
  /** The text content to display. */
4062
4105
  text: string;
4063
4106
  /** Optional style overrides. Theme defaults are used for any omitted property. */
@@ -4142,8 +4185,9 @@ interface AnnotationBase {
4142
4185
  opacity?: number;
4143
4186
  /** Z-index for render ordering. Higher values render on top. */
4144
4187
  zIndex?: number;
4145
- /** When false, the annotation is always shown even at compact breakpoints. Default true. */
4146
- responsive?: boolean;
4188
+ /** At compact widths (below 400 px): true (default) thins or demotes the note to a footnote,
4189
+ * false always shows it, 'hide' leaves it out entirely. */
4190
+ responsive?: boolean | 'hide';
4147
4191
  }
4148
4192
  /**
4149
4193
  * Text annotation positioned at a data coordinate.
@@ -4368,6 +4412,8 @@ interface ThemeConfig {
4368
4412
  annotationLabel?: TokenValue;
4369
4413
  /** Annotation muted color. Accepts a TokenValue light/dark pair. */
4370
4414
  annotationMuted?: TokenValue;
4415
+ /** Color for values that highlight mutes. Accepts a TokenValue for light/dark pairs. */
4416
+ muted?: TokenValue;
4371
4417
  /** Annotation leader color. Accepts a TokenValue light/dark pair. */
4372
4418
  annotationLeader?: TokenValue;
4373
4419
  /** Annotation rule color. Accepts a TokenValue light/dark pair. */
@@ -4506,10 +4552,13 @@ interface LabelConfig {
4506
4552
  density?: LabelDensity;
4507
4553
  /** Number format override for label values (d3-format string, e.g. ",.0f"). */
4508
4554
  format?: string;
4509
- /** Literal string prepended to each formatted label value (e.g. "-" or "$"). */
4555
+ /** Literal string prepended to each formatted label value (e.g. "-" or "$"). Applies to bar, column and arc (pie, donut) labels. */
4510
4556
  prefix?: string;
4511
- /** Literal string appended to each formatted label value (e.g. "%" or "x"). */
4557
+ /** Literal string appended to each formatted label value (e.g. "%" or "x"). Applies to bar, column and arc (pie, donut) labels. */
4512
4558
  suffix?: string;
4559
+ /** Label only the series or values named in `encoding.color.highlight`: bar and column value labels, and the
4560
+ * endpoint labels of line and area charts, which otherwise also name muted series in a quieter ink. */
4561
+ highlightedOnly?: boolean;
4513
4562
  /** Fixed CSS color for all labels. Overrides the default fill-derived color. */
4514
4563
  color?: string;
4515
4564
  /** Font size in pixels for bar/column value labels. */
@@ -4635,6 +4684,10 @@ interface EndpointLabelsConfig {
4635
4684
  valueField?: string;
4636
4685
  /** d3-format string for the value. Defaults to `encoding.y.axis.format`. */
4637
4686
  format?: string;
4687
+ /** Text before the formatted value, e.g. "$". */
4688
+ prefix?: string;
4689
+ /** Text after the formatted value, e.g. "bn". */
4690
+ suffix?: string;
4638
4691
  /** Max wrap width in pixels for long series names. Default 96. */
4639
4692
  width?: number;
4640
4693
  /**
@@ -5038,13 +5091,8 @@ interface RectEncoding<TData extends DataRow = DataRow> extends Encoding<TData>
5038
5091
  x: EncodingChannel<TData>;
5039
5092
  y: EncodingChannel<TData>;
5040
5093
  }
5041
- /**
5042
- * Author-facing accessibility overrides.
5043
- *
5044
- * Everything here is optional; when omitted, openchart auto-generates alt
5045
- * text, ARIA labels, and a screen-reader data table from the spec and data.
5046
- */
5047
- interface A11yConfig {
5094
+ /** An author-written description for assistive technology. */
5095
+ interface A11yDescriptionConfig {
5048
5096
  /**
5049
5097
  * Alt text announced by screen readers for the chart as a whole. Replaces
5050
5098
  * the auto-generated description. Also settable via the top-level
@@ -5052,6 +5100,14 @@ interface A11yConfig {
5052
5100
  * are present.
5053
5101
  */
5054
5102
  description?: string;
5103
+ }
5104
+ /**
5105
+ * Author-facing accessibility overrides.
5106
+ *
5107
+ * Everything here is optional; when omitted, openchart auto-generates alt
5108
+ * text, ARIA labels, and a screen-reader data table from the spec and data.
5109
+ */
5110
+ interface A11yConfig extends A11yDescriptionConfig {
5055
5111
  /** Render the hidden screen-reader data table. Defaults to true; navigation stays enabled. */
5056
5112
  table?: boolean;
5057
5113
  /**
@@ -5394,6 +5450,8 @@ type TableDensity = 'condensed' | 'regular' | 'relaxed';
5394
5450
  * heatmap coloring, inline sparklines, sorted columns, search, and pagination.
5395
5451
  */
5396
5452
  interface TableSpec {
5453
+ /** An author-written description for assistive technology. */
5454
+ a11y?: A11yDescriptionConfig;
5397
5455
  /** Compact layout. v8 defaults to cards; priority retains comparable columns with expandable details. */
5398
5456
  mobileLayout?: 'cards' | 'priority' | 'scroll';
5399
5457
  /** Optional authored measure, unit, provenance, and supplied interval metadata. */
@@ -6079,6 +6137,8 @@ interface GeoMapPointsLayer {
6079
6137
  time?: EncodingChannel;
6080
6138
  }
6081
6139
  interface GeoMapSpec {
6140
+ /** An author-written description for assistive technology. */
6141
+ a11y?: A11yDescriptionConfig;
6082
6142
  /** Optional authored measure, unit, provenance, and supplied interval metadata. */
6083
6143
  fields?: Record<string, FieldMetadata>;
6084
6144
  /** Discriminant: always "map". */
@@ -6720,6 +6780,17 @@ type ElementRef = {
6720
6780
  index: number;
6721
6781
  /** `/columns/<index>` */
6722
6782
  path?: string;
6783
+ } | {
6784
+ type: 'axis';
6785
+ axis: 'x' | 'y' | 'y2';
6786
+ /** `/encoding/x/axis` or `/encoding/y/axis`; absent for y2 */
6787
+ path?: string;
6788
+ } | {
6789
+ type: 'series';
6790
+ /** The series key; null on a chart with one unnamed series. */
6791
+ series: string | null;
6792
+ /** `/encoding/color` when color is encoded, else `/mark` */
6793
+ path?: string;
6723
6794
  };
6724
6795
  /** Helper constructors for ergonomic ElementRef creation. */
6725
6796
  declare const elementRef: {
@@ -6730,7 +6801,16 @@ declare const elementRef: {
6730
6801
  readonly legend: (path?: string) => ElementRef;
6731
6802
  readonly legendEntry: (series: string, index: number, path?: string) => ElementRef;
6732
6803
  readonly column: (key: string, index: number, path?: string) => ElementRef;
6804
+ readonly axis: (axis: "x" | "y" | "y2", path?: string) => ElementRef;
6805
+ readonly series: (series: string | null, path?: string) => ElementRef;
6733
6806
  };
6807
+ /** An annotation tool the host arms in edit mode. `axis` fixes a range's or line's direction. */
6808
+ interface AnnotationPlacementTool {
6809
+ type: 'text' | 'range' | 'refline';
6810
+ /** range: absent means the drag direction decides. refline: absent means 'y' when the y scale
6811
+ * is continuous, else 'x'. Ignored for text. */
6812
+ axis?: 'x' | 'y';
6813
+ }
6734
6814
  /**
6735
6815
  * Event fired when a user interacts with a data mark (bar, point, line segment, etc.).
6736
6816
  *
@@ -6766,6 +6846,9 @@ interface MarkFocusEvent {
6766
6846
  * or ChartProps (React component) to receive interaction callbacks.
6767
6847
  */
6768
6848
  interface ChartEventHandlers {
6849
+ /** The engine disarmed or changed the placement tool (Escape, a finished placement, or leaving
6850
+ * edit mode). Not called for the host's own setPlacementTool calls. */
6851
+ onPlacementToolChange?: (tool: AnnotationPlacementTool | null) => void;
6769
6852
  /** Called when a data mark is clicked. */
6770
6853
  onMarkClick?: (event: MarkEvent) => void;
6771
6854
  /** Called when the mouse enters a data mark. */
@@ -7629,6 +7712,8 @@ declare function resolveTheme(userTheme?: ThemeConfig, base?: ThemeBase): Resolv
7629
7712
  * chrome proportional to the container.
7630
7713
  */
7631
7714
 
7715
+ /** Whether a chrome link is an absolute http, https or mailto URL. */
7716
+ declare function isSafeLink(href: string): boolean;
7632
7717
  /**
7633
7718
  * Line-height multiplier for the auto-thinning footnote list.
7634
7719
  *
@@ -9272,4 +9357,4 @@ declare const CSS_TOKEN_ROOT_SELECTORS: readonly string[];
9272
9357
  declare const CSS_TOKENS: readonly CssTokenDef[];
9273
9358
  declare function cssTokenDefault(name: string, mode: 'light' | 'dark'): string;
9274
9359
 
9275
- export { type A11yConfig, type A11yMetadata, ACHROMATIC_RAMP, AXIS_TITLE_GAP, AXIS_TITLE_OFFSET_COMPACT, AXIS_TITLE_OFFSET_DEFAULT, AXIS_TITLE_TRAILING_PAD, type AggregateOp, type AggregateTransform, type AnimationConfig, type AnimationEase, type AnimationPhaseConfig, type AnimationPreset, type AnimationSpec, type AnimationStagger, type Annotation, type AnnotationAnchor, type AnnotationFootnote, type AnnotationOffset, type AnnotationPosition, type ArcEncoding, type ArcMark, type AreaEncoding, type AreaMark, type AxisConfig, type AxisLabelDensity, type AxisLayout, type AxisTick, BRAND_FONT_SIZE, BRAND_MIN_WIDTH, BRAND_RESERVE_WIDTH, BREAKPOINT_COMPACT_MAX, BREAKPOINT_MEDIUM_MAX, type BarColumnConfig, type BarEncoding, type BarListEncoding, type BarListLayout, type BarListRowMark, type BarListSpec, type BarListSpecWithoutData, type BarTableCell, type BaseLegendLayout, type BeeswarmEncoding, type BinParams, type BinTransform, type Breakpoint, CATEGORICAL_EXTENDED_PALETTE, CATEGORICAL_FILL_PALETTE, CATEGORICAL_FILL_PALETTE_DARK, CATEGORICAL_PALETTE, CATEGORICAL_PALETTE_DARK, CELL_SWEEP_BUDGET_MS, COMPACT_MAX_X_TICKS, COMPACT_WIDTH, CSS_TOKENS, CSS_TOKEN_ROOT_SELECTORS, CURVE_NAMES, type CalculateExpression, type CalculateTransform, type CalendarEncoding, type CategoricalLegendLayout, type CategoricalPalette, type CategoryColorsConfig, type CategoryTableCell, type CellStyle, type ChannelRule, type ChartBuilderOptions, type ChartEventHandlers, type ChartLayout, type ChartSpec, type ChartSpecOverride, type ChartSpecWithoutData, type Chrome, type ChromeDefaults, type ChromeEconomy, type ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ChromeThemeOverride, type CircleEncoding, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type CompileWarning, type CompositionRecommendation, type Condition, type ConditionalValueDef, type ConnectorConfig, type ConnectorType, type ContinuousLegendBin, type ContinuousLegendLayout, type ContinuousLegendTick, type CssTokenDef, type CurveInput, type CurveName, type CurveStop, DEFAULT_THEME, DIVERGING_PALETTES, type DarkMode, type DataRow, type DatasetBinding, type DateGranularity, type DelayAnchor, type DelayRule, type DeltaColumnConfig, type DeltaTableCell, type DensityEncoding, type DensityTransform, type DescriptionEncoding, type DesignDiagnostic, type DesignQuestion, type Display, type DivergingPalette, type DurationRule, ENTRANCE_ROLES, EXIT_CURVE, EXIT_FADE_MS, EXTENDED_OFFSET_STRATEGIES, type EditOp, type EditTransaction, type EditTransactionResult, type ElementRef, type Encoding, type EncodingChannel, type EncodingRule, type EndpointLabelContent, type EndpointLabelEntry, type EndpointLabelsConfig, type EndpointLabelsLayout, type EnterPhaseConfig, type EntranceEndContext, type EntranceRole, type EntranceRoleDef, type EntranceRoleExtent, type EntranceRoleRow, type EntranceTiming, type EntranceTimingContext, type ErrorbarEncoding, FADE_CURVE, FLUID_SPRING, FOOTNOTE_LINE_HEIGHT, type FacetChannel, type FacetLayout, type FacetPanelLayout, type FieldFormatContext, type FieldMetadata, type FieldPredicate, type FieldRef, type FieldType, type FillPatternType, type FilterPredicate, type FilterTransform, type FlagTableCell, type FoldTransform, type FrameConfig, GRAPH_ENCODING_RULES, type GeoAnchor, type GeoCallout, type GeoCalloutNoteSlot, type GeoColorKeyDescriptor, type GeoColorKeyLayout, type GeoDetailLayer, type GeoDetailLayerLayout, type GeoEntityRef, type GeoInset, type GeoLabelAffine, type GeoLabelCandidate, type GeoLabelComponent, type GeoLabelGeometry, type GeoLabelInventoryEntry, type GeoLabelOverlay, type GeoLabelVisibility, type GeoLabelsBundle, type GeoLabelsInput, type GeoMapBorders, type GeoMapEncoding, type GeoMapFeatureMark, type GeoMapFocus, type GeoMapFocusLayout, type GeoMapGeo, type GeoMapLayout, type GeoMapPointMark, type GeoMapPointsLayer, type GeoMapProjection, type GeoMapSpec, type GeoMapSpecWithoutData, type GeoMapZoomConfig, type GeoPlacedLabel, type GeoProjectionContext, type GeoReaderObservation, type GeoReaderSelection, type GeoTextBlock, type GeoViewLayout, type GradientColorStop, type GradientDef, type GradientLegendLayout, type GradientStop, type GraphAnimationConfig, type GraphAnimationSpec, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphEnterPhaseConfig, type GraphInteractionConfig, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphPhaseConfig, type GraphSpec, type GraphSpecWithoutData, type Gridline, HEIGHT_CRAMPED_MAX, HEIGHT_MINIMAL_MAX, HEIGHT_NO_GRID_MAX, HEIGHT_SHORT_MAX, HPAD_COMPACT_FRACTION, HPAD_COMPACT_MIN, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type HistogramEncoding, type ImageColumnConfig, type ImageTableCell, type JoinAggregateTransform, KEYFRAMES, type KeyframeDef, type KeyframeName, type KeyframeProperty, type KeyframeStop, type KeyframeValue, LABEL_GAP_COMPACT, LABEL_GAP_DEFAULT, LINE_POINT_CASCADE_MS, 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, MAP_FEATURE_MAX_DURATION_MS, MAP_POINT_STAGGER_FALLBACK_MS, MAP_SWEEP_BUDGET_MS, MARK_DISPLAY_NAMES, MARK_ENCODING_RULES, MARK_TYPES, MAX_LEFT_LABEL_FRACTION_COMPACT, MAX_LEFT_LABEL_FRACTION_DEFAULT, MAX_LEFT_LABEL_FRACTION_MEDIUM, MAX_LEFT_LABEL_FRACTION_MEDIUM_MAX, MAX_SPRING_DURATION, MAX_SR_TABLE_ROWS, MAX_TOTAL_STAGGER_MS, MOTION_REST_THRESHOLD, type MapSweepTiming, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkFocusEvent, type MarkMetadata, type MarkType, type MeasureTextFn, type Metric, type MonotoneCurveName, type MotionPhase, type MotionSample, NARROW_VIEWPORT_MAX, type NeutralRamp, type NodeOverride, type NumberFormatter, OFFSET_STRATEGIES, type ObservationIdentity, type OffsetStrategy, type PaginationState, type ParliamentEncoding, type PlaybackConfig, type PlaybackPeriodPosition, type PlaybackTimingConfig, type Point, type PointEncoding, type PointMark, type RaceBarGeometry, type RaceBarMarkDef, type RaceBarRow, type RaceBarStatic, type RaceConfig, type RaceEncoding, type RaceFrame, type RaceGeometry, type RaceItem, type RaceLayout, type RaceLineGeometry, type RaceLineMarkDef, type RaceLineStatic, type RaceMarkDef, type RaceMarkType, type RacePlayback, type RaceSpec, type RaceSpecWithoutData, type RaceTableCell, type RaceTableColumn, type RaceTableGeometry, type RaceTableMarkDef, type RaceTableStatic, type RaceTick, type RadialGradient, type RangeAnnotation, type RangeEncoding, type ReaderBindingScope, type ReaderChangeMeta, type ReaderComparisonOperand, type ReaderComparisonResult, type ReaderComparisonScope, type ReaderDomainValue, type ReaderObservation, type ReaderPanelScope, type ReaderSelection, type ReaderSeries, type ReaderSlice, type ReaderSliceIndexOptions, type ReaderSliceMember, type ReaderSliceSelection, type Rect, type RectEncoding, type RectMark, type RefLineAnnotation, type RelativeTimeRef, type ResolveConfig, type ResolveMode, type ResolvedAnimation, type ResolvedAnimationPhase, type ResolvedAnnotation, type ResolvedChrome, type ResolvedChromeElement, type ResolvedChromeRule, type ResolvedColumn, type ResolvedFillPattern, type ResolvedLabel, type ResolvedMetricBar, type ResolvedMetricCell, type ResolvedSeriesSearch, type ResolvedTheme, type ResolvedThemeColors, type ResolvedYouDrawIt, type ResponsiveConfig, type RoleTiming, type RuleMarkLayout, SEQUENTIAL_PALETTES, SUPPORTED_SCHEME_NAMES, type SankeyEncoding, type SankeyLayout, type SankeyLinkColor, type SankeyLinkMark, type SankeyNodeAlign, type SankeyNodeMark, type SankeySpec, type SankeySpecOverride, type SankeySpecWithoutData, type ScaleConfig, type ScaleInvert, type ScaleType, type SequentialPalette, type SeriesSearchConfig, type SeriesStrategy, type SeriesStyle, type SizeLegendCircle, type SizeLegendLayout, type SortByField, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type SpecPatch, type SpringConfig, type StaggerRule, type StoredVizSpec, TICK_LABEL_OFFSET, TICK_LINE_HEIGHT_FACTOR, TOP_PAD_EXTRA_NARROW, type TableBuilderOptions, type TableCell, type TableCellBase, type TableDensity, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, type TableTotalRow, type TextAnnotation, type TextEncoding, type TextMarkLayout, type TextStyle, type TextTableCell, type ThemeChromeDefaults, type ThemeColors, type ThemeConfig, type ThemeFontSizes, type ThemeFontWeights, type ThemeFonts, type ThemeRule, type ThemeSpacing, type TickEncoding, type TickMarkLayout, type TileMapBuilderOptions, type TileMapEncoding, type TileMapLayout, type TileMapPalette, type TileMapSpec, type TileMapSpecWithoutData, type TileMapTileMark, type TimeUnit, type TimeUnitTransform, type TokenValue, type TooltipContent, type TooltipField, type Transform, UPDATE_ENTER_START, type UpdatePhaseConfig, type UpdateTimeline, 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, anchorMs, annotationSource, applyEditTransaction, areaChart, axisTitleOffset, barChart, broadsheet, buildCompactStepFormatter, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, clampStaggerDelay, clarity, columnChart, computeChrome, computeFieldFormatContext, computeLabelBounds, computeNoteBandHeight, computeXAxisExtentFromLabels, contrastRatio, cssTokenDefault, curveStops, curveToCSSLinear, dataTable, deepMergeSpec, defaultNumberFormatter, deriveNeutralRamp, detectCollision, donutChart, dotChart, elementRef, encodePointerToken, entranceAnchorVars, entranceEndMs, entranceRole, entranceTiming, essay, estimateTextWidth, evalCubicBezier, evalCurve, evalKeyframes, evalRoleEase, evalValueCurve, findAccessibleColor, formatCurrency, formatDate, formatNumber, formatOrdinal, formatPercent, generateAltText, generateAriaLabels, generateDataTable, getAxisTitleOffset, getBreakpoint, getHeightClass, getLayoutStrategy, getRepresentativeColor, heuristicMeasure, inferFieldType, invertCurve, invertRoleEase, isAxislessMark, isBarListSpec, isChartSpec, isConditionalDef, isEncodingChannel, isGeoMapSpec, isGradientDef, isGraphSpec, isLayerSpec, isMonotoneCurve, isOpaqueColor, isRaceSpec, isRangeAnnotation, isRefLineAnnotation, isSankeySpec, isTableSpec, isTextAnnotation, isTileMapSpec, isValueDef, isYearContext, jsonPointer, keyframeProperties, keyframeValueToCSS, legacyEditorial, lineChart, mapFeatureDuration, mapSweepTiming, maxRotatedLabelWidth, meetsAA, mergeThemeConfig, motionCSS, overlapArea, pickLabelColor, pieChart, progressTimeMs, resolveChromeEconomy, resolveCollisions, resolveMarkDef, resolveMarkType, resolveMeasurer, resolveNumberFormatter, resolveSchemeName, resolveTheme, roleBaseDuration, roleVars, sampleMotion, scatterChart, shuffledSweepDelays, simulateColorBlindness, springDuration, terminal, textAscent, tileMap, tilemapTileDelays, truncateRotatedLabel, truncateToWidth, updateTimeline, wire, wrapText };
9360
+ export { type A11yConfig, type A11yDescriptionConfig, type A11yMetadata, ACHROMATIC_RAMP, AXIS_TITLE_GAP, AXIS_TITLE_OFFSET_COMPACT, AXIS_TITLE_OFFSET_DEFAULT, AXIS_TITLE_TRAILING_PAD, type AggregateOp, type AggregateTransform, type AnimationConfig, type AnimationEase, type AnimationPhaseConfig, type AnimationPreset, type AnimationSpec, type AnimationStagger, type Annotation, type AnnotationAnchor, type AnnotationFootnote, type AnnotationOffset, type AnnotationPlacementTool, type AnnotationPosition, type ArcEncoding, type ArcMark, type AreaEncoding, type AreaMark, type AxisConfig, type AxisLabelDensity, type AxisLayout, type AxisTick, BRAND_FONT_SIZE, BRAND_MIN_WIDTH, BRAND_RESERVE_WIDTH, BREAKPOINT_COMPACT_MAX, BREAKPOINT_MEDIUM_MAX, type BarColumnConfig, type BarEncoding, type BarListEncoding, type BarListLayout, type BarListRowMark, type BarListSpec, type BarListSpecWithoutData, type BarTableCell, type BaseLegendLayout, type BeeswarmEncoding, type BinParams, type BinTransform, type Breakpoint, CATEGORICAL_EXTENDED_PALETTE, CATEGORICAL_FILL_PALETTE, CATEGORICAL_FILL_PALETTE_DARK, CATEGORICAL_PALETTE, CATEGORICAL_PALETTE_DARK, CELL_SWEEP_BUDGET_MS, COMPACT_MAX_X_TICKS, COMPACT_WIDTH, CSS_TOKENS, CSS_TOKEN_ROOT_SELECTORS, CURVE_NAMES, type CalculateExpression, type CalculateTransform, type CalendarEncoding, type CategoricalLegendLayout, type CategoricalPalette, type CategoryColorsConfig, type CategoryTableCell, type CellStyle, type ChannelRule, type ChartBuilderOptions, type ChartEventHandlers, type ChartLayout, type ChartSpec, type ChartSpecOverride, type ChartSpecWithoutData, type Chrome, type ChromeDefaults, type ChromeEconomy, type ChromeKey, type ChromeMode, type ChromeText, type ChromeTextStyle, type ChromeThemeOverride, type CircleEncoding, type ColorBlindnessType, type ColumnConfig, type CompileOptions, type CompileTableOptions, type CompileWarning, type CompositionRecommendation, type Condition, type ConditionalValueDef, type ConnectorConfig, type ConnectorType, type ContinuousLegendBin, type ContinuousLegendLayout, type ContinuousLegendTick, type CssTokenDef, type CurveInput, type CurveName, type CurveStop, DEFAULT_THEME, DIVERGING_PALETTES, type DarkMode, type DataRow, type DatasetBinding, type DateGranularity, type DelayAnchor, type DelayRule, type DeltaColumnConfig, type DeltaTableCell, type DensityEncoding, type DensityTransform, type DescriptionEncoding, type DesignDiagnostic, type DesignQuestion, type Display, type DivergingPalette, type DurationRule, ENTRANCE_ROLES, EXIT_CURVE, EXIT_FADE_MS, EXTENDED_OFFSET_STRATEGIES, type EditOp, type EditTransaction, type EditTransactionResult, type ElementRef, type Encoding, type EncodingChannel, type EncodingRule, type EndpointLabelContent, type EndpointLabelEntry, type EndpointLabelsConfig, type EndpointLabelsLayout, type EnterPhaseConfig, type EntranceEndContext, type EntranceRole, type EntranceRoleDef, type EntranceRoleExtent, type EntranceRoleRow, type EntranceTiming, type EntranceTimingContext, type ErrorbarEncoding, FADE_CURVE, FLUID_SPRING, FOOTNOTE_LINE_HEIGHT, type FacetChannel, type FacetLayout, type FacetPanelLayout, type FieldFormatContext, type FieldMetadata, type FieldPredicate, type FieldRef, type FieldType, type FillPatternType, type FilterPredicate, type FilterTransform, type FlagTableCell, type FoldTransform, type FrameConfig, GRAPH_ENCODING_RULES, type GeoAnchor, type GeoCallout, type GeoCalloutNoteSlot, type GeoColorKeyDescriptor, type GeoColorKeyLayout, type GeoDetailLayer, type GeoDetailLayerLayout, type GeoEntityRef, type GeoInset, type GeoLabelAffine, type GeoLabelCandidate, type GeoLabelComponent, type GeoLabelGeometry, type GeoLabelInventoryEntry, type GeoLabelOverlay, type GeoLabelVisibility, type GeoLabelsBundle, type GeoLabelsInput, type GeoMapBorders, type GeoMapEncoding, type GeoMapFeatureMark, type GeoMapFocus, type GeoMapFocusLayout, type GeoMapGeo, type GeoMapLayout, type GeoMapPointMark, type GeoMapPointsLayer, type GeoMapProjection, type GeoMapSpec, type GeoMapSpecWithoutData, type GeoMapZoomConfig, type GeoPlacedLabel, type GeoProjectionContext, type GeoReaderObservation, type GeoReaderSelection, type GeoTextBlock, type GeoViewLayout, type GradientColorStop, type GradientDef, type GradientLegendLayout, type GradientStop, type GraphAnimationConfig, type GraphAnimationSpec, type GraphChannelRule, type GraphEdge, type GraphEdgeLayout, type GraphEncoding, type GraphEncodingChannel, type GraphEnterPhaseConfig, type GraphInteractionConfig, type GraphLayout, type GraphLayoutConfig, type GraphNode, type GraphNodeLayout, type GraphPhaseConfig, type GraphSpec, type GraphSpecWithoutData, type Gridline, HEIGHT_CRAMPED_MAX, HEIGHT_MINIMAL_MAX, HEIGHT_NO_GRID_MAX, HEIGHT_SHORT_MAX, HPAD_COMPACT_FRACTION, HPAD_COMPACT_MIN, type HeatmapColumnConfig, type HeatmapTableCell, type HeightClass, type HistogramEncoding, type ImageColumnConfig, type ImageTableCell, type JoinAggregateTransform, KEYFRAMES, type KeyframeDef, type KeyframeName, type KeyframeProperty, type KeyframeStop, type KeyframeValue, LABEL_GAP_COMPACT, LABEL_GAP_DEFAULT, LINE_POINT_CASCADE_MS, 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, MAP_FEATURE_MAX_DURATION_MS, MAP_POINT_STAGGER_FALLBACK_MS, MAP_SWEEP_BUDGET_MS, MARK_DISPLAY_NAMES, MARK_ENCODING_RULES, MARK_TYPES, MAX_LEFT_LABEL_FRACTION_COMPACT, MAX_LEFT_LABEL_FRACTION_DEFAULT, MAX_LEFT_LABEL_FRACTION_MEDIUM, MAX_LEFT_LABEL_FRACTION_MEDIUM_MAX, MAX_SPRING_DURATION, MAX_SR_TABLE_ROWS, MAX_TOTAL_STAGGER_MS, MOTION_REST_THRESHOLD, type MapSweepTiming, type Margins, type Mark, type MarkAria, type MarkDef, type MarkEvent, type MarkFocusEvent, type MarkMetadata, type MarkType, type MeasureTextFn, type Metric, type MonotoneCurveName, type MotionPhase, type MotionSample, NARROW_VIEWPORT_MAX, type NeutralRamp, type NodeOverride, type NumberFormatter, OFFSET_STRATEGIES, type ObservationIdentity, type OffsetStrategy, type PaginationState, type ParliamentEncoding, type PlaybackConfig, type PlaybackPeriodPosition, type PlaybackTimingConfig, type Point, type PointEncoding, type PointMark, type RaceBarGeometry, type RaceBarMarkDef, type RaceBarRow, type RaceBarStatic, type RaceConfig, type RaceEncoding, type RaceFrame, type RaceGeometry, type RaceItem, type RaceLayout, type RaceLineGeometry, type RaceLineMarkDef, type RaceLineStatic, type RaceMarkDef, type RaceMarkType, type RacePlayback, type RaceSpec, type RaceSpecWithoutData, type RaceTableCell, type RaceTableColumn, type RaceTableGeometry, type RaceTableMarkDef, type RaceTableStatic, type RaceTick, type RadialGradient, type RangeAnnotation, type RangeEncoding, type ReaderBindingScope, type ReaderChangeMeta, type ReaderComparisonOperand, type ReaderComparisonResult, type ReaderComparisonScope, type ReaderDomainValue, type ReaderObservation, type ReaderPanelScope, type ReaderSelection, type ReaderSeries, type ReaderSlice, type ReaderSliceIndexOptions, type ReaderSliceMember, type ReaderSliceSelection, type Rect, type RectEncoding, type RectMark, type RefLineAnnotation, type RelativeTimeRef, type ResolveConfig, type ResolveMode, type ResolvedAnimation, type ResolvedAnimationPhase, type ResolvedAnnotation, type ResolvedChrome, type ResolvedChromeElement, type ResolvedChromeRule, type ResolvedColumn, type ResolvedFillPattern, type ResolvedLabel, type ResolvedMetricBar, type ResolvedMetricCell, type ResolvedSeriesSearch, type ResolvedTheme, type ResolvedThemeColors, type ResolvedYouDrawIt, type ResponsiveConfig, type RoleTiming, type RuleMarkLayout, SEQUENTIAL_PALETTES, SUPPORTED_SCHEME_NAMES, type SankeyEncoding, type SankeyLayout, type SankeyLinkColor, type SankeyLinkMark, type SankeyNodeAlign, type SankeyNodeMark, type SankeySpec, type SankeySpecOverride, type SankeySpecWithoutData, type ScaleConfig, type ScaleInvert, type ScaleType, type SequentialPalette, type SeriesSearchConfig, type SeriesStrategy, type SeriesStyle, type SizeLegendCircle, type SizeLegendLayout, type SortByField, type SortState, type SparklineColumnConfig, type SparklineData, type SparklineTableCell, type SpecPatch, type SpringConfig, type StaggerRule, type StoredVizSpec, TICK_LABEL_OFFSET, TICK_LINE_HEIGHT_FACTOR, TOP_PAD_EXTRA_NARROW, type TableBuilderOptions, type TableCell, type TableCellBase, type TableDensity, type TableLayout, type TableRow, type TableSpec, type TableSpecWithoutData, type TableTotalRow, type TextAnnotation, type TextEncoding, type TextMarkLayout, type TextStyle, type TextTableCell, type ThemeChromeDefaults, type ThemeColors, type ThemeConfig, type ThemeFontSizes, type ThemeFontWeights, type ThemeFonts, type ThemeRule, type ThemeSpacing, type TickEncoding, type TickMarkLayout, type TileMapBuilderOptions, type TileMapEncoding, type TileMapLayout, type TileMapPalette, type TileMapSpec, type TileMapSpecWithoutData, type TileMapTileMark, type TimeTickInterval, type TimeTickStep, type TimeUnit, type TimeUnitTransform, type TokenValue, type TooltipContent, type TooltipField, type Transform, UPDATE_ENTER_START, type UpdatePhaseConfig, type UpdateTimeline, 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, anchorMs, annotationSource, applyEditTransaction, areaChart, axisTitleOffset, barChart, broadsheet, buildCompactStepFormatter, buildD3Formatter, buildTemporalFormatter, checkPaletteDistinguishability, clampStaggerDelay, clarity, columnChart, computeChrome, computeFieldFormatContext, computeLabelBounds, computeNoteBandHeight, computeXAxisExtentFromLabels, contrastRatio, cssTokenDefault, curveStops, curveToCSSLinear, dataTable, deepMergeSpec, defaultNumberFormatter, deriveNeutralRamp, detectCollision, donutChart, dotChart, elementRef, encodePointerToken, entranceAnchorVars, entranceEndMs, entranceRole, entranceTiming, essay, estimateTextWidth, evalCubicBezier, evalCurve, evalKeyframes, evalRoleEase, evalValueCurve, findAccessibleColor, formatCurrency, formatDate, formatNumber, formatOrdinal, formatPercent, generateAltText, generateAriaLabels, generateDataTable, getAxisTitleOffset, getBreakpoint, getHeightClass, getLayoutStrategy, getRepresentativeColor, heuristicMeasure, inferFieldType, invertCurve, invertRoleEase, isAxislessMark, isBarListSpec, isChartSpec, isConditionalDef, isEncodingChannel, isGeoMapSpec, isGradientDef, isGraphSpec, isLayerSpec, isMonotoneCurve, isOpaqueColor, isRaceSpec, isRangeAnnotation, isRefLineAnnotation, isSafeLink, isSankeySpec, isTableSpec, isTextAnnotation, isTileMapSpec, isValueDef, isYearContext, jsonPointer, keyframeProperties, keyframeValueToCSS, legacyEditorial, lineChart, mapFeatureDuration, mapSweepTiming, maxRotatedLabelWidth, meetsAA, mergeThemeConfig, motionCSS, overlapArea, pickLabelColor, pieChart, progressTimeMs, resolveChromeEconomy, resolveCollisions, resolveMarkDef, resolveMarkType, resolveMeasurer, resolveNumberFormatter, resolveSchemeName, resolveTheme, roleBaseDuration, roleVars, sampleMotion, scatterChart, shuffledSweepDelays, simulateColorBlindness, springDuration, terminal, textAscent, tileMap, tilemapTileDelays, truncateRotatedLabel, truncateToWidth, updateTimeline, wire, wrapText };
package/dist/index.js CHANGED
@@ -397,6 +397,16 @@ var elementRef = {
397
397
  key,
398
398
  index,
399
399
  ...path !== void 0 ? { path } : {}
400
+ }),
401
+ axis: (axis, path) => ({
402
+ type: "axis",
403
+ axis,
404
+ ...path !== void 0 ? { path } : {}
405
+ }),
406
+ series: (series, path) => ({
407
+ type: "series",
408
+ series,
409
+ ...path !== void 0 ? { path } : {}
400
410
  })
401
411
  };
402
412
 
@@ -1970,6 +1980,7 @@ var DEFAULT_THEME = /* @__PURE__ */ (() => ({
1970
1980
  annotationText: "#71717a",
1971
1981
  annotationLabel: "#333333",
1972
1982
  annotationMuted: "#6b7280",
1983
+ muted: "#d4d4d8",
1973
1984
  annotationLeader: "#8f8f8f",
1974
1985
  annotationRule: "#888888",
1975
1986
  annotationRangeFill: "#f0c040",
@@ -2140,6 +2151,7 @@ function adaptTheme(theme) {
2140
2151
  annotationText: pairs?.["colors.annotationText"] ? pairs["colors.annotationText"].dark : overridden(theme.colors.annotationText, light.annotationText, darkMuted),
2141
2152
  annotationLabel: authoredColor("annotationLabel", "#d1d5db"),
2142
2153
  annotationMuted: authoredColor("annotationMuted", "#9ca3af"),
2154
+ muted: authoredColor("muted", ACHROMATIC_RAMP.fgFaint),
2143
2155
  annotationLeader: authoredColor("annotationLeader", "#9aa0a6"),
2144
2156
  annotationRule: authoredColor("annotationRule", "#9ca3af"),
2145
2157
  annotationRangeFill: authoredColor("annotationRangeFill", "#f0c040"),
@@ -2393,6 +2405,7 @@ function themeConfigToPartial(config, base2) {
2393
2405
  colors.annotationLabel = resolveTokenLight(config.colors.annotationLabel);
2394
2406
  if (config.colors.annotationMuted)
2395
2407
  colors.annotationMuted = resolveTokenLight(config.colors.annotationMuted);
2408
+ if (config.colors.muted) colors.muted = resolveTokenLight(config.colors.muted);
2396
2409
  if (config.colors.annotationLeader)
2397
2410
  colors.annotationLeader = resolveTokenLight(config.colors.annotationLeader);
2398
2411
  if (config.colors.annotationRule)
@@ -2502,6 +2515,7 @@ function collectTokenPairs(config) {
2502
2515
  "annotationText",
2503
2516
  "annotationLabel",
2504
2517
  "annotationMuted",
2518
+ "muted",
2505
2519
  "annotationLeader",
2506
2520
  "annotationRule",
2507
2521
  "annotationRangeFill",
@@ -2609,6 +2623,7 @@ function resolveTheme(userTheme, base2 = DEFAULT_THEME) {
2609
2623
  if (dark) {
2610
2624
  merged = adaptChromeForDarkBg({ ...merged, colors: { ...merged.colors } }, merged.colors.text);
2611
2625
  const authoredColors2 = userTheme?.colors && !Array.isArray(userTheme.colors) ? userTheme.colors : {};
2626
+ if (authoredColors2.muted === void 0) merged.colors.muted = ACHROMATIC_RAMP.fgFaint;
2612
2627
  for (const key of [
2613
2628
  "annotationLabel",
2614
2629
  "annotationMuted",
@@ -2645,10 +2660,24 @@ function resolveTheme(userTheme, base2 = DEFAULT_THEME) {
2645
2660
  }
2646
2661
 
2647
2662
  // src/layout/chrome.ts
2663
+ function isSafeLink(href) {
2664
+ try {
2665
+ const { protocol } = new URL(href);
2666
+ return protocol === "http:" || protocol === "https:" || protocol === "mailto:";
2667
+ } catch (error) {
2668
+ if (error instanceof TypeError) return false;
2669
+ throw error;
2670
+ }
2671
+ }
2648
2672
  function normalizeChromeText(value) {
2649
2673
  if (value === void 0) return null;
2650
2674
  if (typeof value === "string") return { text: value };
2651
- return { text: value.text, style: value.style, offset: value.offset };
2675
+ return {
2676
+ text: value.text,
2677
+ style: value.style,
2678
+ offset: value.offset,
2679
+ ...value.href && isSafeLink(value.href) ? { href: value.href } : {}
2680
+ };
2652
2681
  }
2653
2682
  function scaleFontSize(baseFontSize, width) {
2654
2683
  if (width >= 500) return baseFontSize;
@@ -2794,6 +2823,7 @@ function computeChrome(chrome, theme, width, measureText, chromeMode = "full", p
2794
2823
  const lineCount = estimateLineCount(eyebrowNorm.text, style, maxWidth, measureText, maxLines);
2795
2824
  const element = {
2796
2825
  text: eyebrowNorm.text,
2826
+ ...eyebrowNorm.href ? { href: eyebrowNorm.href } : {},
2797
2827
  x: pad + (eyebrowNorm.offset?.dx ?? 0),
2798
2828
  y: topY + (eyebrowNorm.offset?.dy ?? 0),
2799
2829
  maxWidth,
@@ -2817,6 +2847,7 @@ function computeChrome(chrome, theme, width, measureText, chromeMode = "full", p
2817
2847
  const lineCount = estimateLineCount(titleNorm.text, style, maxWidth, measureText, maxLines);
2818
2848
  const element = {
2819
2849
  text: titleNorm.text,
2850
+ ...titleNorm.href ? { href: titleNorm.href } : {},
2820
2851
  x: pad + (titleNorm.offset?.dx ?? 0),
2821
2852
  y: topY + (titleNorm.offset?.dy ?? 0),
2822
2853
  maxWidth,
@@ -2839,6 +2870,7 @@ function computeChrome(chrome, theme, width, measureText, chromeMode = "full", p
2839
2870
  const lineCount = estimateLineCount(subtitleNorm.text, style, maxWidth, measureText, maxLines);
2840
2871
  const element = {
2841
2872
  text: subtitleNorm.text,
2873
+ ...subtitleNorm.href ? { href: subtitleNorm.href } : {},
2842
2874
  x: pad + (subtitleNorm.offset?.dx ?? 0),
2843
2875
  y: topY + (subtitleNorm.offset?.dy ?? 0),
2844
2876
  maxWidth,
@@ -2895,6 +2927,7 @@ function computeChrome(chrome, theme, width, measureText, chromeMode = "full", p
2895
2927
  );
2896
2928
  brandElement = {
2897
2929
  text: brandNorm.text,
2930
+ ...brandNorm.href ? { href: brandNorm.href } : {},
2898
2931
  x: width - pad + (brandNorm.offset?.dx ?? 0),
2899
2932
  y: startY + (brandNorm.offset?.dy ?? 0),
2900
2933
  maxWidth: Math.max(1, Math.min(maxWidth, naturalWidth)),
@@ -2943,6 +2976,7 @@ function computeChrome(chrome, theme, width, measureText, chromeMode = "full", p
2943
2976
  const itemY = y + (norm.offset?.dy ?? 0);
2944
2977
  elements[key] = {
2945
2978
  text: norm.text,
2979
+ ...norm.href ? { href: norm.href } : {},
2946
2980
  x: pad + (norm.offset?.dx ?? 0),
2947
2981
  y: itemY,
2948
2982
  maxWidth: available,
@@ -4972,6 +5006,7 @@ export {
4972
5006
  isRaceSpec,
4973
5007
  isRangeAnnotation,
4974
5008
  isRefLineAnnotation,
5009
+ isSafeLink,
4975
5010
  isSankeySpec,
4976
5011
  isTableSpec,
4977
5012
  isTextAnnotation,