semiotic 3.8.4 → 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 (222) hide show
  1. package/CLAUDE.md +9 -5
  2. package/README.md +52 -46
  3. package/ai/behaviorContracts.cjs +2 -2
  4. package/ai/componentMetadata.cjs +2 -2
  5. package/ai/dist/mcp-server.js +6 -2
  6. package/ai/examples.md +211 -2
  7. package/ai/schema.json +1388 -14
  8. package/ai/surface-manifest.json +8 -4
  9. package/ai/system-prompt.md +1 -1
  10. package/dist/chunk-chartContainerDataAudit-FEOD5GTQ.module.min.js +2 -0
  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-75OTQSXS.module.min.js +1 -0
  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-LQBSXO7K.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-CO5KQMGH.module.min.js +1 -0
  22. package/dist/chunk-chunk-FHBN7OEB.module.min.js +2 -0
  23. package/dist/{chunk-chunk-KQ546MKE.module.min.js → chunk-chunk-GFTVACTO.module.min.js} +1 -1
  24. package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
  25. package/dist/chunk-chunk-ITDWLZXV.module.min.js +2 -0
  26. package/dist/chunk-chunk-LPSPATPC.module.min.js +1 -0
  27. package/dist/chunk-chunk-OM6NWS4H.module.min.js +2 -0
  28. package/dist/chunk-chunk-PX5YQGDP.module.min.js +2 -0
  29. package/dist/chunk-chunk-Q2BS46W2.module.min.js +2 -0
  30. package/dist/{chunk-chunk-FBGHXL72.module.min.js → chunk-chunk-RA7JCG7D.module.min.js} +1 -1
  31. package/dist/chunk-chunk-RNUHEXZA.module.min.js +2 -0
  32. package/dist/chunk-chunk-ROZWKEUG.module.min.js +1 -0
  33. package/dist/chunk-chunk-SMVD3EQJ.module.min.js +2 -0
  34. package/dist/chunk-chunk-T2FKJD4O.module.min.js +2 -0
  35. package/dist/chunk-chunk-UDREYOLV.module.min.js +1 -0
  36. package/dist/chunk-chunk-VOWE3SAP.module.min.js +2 -0
  37. package/dist/chunk-chunk-VQPNBUSW.module.min.js +2 -0
  38. package/dist/{chunk-chunk-7RYBCTK5.module.min.js → chunk-chunk-WAWCIHFJ.module.min.js} +1 -1
  39. package/dist/{chunk-chunk-F7WFPD4O.module.min.js → chunk-chunk-WYARAXHR.module.min.js} +1 -1
  40. package/dist/{chunk-chunk-JDXT6ORT.module.min.js → chunk-chunk-XP3OHHFX.module.min.js} +1 -1
  41. package/dist/chunk-chunk-XV3KGYTR.module.min.js +2 -0
  42. package/dist/chunk-chunk-YC2IVEPX.module.min.js +1 -0
  43. package/dist/chunk-chunk-ZXIXAPRE.module.min.js +2 -0
  44. package/dist/components/ChartContainer.d.ts +10 -0
  45. package/dist/components/ai/chartCapabilities.d.ts +3 -1
  46. package/dist/components/ai/chartCapabilityTypes.d.ts +14 -0
  47. package/dist/components/chartContainerDataAudit.d.ts +10 -0
  48. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  49. package/dist/components/charts/geo/DistanceCartogram.d.ts +30 -4
  50. package/dist/components/charts/index.d.ts +4 -0
  51. package/dist/components/charts/network/ForceDirectedGraph.d.ts +36 -1
  52. package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
  53. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  54. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
  55. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
  56. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
  57. package/dist/components/charts/physics/CrucibleChart.capability.d.ts +8 -0
  58. package/dist/components/charts/physics/CrucibleChart.d.ts +63 -0
  59. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +27 -0
  60. package/dist/components/charts/physics/crucibleChartProps.d.ts +90 -0
  61. package/dist/components/charts/physics/crucibleChrome.d.ts +47 -0
  62. package/dist/components/charts/physics/crucibleController.d.ts +59 -0
  63. package/dist/components/charts/physics/crucibleEffects.d.ts +30 -0
  64. package/dist/components/charts/physics/cruciblePhysics.d.ts +54 -0
  65. package/dist/components/charts/physics/crucibleProgram.d.ts +38 -0
  66. package/dist/components/charts/physics/crucibleTypes.d.ts +415 -0
  67. package/dist/components/charts/shared/chartSpecCore.d.ts +10 -4
  68. package/dist/components/charts/shared/crucibleWireSchema.d.ts +5 -0
  69. package/dist/components/charts/shared/diagnoseTypes.d.ts +10 -0
  70. package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
  71. package/dist/components/charts/shared/gradient.d.ts +35 -0
  72. package/dist/components/charts/shared/hatchFill.d.ts +3 -10
  73. package/dist/components/charts/shared/hooks.d.ts +2 -50
  74. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  75. package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
  76. package/dist/components/charts/shared/useChartLegend.d.ts +58 -0
  77. package/dist/components/charts/shared/useChartSetup.d.ts +5 -0
  78. package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
  79. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
  80. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  81. package/dist/components/charts/xy/AreaChart.d.ts +25 -42
  82. package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
  83. package/dist/components/charts/xy/BumpChart.d.ts +161 -0
  84. package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
  85. package/dist/components/charts/xy/Heatmap.d.ts +3 -0
  86. package/dist/components/charts/xy/LineChart.d.ts +6 -8
  87. package/dist/components/data/auditData.d.ts +51 -0
  88. package/dist/components/data/dataAuditPresentation.d.ts +18 -0
  89. package/dist/components/data/dataAuditSources.d.ts +9 -0
  90. package/dist/components/data/numericContracts.d.ts +59 -0
  91. package/dist/components/data/numericFieldProfiler.d.ts +23 -0
  92. package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
  93. package/dist/components/legendLayout.d.ts +19 -1
  94. package/dist/components/recipes/netEnsembleLayout.d.ts +167 -0
  95. package/dist/components/recipes/netEnsembleOverlays.d.ts +20 -0
  96. package/dist/components/recipes/wordTrails.d.ts +156 -0
  97. package/dist/components/recipes/wordTrailsProgressiveReveal.d.ts +42 -0
  98. package/dist/components/semiotic-ai-core.d.ts +3 -0
  99. package/dist/components/semiotic-ai-data-audit.d.ts +4 -0
  100. package/dist/components/semiotic-ai.d.ts +9 -6
  101. package/dist/components/semiotic-geo.d.ts +1 -0
  102. package/dist/components/semiotic-network.d.ts +1 -0
  103. package/dist/components/semiotic-ordinal.d.ts +2 -0
  104. package/dist/components/semiotic-physics.d.ts +2 -0
  105. package/dist/components/semiotic-realtime-core.d.ts +1 -0
  106. package/dist/components/semiotic-recipes-core.d.ts +4 -0
  107. package/dist/components/semiotic-server-edge.d.ts +1 -1
  108. package/dist/components/semiotic-server.d.ts +1 -1
  109. package/dist/components/semiotic-utils-core.d.ts +3 -0
  110. package/dist/components/semiotic-xy.d.ts +4 -0
  111. package/dist/components/semiotic.d.ts +5 -5
  112. package/dist/components/server/renderEvidence.d.ts +27 -0
  113. package/dist/components/server/serverChartConfigs.d.ts +2 -0
  114. package/dist/components/server/serverChartConfigsPhysics.d.ts +9 -0
  115. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  116. package/dist/components/server/staticAnnotations.d.ts +12 -0
  117. package/dist/components/server/staticLegend.d.ts +4 -2
  118. package/dist/components/server/staticSVGChrome.d.ts +4 -4
  119. package/dist/components/stream/GeoPipelineStore.d.ts +1 -0
  120. package/dist/components/stream/GeoSVGOverlay.d.ts +11 -10
  121. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
  122. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
  123. package/dist/components/stream/SVGOverlay.d.ts +2 -6
  124. package/dist/components/stream/StalenessBadge.d.ts +2 -6
  125. package/dist/components/stream/geoCartogram.d.ts +7 -0
  126. package/dist/components/stream/geoTypes.d.ts +20 -8
  127. package/dist/components/stream/legendRenderer.d.ts +2 -6
  128. package/dist/components/stream/networkFrameHandleTypes.d.ts +4 -0
  129. package/dist/components/stream/ordinalTypes.d.ts +7 -31
  130. package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
  131. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
  132. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +8 -0
  133. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
  134. package/dist/components/stream/pipelineConfig.d.ts +7 -15
  135. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
  136. package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
  137. package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
  138. package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
  139. package/dist/components/stream/types.d.ts +32 -56
  140. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
  141. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
  142. package/dist/components/types/legendTypes.d.ts +15 -6
  143. package/dist/components/useChartContainerDataAudit.d.ts +7 -0
  144. package/dist/geo.min.js +1 -1
  145. package/dist/geo.module.min.js +1 -1
  146. package/dist/network.min.js +1 -1
  147. package/dist/network.module.min.js +1 -1
  148. package/dist/ordinal.min.js +1 -1
  149. package/dist/ordinal.module.min.js +1 -1
  150. package/dist/physics.min.js +1 -1
  151. package/dist/physics.module.min.js +1 -1
  152. package/dist/physicsWorker.js +1 -1
  153. package/dist/realtime.min.js +1 -1
  154. package/dist/realtime.module.min.js +1 -1
  155. package/dist/semiotic-ai-core.d.ts +3 -0
  156. package/dist/semiotic-ai-core.min.js +1 -1
  157. package/dist/semiotic-ai-core.module.min.js +1 -1
  158. package/dist/semiotic-ai.d.ts +9 -6
  159. package/dist/semiotic-ai.min.js +1 -1
  160. package/dist/semiotic-ai.module.min.js +1 -1
  161. package/dist/semiotic-experimental.min.js +1 -1
  162. package/dist/semiotic-experimental.module.min.js +1 -1
  163. package/dist/semiotic-geo.d.ts +1 -0
  164. package/dist/semiotic-network.d.ts +1 -0
  165. package/dist/semiotic-ordinal.d.ts +2 -0
  166. package/dist/semiotic-physics.d.ts +2 -0
  167. package/dist/semiotic-realtime-core.d.ts +1 -0
  168. package/dist/semiotic-realtime-core.min.js +1 -1
  169. package/dist/semiotic-realtime-core.module.min.js +1 -1
  170. package/dist/semiotic-recipes-core.d.ts +4 -0
  171. package/dist/semiotic-recipes-core.min.js +1 -1
  172. package/dist/semiotic-recipes-core.module.min.js +1 -1
  173. package/dist/semiotic-recipes.min.js +1 -1
  174. package/dist/semiotic-recipes.module.min.js +1 -1
  175. package/dist/semiotic-server-edge.d.ts +1 -1
  176. package/dist/semiotic-server-edge.min.js +1 -1
  177. package/dist/semiotic-server-edge.module.min.js +1 -1
  178. package/dist/semiotic-server-node.min.js +1 -1
  179. package/dist/semiotic-server-node.module.min.js +1 -1
  180. package/dist/semiotic-server.d.ts +1 -1
  181. package/dist/semiotic-utils-core.d.ts +3 -0
  182. package/dist/semiotic-utils-core.min.js +1 -1
  183. package/dist/semiotic-utils-core.module.min.js +1 -1
  184. package/dist/semiotic-utils.min.js +1 -1
  185. package/dist/semiotic-utils.module.min.js +1 -1
  186. package/dist/semiotic-xy.d.ts +4 -0
  187. package/dist/semiotic.d.ts +5 -5
  188. package/dist/semiotic.min.js +1 -1
  189. package/dist/semiotic.module.min.js +1 -1
  190. package/dist/server.min.js +1 -1
  191. package/dist/server.module.min.js +1 -1
  192. package/dist/xy.min.js +1 -1
  193. package/dist/xy.module.min.js +1 -1
  194. package/package.json +2 -2
  195. package/dist/chunk-chunk-3ILKBVVQ.module.min.js +0 -1
  196. package/dist/chunk-chunk-6TPGFL7M.module.min.js +0 -2
  197. package/dist/chunk-chunk-7KZJUTKP.module.min.js +0 -2
  198. package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
  199. package/dist/chunk-chunk-AQPQN2HH.module.min.js +0 -2
  200. package/dist/chunk-chunk-ASKSE5F5.module.min.js +0 -1
  201. package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
  202. package/dist/chunk-chunk-B3DRZPBK.module.min.js +0 -2
  203. package/dist/chunk-chunk-BFHUYEOS.module.min.js +0 -2
  204. package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
  205. package/dist/chunk-chunk-F5V4UIE6.module.min.js +0 -2
  206. package/dist/chunk-chunk-FP44FHFO.module.min.js +0 -2
  207. package/dist/chunk-chunk-HKXUAEPJ.module.min.js +0 -2
  208. package/dist/chunk-chunk-ICEXPNDC.module.min.js +0 -2
  209. package/dist/chunk-chunk-JMVEIZXP.module.min.js +0 -1
  210. package/dist/chunk-chunk-KHCOJMGK.module.min.js +0 -1
  211. package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
  212. package/dist/chunk-chunk-MFHF4J2Z.module.min.js +0 -1
  213. package/dist/chunk-chunk-N6VKKF3A.module.min.js +0 -2
  214. package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
  215. package/dist/chunk-chunk-NKZ75IM5.module.min.js +0 -2
  216. package/dist/chunk-chunk-PLIDPQNG.module.min.js +0 -2
  217. package/dist/chunk-chunk-QGZGZI4X.module.min.js +0 -1
  218. package/dist/chunk-chunk-RP7WTID5.module.min.js +0 -1
  219. package/dist/chunk-chunk-S7KLNUO6.module.min.js +0 -1
  220. package/dist/chunk-chunk-SR4ZXOWR.module.min.js +0 -2
  221. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
  222. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
@@ -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", "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;
@@ -0,0 +1,161 @@
1
+ import * as React from "react";
2
+ import type { RealtimeFrameHandle } from "../../realtime/types";
3
+ import type { StreamXYFrameProps, Style } from "../../stream/types";
4
+ import type { LayoutContext, LayoutResult } from "../../stream/customLayout";
5
+ import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
6
+ import type { Datum } from "../shared/datumTypes";
7
+ import type { TooltipProp } from "../../Tooltip/Tooltip";
8
+ import { type StyleRule } from "../shared/styleRules";
9
+ import type { LegendValue } from "../../types/legendTypes";
10
+ import type { LegendInteractionMode, LegendPosition } from "../shared/useChartLegend";
11
+ export interface RankedBumpDatum<TDatum extends Datum = Datum> extends Datum {
12
+ x: number;
13
+ y: number;
14
+ __bumpRaw: TDatum;
15
+ __bumpSeries: string;
16
+ __bumpColorGroup: string;
17
+ __bumpValue: number;
18
+ __bumpRank: number;
19
+ __bumpXValue: unknown;
20
+ __bumpHighlighted: boolean;
21
+ }
22
+ export interface RankedBumpData<TDatum extends Datum = Datum> {
23
+ data: RankedBumpDatum<TDatum>[];
24
+ xValues: unknown[];
25
+ seriesOrder: string[];
26
+ overallOrder: string[];
27
+ valueExtent: [number, number];
28
+ }
29
+ export interface RankBumpDataOptions<TDatum extends Datum = Datum> {
30
+ xAccessor?: ChartAccessor<TDatum, number | Date | string>;
31
+ yAccessor?: ChartAccessor<TDatum, number>;
32
+ lineBy?: ChartAccessor<TDatum, string>;
33
+ rankDirection?: "descending" | "ascending";
34
+ highlightTop?: number;
35
+ }
36
+ export declare function mapBumpAnnotations(annotations: Datum[] | undefined, xValues: unknown[]): Datum[] | undefined;
37
+ export declare function resolveBumpColorScheme(options: {
38
+ seriesOrder: string[];
39
+ overallOrder: string[];
40
+ highlightTop?: number;
41
+ color?: string;
42
+ colorScheme?: string | string[] | Record<string, string>;
43
+ neutralColor?: string;
44
+ themeCategorical?: string[];
45
+ themeNeutral?: string;
46
+ }): string | string[] | Record<string, string> | undefined;
47
+ /**
48
+ * Rank every x-column and return the flattened, frame-ready rows used by
49
+ * BumpChart. Ranking is ordinal and deterministic: equal values retain series
50
+ * first-appearance order.
51
+ */
52
+ export declare function rankBumpData<TDatum extends Datum = Datum>(input: TDatum[], options?: RankBumpDataOptions<TDatum>): RankedBumpData<TDatum>;
53
+ export interface BumpLayoutConfig {
54
+ ribbon: boolean;
55
+ curve: "smooth" | "linear";
56
+ samplesPerSegment: number;
57
+ ribbonSizeRange: [number, number];
58
+ valueExtent: [number, number];
59
+ seriesOrder: string[];
60
+ lineWidth: number;
61
+ ribbonOpacity: number;
62
+ lineOpacity: number;
63
+ neutralColor?: string;
64
+ color?: string;
65
+ stroke?: string;
66
+ strokeWidth?: number;
67
+ opacity?: number;
68
+ styleRules?: ReadonlyArray<StyleRule>;
69
+ areaStyle?: (datum: Datum) => Style;
70
+ pointStyle?: (datum: Datum) => Style & {
71
+ r?: number;
72
+ };
73
+ labelStyle?: React.CSSProperties | ((datum: Datum) => React.CSSProperties);
74
+ showPoints: boolean;
75
+ pointRadius: number;
76
+ showLabels: boolean | "start" | "end" | "both";
77
+ }
78
+ export declare function bumpLayout(ctx: LayoutContext<BumpLayoutConfig>): LayoutResult;
79
+ export interface BumpChartProps<TDatum extends Datum = Datum> extends BaseChartProps, AxisConfig {
80
+ /** Flat observations. Each x-column is ranked from `yAccessor`. */
81
+ data: TDatum[];
82
+ /** Ranking column accessor. First-seen order determines the x-axis order. Default `"x"`. */
83
+ xAccessor?: ChartAccessor<TDatum, number | Date | string>;
84
+ /** Numeric magnitude to rank and, in ribbon mode, encode as width. Default `"y"`. */
85
+ yAccessor?: ChartAccessor<TDatum, number>;
86
+ /** Series identity accessor. Default `"series"`. */
87
+ lineBy?: ChartAccessor<TDatum, string>;
88
+ /** Highest values rank first by default; use `"ascending"` for metrics where lower is better. */
89
+ rankDirection?: "descending" | "ascending";
90
+ /** Draw magnitude-encoded, perpendicular-offset areas instead of fixed-width lines. */
91
+ ribbon?: boolean;
92
+ /** Centerline shape. Smooth uses horizontal-tangent cubic segments. Default `"smooth"`. */
93
+ curve?: "smooth" | "linear";
94
+ /** Full ribbon width range in pixels. Default `[4, 28]`. */
95
+ ribbonSizeRange?: [number, number];
96
+ /** Number of centerline samples per ranking interval. Default `12`. */
97
+ samplesPerSegment?: number;
98
+ /** Fixed line width when `ribbon` is false. Default `3`. */
99
+ lineWidth?: number;
100
+ /** Highlight only the N best series by mean rank; all others share `neutralColor`. */
101
+ highlightTop?: number;
102
+ /** Shared color for trajectories outside `highlightTop`. */
103
+ neutralColor?: string;
104
+ /** Ordered per-datum style rules. Trajectory rules resolve against each series' first observation. */
105
+ styleRules?: StyleRule[];
106
+ /** Style endpoint labels globally or per original datum. */
107
+ labelStyle?: React.CSSProperties | ((datum: TDatum) => React.CSSProperties);
108
+ colorScheme?: string | string[] | Record<string, string>;
109
+ ribbonOpacity?: number;
110
+ lineOpacity?: number;
111
+ showPoints?: boolean;
112
+ pointRadius?: number;
113
+ /** Endpoint labels. `true` is equivalent to `"end"`. Default `true`. */
114
+ showLabels?: boolean | "start" | "end" | "both";
115
+ showAxes?: boolean;
116
+ showGrid?: boolean;
117
+ showLegend?: boolean;
118
+ /** Additional legend content. */
119
+ legend?: LegendValue;
120
+ legendInteraction?: LegendInteractionMode;
121
+ legendPosition?: LegendPosition;
122
+ enableHover?: boolean;
123
+ /** Dim every trajectory except the hovered series. Default `true`. */
124
+ hoverHighlight?: boolean | "series";
125
+ tooltip?: TooltipProp;
126
+ /** Annotation objects. X coordinates may use the original x values. */
127
+ annotations?: Datum[];
128
+ /** Additional frame props, with BumpChart geometry remaining controlled. */
129
+ frameProps?: Partial<Omit<StreamXYFrameProps, "chartType" | "data" | "size" | "customLayout" | "layoutConfig">>;
130
+ }
131
+ /**
132
+ * Ranking-based bump chart. Each x-column ranks its series by `yAccessor`, and
133
+ * rank becomes vertical position. With `ribbon`, magnitude is encoded by true
134
+ * screen-space ribbon thickness instead of a vertically interpolated area.
135
+ *
136
+ * @example
137
+ * // Fixed-width ranking lines, coloring only the top 3 series by mean rank.
138
+ * <BumpChart
139
+ * data={data}
140
+ * xAccessor="quarter"
141
+ * yAccessor="sales"
142
+ * lineBy="team"
143
+ * highlightTop={3}
144
+ * />
145
+ *
146
+ * @example
147
+ * // Magnitude-encoded ribbons (width ∝ value) with ascending rank for a
148
+ * // "lower is better" metric.
149
+ * <BumpChart
150
+ * data={data}
151
+ * xAccessor="week"
152
+ * yAccessor="latencyMs"
153
+ * lineBy="service"
154
+ * rankDirection="ascending"
155
+ * ribbon
156
+ * />
157
+ */
158
+ export declare const BumpChart: {
159
+ <TDatum extends Datum = Datum>(props: BumpChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
160
+ displayName?: string;
161
+ };
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
5
5
  import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
6
6
  import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
7
7
  import { type TooltipProp } from "../../Tooltip/Tooltip";
8
+ import { type GradientInput } from "../shared/gradient";
8
9
  export { computeDifferenceSegments } from "./differenceSegments";
9
10
  /**
10
11
  * DifferenceChart props
@@ -38,16 +39,8 @@ export interface DifferenceChartProps<TDatum extends Datum = Datum> extends Base
38
39
  curve?: "linear" | "monotoneX" | "monotoneY" | "step" | "stepAfter" | "stepBefore" | "basis" | "cardinal" | "catmullRom";
39
40
  /** Fill opacity for the difference region. Default `0.6`. */
40
41
  areaOpacity?: number;
41
- /** Gradient fill across each segment, same shape as AreaChart.gradientFill. */
42
- gradientFill?: boolean | {
43
- topOpacity: number;
44
- bottomOpacity: number;
45
- } | {
46
- colorStops: Array<{
47
- offset: number;
48
- color: string;
49
- }>;
50
- };
42
+ /** Gradient fill from each segment's tip (offset 0) to its base (offset 1). */
43
+ gradientFill?: GradientInput;
51
44
  /** Enable hover annotations. */
52
45
  enableHover?: boolean;
53
46
  /** Show grid lines. Default `false`. */
@@ -2,6 +2,7 @@ import type { Datum } from "../shared/datumTypes";
2
2
  import * as React from "react";
3
3
  import type { StreamXYFrameProps } from "../../stream/types";
4
4
  import type { RealtimeFrameHandle } from "../../realtime/types";
5
+ import type { GradientLegendValue } from "../../types/legendTypes";
5
6
  import type { LegendInteractionMode } from "../shared/hooks";
6
7
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
7
8
  import { type TooltipProp } from "../../Tooltip/Tooltip";
@@ -103,6 +104,8 @@ export interface HeatmapProps<TDatum extends Datum = Datum> extends BaseChartPro
103
104
  * @default "right"
104
105
  */
105
106
  legendPosition?: "right" | "left" | "top" | "bottom";
107
+ /** Gradient legend layout overrides. */
108
+ legend?: Pick<GradientLegendValue, "legendDistance">;
106
109
  /**
107
110
  * Legend interaction mode.
108
111
  * - "highlight": hover dims non-hovered categories to 30% opacity
@@ -7,6 +7,7 @@ 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 { AnomalyConfig, ForecastConfig } from "../shared/statisticalOverlays";
10
+ import { type ColorGradientInput } from "../shared/gradient";
10
11
  import type { LegendValue } from "../../types/legendTypes";
11
12
  /**
12
13
  * LineChart component props
@@ -113,15 +114,12 @@ export interface LineChartProps<TDatum extends Datum = Datum> extends BaseChartP
113
114
  */
114
115
  areaOpacity?: number;
115
116
  /**
116
- * Horizontal gradient for the line stroke. Color stops define a left-to-right gradient.
117
- * `{ colorStops: [{ offset: 0, color: "blue" }, { offset: 1, color: "red" }] }`
117
+ * Horizontal line-stroke gradient. Offset 0 is the left edge and offset 1
118
+ * is the right edge.
119
+ * @example
120
+ * `{ stops: [{ offset: 0, color: "blue" }, { offset: 1, color: "red" }] }`
118
121
  */
119
- lineGradient?: {
120
- colorStops: Array<{
121
- offset: number;
122
- color: string;
123
- }>;
124
- };
122
+ lineGradient?: ColorGradientInput;
125
123
  /**
126
124
  * Line stroke width
127
125
  * @default 2