semiotic 3.3.1 → 3.4.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 (204) hide show
  1. package/CLAUDE.md +25 -6
  2. package/README.md +1 -1
  3. package/ai/dist/mcp-server.js +104 -9
  4. package/ai/schema.json +42 -1
  5. package/ai/system-prompt.md +4 -0
  6. package/dist/components/Annotation.d.ts +42 -2
  7. package/dist/components/CategoryColors.d.ts +1 -1
  8. package/dist/components/ChartGrid.d.ts +1 -1
  9. package/dist/components/ContextLayout.d.ts +1 -1
  10. package/dist/components/DataSummaryContext.d.ts +1 -1
  11. package/dist/components/DetailsPanel.d.ts +3 -2
  12. package/dist/components/Legend.d.ts +2 -3
  13. package/dist/components/LinkedCharts.d.ts +9 -1
  14. package/dist/components/ThemeProvider.d.ts +1 -1
  15. package/dist/components/Tooltip/FlippingTooltip.d.ts +1 -1
  16. package/dist/components/Tooltip/Tooltip.d.ts +4 -3
  17. package/dist/components/charts/geo/ChoroplethMap.d.ts +4 -4
  18. package/dist/components/charts/geo/DistanceCartogram.d.ts +5 -4
  19. package/dist/components/charts/geo/FlowMap.d.ts +4 -4
  20. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +4 -3
  21. package/dist/components/charts/index.d.ts +3 -1
  22. package/dist/components/charts/network/ChordDiagram.d.ts +4 -3
  23. package/dist/components/charts/network/CirclePack.d.ts +3 -3
  24. package/dist/components/charts/network/ForceDirectedGraph.d.ts +3 -2
  25. package/dist/components/charts/network/OrbitDiagram.d.ts +6 -5
  26. package/dist/components/charts/network/SankeyDiagram.d.ts +4 -3
  27. package/dist/components/charts/network/TreeDiagram.d.ts +3 -3
  28. package/dist/components/charts/network/Treemap.d.ts +3 -3
  29. package/dist/components/charts/ordinal/BarChart.d.ts +30 -4
  30. package/dist/components/charts/ordinal/BoxPlot.d.ts +4 -3
  31. package/dist/components/charts/ordinal/DonutChart.d.ts +4 -3
  32. package/dist/components/charts/ordinal/DotPlot.d.ts +13 -4
  33. package/dist/components/charts/ordinal/FunnelChart.d.ts +4 -3
  34. package/dist/components/charts/ordinal/GaugeChart.d.ts +2 -1
  35. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +6 -5
  36. package/dist/components/charts/ordinal/Histogram.d.ts +4 -3
  37. package/dist/components/charts/ordinal/LikertChart.d.ts +8 -4
  38. package/dist/components/charts/ordinal/PieChart.d.ts +4 -3
  39. package/dist/components/charts/ordinal/RidgelinePlot.d.ts +4 -3
  40. package/dist/components/charts/ordinal/StackedBarChart.d.ts +6 -5
  41. package/dist/components/charts/ordinal/SwarmPlot.d.ts +4 -3
  42. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -3
  43. package/dist/components/charts/ordinal/ViolinPlot.d.ts +4 -3
  44. package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +7 -6
  45. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +10 -7
  46. package/dist/components/charts/realtime/RealtimeLineChart.d.ts +9 -6
  47. package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +7 -6
  48. package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +9 -6
  49. package/dist/components/charts/shared/ChartError.d.ts +1 -2
  50. package/dist/components/charts/shared/annotationResolvers.d.ts +4 -3
  51. package/dist/components/charts/shared/annotationRules.d.ts +2 -1
  52. package/dist/components/charts/shared/colorUtils.d.ts +4 -3
  53. package/dist/components/charts/shared/datumTypes.d.ts +20 -0
  54. package/dist/components/charts/shared/diagnoseConfig.d.ts +2 -7
  55. package/dist/components/charts/shared/formatUtils.d.ts +4 -2
  56. package/dist/components/charts/shared/hooks.d.ts +41 -24
  57. package/dist/components/charts/shared/legendUtils.d.ts +3 -2
  58. package/dist/components/charts/shared/mergeShapeStyle.d.ts +43 -0
  59. package/dist/components/charts/shared/networkUtils.d.ts +7 -6
  60. package/dist/components/charts/shared/selectionUtils.d.ts +14 -11
  61. package/dist/components/charts/shared/statisticalOverlays.d.ts +14 -26
  62. package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +2 -2
  63. package/dist/components/charts/shared/statsTooltip.d.ts +3 -2
  64. package/dist/components/charts/shared/tooltipUtils.d.ts +20 -7
  65. package/dist/components/charts/shared/types.d.ts +27 -19
  66. package/dist/components/charts/shared/useChartSetup.d.ts +15 -6
  67. package/dist/components/charts/shared/useLikertAggregation.d.ts +18 -7
  68. package/dist/components/charts/shared/useOrdinalStreaming.d.ts +3 -2
  69. package/dist/components/charts/shared/useResolvedSelection.d.ts +2 -0
  70. package/dist/components/charts/shared/useStreamingLegend.d.ts +2 -1
  71. package/dist/components/charts/shared/validateChartData.d.ts +2 -1
  72. package/dist/components/charts/shared/validateProps.d.ts +2 -8
  73. package/dist/components/charts/shared/withChartWrapper.d.ts +1 -1
  74. package/dist/components/charts/xy/AreaChart.d.ts +4 -3
  75. package/dist/components/charts/xy/BubbleChart.d.ts +4 -3
  76. package/dist/components/charts/xy/CandlestickChart.d.ts +47 -0
  77. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -3
  78. package/dist/components/charts/xy/Heatmap.d.ts +12 -7
  79. package/dist/components/charts/xy/LineChart.d.ts +4 -3
  80. package/dist/components/charts/xy/MinimapChart.d.ts +4 -4
  81. package/dist/components/charts/xy/MultiAxisLineChart.d.ts +5 -4
  82. package/dist/components/charts/xy/QuadrantChart.d.ts +4 -3
  83. package/dist/components/charts/xy/Scatterplot.d.ts +4 -3
  84. package/dist/components/charts/xy/ScatterplotMatrix.d.ts +3 -3
  85. package/dist/components/charts/xy/StackedAreaChart.d.ts +4 -3
  86. package/dist/components/data/transforms.d.ts +8 -7
  87. package/dist/components/export/chartConfig.d.ts +4 -3
  88. package/dist/components/geo/mergeData.d.ts +2 -1
  89. package/dist/components/realtime/BinAccumulator.d.ts +3 -2
  90. package/dist/components/realtime/renderers/types.d.ts +2 -1
  91. package/dist/components/realtime/renderers/waterfallRenderer.d.ts +2 -1
  92. package/dist/components/realtime/types.d.ts +32 -16
  93. package/dist/components/semiotic-geo.d.ts +4 -0
  94. package/dist/components/semiotic-network.d.ts +7 -0
  95. package/dist/components/semiotic-ordinal.d.ts +8 -0
  96. package/dist/components/semiotic-themes.d.ts +2 -1
  97. package/dist/components/semiotic-xy.d.ts +11 -0
  98. package/dist/components/semiotic.d.ts +3 -3
  99. package/dist/components/server/animatedGif.d.ts +4 -18
  100. package/dist/components/server/renderToStaticSVG.d.ts +6 -5
  101. package/dist/components/server/serverChartConfigs.d.ts +2 -10
  102. package/dist/components/server/staticAnnotations.d.ts +2 -1
  103. package/dist/components/server/staticLegend.d.ts +2 -1
  104. package/dist/components/store/ObservationStore.d.ts +4 -3
  105. package/dist/components/store/SelectionStore.d.ts +3 -8
  106. package/dist/components/store/ThemeStore.d.ts +34 -4
  107. package/dist/components/store/TooltipStore.d.ts +1 -1
  108. package/dist/components/store/useSelection.d.ts +6 -5
  109. package/dist/components/stream/AccessibleDataTable.d.ts +5 -5
  110. package/dist/components/stream/CanvasHitTester.d.ts +10 -4
  111. package/dist/components/stream/DataSourceAdapter.d.ts +19 -1
  112. package/dist/components/stream/FocusRing.d.ts +1 -2
  113. package/dist/components/stream/GeoCanvasHitTester.d.ts +1 -1
  114. package/dist/components/stream/GeoParticlePool.d.ts +2 -1
  115. package/dist/components/stream/GeoPipelineStore.d.ts +26 -7
  116. package/dist/components/stream/MarginalGraphics.d.ts +1 -2
  117. package/dist/components/stream/NetworkPipelineStore.d.ts +8 -2
  118. package/dist/components/stream/NetworkSVGOverlay.d.ts +4 -4
  119. package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -19
  120. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +3 -1
  121. package/dist/components/stream/OrdinalPipelineStore.d.ts +44 -6
  122. package/dist/components/stream/OrdinalSVGOverlay.d.ts +6 -5
  123. package/dist/components/stream/ParticlePool.d.ts +4 -0
  124. package/dist/components/stream/PipelineStore.d.ts +80 -30
  125. package/dist/components/stream/SVGOverlay.d.ts +10 -10
  126. package/dist/components/stream/SceneGraph.d.ts +6 -5
  127. package/dist/components/stream/StreamGeoFrame.d.ts +2 -1
  128. package/dist/components/stream/StreamNetworkFrame.d.ts +2 -1
  129. package/dist/components/stream/StreamOrdinalFrame.d.ts +2 -1
  130. package/dist/components/stream/StreamXYFrame.d.ts +19 -1
  131. package/dist/components/stream/XYBrushOverlay.d.ts +1 -21
  132. package/dist/components/stream/devDataAccessWarning.d.ts +2 -11
  133. package/dist/components/stream/geoTypes.d.ts +32 -18
  134. package/dist/components/stream/hoverUtils.d.ts +14 -1
  135. package/dist/components/stream/layouts/hierarchySceneBuilders.d.ts +4 -3
  136. package/dist/components/stream/layouts/hierarchyUtils.d.ts +4 -3
  137. package/dist/components/stream/networkTypes.d.ts +51 -28
  138. package/dist/components/stream/ordinalSceneBuilders/barFunnelScene.d.ts +1 -1
  139. package/dist/components/stream/ordinalSceneBuilders/barScene.d.ts +2 -2
  140. package/dist/components/stream/ordinalSceneBuilders/connectorScene.d.ts +1 -1
  141. package/dist/components/stream/ordinalSceneBuilders/pointScene.d.ts +2 -2
  142. package/dist/components/stream/ordinalSceneBuilders/statisticalScene.d.ts +4 -4
  143. package/dist/components/stream/ordinalSceneBuilders/swimlaneScene.d.ts +1 -1
  144. package/dist/components/stream/ordinalSceneBuilders/timelineScene.d.ts +1 -1
  145. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +9 -8
  146. package/dist/components/stream/ordinalTypes.d.ts +102 -29
  147. package/dist/components/stream/pipelineDecay.d.ts +2 -1
  148. package/dist/components/stream/pipelinePulse.d.ts +2 -1
  149. package/dist/components/stream/pipelineTransitionUtils.d.ts +21 -0
  150. package/dist/components/stream/pipelineTransitions.d.ts +16 -4
  151. package/dist/components/stream/quadtreeHitTest.d.ts +22 -0
  152. package/dist/components/stream/renderers/colorUtils.d.ts +20 -0
  153. package/dist/components/stream/renderers/resolveCSSColor.d.ts +23 -6
  154. package/dist/components/stream/types.d.ts +63 -8
  155. package/dist/components/stream/useFrame.d.ts +122 -0
  156. package/dist/components/stream/xySceneBuilders/areaScene.d.ts +3 -2
  157. package/dist/components/stream/xySceneBuilders/barScene.d.ts +2 -1
  158. package/dist/components/stream/xySceneBuilders/boundsScene.d.ts +2 -1
  159. package/dist/components/stream/xySceneBuilders/candlestickScene.d.ts +2 -1
  160. package/dist/components/stream/xySceneBuilders/emitPointNodes.d.ts +3 -2
  161. package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +2 -1
  162. package/dist/components/stream/xySceneBuilders/lineScene.d.ts +2 -1
  163. package/dist/components/stream/xySceneBuilders/mixedScene.d.ts +2 -1
  164. package/dist/components/stream/xySceneBuilders/pointScene.d.ts +2 -1
  165. package/dist/components/stream/xySceneBuilders/swarmScene.d.ts +2 -1
  166. package/dist/components/stream/xySceneBuilders/types.d.ts +35 -26
  167. package/dist/components/stream/xySceneBuilders/waterfallScene.d.ts +2 -1
  168. package/dist/components/types/marginType.d.ts +15 -0
  169. package/dist/geo.min.js +1 -1
  170. package/dist/geo.module.min.js +1 -1
  171. package/dist/network.min.js +1 -1
  172. package/dist/network.module.min.js +1 -1
  173. package/dist/ordinal.min.js +1 -1
  174. package/dist/ordinal.module.min.js +1 -1
  175. package/dist/realtime.min.js +1 -1
  176. package/dist/realtime.module.min.js +1 -1
  177. package/dist/semiotic-ai.min.js +1 -1
  178. package/dist/semiotic-ai.module.min.js +1 -1
  179. package/dist/semiotic-geo.d.ts +4 -0
  180. package/dist/semiotic-network.d.ts +7 -0
  181. package/dist/semiotic-ordinal.d.ts +8 -0
  182. package/dist/semiotic-statisticalOverlays-Ckd_jM8z.js +1 -0
  183. package/dist/semiotic-themes.d.ts +2 -1
  184. package/dist/semiotic-themes.min.js +1 -1
  185. package/dist/semiotic-themes.module.min.js +1 -1
  186. package/dist/semiotic-utils.min.js +1 -1
  187. package/dist/semiotic-utils.module.min.js +1 -1
  188. package/dist/semiotic-xy.d.ts +11 -0
  189. package/dist/semiotic.d.ts +3 -3
  190. package/dist/semiotic.min.js +1 -1
  191. package/dist/semiotic.module.min.js +1 -1
  192. package/dist/server.min.js +1 -1
  193. package/dist/server.module.min.js +1 -1
  194. package/dist/test-utils/canvasMock.d.ts +35 -1
  195. package/dist/test-utils/ordinalFixtures.d.ts +48 -0
  196. package/dist/xy.min.js +1 -1
  197. package/dist/xy.module.min.js +1 -1
  198. package/package.json +50 -42
  199. package/dist/components/types/annotationTypes.d.ts +0 -145
  200. package/dist/components/types/generalTypes.d.ts +0 -241
  201. package/dist/components/types/interactionTypes.d.ts +0 -72
  202. package/dist/components/types/networkTypes.d.ts +0 -174
  203. package/dist/components/types/ordinalTypes.d.ts +0 -112
  204. package/dist/semiotic-statisticalOverlays-DGX_WWc5.js +0 -1
@@ -1,21 +1,22 @@
1
1
  import type { ScaleLinear } from "d3-scale";
2
2
  import type { OrdinalScales, OrdinalColumn, OrdinalPipelineConfig, OrdinalSceneNode, OrdinalLayout } from "../ordinalTypes";
3
3
  import type { Style } from "../types";
4
+ import type { Datum } from "../../charts/shared/datumTypes";
4
5
  export interface OrdinalSceneContext {
5
6
  scales: OrdinalScales;
6
7
  columns: Record<string, OrdinalColumn>;
7
8
  config: OrdinalPipelineConfig;
8
- getR: (d: any) => number;
9
- getStack?: (d: any) => string;
10
- getGroup?: (d: any) => string;
11
- getColor?: (d: any) => string;
12
- getConnector?: (d: any) => string;
13
- getO: (d: any) => string;
9
+ getR: (d: Datum) => number;
10
+ getStack?: (d: Datum) => string;
11
+ getGroup?: (d: Datum) => string;
12
+ getColor?: (d: Datum) => string;
13
+ getConnector?: (d: Datum) => string;
14
+ getO: (d: Datum) => string;
14
15
  multiScales: ScaleLinear<number, number>[];
15
- rAccessors: ((d: any) => number)[];
16
+ rAccessors: ((d: Datum) => number)[];
16
17
  resolvePieceStyle: (d: any, category?: string) => Style;
17
18
  resolveSummaryStyle: (d: any, category?: string) => Style;
18
19
  /** For timeline: resolve rAccessor as [start, end] */
19
- getRawRange: (d: any) => [number, number] | null;
20
+ getRawRange: (d: Datum) => [number, number] | null;
20
21
  }
21
22
  export type SceneBuilderFn = (ctx: OrdinalSceneContext, layout: OrdinalLayout) => OrdinalSceneNode[];
@@ -1,8 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ScaleLinear, ScaleBand } from "d3-scale";
3
- import type { ArrowOfTime, WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../realtime/types";
4
- import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig } from "./types";
3
+ import type { WindowMode, HoverAnnotationConfig, HoverData, AnnotationContext } from "../realtime/types";
4
+ import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, ThemeSemanticColors } from "./types";
5
+ import type { AnimateProp } from "./pipelineTransitionUtils";
5
6
  import type { LegendGroup } from "../types/legendTypes";
7
+ import type { Datum } from "../charts/shared/datumTypes";
6
8
  export type OrdinalChartType = "bar" | "clusterbar" | "point" | "swarm" | "pie" | "donut" | "boxplot" | "violin" | "histogram" | "ridgeline" | "timeline" | "funnel" | "bar-funnel" | "swimlane";
7
9
  export interface OrdinalScales {
8
10
  o: ScaleBand<string>;
@@ -28,6 +30,8 @@ export interface WedgeSceneNode {
28
30
  _pulseColor?: string;
29
31
  _pulseGlowRadius?: number;
30
32
  _targetOpacity?: number;
33
+ _targetStartAngle?: number;
34
+ _targetEndAngle?: number;
31
35
  _transitionKey?: string;
32
36
  }
33
37
  export interface BoxplotSceneNode {
@@ -140,7 +144,7 @@ export interface OrdinalColumn {
140
144
  width: number;
141
145
  middle: number;
142
146
  padding: number;
143
- pieceData: Record<string, any>[];
147
+ pieceData: Datum[];
144
148
  /** For radial: proportion of total (0-1) */
145
149
  pct: number;
146
150
  /** For radial: cumulative start proportion */
@@ -153,20 +157,36 @@ export interface OrdinalPipelineConfig {
153
157
  windowMode: WindowMode;
154
158
  extentPadding: number;
155
159
  projection: "vertical" | "horizontal" | "radial";
156
- oAccessor?: string | ((d: any) => string);
157
- rAccessor?: string | ((d: any) => number) | Array<string | ((d: any) => number)>;
158
- colorAccessor?: string | ((d: any) => string);
159
- stackBy?: string | ((d: any) => string);
160
- groupBy?: string | ((d: any) => string);
160
+ categoryAccessor?: string | ((d: Datum) => string);
161
+ valueAccessor?: string | ((d: Datum) => number) | Array<string | ((d: Datum) => number)>;
162
+ colorAccessor?: string | ((d: Datum) => string);
163
+ stackBy?: string | ((d: Datum) => string);
164
+ groupBy?: string | ((d: Datum) => string);
165
+ timeAccessor?: string | ((d: Datum) => number);
166
+ /** @deprecated Use categoryAccessor */
167
+ oAccessor?: string | ((d: Datum) => string);
168
+ /** @deprecated Use valueAccessor */
169
+ rAccessor?: string | ((d: Datum) => number) | Array<string | ((d: Datum) => number)>;
161
170
  multiAxis?: boolean;
162
- timeAccessor?: string | ((d: any) => number);
163
- valueAccessor?: string | ((d: any) => number);
164
- categoryAccessor?: string | ((d: any) => string);
165
171
  rExtent?: [number?, number?];
166
172
  oExtent?: string[];
167
173
  barPadding?: number;
168
174
  /** Rounded top corner radius for bar charts. Only the end away from the baseline is rounded. For stacked bars, only the topmost segment gets rounded. */
169
175
  roundedTop?: number;
176
+ /** Gradient fill for bar rects. `{ topOpacity, bottomOpacity }` fades the
177
+ * resolved fill color from tip (opposite the baseline) to base; `{ colorStops }`
178
+ * renders a multi-color gradient along the same axis. Direction follows the
179
+ * bar's orientation (tip → base). Same shape as AreaChart.gradientFill
180
+ * sans the `boolean` case — the HOC resolves `true` to default opacities. */
181
+ gradientFill?: {
182
+ topOpacity: number;
183
+ bottomOpacity: number;
184
+ } | {
185
+ colorStops: Array<{
186
+ offset: number;
187
+ color: string;
188
+ }>;
189
+ };
170
190
  /** When true, adds padding below the 0 baseline. When false (default), bars are flush with the axis line. */
171
191
  baselinePadding?: boolean;
172
192
  innerRadius?: number;
@@ -182,34 +202,47 @@ export interface OrdinalPipelineConfig {
182
202
  amplitude?: number;
183
203
  connectorOpacity?: number;
184
204
  showLabels?: boolean;
185
- oSort?: ((a: any, b: any) => number) | boolean | "asc" | "desc";
186
- connectorAccessor?: string | ((d: any) => string);
187
- connectorStyle?: Style | ((d: any) => Style);
205
+ oSort?: ((a: string, b: string) => number) | boolean | "asc" | "desc" | "auto";
206
+ connectorAccessor?: string | ((d: Datum) => string);
207
+ connectorStyle?: Style | ((d: Datum) => Style);
188
208
  dynamicColumnWidth?: string | ((data: any[]) => number);
189
209
  pieceStyle?: (d: any, category?: string) => Style;
190
210
  summaryStyle?: (d: any, category?: string) => Style;
191
211
  colorScheme?: string | string[];
212
+ themeCategorical?: string[];
213
+ /** Theme-resolved semantic role colors — default fallback before hardcoded hex. See `ThemeSemanticColors` in ./types. */
214
+ themeSemantic?: ThemeSemanticColors;
215
+ /** Theme sequential scheme name — fallback for magnitude encodings. */
216
+ themeSequential?: string;
217
+ /** Theme diverging scheme name — fallback for midpoint encodings (LikertChart). */
218
+ themeDiverging?: string;
192
219
  barColors?: Record<string, string>;
193
220
  /** ID accessor for remove() — extracts a unique identifier from each datum */
194
- dataIdAccessor?: string | ((d: any) => string);
221
+ dataIdAccessor?: string | ((d: Datum) => string);
195
222
  decay?: DecayConfig;
196
223
  pulse?: PulseConfig;
197
224
  transition?: TransitionConfig;
225
+ /** Whether to animate elements on first render (bars grow from baseline, wedges sweep in) */
226
+ introAnimation?: boolean;
198
227
  staleness?: StalenessConfig;
199
228
  }
200
- export interface StreamOrdinalFrameProps<T = Record<string, any>> {
229
+ export interface StreamOrdinalFrameProps<T = Datum> {
201
230
  chartType: OrdinalChartType;
202
231
  runtimeMode?: "bounded" | "streaming";
203
232
  data?: T[];
204
- oAccessor?: string | ((d: T) => string);
205
- rAccessor?: string | ((d: T) => number) | Array<string | ((d: T) => number)>;
233
+ /** Category field — the ordinal dimension (replaces oAccessor) */
234
+ categoryAccessor?: string | ((d: T) => string);
235
+ /** Value field — the quantitative dimension (replaces rAccessor). Can be array for multiAxis. */
236
+ valueAccessor?: string | ((d: T) => number) | Array<string | ((d: T) => number)>;
206
237
  colorAccessor?: string | ((d: T) => string);
207
238
  stackBy?: string | ((d: T) => string);
208
239
  groupBy?: string | ((d: T) => string);
209
- multiAxis?: boolean;
210
240
  timeAccessor?: string | ((d: T) => number);
211
- valueAccessor?: string | ((d: T) => number);
212
- categoryAccessor?: string | ((d: T) => string);
241
+ /** @deprecated Use categoryAccessor instead */
242
+ oAccessor?: string | ((d: T) => string);
243
+ /** @deprecated Use valueAccessor instead */
244
+ rAccessor?: string | ((d: T) => number) | Array<string | ((d: T) => number)>;
245
+ multiAxis?: boolean;
213
246
  projection?: "vertical" | "horizontal" | "radial";
214
247
  size?: [number, number];
215
248
  responsiveWidth?: boolean;
@@ -222,6 +255,17 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
222
255
  };
223
256
  barPadding?: number;
224
257
  roundedTop?: number;
258
+ /** Gradient fill for bar rects. Same shape as AreaChart.gradientFill sans
259
+ * the boolean case — resolve booleans at the HOC layer. */
260
+ gradientFill?: {
261
+ topOpacity: number;
262
+ bottomOpacity: number;
263
+ } | {
264
+ colorStops: Array<{
265
+ offset: number;
266
+ color: string;
267
+ }>;
268
+ };
225
269
  baselinePadding?: boolean;
226
270
  innerRadius?: number;
227
271
  cornerRadius?: number;
@@ -238,14 +282,13 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
238
282
  rExtent?: [number?, number?];
239
283
  oExtent?: string[];
240
284
  extentPadding?: number;
241
- oSort?: ((a: any, b: any) => number) | boolean | "asc" | "desc";
242
- arrowOfTime?: ArrowOfTime;
285
+ oSort?: ((a: string, b: string) => number) | boolean | "asc" | "desc" | "auto";
243
286
  windowMode?: WindowMode;
244
287
  windowSize?: number;
245
288
  connectorAccessor?: string | ((d: T) => string);
246
- connectorStyle?: Style | ((d: any) => Style);
289
+ connectorStyle?: Style | ((d: Datum) => Style);
247
290
  /** ID accessor for remove()/update() — extracts a unique identifier from each datum */
248
- dataIdAccessor?: string | ((d: any) => string);
291
+ dataIdAccessor?: string | ((d: Datum) => string);
249
292
  /** Custom tick values for the value (r) axis. Overrides the default d3 ticks. */
250
293
  rTickValues?: number[];
251
294
  /** Align first tick label to start and last tick label to end. Default false. */
@@ -256,16 +299,28 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
256
299
  barColors?: Record<string, string>;
257
300
  showAxes?: boolean;
258
301
  showCategoryTicks?: boolean;
302
+ /** Category axis label */
303
+ categoryLabel?: string;
304
+ /** Value axis label */
305
+ valueLabel?: string;
306
+ /** Category tick formatter */
307
+ categoryFormat?: (d: string, index?: number) => string | ReactNode;
308
+ /** Value tick formatter */
309
+ valueFormat?: (d: number | string) => string;
310
+ /** @deprecated Use categoryLabel */
259
311
  oLabel?: string;
312
+ /** @deprecated Use valueLabel */
260
313
  rLabel?: string;
314
+ /** @deprecated Use categoryFormat */
261
315
  oFormat?: (d: string, index?: number) => string | ReactNode;
316
+ /** @deprecated Use valueFormat */
262
317
  rFormat?: (d: number | string) => string;
263
318
  enableHover?: boolean;
264
319
  hoverAnnotation?: boolean | HoverAnnotationConfig;
265
320
  tooltipContent?: (d: HoverData) => ReactNode;
266
321
  customHoverBehavior?: (d: HoverData | null) => void;
267
- annotations?: Record<string, any>[];
268
- svgAnnotationRules?: (annotation: Record<string, any>, index: number, context: AnnotationContext) => ReactNode;
322
+ annotations?: Datum[];
323
+ svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
269
324
  showGrid?: boolean;
270
325
  legend?: ReactNode | {
271
326
  legendGroups: LegendGroup[];
@@ -298,6 +353,10 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
298
353
  decay?: DecayConfig;
299
354
  pulse?: PulseConfig;
300
355
  transition?: TransitionConfig;
356
+ /** Declarative animation: `true` for defaults (300ms ease-out), or config object.
357
+ * When enabled, charts animate on first render (intro) and on data change.
358
+ * Set `{ intro: false }` to disable the intro animation. */
359
+ animate?: AnimateProp;
301
360
  staleness?: StalenessConfig;
302
361
  /** Render a visually-hidden data table from the scene graph for screen readers */
303
362
  accessibleTable?: boolean;
@@ -306,9 +365,22 @@ export interface StreamOrdinalFrameProps<T = Record<string, any>> {
306
365
  /** Accessible summary rendered as a screen-reader-only note */
307
366
  summary?: string;
308
367
  }
309
- export interface StreamOrdinalFrameHandle<T = Record<string, any>> {
368
+ export interface StreamOrdinalFrameHandle<T = Datum> {
310
369
  push(datum: T): void;
311
370
  pushMany(data: T[]): void;
371
+ /** Replace all data. Unlike `clear() + pushMany()`, `replace()` preserves
372
+ * the previous scene's position snapshot so data-change transitions fire.
373
+ * Use when you need to swap in a full new dataset (e.g. re-aggregated
374
+ * values from streaming input) and want the bars/points/etc. to animate
375
+ * between the old and new positions.
376
+ *
377
+ * Note: for datasets within the DataSourceAdapter chunk threshold (the
378
+ * common case for aggregator HOCs like LikertChart) the replacement
379
+ * lands in a single changeset. Larger datasets fall through to the
380
+ * progressive-chunked path used by the `data` prop — the first chunk
381
+ * resets + seeds the buffer, subsequent chunks append on successive
382
+ * animation frames, so replacement is not instantaneous for large N. */
383
+ replace(data: T[]): void;
312
384
  /** Remove data items by ID. Requires dataIdAccessor. */
313
385
  remove(id: string | string[]): T[];
314
386
  /** Update data items by ID in place. Requires dataIdAccessor. Returns previous values. */
@@ -322,4 +394,5 @@ export interface OrdinalLayout {
322
394
  height: number;
323
395
  }
324
396
  export type OrdinalRendererFn = (ctx: CanvasRenderingContext2D, nodes: OrdinalSceneNode[], scales: OrdinalScales, layout: OrdinalLayout) => void;
325
- export type { HoverData, HoverAnnotationConfig, AnnotationContext, ArrowOfTime, WindowMode };
397
+ export type { HoverData, HoverAnnotationConfig, AnnotationContext, WindowMode };
398
+ export type { ArrowOfTime } from "../realtime/types";
@@ -1,3 +1,4 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
1
2
  /**
2
3
  * Shared decay encoding utilities for all pipeline stores.
3
4
  *
@@ -18,4 +19,4 @@ export declare function computeDecayOpacity(decay: DecayConfig, bufferIndex: num
18
19
  * Apply decay opacity to a list of scene nodes.
19
20
  * Uses the datum's index in the buffer data array.
20
21
  */
21
- export declare function applyDecay(decay: DecayConfig, nodes: SceneNode[], data: Record<string, any>[]): void;
22
+ export declare function applyDecay(decay: DecayConfig, nodes: SceneNode[], data: Datum[]): void;
@@ -1,3 +1,4 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
1
2
  /**
2
3
  * Pulse encoding for XY pipeline scene nodes.
3
4
  *
@@ -17,7 +18,7 @@ export declare function computePulseIntensity(pulse: PulseConfig, insertTime: nu
17
18
  /**
18
19
  * Apply pulse glow to scene nodes using insertion timestamps.
19
20
  */
20
- export declare function applyPulse(pulse: PulseConfig, nodes: SceneNode[], data: Record<string, any>[], timestampBuffer: RingBuffer<number>): void;
21
+ export declare function applyPulse(pulse: PulseConfig, nodes: SceneNode[], data: Datum[], timestampBuffer: RingBuffer<number>): void;
21
22
  /**
22
23
  * Check whether there are active pulse animations needing continuous rendering.
23
24
  */
@@ -40,3 +40,24 @@ export declare function lerp(from: number, to: number, t: number): number;
40
40
  * Get the current timestamp in a way that works both in browser and Node.
41
41
  */
42
42
  export declare function now(): number;
43
+ /** The animate prop type accepted by all HOCs and Stream Frames.
44
+ * Single source of truth — re-exported by types.ts, ordinalTypes.ts, networkTypes.ts, geoTypes.ts. */
45
+ export type AnimateProp = boolean | {
46
+ duration?: number;
47
+ easing?: "linear" | "ease-out";
48
+ intro?: boolean;
49
+ };
50
+ /**
51
+ * Resolve the declarative `animate` prop into a concrete TransitionConfig.
52
+ * Used by all 4 Stream Frames. `animate` takes precedence over `transitionProp`.
53
+ */
54
+ export declare function resolveAnimateConfig(animate: AnimateProp | undefined, transitionProp: {
55
+ duration?: number;
56
+ easing?: "ease-out" | "linear";
57
+ } | undefined): {
58
+ transition: {
59
+ duration?: number;
60
+ easing?: "ease-out" | "linear";
61
+ } | undefined;
62
+ introEnabled: boolean;
63
+ };
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import type { SceneNode, TransitionConfig } from "./types";
14
14
  import type { ActiveTransition } from "./pipelineTransitionUtils";
15
+ import type { Datum } from "../charts/shared/datumTypes";
15
16
  export type PrevPosition = {
16
17
  x: number;
17
18
  y: number;
@@ -19,6 +20,10 @@ export type PrevPosition = {
19
20
  h?: number;
20
21
  r?: number;
21
22
  opacity?: number;
23
+ openY?: number;
24
+ closeY?: number;
25
+ highY?: number;
26
+ lowY?: number;
22
27
  };
23
28
  export type PrevPath = {
24
29
  topPath?: [number, number][];
@@ -29,12 +34,19 @@ export type PrevPath = {
29
34
  /** Context needed from PipelineStore for identity resolution */
30
35
  export interface TransitionContext {
31
36
  runtimeMode?: "streaming" | "bounded";
32
- getX: (d: any) => number;
33
- getY: (d: any) => number;
34
- getCategory?: (d: any) => string;
37
+ getX: (d: Datum) => number;
38
+ getY: (d: Datum) => number;
39
+ getCategory?: (d: Datum) => string;
35
40
  }
36
41
  /**
37
42
  * Get a stable identity key for a scene node.
43
+ *
44
+ * Exit stubs (created during startTransition for scrolled-off nodes) have
45
+ * `datum: null` and carry their original identity on `_transitionKey`. If a
46
+ * new transition starts while exits are still in the scene, resolving their
47
+ * identity via the datum-less fallback (e.g. `c:${index}`) would reshuffle
48
+ * which exit matches which key on the next snapshot. Preferring the stored
49
+ * `_transitionKey` keeps exits stable across overlapping transitions.
38
50
  */
39
51
  export declare function getNodeIdentity(ctx: TransitionContext, node: SceneNode, index: number): string | null;
40
52
  /**
@@ -56,4 +68,4 @@ export declare function startTransition(ctx: TransitionContext, transition: Tran
56
68
  * Advance the transition animation. Returns true if still animating.
57
69
  * Mutates scene nodes in place.
58
70
  */
59
- export declare function advanceTransition(now: number, transition: TransitionConfig, state: TransitionState, prevPositionMap: Map<string, PrevPosition>, prevPathMap: Map<string, PrevPath>): boolean;
71
+ export declare function advanceTransition(now: number, transition: TransitionConfig, state: TransitionState, prevPositionMap: Map<string, PrevPosition>, _prevPathMap: Map<string, PrevPath>): boolean;
@@ -0,0 +1,22 @@
1
+ import type { Quadtree } from "d3-quadtree";
2
+ export interface QuadtreeHit<T> {
3
+ node: T;
4
+ distance: number;
5
+ }
6
+ /**
7
+ * Find the closest point whose own hit radius contains the cursor.
8
+ *
9
+ * Uses `quadtree.visit()` to enumerate every candidate within the widened
10
+ * search radius (maxDistance extended by the largest point radius in the
11
+ * scene). `quadtree.find()` alone is insufficient because it returns the
12
+ * nearest candidate by center-to-center distance — a farther point with a
13
+ * much larger visual radius can still be a valid hit that `find()` would
14
+ * hide.
15
+ *
16
+ * `T` must expose `x`, `y`, and `r` — the standard `PointSceneNode` shape.
17
+ */
18
+ export declare function findHitPointInQuadtree<T extends {
19
+ x: number;
20
+ y: number;
21
+ r: number;
22
+ }>(qt: Quadtree<T>, px: number, py: number, maxDistance: number, maxPointRadius: number): QuadtreeHit<T> | null;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Color utilities shared across canvas renderers.
3
+ *
4
+ * Kept here (not in layouts/hierarchyUtils or a deeper shared module) so
5
+ * renderers don't reach into unrelated layers for primitive helpers.
6
+ */
7
+ /**
8
+ * Resolve any valid CSS color string to an [r, g, b] tuple.
9
+ *
10
+ * Uses the canvas's own fillStyle round-trip to normalize first: assigning a
11
+ * CSS color to `ctx.fillStyle` and reading it back always yields `#rrggbb`
12
+ * or `rgba(r, g, b, a)`. That means named colors (`red`, `steelblue`), hsl(),
13
+ * and any other valid CSS form work the same as hex and rgb. Without the
14
+ * normalization pass a bare regex parser silently falls back on anything it
15
+ * doesn't match — gradients from named colors would render gray.
16
+ *
17
+ * The prior fillStyle is restored so this is callable from the middle of a
18
+ * draw without disturbing in-progress paint state.
19
+ */
20
+ export declare function parseCanvasColor(ctx: CanvasRenderingContext2D, color: string): [number, number, number];
@@ -5,13 +5,30 @@
5
5
  * reads the computed value from the canvas element. Otherwise returns
6
6
  * the input unchanged.
7
7
  *
8
- * Per-canvas cache avoids repeated getComputedStyle calls within a single
9
- * paint cycle. The cache is cleared on theme changes via clearCSSColorCache(),
10
- * which each Stream Frame calls in its theme-change useEffect.
8
+ * Per-canvas cache avoids repeated `getComputedStyle` calls. Cached entries
9
+ * are tagged with a global version counter that's bumped whenever a theme
10
+ * change is detected either through `clearCSSColorCache()` (called by
11
+ * Stream Frames on `currentTheme` change) or via the global observer below
12
+ * (catches external class toggles on `<html>` and `prefers-color-scheme`
13
+ * media-query changes that bypass React).
11
14
  */
12
15
  export declare function resolveCSSColor(ctx: CanvasRenderingContext2D, value: string | undefined): string | undefined;
13
16
  /**
14
- * Clear the per-canvas CSS variable cache. Called by Stream Frames
15
- * when the theme changes so the next paint reads fresh computed values.
17
+ * Invalidate the CSS variable cache. Stream Frames call this from their
18
+ * `currentTheme` `useEffect` so the next paint reads fresh computed values.
19
+ *
20
+ * The `canvas` argument is accepted for backward compatibility but ignored —
21
+ * invalidation is global because theme changes are global.
22
+ */
23
+ export declare function clearCSSColorCache(_canvas?: HTMLCanvasElement): void;
24
+ /**
25
+ * Test-only: reset all cache state, including disconnecting any installed
26
+ * observer/matchMedia listeners. Required for test isolation — without it,
27
+ * observers accumulate across files and bump `currentVersion` more than once
28
+ * per real DOM mutation.
29
+ *
30
+ * `currentVersion` is *incremented* (not reset to zero) so any WeakMap entries
31
+ * that survive from a previous test can't accidentally be re-validated by a
32
+ * version collision.
16
33
  */
17
- export declare function clearCSSColorCache(canvas: HTMLCanvasElement): void;
34
+ export declare function _resetCSSColorCacheForTest(): void;
@@ -1,6 +1,22 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ScaleLinear } from "d3-scale";
3
+ import type { AnimateProp } from "./pipelineTransitionUtils";
3
4
  import type { ArrowOfTime, WindowMode, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, HoverAnnotationConfig, HoverData, AnnotationContext, AnnotationAnchorMode } from "../realtime/types";
5
+ import type { Datum } from "../charts/shared/datumTypes";
6
+ export interface ThemeSemanticColors {
7
+ primary?: string;
8
+ secondary?: string;
9
+ success?: string;
10
+ danger?: string;
11
+ warning?: string;
12
+ error?: string;
13
+ info?: string;
14
+ text?: string;
15
+ textSecondary?: string;
16
+ border?: string;
17
+ grid?: string;
18
+ surface?: string;
19
+ }
4
20
  export interface DecayConfig {
5
21
  type: "linear" | "exponential" | "step";
6
22
  /** Exponential: half-life in buffer positions (default: bufferSize/2) */
@@ -107,6 +123,8 @@ export interface LineSceneNode {
107
123
  _prevPath?: [number, number][];
108
124
  /** Target path coordinates for interpolation during transitions */
109
125
  _targetPath?: [number, number][];
126
+ /** Intro clip fraction (0→1): reveals line from left to right via canvas clip */
127
+ _introClipFraction?: number;
110
128
  }
111
129
  export interface AreaSceneNode {
112
130
  type: "area";
@@ -156,6 +174,8 @@ export interface AreaSceneNode {
156
174
  _prevBottomPath?: [number, number][];
157
175
  /** Target bottom path coordinates for interpolation during transitions */
158
176
  _targetBottomPath?: [number, number][];
177
+ /** Intro clip fraction (0→1): reveals area from left to right via canvas clip */
178
+ _introClipFraction?: number;
159
179
  }
160
180
  export interface PointSceneNode {
161
181
  type: "point";
@@ -189,8 +209,23 @@ export interface RectSceneNode {
189
209
  h: number;
190
210
  /** Rounded corner radius on the end away from the baseline */
191
211
  roundedTop?: number;
192
- /** Which edge to round: "top"/"bottom" (vertical), "right"/"left" (horizontal) */
212
+ /** Which edge is the "tip" (opposite the baseline): "top"/"bottom" for
213
+ * vertical orientation, "right"/"left" for horizontal. Used by the
214
+ * renderer for rounded-corner placement AND gradient direction. Set by
215
+ * bar scene builders unconditionally so gradients resolve without
216
+ * requiring roundedTop. */
193
217
  roundedEdge?: "top" | "bottom" | "right" | "left";
218
+ /** Gradient fill — same shape as the area-scene version. Runs tip → base
219
+ * along the bar axis (inferred from `roundedEdge`). */
220
+ fillGradient?: {
221
+ topOpacity: number;
222
+ bottomOpacity: number;
223
+ } | {
224
+ colorStops: Array<{
225
+ offset: number;
226
+ color: string;
227
+ }>;
228
+ };
194
229
  style: Style;
195
230
  datum: any;
196
231
  group?: string;
@@ -263,6 +298,13 @@ export interface CandlestickSceneNode {
263
298
  _decayOpacity?: number;
264
299
  /** Stable identity key for transition tracking */
265
300
  _transitionKey?: string;
301
+ /** Geometry targets — set during a transition so advanceTransition can lerp
302
+ * toward them from the snapshotted prev position. Cleared on completion. */
303
+ _targetX?: number;
304
+ _targetOpenY?: number;
305
+ _targetCloseY?: number;
306
+ _targetHighY?: number;
307
+ _targetLowY?: number;
266
308
  }
267
309
  export interface CandlestickStyle {
268
310
  upColor?: string;
@@ -273,11 +315,20 @@ export interface CandlestickStyle {
273
315
  /** Single color for range/dumbbell mode (replaces up/down when no open/close provided) */
274
316
  rangeColor?: string;
275
317
  }
276
- export interface Changeset<T = Record<string, any>> {
318
+ export interface Changeset<T = Datum> {
277
319
  inserts: T[];
278
320
  bounded: boolean;
279
321
  /** Hint: total dataset size when progressively chunking bounded data */
280
322
  totalSize?: number;
323
+ /** When true on a bounded changeset, the store replaces the buffer
324
+ * contents but does NOT clear its category insertion-order memory
325
+ * and marks itself as having received streaming-sourced data. Used
326
+ * by aggregator HOCs (LikertChart, future density/bin charts) that
327
+ * re-derive their full dataset from streaming input on every push —
328
+ * the user perceives it as a stream even though the transport is
329
+ * a wholesale replacement. Without this, re-aggregation would wipe
330
+ * the category order and categories would shuffle on every tick. */
331
+ preserveCategoryOrder?: boolean;
281
332
  }
282
333
  /**
283
334
  * Note: when xScaleType="time", the x scale is a d3.scaleTime at runtime
@@ -293,7 +344,7 @@ export interface StreamLayout {
293
344
  height: number;
294
345
  }
295
346
  export type CurveType = "linear" | "monotoneX" | "monotoneY" | "step" | "stepAfter" | "stepBefore" | "basis" | "cardinal" | "catmullRom" | "natural";
296
- export interface StreamXYFrameProps<T = Record<string, any>> {
347
+ export interface StreamXYFrameProps<T = Datum> {
297
348
  chartType: StreamChartType;
298
349
  runtimeMode?: RuntimeMode;
299
350
  data?: T[];
@@ -403,8 +454,8 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
403
454
  yLabel?: string;
404
455
  /** Label for the right Y axis (dual-axis charts) */
405
456
  yLabelRight?: string;
406
- xFormat?: (d: any, index?: number, allTicks?: number[]) => string | ReactNode;
407
- yFormat?: (d: any) => string | ReactNode;
457
+ xFormat?: (d: number | Date | string, index?: number, allTicks?: number[]) => string | ReactNode;
458
+ yFormat?: (d: number | Date | string) => string | ReactNode;
408
459
  tickFormatTime?: (value: number) => string;
409
460
  tickFormatValue?: (value: number) => string;
410
461
  hoverAnnotation?: boolean | HoverAnnotationConfig;
@@ -434,8 +485,8 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
434
485
  } | null) => void;
435
486
  /** Accessor for unique point IDs used by point-anchored annotations */
436
487
  pointIdAccessor?: string | ((d: T) => string);
437
- annotations?: Record<string, any>[];
438
- svgAnnotationRules?: (annotation: Record<string, any>, index: number, context: AnnotationContext) => ReactNode;
488
+ annotations?: Datum[];
489
+ svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
439
490
  showGrid?: boolean;
440
491
  legend?: ReactNode | {
441
492
  legendGroups: any[];
@@ -467,6 +518,10 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
467
518
  pulse?: PulseConfig;
468
519
  /** Smooth position transitions on data change */
469
520
  transition?: TransitionConfig;
521
+ /** Declarative animation: `true` for defaults (300ms ease-out), or config object.
522
+ * When enabled, charts animate on first render (intro) and on data change.
523
+ * Set `{ intro: false }` to disable the intro animation. */
524
+ animate?: AnimateProp;
470
525
  /** Frame-level data liveness indicator */
471
526
  staleness?: StalenessConfig;
472
527
  /** Marginal distribution plots in axis margins (histogram, violin, ridgeline, boxplot) */
@@ -492,7 +547,7 @@ export interface StreamXYFrameProps<T = Record<string, any>> {
492
547
  /** Source chart ID — crosshair is suppressed on the source chart to avoid double rendering */
493
548
  linkedCrosshairSourceId?: string;
494
549
  }
495
- export interface StreamXYFrameHandle<T = Record<string, any>> {
550
+ export interface StreamXYFrameHandle<T = Datum> {
496
551
  push(datum: T): void;
497
552
  pushMany(data: T[]): void;
498
553
  /** Remove data points by ID. Requires pointIdAccessor. */