semiotic 3.8.5 → 3.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CLAUDE.md +5 -4
  2. package/README.md +42 -42
  3. package/ai/behaviorContracts.cjs +2 -2
  4. package/ai/componentMetadata.cjs +1 -1
  5. package/ai/dist/mcp-server.js +2 -0
  6. package/ai/examples.md +44 -2
  7. package/ai/schema.json +385 -14
  8. package/ai/surface-manifest.json +6 -4
  9. package/ai/system-prompt.md +1 -1
  10. package/dist/{chunk-chartContainerDataAudit-74TLKIP6.module.min.js → chunk-chartContainerDataAudit-FEOD5GTQ.module.min.js} +1 -1
  11. package/dist/chunk-chunk-2CHN2TA3.module.min.js +1 -0
  12. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +1 -0
  13. package/dist/chunk-chunk-3NGIKFD6.module.min.js +1 -0
  14. package/dist/chunk-chunk-3SHB24AG.module.min.js +1 -0
  15. package/dist/chunk-chunk-4MMOOYTX.module.min.js +2 -0
  16. package/dist/{chunk-chunk-KT2VAZMZ.module.min.js → chunk-chunk-75OTQSXS.module.min.js} +1 -1
  17. package/dist/chunk-chunk-A5GRQUOF.module.min.js +1 -0
  18. package/dist/chunk-chunk-AAF5LZAU.module.min.js +2 -0
  19. package/dist/{chunk-chunk-4AANPFOX.module.min.js → chunk-chunk-ARZGA4LJ.module.min.js} +1 -1
  20. package/dist/chunk-chunk-CAFLML4L.module.min.js +2 -0
  21. package/dist/chunk-chunk-FHBN7OEB.module.min.js +2 -0
  22. package/dist/{chunk-chunk-TMWIZL3K.module.min.js → chunk-chunk-GFTVACTO.module.min.js} +1 -1
  23. package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
  24. package/dist/chunk-chunk-ITDWLZXV.module.min.js +2 -0
  25. package/dist/chunk-chunk-LPSPATPC.module.min.js +1 -0
  26. package/dist/chunk-chunk-OM6NWS4H.module.min.js +2 -0
  27. package/dist/chunk-chunk-PX5YQGDP.module.min.js +2 -0
  28. package/dist/chunk-chunk-Q2BS46W2.module.min.js +2 -0
  29. package/dist/{chunk-chunk-LJLS6DY7.module.min.js → chunk-chunk-RA7JCG7D.module.min.js} +1 -1
  30. package/dist/chunk-chunk-RNUHEXZA.module.min.js +2 -0
  31. package/dist/chunk-chunk-ROZWKEUG.module.min.js +1 -0
  32. package/dist/chunk-chunk-SMVD3EQJ.module.min.js +2 -0
  33. package/dist/chunk-chunk-T2FKJD4O.module.min.js +2 -0
  34. package/dist/{chunk-chunk-K3DMEW22.module.min.js → chunk-chunk-UDREYOLV.module.min.js} +1 -1
  35. package/dist/chunk-chunk-VOWE3SAP.module.min.js +2 -0
  36. package/dist/chunk-chunk-VQPNBUSW.module.min.js +2 -0
  37. package/dist/{chunk-chunk-N5DDKCCF.module.min.js → chunk-chunk-WAWCIHFJ.module.min.js} +1 -1
  38. package/dist/{chunk-chunk-XXWSHGPL.module.min.js → chunk-chunk-WYARAXHR.module.min.js} +1 -1
  39. package/dist/{chunk-chunk-I36PJ4OC.module.min.js → chunk-chunk-XP3OHHFX.module.min.js} +1 -1
  40. package/dist/chunk-chunk-XV3KGYTR.module.min.js +2 -0
  41. package/dist/chunk-chunk-YC2IVEPX.module.min.js +1 -0
  42. package/dist/components/ai/chartCapabilities.d.ts +2 -1
  43. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  44. package/dist/components/charts/geo/DistanceCartogram.d.ts +1 -1
  45. package/dist/components/charts/index.d.ts +3 -0
  46. package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
  47. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  48. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
  49. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
  50. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
  51. package/dist/components/charts/shared/chartSpecCore.d.ts +2 -4
  52. package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
  53. package/dist/components/charts/shared/gradient.d.ts +35 -0
  54. package/dist/components/charts/shared/hatchFill.d.ts +3 -10
  55. package/dist/components/charts/shared/hooks.d.ts +2 -50
  56. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  57. package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
  58. package/dist/components/charts/shared/useChartLegend.d.ts +58 -0
  59. package/dist/components/charts/shared/useChartSetup.d.ts +5 -0
  60. package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
  61. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
  62. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  63. package/dist/components/charts/xy/AreaChart.d.ts +25 -42
  64. package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
  65. package/dist/components/charts/xy/BumpChart.d.ts +161 -0
  66. package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
  67. package/dist/components/charts/xy/Heatmap.d.ts +3 -0
  68. package/dist/components/charts/xy/LineChart.d.ts +6 -8
  69. package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
  70. package/dist/components/legendLayout.d.ts +19 -1
  71. package/dist/components/semiotic-ai.d.ts +2 -1
  72. package/dist/components/semiotic-geo.d.ts +1 -0
  73. package/dist/components/semiotic-network.d.ts +1 -0
  74. package/dist/components/semiotic-ordinal.d.ts +2 -0
  75. package/dist/components/semiotic-physics.d.ts +1 -0
  76. package/dist/components/semiotic-realtime-core.d.ts +1 -0
  77. package/dist/components/semiotic-server-edge.d.ts +1 -1
  78. package/dist/components/semiotic-server.d.ts +1 -1
  79. package/dist/components/semiotic-xy.d.ts +4 -0
  80. package/dist/components/semiotic.d.ts +4 -4
  81. package/dist/components/server/serverChartConfigs.d.ts +1 -0
  82. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  83. package/dist/components/server/staticLegend.d.ts +4 -2
  84. package/dist/components/server/staticSVGChrome.d.ts +4 -4
  85. package/dist/components/stream/GeoSVGOverlay.d.ts +4 -10
  86. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
  87. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
  88. package/dist/components/stream/SVGOverlay.d.ts +2 -6
  89. package/dist/components/stream/StalenessBadge.d.ts +2 -6
  90. package/dist/components/stream/geoTypes.d.ts +3 -6
  91. package/dist/components/stream/legendRenderer.d.ts +2 -6
  92. package/dist/components/stream/ordinalTypes.d.ts +7 -31
  93. package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
  94. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
  95. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
  96. package/dist/components/stream/pipelineConfig.d.ts +7 -15
  97. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
  98. package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
  99. package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
  100. package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
  101. package/dist/components/stream/types.d.ts +32 -56
  102. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
  103. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
  104. package/dist/components/types/legendTypes.d.ts +15 -6
  105. package/dist/geo.min.js +1 -1
  106. package/dist/geo.module.min.js +1 -1
  107. package/dist/network.min.js +1 -1
  108. package/dist/network.module.min.js +1 -1
  109. package/dist/ordinal.min.js +1 -1
  110. package/dist/ordinal.module.min.js +1 -1
  111. package/dist/physics.min.js +1 -1
  112. package/dist/physics.module.min.js +1 -1
  113. package/dist/physicsWorker.js +1 -1
  114. package/dist/realtime.min.js +1 -1
  115. package/dist/realtime.module.min.js +1 -1
  116. package/dist/semiotic-ai-core.min.js +1 -1
  117. package/dist/semiotic-ai-core.module.min.js +1 -1
  118. package/dist/semiotic-ai.d.ts +2 -1
  119. package/dist/semiotic-ai.min.js +1 -1
  120. package/dist/semiotic-ai.module.min.js +1 -1
  121. package/dist/semiotic-experimental.min.js +1 -1
  122. package/dist/semiotic-experimental.module.min.js +1 -1
  123. package/dist/semiotic-geo.d.ts +1 -0
  124. package/dist/semiotic-network.d.ts +1 -0
  125. package/dist/semiotic-ordinal.d.ts +2 -0
  126. package/dist/semiotic-physics.d.ts +1 -0
  127. package/dist/semiotic-realtime-core.d.ts +1 -0
  128. package/dist/semiotic-realtime-core.min.js +1 -1
  129. package/dist/semiotic-realtime-core.module.min.js +1 -1
  130. package/dist/semiotic-recipes-core.module.min.js +1 -1
  131. package/dist/semiotic-recipes.module.min.js +1 -1
  132. package/dist/semiotic-server-edge.d.ts +1 -1
  133. package/dist/semiotic-server-edge.min.js +1 -1
  134. package/dist/semiotic-server-edge.module.min.js +1 -1
  135. package/dist/semiotic-server-node.min.js +1 -1
  136. package/dist/semiotic-server-node.module.min.js +1 -1
  137. package/dist/semiotic-server.d.ts +1 -1
  138. package/dist/semiotic-utils-core.min.js +1 -1
  139. package/dist/semiotic-utils-core.module.min.js +1 -1
  140. package/dist/semiotic-utils.min.js +1 -1
  141. package/dist/semiotic-utils.module.min.js +1 -1
  142. package/dist/semiotic-xy.d.ts +4 -0
  143. package/dist/semiotic.d.ts +4 -4
  144. package/dist/semiotic.min.js +1 -1
  145. package/dist/semiotic.module.min.js +1 -1
  146. package/dist/server.min.js +1 -1
  147. package/dist/server.module.min.js +1 -1
  148. package/dist/xy.min.js +1 -1
  149. package/dist/xy.module.min.js +1 -1
  150. package/package.json +1 -1
  151. package/dist/chunk-chunk-5I3UZV4Q.module.min.js +0 -2
  152. package/dist/chunk-chunk-74CCPVXB.module.min.js +0 -1
  153. package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
  154. package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
  155. package/dist/chunk-chunk-BANTPINB.module.min.js +0 -2
  156. package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
  157. package/dist/chunk-chunk-CKMD5NV3.module.min.js +0 -2
  158. package/dist/chunk-chunk-CWQ5YIHX.module.min.js +0 -2
  159. package/dist/chunk-chunk-E6TXX6MI.module.min.js +0 -1
  160. package/dist/chunk-chunk-L6EA5V3G.module.min.js +0 -2
  161. package/dist/chunk-chunk-LJPCLYSC.module.min.js +0 -2
  162. package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
  163. package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
  164. package/dist/chunk-chunk-NLO44TOS.module.min.js +0 -2
  165. package/dist/chunk-chunk-PZJ2SBLL.module.min.js +0 -2
  166. package/dist/chunk-chunk-QUJ6TTLY.module.min.js +0 -1
  167. package/dist/chunk-chunk-RBIDBUT4.module.min.js +0 -2
  168. package/dist/chunk-chunk-RFLAG356.module.min.js +0 -1
  169. package/dist/chunk-chunk-RPU4IZAV.module.min.js +0 -2
  170. package/dist/chunk-chunk-SKMBCFIL.module.min.js +0 -2
  171. package/dist/chunk-chunk-TAE7W424.module.min.js +0 -2
  172. package/dist/chunk-chunk-TUBMTZMU.module.min.js +0 -2
  173. package/dist/chunk-chunk-UFFEXJQY.module.min.js +0 -1
  174. package/dist/chunk-chunk-XSCHTS4D.module.min.js +0 -2
  175. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
  176. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
@@ -1,6 +1,7 @@
1
1
  import type { ChartCapability } from "./chartCapabilityTypes";
2
2
  import { LineChartCapability } from "../charts/xy/LineChart.capability";
3
3
  import { AreaChartCapability } from "../charts/xy/AreaChart.capability";
4
+ import { BumpChartCapability } from "../charts/xy/BumpChart.capability";
4
5
  import { StackedAreaChartCapability } from "../charts/xy/StackedAreaChart.capability";
5
6
  import { ScatterplotCapability } from "../charts/xy/Scatterplot.capability";
6
7
  import { ConnectedScatterplotCapability } from "../charts/xy/ConnectedScatterplot.capability";
@@ -60,4 +61,4 @@ export declare function unregisterChartCapability(component: string): void;
60
61
  export declare function getCapabilities(): ReadonlyArray<ChartCapability>;
61
62
  /** Look up a capability by component name. */
62
63
  export declare function getCapability(component: string): ChartCapability | undefined;
63
- export { LineChartCapability, AreaChartCapability, StackedAreaChartCapability, ScatterplotCapability, ConnectedScatterplotCapability, BubbleChartCapability, QuadrantChartCapability, MultiAxisLineChartCapability, MinimapChartCapability, DifferenceChartCapability, CandlestickChartCapability, HeatmapCapability, BarChartCapability, GroupedBarChartCapability, StackedBarChartCapability, DotPlotCapability, PieChartCapability, DonutChartCapability, FunnelChartCapability, GaugeChartCapability, LikertChartCapability, SwimlaneChartCapability, HistogramCapability, BoxPlotCapability, SwarmPlotCapability, ViolinPlotCapability, RidgelinePlotCapability, ForceDirectedGraphCapability, SankeyDiagramCapability, ChordDiagramCapability, ProcessSankeyCapability, TreeDiagramCapability, TreemapCapability, CirclePackCapability, OrbitDiagramCapability, ChoroplethMapCapability, ProportionalSymbolMapCapability, FlowMapCapability, DistanceCartogramCapability, GaltonBoardChartCapability, EventDropChartCapability, PhysicsPileChartCapability, CollisionSwarmChartCapability, PhysicalFlowChartCapability, ProcessFlowChartCapability, GauntletChartCapability, CrucibleChartCapability };
64
+ export { LineChartCapability, AreaChartCapability, BumpChartCapability, StackedAreaChartCapability, ScatterplotCapability, ConnectedScatterplotCapability, BubbleChartCapability, QuadrantChartCapability, MultiAxisLineChartCapability, MinimapChartCapability, DifferenceChartCapability, CandlestickChartCapability, HeatmapCapability, BarChartCapability, GroupedBarChartCapability, StackedBarChartCapability, DotPlotCapability, PieChartCapability, DonutChartCapability, FunnelChartCapability, GaugeChartCapability, LikertChartCapability, SwimlaneChartCapability, HistogramCapability, BoxPlotCapability, SwarmPlotCapability, ViolinPlotCapability, RidgelinePlotCapability, ForceDirectedGraphCapability, SankeyDiagramCapability, ChordDiagramCapability, ProcessSankeyCapability, TreeDiagramCapability, TreemapCapability, CirclePackCapability, OrbitDiagramCapability, ChoroplethMapCapability, ProportionalSymbolMapCapability, FlowMapCapability, DistanceCartogramCapability, GaltonBoardChartCapability, EventDropChartCapability, PhysicsPileChartCapability, CollisionSwarmChartCapability, PhysicalFlowChartCapability, ProcessFlowChartCapability, GauntletChartCapability, CrucibleChartCapability };
@@ -7,6 +7,7 @@ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types"
7
7
  import type { TooltipProp } from "../../Tooltip/Tooltip";
8
8
  import type { ChartRecipe } from "../../ai/chartRecipes";
9
9
  import type { LegendValue } from "../../types/legendTypes";
10
+ import type { LegendInteractionMode, LegendPosition } from "../shared/useChartLegend";
10
11
  export interface XYCustomChartProps<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> extends BaseChartProps, AxisConfig {
11
12
  /** Data passed through to LayoutContext.data. */
12
13
  data?: TDatum[];
@@ -34,6 +35,8 @@ export interface XYCustomChartProps<TDatum extends Datum = Datum, TConfig extend
34
35
  showLegend?: boolean;
35
36
  /** Additional legend content. Categorical groups follow the inferred colorBy legend. */
36
37
  legend?: LegendValue;
38
+ legendInteraction?: LegendInteractionMode;
39
+ legendPosition?: LegendPosition;
37
40
  annotations?: Datum[];
38
41
  /** Field or function that declares the semantic category used for custom-layout color. */
39
42
  colorBy?: ChartAccessor<TDatum, string>;
@@ -25,7 +25,7 @@ export interface DistanceCartogramProps<TDatum extends Datum = Datum> extends Ba
25
25
  center: string;
26
26
  /** Cost/distance accessor — numeric field or function */
27
27
  costAccessor: string | ((d: Datum) => number);
28
- /** Interpolation between geographic (0) and cartogram (1) @default 1 */
28
+ /** Interpolation between geographic (0) and cartogram (1), clamped to [0, 1]. @default 1 */
29
29
  strength?: number;
30
30
  /** Line rendering mode @default "straight" */
31
31
  lineMode?: "straight" | "fractional";
@@ -12,8 +12,11 @@ export { ConnectedScatterplot } from "./xy/ConnectedScatterplot";
12
12
  export type { ConnectedScatterplotProps } from "./xy/ConnectedScatterplot";
13
13
  export { LineChart } from "./xy/LineChart";
14
14
  export type { LineChartProps } from "./xy/LineChart";
15
+ export { BumpChart, rankBumpData } from "./xy/BumpChart";
16
+ export type { BumpChartProps, RankedBumpData, RankedBumpDatum, RankBumpDataOptions, } from "./xy/BumpChart";
15
17
  export { AreaChart } from "./xy/AreaChart";
16
18
  export type { AreaChartProps, SemanticGradientStop } from "./xy/AreaChart";
19
+ export type { GradientConfig, GradientStop, SemanticGradientInput, } from "./shared/gradient";
17
20
  export { DifferenceChart } from "./xy/DifferenceChart";
18
21
  export type { DifferenceChartProps } from "./xy/DifferenceChart";
19
22
  export { StackedAreaChart } from "./xy/StackedAreaChart";
@@ -7,6 +7,7 @@ import { type TooltipProp } from "../../Tooltip/Tooltip";
7
7
  import type { RealtimeFrameHandle } from "../../realtime/types";
8
8
  import { type StyleRule } from "../shared/styleRules";
9
9
  import { type RegressionProp } from "../shared/regressionUtils";
10
+ import { type GradientInput } from "../shared/gradient";
10
11
  /**
11
12
  * BarChart component props
12
13
  */
@@ -64,24 +65,16 @@ export interface BarChartProps<TDatum extends Datum = Datum> extends BaseChartPr
64
65
  /** Rounded top corner radius in pixels. Only the end away from the baseline is rounded. */
65
66
  roundedTop?: number;
66
67
  /**
67
- * Gradient fill from the bar's tip (opposite the baseline) toward its base.
68
- * - `true` default opacity fade (80% 5% of the resolved fill color).
69
- * - `{ topOpacity, bottomOpacity }` — explicit opacity stops on the resolved fill.
70
- * - `{ colorStops: [{offset, color}, ...] }` — arbitrary multi-color gradient.
71
- *
68
+ * Gradient fill from the bar's tip (offset 0) toward its base (offset 1).
69
+ * Stops can set `color`, `opacity`, or both. Omit a stop color to inherit
70
+ * the resolved bar color.
71
+ * @example
72
+ * `{ stops: [{ offset: 0, opacity: 0.8 }, { offset: 1, opacity: 0.05 }] }`
72
73
  * Direction follows the bar's orientation (vertical/horizontal) and sign
73
74
  * (positive/negative bars). Same API as `AreaChart.gradientFill`.
74
75
  * @default false
75
76
  */
76
- gradientFill?: boolean | {
77
- topOpacity: number;
78
- bottomOpacity: number;
79
- } | {
80
- colorStops: Array<{
81
- offset: number;
82
- color: string;
83
- }>;
84
- };
77
+ gradientFill?: GradientInput;
85
78
  /**
86
79
  * Declarative, threshold-aware bar styling. An ordered list of
87
80
  * `{ when, style }` rules; every rule whose condition matches a bar
@@ -25,6 +25,9 @@ export interface GaugeChartProps extends BaseChartProps {
25
25
  /**
26
26
  * Arc-length gradient for the gauge band.
27
27
  *
28
+ * Offset 0 is the sweep start and offset 1 is the sweep end. Stops can set
29
+ * `color`, `opacity`, or both.
30
+ *
28
31
  * The gradient is sampled along the visible filled arc from sweep start
29
32
  * toward the current value. If `fillZones` is false, the entire arc uses
30
33
  * the gradient. If `fillZones` is true, the unfilled remainder stays on
@@ -6,6 +6,7 @@ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/
6
6
  import { type TooltipProp } from "../../Tooltip/Tooltip";
7
7
  import { type StyleRule } from "../shared/styleRules";
8
8
  import type { RealtimeFrameHandle } from "../../realtime/types";
9
+ import { type GradientInput } from "../shared/gradient";
9
10
  export interface GroupedBarChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
10
11
  data?: TDatum[];
11
12
  categoryAccessor?: ChartAccessor<TDatum, string>;
@@ -22,6 +23,8 @@ export interface GroupedBarChartProps<TDatum extends Datum = Datum> extends Base
22
23
  barPadding?: number;
23
24
  /** Rounded corner radius on bar ends (away from baseline). */
24
25
  roundedTop?: number;
26
+ /** Tip-to-base bar gradient using `{ stops: [{ offset, color?, opacity? }] }`. */
27
+ gradientFill?: GradientInput;
25
28
  /**
26
29
  * Declarative, threshold-aware bar styling. Ordered `{ when, style }`
27
30
  * rules; the last applicable rule wins per property. `when` accepts a
@@ -6,6 +6,7 @@ import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/
6
6
  import { type TooltipProp } from "../../Tooltip/Tooltip";
7
7
  import type { RealtimeFrameHandle } from "../../realtime/types";
8
8
  import { type StyleRule } from "../shared/styleRules";
9
+ import { type GradientInput } from "../shared/gradient";
9
10
  export interface StackedBarChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
10
11
  data?: TDatum[];
11
12
  categoryAccessor?: ChartAccessor<TDatum, string>;
@@ -23,6 +24,8 @@ export interface StackedBarChartProps<TDatum extends Datum = Datum> extends Base
23
24
  barPadding?: number;
24
25
  /** Rounded top corner radius. Only the topmost stacked segment gets rounded. */
25
26
  roundedTop?: number;
27
+ /** Tip-to-base segment gradient using `{ stops: [{ offset, color?, opacity? }] }`. */
28
+ gradientFill?: GradientInput;
26
29
  /**
27
30
  * Declarative, threshold-aware segment styling. Ordered `{ when, style }`
28
31
  * rules; the last applicable rule wins per property. `when` accepts a
@@ -5,6 +5,7 @@ import type { LegendInteractionMode } from "../shared/hooks";
5
5
  import type { BaseChartProps, ChartAccessor, CategoryFormatFn } from "../shared/types";
6
6
  import { type TooltipProp } from "../../Tooltip/Tooltip";
7
7
  import type { RealtimeFrameHandle } from "../../realtime/types";
8
+ import { type GradientInput } from "../shared/gradient";
8
9
  export interface SwimlaneChartProps<TDatum extends Datum = Datum> extends BaseChartProps {
9
10
  /** Data array. Omit for push API mode. */
10
11
  data?: TDatum[];
@@ -61,20 +62,9 @@ export interface SwimlaneChartProps<TDatum extends Datum = Datum> extends BaseCh
61
62
  rTickValues?: number[];
62
63
  /** Align first value tick label to start, last to end. Prevents clipping at chart edges. */
63
64
  tickLabelEdgeAlign?: boolean;
64
- /** Gradient fill for swimlane segments. `true` uses tip→base opacity ramp;
65
- * pass `{ topOpacity, bottomOpacity }` for a uniform alpha gradient or
66
- * `{ colorStops }` for a multi-stop color ramp. Same shape as
67
- * BarChart.gradientFill / AreaChart.gradientFill. The gradient runs along
68
- * the lane's growth direction (left→right horizontal, bottom→top vertical). */
69
- gradientFill?: boolean | {
70
- topOpacity: number;
71
- bottomOpacity: number;
72
- } | {
73
- colorStops: Array<{
74
- offset: number;
75
- color: string;
76
- }>;
77
- };
65
+ /** Gradient fill along the lane's growth direction. Offset 0 is the tip
66
+ * and offset 1 is the base. Stops can set `color`, `opacity`, or both. */
67
+ gradientFill?: GradientInput;
78
68
  /** Lane "track" fill — a rect drawn behind each lane spanning the full
79
69
  * value-axis range, sized to the lane's bandwidth. Lets budget/progress
80
70
  * lanes read as filled vs. empty. Pass a color string (CSS vars
@@ -1,12 +1,10 @@
1
1
  /**
2
- * Single source of truth for per-chart prop specifications.
3
- *
4
- * Three downstream consumers used to maintain their own per-chart entries:
2
+ * Single source of truth for per-chart prop specifications consumed by:
5
3
  * - `ai/schema.json` (LLM tool definitions)
6
4
  * - `src/components/charts/shared/validationMap.ts` (runtime prop validation)
7
5
  * - `ai/componentMetadata.cjs` (category buckets)
8
6
  *
9
- * Today, `validationMap.generated.ts` and `ai/schema.json` are generated from
7
+ * `validationMap.generated.ts` and `ai/schema.json` are generated from
10
8
  * this registry — run `npm run docs:chart-specs:schema` to refresh both after
11
9
  * editing a spec. `componentMetadata.cjs` is still
12
10
  * hand-edited but gated for parity by the registry: `check:chart-specs` (run
@@ -1,16 +1,12 @@
1
1
  import type { Datum } from "./datumTypes";
2
+ import type { ColorGradientInput, GradientConfig, GradientStop } from "./gradient";
2
3
  export interface GaugeThresholdLike {
3
4
  value: number;
4
5
  color: string;
5
6
  label?: string;
6
7
  }
7
- export interface GaugeGradientStop {
8
- offset: number;
9
- color: string;
10
- }
11
- export interface GaugeGradientFill {
12
- colorStops: GaugeGradientStop[];
13
- }
8
+ export type GaugeGradientStop = GradientStop;
9
+ export type GaugeGradientFill = ColorGradientInput;
14
10
  export interface GaugeArcDatum extends Datum {
15
11
  category: string;
16
12
  value: number;
@@ -48,7 +44,7 @@ interface BuildGaugeArcModelOptions {
48
44
  backgroundColor: string;
49
45
  fillZones: boolean;
50
46
  showScaleLabels: boolean;
51
- gradientFill?: GaugeGradientFill;
47
+ gradientFill?: GradientConfig;
52
48
  gradientSteps?: number;
53
49
  }
54
50
  /**
@@ -0,0 +1,35 @@
1
+ export interface GradientStop {
2
+ /** Position along the gradient, clamped to 0–1. */
3
+ offset: number;
4
+ /** Stop color. Omit to inherit the mark's resolved color. */
5
+ color?: string;
6
+ /** Stop opacity, clamped to 0–1. */
7
+ opacity?: number;
8
+ }
9
+ export interface GradientConfig {
10
+ stops: GradientStop[];
11
+ }
12
+ interface ColorStopsConfig {
13
+ colorStops: Array<{
14
+ offset: number;
15
+ color: string;
16
+ }>;
17
+ }
18
+ interface OpacityEndpointsConfig {
19
+ topOpacity?: number;
20
+ bottomOpacity?: number;
21
+ }
22
+ export interface SemanticGradientStopInput {
23
+ at: number;
24
+ color: string;
25
+ opacity?: number;
26
+ }
27
+ export type GradientInput = GradientConfig | boolean | ColorStopsConfig | OpacityEndpointsConfig;
28
+ export type ColorGradientInput = GradientConfig | ColorStopsConfig;
29
+ export type SemanticGradientInput = GradientConfig | SemanticGradientStopInput[];
30
+ export declare const DEFAULT_GRADIENT: GradientConfig;
31
+ export declare function normalizeGradient(input: GradientInput | null | undefined, defaultGradient?: GradientConfig): GradientConfig | undefined;
32
+ export declare function normalizeColorGradient(input: ColorGradientInput | null | undefined): GradientConfig | undefined;
33
+ export declare function normalizeSemanticGradient(input: SemanticGradientInput | null | undefined): GradientConfig | undefined;
34
+ export declare function reverseGradient(gradient: GradientConfig): GradientConfig;
35
+ export {};
@@ -1,15 +1,8 @@
1
1
  /**
2
- * Declarative hatch-fill descriptor — a single value that renders as a
3
- * diagonal-line pattern on BOTH rendering backends.
2
+ * Declarative hatch-fill descriptor that renders as a diagonal-line pattern
3
+ * on both rendering backends.
4
4
  *
5
- * The library historically had two disjoint hatch primitives: a canvas
6
- * `createHatchPattern` (→ `CanvasPattern`) and an SVG `<pattern>` builder
7
- * (`hatchFill` recipe / `createSVGHatchPattern`). A caller had to know
8
- * which medium they were painting into and hand-produce the right thing —
9
- * which is why a `CanvasPattern` returned from a `pieceStyle` silently
10
- * collapses to a solid color in SSR (`svgFill` drops non-string fills).
11
- *
12
- * `HatchFill` closes that gap: it is a plain, serializable descriptor that
5
+ * `HatchFill` is a plain, serializable descriptor that
13
6
  * can be set directly as `style.fill`. The canvas renderer resolves it to a
14
7
  * `CanvasPattern` (`resolveHatchCanvasPattern`); the SVG serializer resolves
15
8
  * it to a `<pattern>` def + `url(#id)` (`hatchPatternDef` / `hatchFillId`).
@@ -2,9 +2,7 @@ export { DEFAULT_COLOR } from "./colorUtils";
2
2
  import type { SelectionHookResult } from "./selectionUtils";
3
3
  import type { OnObservationCallback } from "../../store/ObservationStore";
4
4
  import type { Accessor, SelectionConfig, LinkedHoverProp, ChartMode, HoverHighlightMode, ResolvedMobileInteractionConfig } from "./types";
5
- import type { MarginType, PartialMargin } from "../../types/marginType";
6
5
  import type { TransitionConfig } from "../../stream/types";
7
- import type { LegendValue } from "../../types/legendTypes";
8
6
  import type { Datum } from "./datumTypes";
9
7
  import type { ChartModeInput, ChartModeResult } from "./chartMode";
10
8
  export { DISABLED_MOBILE_INTERACTION, MOBILE_INTERACTION_DEFAULTS, MOBILE_INTERACTION_MIN_HIT_RADIUS, MOBILE_INTERACTION_TARGET_SIZE, isChartMode, resolveChartMode, resolveMobileInteraction, } from "./chartMode";
@@ -96,54 +94,8 @@ export declare function getCrosshairProps(linkedHover: unknown, crosshairSourceI
96
94
  linkedCrosshairName: string;
97
95
  linkedCrosshairSourceId: string;
98
96
  } | undefined;
99
- /**
100
- * Hook to create a legend and compute margins with legend-aware adjustment.
101
- * Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
102
- * expansion pattern that every chart with color encoding repeats.
103
- */
104
- export type LegendPosition = "right" | "left" | "top" | "bottom";
105
- export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, additionalLegend, }: {
106
- data: Array<Datum>;
107
- colorBy: Accessor<string> | undefined;
108
- colorScale: ((v: string) => string) | undefined;
109
- showLegend: boolean | undefined;
110
- legendPosition?: LegendPosition;
111
- userMargin: PartialMargin | undefined;
112
- defaults?: MarginType;
113
- categories?: string[];
114
- /** Caller legend composed after the chart's inferred categorical groups. */
115
- additionalLegend?: LegendValue;
116
- }): {
117
- legend: LegendValue | undefined;
118
- margin: MarginType;
119
- legendPosition: LegendPosition;
120
- };
121
- export type LegendInteractionMode = "highlight" | "isolate" | "none";
122
- export interface LegendInteractionState {
123
- highlightedCategory: string | null;
124
- isolatedCategories: Set<string>;
125
- onLegendHover: (item: {
126
- label: string;
127
- } | null) => void;
128
- onLegendClick: (item: {
129
- label: string;
130
- }) => void;
131
- /** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
132
- legendSelectionHook: {
133
- isActive: boolean;
134
- predicate: (d: Datum) => boolean;
135
- } | null;
136
- }
137
- /**
138
- * Hook managing legend highlight/isolate interaction.
139
- * - "highlight": hover over a legend item produces a selection hook that
140
- * `wrapStyleWithSelection` uses to dim non-matching data. The actual
141
- * dim opacity resolves in this order: per-chart
142
- * `selection.unselectedOpacity` → `theme.colors.selectionOpacity` →
143
- * `DEFAULT_SELECTION_OPACITY` fallback.
144
- * - "isolate": click toggles category visibility; click all to reset
145
- */
146
- export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
97
+ export { useChartLegendAndMargin, useLegendInteraction, } from "./useChartLegend";
98
+ export type { LegendPosition, LegendInteractionMode, LegendInteractionState, } from "./useChartLegend";
147
99
  /**
148
100
  * React-facing alias for {@link resolveChartMode}. Mode resolution is kept
149
101
  * pure so non-React renderers (notably semiotic/server) consume the exact same
@@ -5,5 +5,5 @@
5
5
  * This compact registry is intentionally separate from validation metadata:
6
6
  * config serialization only needs chart-name membership.
7
7
  */
8
- export declare const KNOWN_CHART_COMPONENTS: readonly ["BarChart", "StackedBarChart", "GroupedBarChart", "SwarmPlot", "BoxPlot", "Histogram", "ViolinPlot", "RidgelinePlot", "DotPlot", "PieChart", "DonutChart", "GaugeChart", "FunnelChart", "SwimlaneChart", "LikertChart", "LineChart", "AreaChart", "DifferenceChart", "StackedAreaChart", "Scatterplot", "BubbleChart", "Heatmap", "QuadrantChart", "MultiAxisLineChart", "CandlestickChart", "ConnectedScatterplot", "ScatterplotMatrix", "MinimapChart", "ForceDirectedGraph", "SankeyDiagram", "ProcessSankey", "ChordDiagram", "TreeDiagram", "Treemap", "CirclePack", "OrbitDiagram", "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram", "RealtimeLineChart", "RealtimeHistogram", "TemporalHistogram", "RealtimeSwarmChart", "RealtimeWaterfallChart", "RealtimeHeatmap", "GaltonBoardChart", "EventDropChart", "PhysicsPileChart", "CollisionSwarmChart", "GauntletChart", "CrucibleChart", "ProcessFlowChart", "PhysicalFlowChart", "BigNumber"];
8
+ export declare const KNOWN_CHART_COMPONENTS: readonly ["BarChart", "StackedBarChart", "GroupedBarChart", "SwarmPlot", "BoxPlot", "Histogram", "ViolinPlot", "RidgelinePlot", "DotPlot", "PieChart", "DonutChart", "GaugeChart", "FunnelChart", "SwimlaneChart", "LikertChart", "LineChart", "BumpChart", "AreaChart", "DifferenceChart", "StackedAreaChart", "Scatterplot", "BubbleChart", "Heatmap", "QuadrantChart", "MultiAxisLineChart", "CandlestickChart", "ConnectedScatterplot", "ScatterplotMatrix", "MinimapChart", "ForceDirectedGraph", "SankeyDiagram", "ProcessSankey", "ChordDiagram", "TreeDiagram", "Treemap", "CirclePack", "OrbitDiagram", "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram", "RealtimeLineChart", "RealtimeHistogram", "TemporalHistogram", "RealtimeSwarmChart", "RealtimeWaterfallChart", "RealtimeHeatmap", "GaltonBoardChart", "EventDropChart", "PhysicsPileChart", "CollisionSwarmChart", "GauntletChart", "CrucibleChart", "ProcessFlowChart", "PhysicalFlowChart", "BigNumber"];
9
9
  export declare function isKnownChartComponent(componentName: string): boolean;
@@ -18,8 +18,7 @@ import type { AutoPlaceAnnotations } from "../../recipes/annotationLayout";
18
18
  * and the user's tooltip body reads only fields it knows about.
19
19
  *
20
20
  * Typing the helper's return at the wider `HoverData` shape lets either
21
- * source flow through without a cast at the call site, matching the
22
- * inline form HOCs used before this refactor.
21
+ * source flow through without a cast at the call site.
23
22
  */
24
23
  type FrameTooltipContent = (d: HoverData) => ReactNode;
25
24
  /**
@@ -0,0 +1,58 @@
1
+ import type { Accessor } from "./types";
2
+ import type { MarginType, PartialMargin } from "../../types/marginType";
3
+ import type { LegendLayout, LegendValue } from "../../types/legendTypes";
4
+ import type { Datum } from "./datumTypes";
5
+ /**
6
+ * Hook to create a legend and compute margins with legend-aware adjustment.
7
+ * Consolidates the shouldShowLegend / createLegend / margin merge / right-margin
8
+ * expansion pattern that every chart with color encoding repeats.
9
+ */
10
+ export type LegendPosition = "right" | "left" | "top" | "bottom";
11
+ export declare function useChartLegendAndMargin({ data, colorBy, colorScale, showLegend, legendPosition, userMargin, defaults, categories, additionalLegend, chartWidth, legendLayout, hasTitle, }: {
12
+ data: Array<Datum>;
13
+ colorBy: Accessor<string> | undefined;
14
+ colorScale: ((v: string) => string) | undefined;
15
+ showLegend: boolean | undefined;
16
+ legendPosition?: LegendPosition;
17
+ userMargin: PartialMargin | undefined;
18
+ defaults?: MarginType;
19
+ categories?: string[];
20
+ /** Caller legend composed after the chart's inferred categorical groups. */
21
+ additionalLegend?: LegendValue;
22
+ /** Total chart width, used to estimate wrapping for top/bottom legends. */
23
+ chartWidth?: number;
24
+ /** Legend metrics shared with the renderer. */
25
+ legendLayout?: LegendLayout;
26
+ /** Reserve the chart-title band above a top legend. */
27
+ hasTitle?: boolean;
28
+ }): {
29
+ legend: LegendValue | undefined;
30
+ margin: MarginType;
31
+ legendPosition: LegendPosition;
32
+ };
33
+ export type LegendInteractionMode = "highlight" | "isolate" | "none";
34
+ export interface LegendInteractionState {
35
+ highlightedCategory: string | null;
36
+ isolatedCategories: Set<string>;
37
+ onLegendHover: (item: {
38
+ label: string;
39
+ } | null) => void;
40
+ onLegendClick: (item: {
41
+ label: string;
42
+ }) => void;
43
+ /** Selection predicate that dims non-matching data — use with wrapStyleWithSelection */
44
+ legendSelectionHook: {
45
+ isActive: boolean;
46
+ predicate: (d: Datum) => boolean;
47
+ } | null;
48
+ }
49
+ /**
50
+ * Hook managing legend highlight/isolate interaction.
51
+ * - "highlight": hover over a legend item produces a selection hook that
52
+ * `wrapStyleWithSelection` uses to dim non-matching data. The actual
53
+ * dim opacity resolves in this order: per-chart
54
+ * `selection.unselectedOpacity` → `theme.colors.selectionOpacity` →
55
+ * `DEFAULT_SELECTION_OPACITY` fallback.
56
+ * - "isolate": click toggles category visibility; click all to reset
57
+ */
58
+ export declare function useLegendInteraction(mode: LegendInteractionMode | undefined, colorBy: string | ((d: Datum) => string) | undefined, allCategories: string[]): LegendInteractionState;
@@ -8,6 +8,7 @@ import type { PartialMargin } from "../../types/marginType";
8
8
  import type { SelectionHookResult } from "./selectionUtils";
9
9
  import type { ReactElement, ReactNode } from "react";
10
10
  import type { LegendValue } from "../../types/legendTypes";
11
+ import type { LegendLayout } from "../../types/legendTypes";
11
12
  /**
12
13
  * Input parameters for useChartSetup.
13
14
  *
@@ -46,6 +47,8 @@ export interface ChartSetupInput {
46
47
  showLegend: boolean | undefined;
47
48
  /** Caller legend appended to inferred categorical legend groups. */
48
49
  legend?: LegendValue;
50
+ /** Shared legend metrics, including any side-axis gutter. */
51
+ legendLayout?: LegendLayout;
49
52
  /** User-provided margin */
50
53
  userMargin: PartialMargin | undefined;
51
54
  /** Mode-resolved margin defaults */
@@ -76,6 +79,8 @@ export interface ChartSetupInput {
76
79
  width: number;
77
80
  /** Resolved height from useChartMode */
78
81
  height: number;
82
+ /** Whether the resolved chart mode includes a title. */
83
+ hasTitle?: boolean;
79
84
  }
80
85
  /**
81
86
  * Output from useChartSetup.
@@ -1,7 +1,7 @@
1
1
  import type { Ref, RefObject, ReactElement, ReactNode } from "react";
2
2
  import { useChartMode } from "./hooks";
3
3
  import { type ChartSetupResult } from "./useChartSetup";
4
- import type { Accessor, ChartMode, SelectionConfig, LinkedHoverProp, MobileInteractionProp } from "./types";
4
+ import type { Accessor, ChartMode, SelectionConfig, LinkedHoverProp, MobileInteractionProp, HoverHighlightMode } from "./types";
5
5
  import type { MobileVisualizationContract } from "./auditMobileVisualization";
6
6
  import type { ResponsiveRule } from "./responsiveRules";
7
7
  import type { OnObservationCallback } from "../../store/ObservationStore";
@@ -9,6 +9,7 @@ import { type PartialMargin, type MarginType } from "../../types/marginType";
9
9
  import type { Datum } from "./datumTypes";
10
10
  import type { RealtimeFrameHandle } from "../../realtime/types";
11
11
  import type { LegendValue } from "../../types/legendTypes";
12
+ import type { LegendInteractionMode, LegendPosition } from "./useChartLegend";
12
13
  /**
13
14
  * Margin shorthand → sided form. The Stream*Frame margin props only
14
15
  * accept the sided object form, so HOCs that expose the user-friendly
@@ -67,9 +68,13 @@ interface DataSetupOptions extends ScaffoldOptions {
67
68
  colorBy?: Accessor<string>;
68
69
  /** Caller legend appended to the inferred colorBy legend. */
69
70
  legend?: LegendValue;
71
+ legendInteraction?: LegendInteractionMode;
72
+ legendPosition?: LegendPosition;
70
73
  /** Pass-through chart-setup inputs. */
71
74
  selection?: SelectionConfig;
72
75
  linkedHover?: LinkedHoverProp;
76
+ /** Dim sibling categories while hovering a custom-layout mark. */
77
+ hoverHighlight?: HoverHighlightMode;
73
78
  onObservation?: OnObservationCallback;
74
79
  onClick?: (datum: Datum, ev: {
75
80
  x: number;
@@ -47,6 +47,7 @@ export interface NetworkChartSetupInput<TNode extends Datum = Datum, TEdge exten
47
47
  userMargin?: PartialMargin;
48
48
  width: number;
49
49
  height: number;
50
+ hasTitle?: boolean;
50
51
  loading?: boolean;
51
52
  /** Custom content rendered in place of the default skeleton while `loading` is true. */
52
53
  loadingContent?: ReactNode | false;
@@ -49,7 +49,7 @@ export declare function useStreamingLegend({ isPushMode, colorBy, colorScheme, s
49
49
  };
50
50
  streamingLegend: {
51
51
  legendGroups: {
52
- styleFn: (d: import("../../types/legendTypes").LegendItem) => Record<string, string | number>;
52
+ styleFn: (d: import("../../semiotic-geo").LegendItem) => Record<string, string | number>;
53
53
  type: "fill";
54
54
  items: {
55
55
  label: string;
@@ -7,23 +7,8 @@ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types"
7
7
  import { type TooltipProp } from "../../Tooltip/Tooltip";
8
8
  import { type StyleRule } from "../shared/styleRules";
9
9
  import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
10
- export interface SemanticGradientStop {
11
- /** Percent from baseline to line/top. 0 = baseline, 100 = line/top. */
12
- at: number;
13
- color: string;
14
- /** Optional opacity applied to this stop. */
15
- opacity?: number;
16
- }
17
- /**
18
- * Convert value-anchored `semanticGradient` stops (`{ at, color }` on the value
19
- * scale, 0–100) into the frame's `gradientFill.colorStops` (offset 0 = top).
20
- * Exported so the server (`renderChart`) config resolves it identically to this
21
- * HOC — otherwise SSR silently drops `semanticGradient` and paints a flat area.
22
- */
23
- export declare function semanticGradientToColorStops(stops: SemanticGradientStop[]): Array<{
24
- offset: number;
25
- color: string;
26
- }>;
10
+ import { type ColorGradientInput, type GradientInput, type SemanticGradientInput, type SemanticGradientStopInput } from "../shared/gradient";
11
+ export type SemanticGradientStop = SemanticGradientStopInput;
27
12
  /**
28
13
  * AreaChart component props
29
14
  */
@@ -101,28 +86,28 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
101
86
  */
102
87
  y0Accessor?: ChartAccessor<TDatum, number>;
103
88
  /**
104
- * Gradient fill from line to baseline. Set `true` for default opacity (80% → 5%),
105
- * `{ topOpacity, bottomOpacity }` for custom opacity, or
106
- * `{ colorStops: [{offset, color}] }` for multi-color gradients.
89
+ * Gradient fill from the line to the baseline. Offset 0 is the line/top and
90
+ * offset 1 is the baseline. Omit a stop color to inherit the area color.
91
+ * @example
92
+ * `{ stops: [{ offset: 0, opacity: 0.8 }, { offset: 1, opacity: 0.05 }] }`
107
93
  * @default false
108
94
  */
109
- gradientFill?: boolean | {
110
- topOpacity: number;
111
- bottomOpacity: number;
112
- } | {
113
- colorStops: Array<{
114
- offset: number;
115
- color: string;
116
- }>;
117
- };
118
- /**
119
- * Semantic area gradient stops expressed in user-facing percentages:
120
- * `at: 0` is the baseline and `at: 100` is the line/top of the area.
121
- * This is converted to `gradientFill.colorStops`, whose raw offsets use
122
- * the renderer coordinate convention (`0` = top, `1` = baseline).
95
+ gradientFill?: GradientInput;
96
+ /**
97
+ * Value-anchored area gradient. Offset 0 is the resolved y-domain minimum
98
+ * and offset 1 is the resolved y-domain maximum.
123
99
  * When set, this takes precedence over `gradientFill`.
100
+ * @example
101
+ * `{ stops: [{ offset: 0, color: "#4e79a7" }, { offset: 1, color: "#d62728" }] }`
102
+ */
103
+ semanticGradient?: SemanticGradientInput;
104
+ /**
105
+ * Color the area's top-edge line with hard value bands derived from
106
+ * `semanticGradient`. Stop opacity is intentionally ignored for the line.
107
+ * Set to `false` to retain the normal solid stroke (or `lineGradient`).
108
+ * @default true when semanticGradient is set
124
109
  */
125
- semanticGradient?: SemanticGradientStop[];
110
+ semanticLine?: boolean;
126
111
  /**
127
112
  * Area opacity (flat fill, ignored when gradientFill is set)
128
113
  * @default 0.7
@@ -131,12 +116,7 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
131
116
  /**
132
117
  * Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
133
118
  */
134
- lineGradient?: {
135
- colorStops: Array<{
136
- offset: number;
137
- color: string;
138
- }>;
139
- };
119
+ lineGradient?: ColorGradientInput;
140
120
  /**
141
121
  * Show line on top of area
142
122
  * @default true
@@ -280,7 +260,10 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
280
260
  * xAccessor="t"
281
261
  * yAccessor="value"
282
262
  * color="steelblue"
283
- * gradientFill={{ topOpacity: 0.8, bottomOpacity: 0.05 }}
263
+ * gradientFill={{ stops: [
264
+ * { offset: 0, opacity: 0.8 },
265
+ * { offset: 1, opacity: 0.05 },
266
+ * ] }}
284
267
  * />
285
268
  * ```
286
269
  *
@@ -0,0 +1,11 @@
1
+ import type { ChartCapability } from "../../ai/chartCapabilityTypes";
2
+ /**
3
+ * BumpChart capability — the ranking-over-x chart. Its canonical job is the
4
+ * `rank` intent: several series ranked against each other at each x-column,
5
+ * with rank as vertical position and the crossings telling the "who overtook
6
+ * whom" story. The `ribbon` variant additionally encodes magnitude.
7
+ *
8
+ * Read alongside `BumpChart.tsx`; this is what makes the chart discoverable
9
+ * through `suggestCharts` and self-describing through `describeChart` (L4).
10
+ */
11
+ export declare const BumpChartCapability: ChartCapability;