semiotic 3.8.0 → 3.8.1

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 (234) hide show
  1. package/CLAUDE.md +12 -9
  2. package/README.md +39 -39
  3. package/ai/dist/mcp-server.js +98 -17
  4. package/ai/schema.json +1 -1
  5. package/ai/surface-manifest.json +3 -2
  6. package/ai/system-prompt.md +3 -2
  7. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
  8. package/dist/components/AccessibleNavTree.d.ts +7 -1
  9. package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
  10. package/dist/components/ai/useNavigationSync.d.ts +17 -2
  11. package/dist/components/chartContainerMobile.d.ts +9 -0
  12. package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
  13. package/dist/components/charts/geo/DistanceCartogram.d.ts +14 -2
  14. package/dist/components/charts/geo/FlowMap.d.ts +10 -6
  15. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +14 -2
  16. package/dist/components/charts/index.d.ts +6 -0
  17. package/dist/components/charts/network/ChordDiagram.d.ts +9 -1
  18. package/dist/components/charts/network/ForceDirectedGraph.d.ts +11 -0
  19. package/dist/components/charts/network/SankeyDiagram.d.ts +9 -1
  20. package/dist/components/charts/ordinal/BarChart.d.ts +21 -0
  21. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +11 -0
  22. package/dist/components/charts/ordinal/StackedBarChart.d.ts +11 -0
  23. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +7 -0
  24. package/dist/components/charts/physics/EventDropChart.d.ts +7 -0
  25. package/dist/components/charts/physics/GaltonBoardChart.d.ts +8 -0
  26. package/dist/components/charts/physics/PhysicsCustomChart.d.ts +4 -25
  27. package/dist/components/charts/physics/PhysicsPileChart.d.ts +7 -0
  28. package/dist/components/charts/physics/physicsChartShared.d.ts +17 -1
  29. package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
  30. package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
  31. package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
  32. package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
  33. package/dist/components/charts/shared/annotationRules.d.ts +2 -1
  34. package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
  35. package/dist/components/charts/shared/chartSpecCore.d.ts +3 -3
  36. package/dist/components/charts/shared/datumTypes.d.ts +2 -0
  37. package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +2 -0
  38. package/dist/components/charts/shared/formatUtils.d.ts +3 -3
  39. package/dist/components/charts/shared/hatchFill.d.ts +87 -0
  40. package/dist/components/charts/shared/hooks.d.ts +7 -6
  41. package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
  42. package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
  43. package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
  44. package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
  45. package/dist/components/charts/shared/sparseArray.d.ts +1 -1
  46. package/dist/components/charts/shared/streamPropsHelpers.d.ts +6 -4
  47. package/dist/components/charts/shared/styleRules.d.ts +205 -0
  48. package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
  49. package/dist/components/charts/shared/types.d.ts +9 -6
  50. package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
  51. package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
  52. package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
  53. package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
  54. package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
  55. package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
  56. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +24 -1
  57. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  58. package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
  59. package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
  60. package/dist/components/charts/shared/validateChartData.d.ts +7 -5
  61. package/dist/components/charts/shared/validationMap.d.ts +11 -2
  62. package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
  63. package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
  64. package/dist/components/charts/value/targetPresentation.d.ts +22 -0
  65. package/dist/components/charts/value/types.d.ts +5 -6
  66. package/dist/components/charts/xy/AreaChart.d.ts +8 -0
  67. package/dist/components/charts/xy/BubbleChart.d.ts +9 -0
  68. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
  69. package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
  70. package/dist/components/charts/xy/Heatmap.d.ts +2 -2
  71. package/dist/components/charts/xy/LineChart.d.ts +11 -0
  72. package/dist/components/charts/xy/QuadrantChart.d.ts +7 -0
  73. package/dist/components/charts/xy/Scatterplot.d.ts +10 -0
  74. package/dist/components/charts/xy/StackedAreaChart.d.ts +7 -0
  75. package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
  76. package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
  77. package/dist/components/controls/SentenceFilter.d.ts +97 -0
  78. package/dist/components/data/fromVegaLite.d.ts +19 -9
  79. package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
  80. package/dist/components/semiotic-ai.d.ts +3 -1
  81. package/dist/components/semiotic-controls.d.ts +2 -0
  82. package/dist/components/semiotic-geo.d.ts +4 -0
  83. package/dist/components/semiotic-network.d.ts +4 -0
  84. package/dist/components/semiotic-ordinal.d.ts +6 -0
  85. package/dist/components/semiotic-physics.d.ts +4 -0
  86. package/dist/components/semiotic-rough.d.ts +4 -0
  87. package/dist/components/semiotic-utils-core.d.ts +4 -0
  88. package/dist/components/semiotic-xy.d.ts +4 -0
  89. package/dist/components/semiotic.d.ts +9 -1
  90. package/dist/components/server/optionalImageTypes.d.ts +37 -0
  91. package/dist/components/server/serverChartConfigShared.d.ts +9 -5
  92. package/dist/components/server/serverChartConfigs.d.ts +4 -4
  93. package/dist/components/server/staticAnnotations.d.ts +6 -3
  94. package/dist/components/server/staticLegend.d.ts +1 -1
  95. package/dist/components/server/staticNetwork.d.ts +4 -4
  96. package/dist/components/server/staticSVGChrome.d.ts +2 -2
  97. package/dist/components/store/ObservationStore.d.ts +21 -1
  98. package/dist/components/stream/AccessibleDataTable.d.ts +4 -10
  99. package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
  100. package/dist/components/stream/CanvasHitTester.d.ts +4 -4
  101. package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
  102. package/dist/components/stream/FrameRuntime.d.ts +57 -0
  103. package/dist/components/stream/GeoParticlePool.d.ts +1 -1
  104. package/dist/components/stream/GeoPipelineStore.d.ts +43 -12
  105. package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
  106. package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
  107. package/dist/components/stream/NetworkPipelineStore.d.ts +24 -21
  108. package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
  109. package/dist/components/stream/NetworkSVGOverlay.d.ts +6 -0
  110. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
  111. package/dist/components/stream/OrdinalPipelineStore.d.ts +13 -13
  112. package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
  113. package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
  114. package/dist/components/stream/ParticlePool.d.ts +1 -1
  115. package/dist/components/stream/PipelineStore.d.ts +12 -16
  116. package/dist/components/stream/SVGOverlay.d.ts +6 -0
  117. package/dist/components/stream/SceneGraph.d.ts +3 -3
  118. package/dist/components/stream/accessorUtils.d.ts +2 -2
  119. package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
  120. package/dist/components/stream/frameGraphics.d.ts +4 -0
  121. package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
  122. package/dist/components/stream/geoPipelineHelpers.d.ts +3 -3
  123. package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
  124. package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
  125. package/dist/components/stream/geoTypes.d.ts +48 -15
  126. package/dist/components/stream/hitTestUtils.d.ts +2 -2
  127. package/dist/components/stream/hoverUtils.d.ts +4 -2
  128. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +1 -0
  129. package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
  130. package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
  131. package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
  132. package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
  133. package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
  134. package/dist/components/stream/networkFrameObservations.d.ts +15 -0
  135. package/dist/components/stream/networkFramePaint.d.ts +11 -2
  136. package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
  137. package/dist/components/stream/networkPipelineConfig.d.ts +2 -2
  138. package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
  139. package/dist/components/stream/networkTypes.d.ts +37 -56
  140. package/dist/components/stream/ordinalCanvasRenderers.d.ts +2 -2
  141. package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +20 -1
  142. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
  143. package/dist/components/stream/ordinalTypes.d.ts +30 -3
  144. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +2 -0
  145. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +6 -0
  146. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +21 -6
  147. package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
  148. package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
  149. package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +19 -1
  150. package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +3 -1
  151. package/dist/components/stream/pipelineConfig.d.ts +4 -2
  152. package/dist/components/stream/pipelineDecay.d.ts +2 -2
  153. package/dist/components/stream/pipelinePulse.d.ts +2 -2
  154. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +23 -2
  155. package/dist/components/stream/pipelineTransitions.d.ts +1 -1
  156. package/dist/components/stream/pipelineUpdateContract.d.ts +7 -0
  157. package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
  158. package/dist/components/stream/renderBackend.d.ts +27 -0
  159. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
  160. package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
  161. package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
  162. package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
  163. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +31 -4
  164. package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
  165. package/dist/components/stream/streamThemeTypes.d.ts +14 -0
  166. package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
  167. package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
  168. package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
  169. package/dist/components/stream/titleLayout.d.ts +31 -0
  170. package/dist/components/stream/types.d.ts +30 -65
  171. package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
  172. package/dist/components/stream/useFrame.d.ts +23 -0
  173. package/dist/components/stream/useLegendCategoryEmission.d.ts +3 -3
  174. package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
  175. package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
  176. package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
  177. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -5
  178. package/dist/controls.min.js +1 -1
  179. package/dist/controls.module.min.js +1 -1
  180. package/dist/forceLayoutWorker.js +1 -1
  181. package/dist/geo.min.js +1 -1
  182. package/dist/geo.module.min.js +1 -1
  183. package/dist/network.min.js +1 -1
  184. package/dist/network.module.min.js +1 -1
  185. package/dist/ordinal.min.js +1 -1
  186. package/dist/ordinal.module.min.js +1 -1
  187. package/dist/physics.min.js +1 -1
  188. package/dist/physics.module.min.js +1 -1
  189. package/dist/physicsWorker.js +1 -1
  190. package/dist/realtime.min.js +1 -1
  191. package/dist/realtime.module.min.js +1 -1
  192. package/dist/rough.min.js +1 -0
  193. package/dist/rough.module.min.js +1 -0
  194. package/dist/semiotic-ai-core.min.js +1 -1
  195. package/dist/semiotic-ai-core.module.min.js +1 -1
  196. package/dist/semiotic-ai.d.ts +3 -1
  197. package/dist/semiotic-ai.min.js +1 -1
  198. package/dist/semiotic-ai.module.min.js +1 -1
  199. package/dist/semiotic-controls.d.ts +2 -0
  200. package/dist/semiotic-data.min.js +1 -1
  201. package/dist/semiotic-data.module.min.js +1 -1
  202. package/dist/semiotic-experimental.min.js +1 -1
  203. package/dist/semiotic-experimental.module.min.js +1 -1
  204. package/dist/semiotic-geo.d.ts +4 -0
  205. package/dist/semiotic-network.d.ts +4 -0
  206. package/dist/semiotic-ordinal.d.ts +6 -0
  207. package/dist/semiotic-physics.d.ts +4 -0
  208. package/dist/semiotic-realtime-core.min.js +1 -1
  209. package/dist/semiotic-realtime-core.module.min.js +1 -1
  210. package/dist/semiotic-realtime-react.min.js +1 -1
  211. package/dist/semiotic-realtime-react.module.min.js +1 -1
  212. package/dist/semiotic-rough.d.ts +4 -0
  213. package/dist/semiotic-server-edge.min.js +1 -1
  214. package/dist/semiotic-server-edge.module.min.js +1 -1
  215. package/dist/semiotic-server-node.min.js +1 -1
  216. package/dist/semiotic-server-node.module.min.js +1 -1
  217. package/dist/semiotic-utils-core.d.ts +4 -0
  218. package/dist/semiotic-utils-core.min.js +1 -1
  219. package/dist/semiotic-utils-core.module.min.js +1 -1
  220. package/dist/semiotic-utils.min.js +1 -1
  221. package/dist/semiotic-utils.module.min.js +1 -1
  222. package/dist/semiotic-value.min.js +1 -1
  223. package/dist/semiotic-value.module.min.js +1 -1
  224. package/dist/semiotic-xy.d.ts +4 -0
  225. package/dist/semiotic.d.ts +9 -1
  226. package/dist/semiotic.min.js +1 -1
  227. package/dist/semiotic.module.min.js +1 -1
  228. package/dist/server.min.js +1 -1
  229. package/dist/server.module.min.js +1 -1
  230. package/dist/test-utils/capturedFrameProps.d.ts +67 -0
  231. package/dist/test-utils/frameMock.d.ts +12 -9
  232. package/dist/xy.min.js +1 -1
  233. package/dist/xy.module.min.js +1 -1
  234. package/package.json +26 -7
@@ -1,9 +1,16 @@
1
1
  import * as React from "react";
2
2
  import type { HoverData } from "../../realtime/types";
3
3
  import type { Datum } from "./datumTypes";
4
+ export type TooltipValue = string | number | boolean | Date | Datum | Datum[] | null | undefined;
5
+ type TooltipAccessor = string | {
6
+ bivarianceHack(datum: Datum): TooltipValue;
7
+ }["bivarianceHack"];
8
+ type TooltipFormatter = {
9
+ bivarianceHack(value: TooltipValue, index?: number, allTicks?: number[]): React.ReactNode;
10
+ }["bivarianceHack"];
4
11
  export interface TooltipFieldConfig {
5
12
  label: string;
6
- accessor: string | ((d: any) => any);
13
+ accessor: TooltipAccessor;
7
14
  role?: "title" | "x" | "y" | "color" | "size" | "group" | "value";
8
15
  /** Per-field formatter. HOCs pass `xFormat`/`yFormat`/`valueFormat` here so
9
16
  * the default tooltip renders values consistently with the axis. Typed
@@ -12,15 +19,15 @@ export interface TooltipFieldConfig {
12
19
  * (`(d, index?, allTicks?) => ReactNode`). A ReactNode return renders
13
20
  * as-is in the tooltip span. If the formatter throws, the tooltip
14
21
  * falls back to the built-in `formatVal`. */
15
- format?: (v: any, ...rest: any[]) => React.ReactNode;
22
+ format?: TooltipFormatter;
16
23
  }
17
24
  /**
18
25
  * Extract a display name from an accessor.
19
26
  * Strings return themselves; functions return "value".
20
27
  */
21
- export declare function accessorName(acc: string | ((...args: any[]) => any)): string;
28
+ export declare function accessorName(acc: TooltipAccessor): string;
22
29
  export declare function formatVal(v: unknown): string;
23
- export declare function resolveValue(d: Datum, acc: string | ((d: Datum) => any)): unknown;
30
+ export declare function resolveValue(d: Datum, acc: TooltipAccessor): TooltipValue;
24
31
  export { smartTooltipEntries } from "./smartTooltip";
25
32
  export type { SmartTooltipEntry, SmartTooltipResult } from "./smartTooltip";
26
33
  /**
@@ -33,7 +40,13 @@ export type { SmartTooltipEntry, SmartTooltipResult } from "./smartTooltip";
33
40
  * Returns an empty array when band is not configured, so the spread at
34
41
  * the call site is a no-op for the common case.
35
42
  */
36
- export declare function bandTooltipFields(band: unknown, valueFormat?: (v: any, ...rest: any[]) => React.ReactNode): TooltipFieldConfig[];
43
+ export declare function bandTooltipFields(band: {
44
+ y0Accessor?: TooltipAccessor;
45
+ y1Accessor?: TooltipAccessor;
46
+ } | Array<{
47
+ y0Accessor?: TooltipAccessor;
48
+ y1Accessor?: TooltipAccessor;
49
+ }> | null | undefined, valueFormat?: TooltipFormatter): TooltipFieldConfig[];
37
50
  /**
38
51
  * Build a default tooltipContent function for StreamXYFrame HOCs.
39
52
  * Receives HoverData ({ data, time, value, x, y }) and renders
@@ -48,13 +61,13 @@ export declare function buildDefaultTooltip(fields: TooltipFieldConfig[]): (hove
48
61
  * (PieChart/DonutChart wrap data in arrays). Default: `d.data || d`.
49
62
  */
50
63
  export declare function buildOrdinalTooltip({ categoryAccessor, valueAccessor, groupAccessor, groupLabel, pieData, valueFormat, }: {
51
- categoryAccessor: string | ((d: Datum) => any);
52
- valueAccessor: string | ((d: Datum) => any);
53
- groupAccessor?: string | ((d: Datum) => any);
64
+ categoryAccessor: TooltipAccessor;
65
+ valueAccessor: TooltipAccessor;
66
+ groupAccessor?: TooltipAccessor;
54
67
  groupLabel?: string;
55
68
  pieData?: boolean;
56
69
  /** Same formatter the HOC passes to the value axis. Threaded here so the
57
70
  * default tooltip shows values consistently with the axis ("$450k", not
58
71
  * "450000"). Override by passing a custom `tooltip` prop. */
59
- valueFormat?: (v: any, ...rest: any[]) => React.ReactNode;
72
+ valueFormat?: TooltipFormatter;
60
73
  }): (d: Datum) => React.ReactNode;
@@ -2,7 +2,7 @@ import type React from "react";
2
2
  import type { PartialMargin } from "../../types/marginType";
3
3
  import type { OnObservationCallback } from "../../store/ObservationStore";
4
4
  import type { AnimateProp } from "../../stream/pipelineTransitionUtils";
5
- import type { Datum } from "./datumTypes";
5
+ import type { Datum, DatumValue } from "./datumTypes";
6
6
  import type { AutoPlaceAnnotations } from "../../recipes/annotationLayout";
7
7
  import type { ResponsiveRule } from "./responsiveRules";
8
8
  import type { MobileVisualizationContract } from "./auditMobileVisualization";
@@ -164,10 +164,7 @@ export interface BaseChartProps {
164
164
  accessibleTable?: boolean;
165
165
  /** Callback when a data element is clicked. Receives the original datum and pixel coordinates.
166
166
  * For lines, receives the line data; for bars, the bar datum; for pie slices, the slice datum. */
167
- onClick?: (datum: any, event: {
168
- x: number;
169
- y: number;
170
- }) => void;
167
+ onClick?: DatumClickHandler;
171
168
  /** Dim non-hovered series when hovering a data mark. Requires `colorBy`. */
172
169
  hoverHighlight?: HoverHighlightMode;
173
170
  /** Max pixel distance for hover/click hit testing. Default 30. Increase for sparse charts, decrease for dense ones. */
@@ -198,6 +195,12 @@ export interface BaseChartProps {
198
195
  * - Network / geo / hierarchy charts: no-op (no continuous axis). */
199
196
  axisExtent?: import("./axisExtent").AxisExtentMode;
200
197
  }
198
+ export type DatumClickHandler = {
199
+ bivarianceHack(datum: Datum, event: {
200
+ x: number;
201
+ y: number;
202
+ }): void;
203
+ }["bivarianceHack"];
201
204
  /**
202
205
  * Axis configuration props
203
206
  */
@@ -220,7 +223,7 @@ export type CategoryFormatFn = (label: string, index?: number) => string | React
220
223
  * Accessor type - can be a property name or a function
221
224
  * @deprecated Use DataAccessor from generalTypes for generic type safety
222
225
  */
223
- export type Accessor<T = any> = string | ((d: any, i?: number) => T);
226
+ export type Accessor<T = DatumValue> = string | ((d: Datum, i?: number) => T);
224
227
  /**
225
228
  * Generic accessor type that provides autocomplete when TDatum is specified.
226
229
  * Uses Datum in the function param so HOC charts can pass
@@ -3,6 +3,11 @@ import type { Datum } from "./datumTypes";
3
3
  import type { Accessor, ChartAccessor } from "./types";
4
4
  import type { SelectionHookResult } from "./selectionUtils";
5
5
  import type { HoverData } from "../../stream/types";
6
+ import type { BandConfig } from "../../stream/types";
7
+ import { type StyleRule, type StyleRuleContext } from "./styleRules";
8
+ import type { HatchFill } from "./hatchFill";
9
+ /** Values a resolved area/line style may carry (`fill` can be a HatchFill). */
10
+ type AreaStyleValue = string | number | HatchFill | CanvasPattern | undefined;
6
11
  export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
7
12
  /** Sparse-filtered data array (the HOC's `safeData`). */
8
13
  safeData: TDatum[];
@@ -54,14 +59,22 @@ export interface AreaSeriesSetupOptions<TDatum extends Datum = Datum> {
54
59
  groupField?: Accessor<string> | ChartAccessor<TDatum, string>;
55
60
  /** Optional band prop — when set, the default tooltip surfaces a
56
61
  * pair of rows per band (low + high). Threaded through verbatim. */
57
- band?: unknown;
62
+ band?: BandConfig<TDatum> | Array<BandConfig<TDatum>>;
63
+ /**
64
+ * Declarative style rules, merged on top of the resolved area fill/stroke
65
+ * (last-applicable rule wins). Per-series: resolves against the series'
66
+ * sample datum. A rule `fill` may be a color or a HatchFill.
67
+ */
68
+ styleRules?: ReadonlyArray<StyleRule>;
69
+ /** Build the `StyleRuleContext` for a series sample datum. */
70
+ ruleContext?: (d: Datum) => StyleRuleContext;
58
71
  }
59
72
  export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
60
73
  /** Flat data array ready for `<StreamXYFrame data={…} />`. Empty
61
74
  * when the HOC is in push mode (no `data` prop). */
62
75
  flattenedData: TDatum[];
63
76
  /** Selection-aware line/area style fn. */
64
- lineStyle: (d: Datum) => Record<string, string | number>;
77
+ lineStyle: (d: Datum) => Record<string, AreaStyleValue>;
65
78
  /** Selection-aware point style fn — `undefined` when `showPoints`
66
79
  * is false so the HOC can spread it conditionally. */
67
80
  pointStyle: ((d: Datum) => Record<string, string | number>) | undefined;
@@ -76,3 +89,4 @@ export interface AreaSeriesSetupResult<TDatum extends Datum = Datum> {
76
89
  * verbatim before extraction.
77
90
  */
78
91
  export declare function useAreaSeriesSetup<TDatum extends Datum = Datum>(options: AreaSeriesSetupOptions<TDatum>): AreaSeriesSetupResult<TDatum>;
92
+ export {};
@@ -18,7 +18,7 @@ export interface ChartSetupInput {
18
18
  /** The data array used for color scale and category extraction */
19
19
  data: Array<Datum>;
20
20
  /** The original data prop (may be undefined) — used for empty-state check */
21
- rawData: unknown[] | undefined;
21
+ rawData: Array<Datum | null | undefined> | undefined;
22
22
  /** The color-by accessor (may be an "actual" colorBy derived from stackBy/groupBy/categoryAccessor) */
23
23
  colorBy: Accessor<string> | undefined;
24
24
  /** Color scheme name or custom array — undefined lets useColorScale consult the theme */
@@ -53,7 +53,7 @@ export interface ChartSetupInput {
53
53
  right: number;
54
54
  };
55
55
  /** onClick callback */
56
- onClick?: (datum: any, event: {
56
+ onClick?: (datum: Datum, event: {
57
57
  x: number;
58
58
  y: number;
59
59
  }) => void;
@@ -28,6 +28,9 @@ interface ScaffoldOptions {
28
28
  enableHover?: boolean;
29
29
  showLegend?: boolean;
30
30
  title?: string;
31
+ description?: string;
32
+ summary?: string;
33
+ accessibleTable?: boolean;
31
34
  mobileInteraction?: MobileInteractionProp;
32
35
  mobileSemantics?: MobileVisualizationContract;
33
36
  responsiveRules?: ResponsiveRule[];
@@ -1,4 +1,4 @@
1
- import type { Ref, RefObject, DependencyList } from "react";
1
+ import type { Ref, RefObject } from "react";
2
2
  import type { RealtimeFrameHandle } from "../../realtime/types";
3
3
  type FrameVariant = "xy" | "network" | "geo-points" | "geo-lines";
4
4
  interface Options {
@@ -15,7 +15,6 @@ interface Options {
15
15
  variant: FrameVariant;
16
16
  frameRef: RefObject<unknown>;
17
17
  overrides?: Partial<RealtimeFrameHandle>;
18
- deps?: DependencyList;
19
18
  }
20
19
  /**
21
20
  * Wire up the HOC's exposed `ref` to the inner frame ref using the
@@ -30,11 +30,11 @@ export declare function resolveAccessorFn<T>(accessor: string | ((d: Datum) => T
30
30
  * Interpolates from red → gray → blue for odd, red → blue for even.
31
31
  */
32
32
  export declare function defaultDivergingScheme(n: number, themeDivergingSchemeName?: string): string[];
33
- export declare function aggregateData(data: any[], levels: string[], getCat: (d: Datum) => string, getScore: ((d: Datum) => number) | null, getLevel: ((d: Datum) => string) | null, getCount: ((d: Datum) => number) | null): AggregatedRow[];
33
+ export declare function aggregateData(data: Datum[], levels: string[], getCat: (d: Datum) => string, getScore: ((d: Datum) => number) | null, getLevel: ((d: Datum) => string) | null, getCount: ((d: Datum) => number) | null): AggregatedRow[];
34
34
  export declare function toDivergingValues(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
35
35
  export declare function orderForDiverging(rows: AggregatedRow[], levels: string[]): AggregatedRow[];
36
36
  interface UseLikertAggregationConfig {
37
- data: any[] | undefined;
37
+ data: Datum[] | undefined;
38
38
  levels: string[];
39
39
  categoryAccessor?: string | ((d: Datum) => string);
40
40
  valueAccessor?: string | ((d: Datum) => number);
@@ -47,9 +47,9 @@ interface UseLikertAggregationResult {
47
47
  /** Pre-processed data for static mode */
48
48
  processedData: AggregatedRow[];
49
49
  /** Re-aggregate all accumulated data (call from push handlers) */
50
- reAggregate: (rawData: any[]) => void;
50
+ reAggregate: (rawData: Datum[]) => void;
51
51
  /** Ref holding accumulated raw data for push mode */
52
- accumulatorRef: MutableRefObject<any[]>;
52
+ accumulatorRef: MutableRefObject<Datum[]>;
53
53
  }
54
54
  /**
55
55
  * Encapsulates Likert-specific data aggregation:
@@ -1,4 +1,5 @@
1
1
  import type { ChartAccessor } from "./types";
2
+ import type { Datum } from "./datumTypes";
2
3
  export interface OrdinalBrushInput {
3
4
  brushProp: boolean | undefined;
4
5
  onBrushProp: ((extent: {
@@ -8,7 +9,7 @@ export interface OrdinalBrushInput {
8
9
  name: string;
9
10
  rField?: string;
10
11
  } | undefined;
11
- valueAccessor: ChartAccessor<any, number>;
12
+ valueAccessor: ChartAccessor<Datum, number>;
12
13
  }
13
14
  export interface OrdinalBrushResult {
14
15
  hasBrush: boolean;
@@ -1,6 +1,15 @@
1
1
  import type { Datum } from "./datumTypes";
2
2
  import type { Accessor, ChartAccessor } from "./types";
3
3
  import type { SelectionHookResult } from "./selectionUtils";
4
+ import { type StyleRule } from "./styleRules";
5
+ import type { HatchFill } from "./hatchFill";
6
+ /**
7
+ * Values a resolved piece style may carry. Wider than the axis-style
8
+ * `string | number` because `fill` can be a declarative {@link HatchFill}
9
+ * descriptor or a raw `CanvasPattern`.
10
+ */
11
+ type PieceStyleValue = string | number | HatchFill | CanvasPattern | undefined;
12
+ type PieceStyleObject = Record<string, PieceStyleValue>;
4
13
  export interface OrdinalPieceStyleOptions {
5
14
  /** colorBy accessor — string field name or function */
6
15
  colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
@@ -65,6 +74,19 @@ export interface OrdinalPieceStyleOptions {
65
74
  effectiveSelectionHook: SelectionHookResult | null | undefined;
66
75
  /** Resolved selection config (typically `setup.resolvedSelection`). */
67
76
  resolvedSelection: import("./types").SelectionConfig | undefined;
77
+ /**
78
+ * Declarative, threshold-aware style rules. Evaluated per piece and merged
79
+ * on top of the resolved base fill (last-applicable rule wins per property).
80
+ * The user's `frameProps.pieceStyle` still overrides these, and top-level
81
+ * primitive props (`stroke`/`strokeWidth`/`opacity`) override everything.
82
+ */
83
+ styleRules?: ReadonlyArray<StyleRule>;
84
+ /**
85
+ * Resolve the numeric value a threshold rule compares against for a datum
86
+ * (typically the chart's `valueAccessor` output). Lets `{ when: { gt: 10 } }`
87
+ * work with no `field` on the threshold.
88
+ */
89
+ resolveRuleValue?: (d: Datum) => number | undefined;
68
90
  }
69
91
  /**
70
92
  * Build a memoized `pieceStyle` function that the chart can pass
@@ -84,4 +106,5 @@ export interface OrdinalPieceStyleOptions {
84
106
  * })
85
107
  * ```
86
108
  */
87
- export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) => Record<string, string | number | undefined>;
109
+ export declare function useOrdinalPieceStyle(options: OrdinalPieceStyleOptions): (d: Datum, category?: string) => PieceStyleObject;
110
+ export {};
@@ -37,7 +37,7 @@ export declare function useStreamingLegend({ isPushMode, colorBy, colorScheme, s
37
37
  legendPosition?: LegendPosition;
38
38
  }): {
39
39
  wrapPush: (originalPush: (d: Datum) => void) => (datum: Datum) => void;
40
- wrapPushMany: (originalPushMany: (d: any[]) => void) => (data: any[]) => void;
40
+ wrapPushMany: (originalPushMany: (data: Datum[]) => void) => (data: Datum[]) => void;
41
41
  resetCategories: () => void;
42
42
  categories: string[];
43
43
  categoryDomainProps: {
@@ -1,6 +1,7 @@
1
1
  import type { Datum } from "./datumTypes";
2
2
  import type { Accessor, ChartAccessor } from "./types";
3
3
  import type { SelectionHookResult, SelectionStyleConfig } from "./selectionUtils";
4
+ import { type StyleRule, type StyleRuleContext } from "./styleRules";
4
5
  export interface XYLineStyleOptions {
5
6
  /**
6
7
  * Base stroke width. The top-level `strokeWidth` override below
@@ -33,6 +34,15 @@ export interface XYLineStyleOptions {
33
34
  effectiveSelectionHook?: SelectionHookResult | null;
34
35
  /** Resolved selection style config (matched/unmatched style overrides). */
35
36
  resolvedSelection?: SelectionStyleConfig;
37
+ /**
38
+ * Declarative style rules, merged on top of the resolved base stroke/fill
39
+ * (last-applicable rule wins). NOTE: line styles resolve per-SERIES against
40
+ * a representative sample datum (the series' first point), so a rule's
41
+ * `ctx.x`/`ctx.y` reflect that sample point, not every vertex.
42
+ */
43
+ styleRules?: ReadonlyArray<StyleRule>;
44
+ /** Build the `StyleRuleContext` for a series' sample datum + group key. */
45
+ ruleContext?: (d: Datum, group?: string) => StyleRuleContext;
36
46
  }
37
47
  /**
38
48
  * Returns a memoized `lineStyle` callback that the XY frame's
@@ -1,6 +1,11 @@
1
1
  import type { Datum } from "./datumTypes";
2
2
  import type { Accessor, ChartAccessor } from "./types";
3
3
  import type { SelectionHookResult } from "./selectionUtils";
4
+ import { type StyleRule, type StyleRuleContext } from "./styleRules";
5
+ import type { HatchFill } from "./hatchFill";
6
+ /** Values a resolved point style may carry (`fill` can be a HatchFill). */
7
+ type PointStyleValue = string | number | HatchFill | CanvasPattern | undefined;
8
+ type PointStyleObject = Record<string, PointStyleValue>;
4
9
  export interface XYPointStyleOptions {
5
10
  /** colorBy accessor — string field name or function. */
6
11
  colorBy?: Accessor<string> | ChartAccessor<Datum, string>;
@@ -46,6 +51,18 @@ export interface XYPointStyleOptions {
46
51
  effectiveSelectionHook: SelectionHookResult | null | undefined;
47
52
  /** Resolved selection config (typically `setup.resolvedSelection`). */
48
53
  resolvedSelection: import("./types").SelectionConfig | undefined;
54
+ /**
55
+ * Declarative style rules, evaluated per point and merged on top of the
56
+ * resolved base fill (last-applicable rule wins). Same engine and precedence
57
+ * as the ordinal bar `styleRules`.
58
+ */
59
+ styleRules?: ReadonlyArray<StyleRule>;
60
+ /**
61
+ * Build the `StyleRuleContext` for a point — populate `value`/`x`/`y` from
62
+ * the chart's accessors so thresholds can target either axis
63
+ * (`{ axis: "x", gt: 5 }`). Called only when `styleRules` is set.
64
+ */
65
+ ruleContext?: (d: Datum) => StyleRuleContext;
49
66
  /**
50
67
  * For ConnectedScatterplot-style charts whose color depends on the
51
68
  * point's position in an ordered sequence, the resolver may need
@@ -84,4 +101,5 @@ export interface XYPointStyleOptions {
84
101
  * })
85
102
  * ```
86
103
  */
87
- export declare function useXYPointStyle(options: XYPointStyleOptions): (d: Datum) => Record<string, string | number | undefined>;
104
+ export declare function useXYPointStyle(options: XYPointStyleOptions): (d: Datum) => PointStyleObject;
105
+ export {};
@@ -9,22 +9,24 @@ import type { Datum } from "./datumTypes";
9
9
  * Samples first, last, and a middle element to catch common mistakes
10
10
  * (wrong field names, missing data) without iterating the entire dataset.
11
11
  */
12
- type AccessorLike = string | ((...args: any[]) => any);
12
+ type AccessorResult = string | number | boolean | Date | Datum | null | undefined;
13
+ type AccessorLike = string | ((datum: Datum, index?: number) => AccessorResult);
14
+ type ChartDataInput = ReadonlyArray<Datum> | Datum | string | number | boolean | null | undefined;
13
15
  interface ArrayDataValidation {
14
16
  componentName: string;
15
- data: any;
17
+ data: ChartDataInput;
16
18
  accessors?: Record<string, AccessorLike | undefined>;
17
19
  requiredProps?: Datum;
18
20
  }
19
21
  interface ObjectDataValidation {
20
22
  componentName: string;
21
- data: any | undefined | null;
23
+ data: ChartDataInput;
22
24
  dataLabel?: string;
23
25
  }
24
26
  interface NetworkDataValidation {
25
27
  componentName: string;
26
- nodes?: any[] | undefined | null;
27
- edges?: any[] | undefined | null;
28
+ nodes?: ReadonlyArray<Datum> | null;
29
+ edges?: ReadonlyArray<Datum> | null;
28
30
  nodesRequired?: boolean;
29
31
  edgesRequired?: boolean;
30
32
  accessors?: Record<string, AccessorLike | undefined>;
@@ -1,2 +1,11 @@
1
- import type { ComponentSpec } from "./validateProps";
2
- export declare const VALIDATION_MAP: Record<string, ComponentSpec>;
1
+ /**
2
+ * Runtime validation map derived from the Chart Spec Registry.
3
+ *
4
+ * The generated module contains only the fields consumed by `validateProps`.
5
+ * Keeping the docs/schema-rich registry out of this runtime import path saves
6
+ * it from every AI and utility bundle while preserving VALIDATION_MAP's public
7
+ * object shape. Regenerate after chart-spec edits with:
8
+ *
9
+ * npm run docs:chart-specs:schema
10
+ */
11
+ export { VALIDATION_MAP } from "./validationMap.generated";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * AUTO-GENERATED from chartSpecs.ts by scripts/regenerate-schema.ts.
3
+ * Do not edit by hand; run `npm run docs:chart-specs:schema`.
4
+ */
5
+ import type { ComponentSpec } from "./validateProps";
6
+ export declare const VALIDATION_MAP: Record<string, ComponentSpec>;
@@ -1,4 +1,5 @@
1
1
  import * as React from "react";
2
+ import type { Datum, DatumValue } from "./datumTypes";
2
3
  interface SafeRenderProps {
3
4
  componentName: string;
4
5
  width: number;
@@ -25,7 +26,7 @@ export declare function SafeRender({ componentName, width, height, children }: S
25
26
  * Renders a "No data available" placeholder when data is empty.
26
27
  * Returns null when data is present or emptyContent is `false`.
27
28
  */
28
- export declare function renderEmptyState(data: any[] | undefined | null, width: number, height: number, emptyContent?: React.ReactNode | false): React.ReactElement | null;
29
+ export declare function renderEmptyState(data: Datum[] | undefined | null, width: number, height: number, emptyContent?: React.ReactNode | false): React.ReactElement | null;
29
30
  /**
30
31
  * Renders a loading placeholder while `loading` is true.
31
32
  *
@@ -39,7 +40,7 @@ export declare function renderEmptyState(data: any[] | undefined | null, width:
39
40
  */
40
41
  export declare function renderLoadingState(loading: boolean | undefined, width: number, height: number, loadingContent?: React.ReactNode | false): React.ReactElement | null;
41
42
  /** Warn if a string accessor isn't found in the first data element */
42
- export declare function warnMissingField(componentName: string, data: any[] | undefined, accessorName: string, accessorValue: any): void;
43
+ export declare function warnMissingField(componentName: string, data: Datum[] | undefined, accessorName: string, accessorValue: DatumValue): void;
43
44
  /** Warn if data looks like the wrong shape for this chart type */
44
- export declare function warnDataShape(componentName: string, data: any[] | undefined, expectedKeys: string[], hint: string): void;
45
+ export declare function warnDataShape(componentName: string, data: Array<Datum | string | number | boolean | null | undefined> | undefined, expectedKeys: string[], hint: string): void;
45
46
  export {};
@@ -0,0 +1,22 @@
1
+ import type { BigNumberFormat, BigNumberTarget } from "./types";
2
+ export interface TargetPresentation {
3
+ label: string | undefined;
4
+ percent: string | null;
5
+ formattedValue: string;
6
+ text: string;
7
+ }
8
+ interface UseTargetPresentationOptions {
9
+ target: BigNumberTarget | undefined;
10
+ value: number | null | undefined;
11
+ format: BigNumberFormat | undefined;
12
+ locale: string | undefined;
13
+ currency: string | undefined;
14
+ precision: number | undefined;
15
+ }
16
+ /**
17
+ * Format a finite target once for both visible chrome and the accessible
18
+ * sentence. Invalid target values are omitted rather than announcing NaN or
19
+ * infinity.
20
+ */
21
+ export declare function useTargetPresentation({ target, value, format, locale, currency, precision }: UseTargetPresentationOptions): TargetPresentation | null;
22
+ export {};
@@ -70,7 +70,7 @@ export interface BigNumberThreshold {
70
70
  level: BigNumberLevel;
71
71
  /** Explicit colour override; otherwise `var(--semiotic-{level})`. */
72
72
  color?: string;
73
- /** Optional label surfaced in tooltips, the ARIA sentence, and capability output. */
73
+ /** Optional label appended to the generated ARIA sentence. */
74
74
  label?: string;
75
75
  }
76
76
  /**
@@ -252,11 +252,10 @@ export interface BigNumberProps<_TDatum extends Datum = Datum> {
252
252
  * full-width and stacks the chart at full card width under the delta
253
253
  * row. */
254
254
  trendSlot?: BigNumberSlot;
255
- /** **Square** chart embedded beside the value — e.g. a `DonutChart` /
256
- * `PieChart` / `Scatterplot` / `Treemap`. When set, the card splits
257
- * into a left column (header + value + delta) and a right column
258
- * (the square chart). Compose with `trendSlot` to get both
259
- * (square chart on the right, wide trend along the bottom). */
255
+ /** **Square** chart anchored as a top-right card decoration — e.g. a
256
+ * `DonutChart` / `PieChart` / `Scatterplot` / `Treemap`. The header
257
+ * reserves its corner; choose `chartSize` to leave room for large values
258
+ * or compose with `trendSlot` for a wide chart along the bottom. */
260
259
  chartSlot?: BigNumberSlot;
261
260
  /** Reserved pixel size (square) for `chartSlot`. Defaults are
262
261
  * mode-keyed for sparkline scale — 44 px for `tile`, 80 px for
@@ -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 StyleRule } from "../shared/styleRules";
8
9
  import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
9
10
  export interface SemanticGradientStop {
10
11
  /** Percent from baseline to line/top. 0 = baseline, 100 = line/top. */
@@ -65,6 +66,13 @@ export interface AreaChartProps<TDatum extends Datum = Datum> extends BaseChartP
65
66
  * @default "category10"
66
67
  */
67
68
  colorScheme?: string | string[] | Record<string, string>;
69
+ /**
70
+ * Declarative, threshold-aware area styling. Ordered `{ when, style }`
71
+ * rules; last applicable rule wins. Per-SERIES (resolves against the series'
72
+ * sample datum). A rule `fill` may be a color or a HatchFill — hatch an
73
+ * "uncertain"/"projected" series. Layers over the resolved series color.
74
+ */
75
+ styleRules?: StyleRule[];
68
76
  /**
69
77
  * Curve interpolation type
70
78
  * @default "monotoneX"
@@ -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 StyleRule } from "../shared/styleRules";
8
9
  import { type RegressionProp } from "../shared/regressionUtils";
9
10
  /**
10
11
  * BubbleChart component props
@@ -56,6 +57,14 @@ export interface BubbleChartProps<TDatum extends Datum = Datum> extends BaseChar
56
57
  * @default "category10"
57
58
  */
58
59
  colorScheme?: string | string[] | Record<string, string>;
60
+ /**
61
+ * Declarative, threshold-aware bubble styling. Ordered `{ when, style }`
62
+ * rules; last applicable rule wins per property. `when` accepts a predicate
63
+ * (`ctx` = `{ value, x, y, size, category }`), a declarative threshold
64
+ * (`{ axis: "x"|"y", gt, … }`), or `true`. A rule's `fill` may be a color or
65
+ * a HatchFill. Layers over the resolved base color.
66
+ */
67
+ styleRules?: StyleRule[];
59
68
  /**
60
69
  * Bubble opacity
61
70
  * @default 0.6
@@ -5,6 +5,7 @@ import type { RealtimeFrameHandle } from "../../realtime/types";
5
5
  import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
6
6
  import { type TooltipProp } from "../../Tooltip/Tooltip";
7
7
  import type { LegendInteractionMode } from "../shared/hooks";
8
+ import { type StyleRule } from "../shared/styleRules";
8
9
  import { type RegressionProp } from "../shared/regressionUtils";
9
10
  import type { ForecastConfig, AnomalyConfig } from "../shared/statisticalOverlays";
10
11
  /**
@@ -25,6 +26,12 @@ export interface ConnectedScatterplotProps<TDatum extends Datum = Datum> extends
25
26
  orderAccessor?: string | ((d: TDatum) => number | Date);
26
27
  /** Label for the ordering metric in tooltips @default "Order" or the accessor field name */
27
28
  orderLabel?: string;
29
+ /**
30
+ * Declarative, threshold-aware point styling (see Scatterplot). Ordered
31
+ * `{ when, style }` rules; last applicable rule wins. Layers over the
32
+ * order-derived base fill.
33
+ */
34
+ styleRules?: StyleRule[];
28
35
  /** Point radius @default 4 */
29
36
  pointRadius?: number;
30
37
  /** Enable hover annotations @default true */
@@ -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
+ export { computeDifferenceSegments } from "./differenceSegments";
8
9
  /**
9
10
  * DifferenceChart props
10
11
  */
@@ -75,57 +76,6 @@ export interface DifferenceChartProps<TDatum extends Datum = Datum> extends Base
75
76
  /** Pass-through StreamXYFrame props. */
76
77
  frameProps?: Partial<Omit<StreamXYFrameProps, "chartType" | "data" | "size">>;
77
78
  }
78
- /**
79
- * Crossover-segmented record used by the area pipeline. One row per
80
- * vertex along either the upper or lower boundary; `__diffSegment` is a
81
- * group key per segment so the area scene builder produces one polygon
82
- * per id with the correct fill color.
83
- */
84
- interface SegmentRow {
85
- __x: number;
86
- /** Upper boundary y value (max of A, B). The area pipeline reads this. */
87
- __y: number;
88
- /** Lower boundary y value (min of A, B) — picked up as per-datum y0. */
89
- __y0: number;
90
- /** Segment id. Format: `"seg-<index>-<winner>"`. */
91
- __diffSegment: string;
92
- /** Which series is on top in this segment ("A" or "B"). Drives fill. */
93
- __diffWinner: "A" | "B";
94
- /** Original A value at this x (or interpolated at crossovers). */
95
- __valA: number;
96
- /** Original B value at this x (or interpolated at crossovers). */
97
- __valB: number;
98
- /** Original datum (for tooltip lookup at non-crossover vertices). */
99
- __sourceDatum?: Datum;
100
- }
101
- /**
102
- * Walk sorted data, splitting at each A↔B crossover. Inserts an
103
- * interpolated vertex on BOTH sides of every crossover so adjacent
104
- * segments meet at a zero-width point (no jagged edges).
105
- *
106
- * Non-finite rows are skipped; the algorithm tracks the most recent
107
- * VALID non-tie row (not the index neighbor) for crossover detection,
108
- * so a non-finite gap doesn't drop a crossover that straddles it.
109
- *
110
- * Tie rows (a === b) are handled distinctly from non-tie rows:
111
- *
112
- * - When a tie row sits BETWEEN two non-tie rows with the SAME
113
- * winner, the tie is emitted in that winner's segment as a
114
- * zero-width vertex.
115
- * - When a tie row sits between non-tie rows with DIFFERENT winners,
116
- * the FIRST tie of the run becomes the crossover vertex. The old
117
- * segment closes at the tie's x, the new segment opens at the same
118
- * point, and any subsequent tie rows (multi-tie runs) carry into
119
- * the new segment as zero-width vertices.
120
- *
121
- * This preserves the data's actual zero-difference point: if the user
122
- * supplied a tie row explicitly, the fill switches color exactly at
123
- * that x rather than at a linear-interpolated x that ignored the tie.
124
- *
125
- * Exported for direct unit-testing — the area pipeline depends on the
126
- * exact crossover-vertex shape produced here.
127
- */
128
- export declare function computeDifferenceSegments<TDatum extends Datum>(raw: TDatum[], getX: (d: TDatum) => number, getA: (d: TDatum) => number, getB: (d: TDatum) => number): SegmentRow[];
129
79
  /**
130
80
  * DifferenceChart — fills the area between two series with a color
131
81
  * that switches based on which series is higher at each x. Crossover
@@ -169,4 +119,3 @@ export declare const DifferenceChart: {
169
119
  <TDatum extends Datum = Datum>(props: DifferenceChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
170
120
  displayName?: string;
171
121
  };
172
- export {};
@@ -43,7 +43,7 @@ export interface HeatmapProps<TDatum extends Datum = Datum> extends BaseChartPro
43
43
  /**
44
44
  * Format function for x-axis tick labels
45
45
  */
46
- xFormat?: (d: any, index?: number, allTicks?: number[]) => string;
46
+ xFormat?: (d: string | number | Date, index?: number, allTicks?: number[]) => string;
47
47
  /**
48
48
  * Format function for y-axis tick labels
49
49
  */
@@ -64,7 +64,7 @@ export interface HeatmapProps<TDatum extends Datum = Datum> extends BaseChartPro
64
64
  * customColorScale={scaleSequential(interpolatePlasma).domain([0, 100])}
65
65
  * ```
66
66
  */
67
- customColorScale?: any;
67
+ customColorScale?: (value: number) => string;
68
68
  /**
69
69
  * Show values in cells
70
70
  * @default false