semiotic 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/CLAUDE.md +242 -29
  2. package/README.md +101 -66
  3. package/ai/cli.js +34 -21
  4. package/ai/dist/componentRegistry.js +2 -0
  5. package/ai/dist/mcp-server.js +54 -0
  6. package/ai/examples.md +433 -18
  7. package/ai/schema.json +134 -1
  8. package/ai/system-prompt.md +51 -10
  9. package/dist/{ChartGrid.d.ts → components/ChartGrid.d.ts} +9 -7
  10. package/dist/components/Legend.d.ts +9 -0
  11. package/dist/{LinkedCharts.d.ts → components/LinkedCharts.d.ts} +34 -1
  12. package/dist/{Tooltip → components/Tooltip}/Tooltip.d.ts +9 -2
  13. package/dist/components/charts/geo/ChoroplethMap.d.ts +53 -0
  14. package/dist/components/charts/geo/DistanceCartogram.d.ts +90 -0
  15. package/dist/components/charts/geo/FlowMap.d.ts +83 -0
  16. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +67 -0
  17. package/dist/components/charts/geo/index.d.ts +8 -0
  18. package/dist/{charts → components/charts}/index.d.ts +4 -0
  19. package/dist/{charts → components/charts}/network/ChordDiagram.d.ts +8 -5
  20. package/dist/{charts → components/charts}/network/CirclePack.d.ts +4 -2
  21. package/dist/{charts → components/charts}/network/ForceDirectedGraph.d.ts +10 -6
  22. package/dist/components/charts/network/OrbitDiagram.d.ts +79 -0
  23. package/dist/{charts → components/charts}/network/SankeyDiagram.d.ts +8 -5
  24. package/dist/{charts → components/charts}/network/TreeDiagram.d.ts +4 -2
  25. package/dist/{charts → components/charts}/network/Treemap.d.ts +4 -2
  26. package/dist/{charts → components/charts}/ordinal/BarChart.d.ts +9 -5
  27. package/dist/{charts → components/charts}/ordinal/BoxPlot.d.ts +9 -5
  28. package/dist/{charts → components/charts}/ordinal/DonutChart.d.ts +9 -5
  29. package/dist/{charts → components/charts}/ordinal/DotPlot.d.ts +9 -5
  30. package/dist/{charts → components/charts}/ordinal/GroupedBarChart.d.ts +9 -5
  31. package/dist/{charts → components/charts}/ordinal/Histogram.d.ts +8 -5
  32. package/dist/{charts → components/charts}/ordinal/PieChart.d.ts +9 -5
  33. package/dist/{charts → components/charts}/ordinal/RidgelinePlot.d.ts +2 -0
  34. package/dist/{charts → components/charts}/ordinal/StackedBarChart.d.ts +9 -5
  35. package/dist/{charts → components/charts}/ordinal/SwarmPlot.d.ts +9 -5
  36. package/dist/{charts → components/charts}/ordinal/ViolinPlot.d.ts +8 -5
  37. package/dist/{charts → components/charts}/realtime/RealtimeHeatmap.d.ts +24 -6
  38. package/dist/{charts → components/charts}/realtime/RealtimeHistogram.d.ts +28 -7
  39. package/dist/{charts → components/charts}/realtime/RealtimeLineChart.d.ts +23 -5
  40. package/dist/{charts → components/charts}/realtime/RealtimeSwarmChart.d.ts +24 -6
  41. package/dist/{charts → components/charts}/realtime/RealtimeWaterfallChart.d.ts +23 -5
  42. package/dist/{charts → components/charts}/shared/colorUtils.d.ts +5 -0
  43. package/dist/components/charts/shared/diagnoseConfig.d.ts +23 -0
  44. package/dist/{charts → components/charts}/shared/hooks.d.ts +36 -2
  45. package/dist/{charts → components/charts}/shared/legendUtils.d.ts +2 -3
  46. package/dist/{charts → components/charts}/shared/statisticalOverlays.d.ts +1 -2
  47. package/dist/components/charts/shared/statisticalOverlaysLazy.d.ts +10 -0
  48. package/dist/components/charts/shared/stringDistance.d.ts +11 -0
  49. package/dist/{charts → components/charts}/shared/tooltipUtils.d.ts +2 -2
  50. package/dist/{charts → components/charts}/shared/types.d.ts +16 -4
  51. package/dist/components/charts/shared/useChartSetup.d.ts +112 -0
  52. package/dist/components/charts/shared/useStreamingLegend.d.ts +65 -0
  53. package/dist/{charts → components/charts}/shared/withChartWrapper.d.ts +10 -0
  54. package/dist/{charts → components/charts}/xy/AreaChart.d.ts +18 -5
  55. package/dist/{charts → components/charts}/xy/BubbleChart.d.ts +18 -5
  56. package/dist/{charts → components/charts}/xy/ConnectedScatterplot.d.ts +10 -6
  57. package/dist/{charts → components/charts}/xy/Heatmap.d.ts +24 -5
  58. package/dist/{charts → components/charts}/xy/LineChart.d.ts +47 -5
  59. package/dist/{charts → components/charts}/xy/MinimapChart.d.ts +3 -0
  60. package/dist/components/charts/xy/QuadrantChart.d.ts +120 -0
  61. package/dist/{charts → components/charts}/xy/Scatterplot.d.ts +11 -5
  62. package/dist/{charts → components/charts}/xy/StackedAreaChart.d.ts +18 -5
  63. package/dist/{export → components/export}/exportChart.d.ts +6 -1
  64. package/dist/components/geo/mergeData.d.ts +18 -0
  65. package/dist/components/geo/referenceGeography.d.ts +10 -0
  66. package/dist/components/geo/useReferenceAreas.d.ts +13 -0
  67. package/dist/{realtime → components/realtime}/RingBuffer.d.ts +1 -0
  68. package/dist/{realtime → components/realtime}/types.d.ts +17 -0
  69. package/dist/components/semiotic-ai.d.ts +61 -0
  70. package/dist/components/semiotic-data.d.ts +8 -0
  71. package/dist/components/semiotic-geo.d.ts +16 -0
  72. package/dist/components/semiotic-network.d.ts +14 -0
  73. package/dist/components/semiotic-ordinal.d.ts +18 -0
  74. package/dist/components/semiotic-realtime.d.ts +22 -0
  75. package/dist/components/semiotic-server.d.ts +1 -0
  76. package/dist/components/semiotic-xy.d.ts +17 -0
  77. package/dist/components/semiotic.d.ts +57 -0
  78. package/dist/{server → components/server}/renderToStaticSVG.d.ts +11 -2
  79. package/dist/components/stream/AccessibleDataTable.d.ts +50 -0
  80. package/dist/{stream → components/stream}/CanvasHitTester.d.ts +8 -2
  81. package/dist/components/stream/DataSourceAdapter.d.ts +64 -0
  82. package/dist/components/stream/GeoCanvasHitTester.d.ts +19 -0
  83. package/dist/components/stream/GeoParticlePool.d.ts +46 -0
  84. package/dist/components/stream/GeoPipelineStore.d.ts +81 -0
  85. package/dist/components/stream/GeoTileRenderer.d.ts +31 -0
  86. package/dist/{stream → components/stream}/NetworkPipelineStore.d.ts +16 -4
  87. package/dist/{stream → components/stream}/NetworkSVGOverlay.d.ts +24 -1
  88. package/dist/{stream → components/stream}/OrdinalPipelineStore.d.ts +8 -4
  89. package/dist/{stream → components/stream}/OrdinalSVGOverlay.d.ts +31 -1
  90. package/dist/{stream → components/stream}/PipelineStore.d.ts +64 -5
  91. package/dist/components/stream/SVGOverlay.d.ts +98 -0
  92. package/dist/{stream → components/stream}/SceneGraph.d.ts +7 -3
  93. package/dist/components/stream/SceneToSVG.d.ts +22 -0
  94. package/dist/components/stream/StreamGeoFrame.d.ts +4 -0
  95. package/dist/{stream → components/stream}/accessorUtils.d.ts +1 -0
  96. package/dist/components/stream/canvasSetup.d.ts +26 -0
  97. package/dist/components/stream/geoTypes.d.ts +186 -0
  98. package/dist/components/stream/hitTestUtils.d.ts +23 -0
  99. package/dist/components/stream/layouts/forceLayoutPlugin.d.ts +2 -0
  100. package/dist/{stream → components/stream}/layouts/index.d.ts +2 -1
  101. package/dist/components/stream/layouts/orbitLayoutPlugin.d.ts +2 -0
  102. package/dist/components/stream/legendRenderer.d.ts +33 -0
  103. package/dist/{stream → components/stream}/networkTypes.d.ts +59 -3
  104. package/dist/{stream → components/stream}/ordinalTypes.d.ts +26 -10
  105. package/dist/components/stream/pipelineTransitionUtils.d.ts +42 -0
  106. package/dist/components/stream/renderers/areaCanvasRenderer.d.ts +2 -0
  107. package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +9 -0
  108. package/dist/{stream → components/stream}/renderers/heatmapCanvasRenderer.d.ts +2 -1
  109. package/dist/{stream → components/stream}/renderers/lineCanvasRenderer.d.ts +1 -0
  110. package/dist/components/stream/renderers/renderPulse.d.ts +50 -0
  111. package/dist/{stream → components/stream}/types.d.ts +89 -3
  112. package/dist/components/stream/useStalenessCheck.d.ts +16 -0
  113. package/dist/components/types/legendTypes.d.ts +49 -0
  114. package/dist/geo.min.js +1 -0
  115. package/dist/geo.module.min.js +1 -0
  116. package/dist/network.min.js +1 -1
  117. package/dist/network.module.min.js +1 -1
  118. package/dist/ordinal.min.js +1 -1
  119. package/dist/ordinal.module.min.js +1 -1
  120. package/dist/realtime.min.js +1 -1
  121. package/dist/realtime.module.min.js +1 -1
  122. package/dist/semiotic-ai.d.ts +3 -0
  123. package/dist/semiotic-ai.min.js +1 -1
  124. package/dist/semiotic-ai.module.min.js +1 -1
  125. package/dist/semiotic-data.d.ts +1 -0
  126. package/dist/semiotic-data.min.js +1 -1
  127. package/dist/semiotic-data.module.min.js +1 -1
  128. package/dist/semiotic-geo.d.ts +16 -0
  129. package/dist/semiotic-network.d.ts +1 -0
  130. package/dist/semiotic-ordinal.d.ts +1 -0
  131. package/dist/semiotic-server.d.ts +1 -1
  132. package/dist/semiotic-xy.d.ts +1 -0
  133. package/dist/semiotic.d.ts +4 -4
  134. package/dist/semiotic.min.js +1 -1
  135. package/dist/semiotic.module.min.js +1 -1
  136. package/dist/server.min.js +1 -1
  137. package/dist/server.module.min.js +1 -1
  138. package/dist/test-utils/canvasMock.d.ts +23 -0
  139. package/dist/test-utils/frameMock.d.ts +78 -0
  140. package/dist/xy.min.js +1 -1
  141. package/dist/xy.module.min.js +1 -1
  142. package/package.json +34 -20
  143. package/dist/Legend.d.ts +0 -3
  144. package/dist/stream/DataSourceAdapter.d.ts +0 -35
  145. package/dist/stream/SVGOverlay.d.ts +0 -56
  146. package/dist/stream/layouts/forceLayoutPlugin.d.ts +0 -9
  147. package/dist/stream/renderers/areaCanvasRenderer.d.ts +0 -7
  148. package/dist/types/legendTypes.d.ts +0 -20
  149. /package/dist/{Annotation.d.ts → components/Annotation.d.ts} +0 -0
  150. /package/dist/{CategoryColors.d.ts → components/CategoryColors.d.ts} +0 -0
  151. /package/dist/{ChartContainer.d.ts → components/ChartContainer.d.ts} +0 -0
  152. /package/dist/{ChartErrorBoundary.d.ts → components/ChartErrorBoundary.d.ts} +0 -0
  153. /package/dist/{ContextLayout.d.ts → components/ContextLayout.d.ts} +0 -0
  154. /package/dist/{DetailsPanel.d.ts → components/DetailsPanel.d.ts} +0 -0
  155. /package/dist/{ThemeProvider.d.ts → components/ThemeProvider.d.ts} +0 -0
  156. /package/dist/{charts → components/charts}/shared/ChartError.d.ts +0 -0
  157. /package/dist/{charts → components/charts}/shared/annotationRules.d.ts +0 -0
  158. /package/dist/{charts → components/charts}/shared/formatUtils.d.ts +0 -0
  159. /package/dist/{charts → components/charts}/shared/loess.d.ts +0 -0
  160. /package/dist/{charts → components/charts}/shared/networkUtils.d.ts +0 -0
  161. /package/dist/{charts → components/charts}/shared/selectionUtils.d.ts +0 -0
  162. /package/dist/{charts → components/charts}/shared/validateChartData.d.ts +0 -0
  163. /package/dist/{charts → components/charts}/shared/validateProps.d.ts +0 -0
  164. /package/dist/{charts → components/charts}/xy/ScatterplotMatrix.d.ts +0 -0
  165. /package/dist/{data → components/data}/fromVegaLite.d.ts +0 -0
  166. /package/dist/{data → components/data}/transforms.d.ts +0 -0
  167. /package/dist/{export → components/export}/chartConfig.d.ts +0 -0
  168. /package/dist/{export → components/export}/selectionSerializer.d.ts +0 -0
  169. /package/dist/{geometry → components/geometry}/sankeyLinks.d.ts +0 -0
  170. /package/dist/{realtime → components/realtime}/BinAccumulator.d.ts +0 -0
  171. /package/dist/{realtime → components/realtime}/IncrementalExtent.d.ts +0 -0
  172. /package/dist/{realtime → components/realtime}/renderers/types.d.ts +0 -0
  173. /package/dist/{realtime → components/realtime}/renderers/waterfallRenderer.d.ts +0 -0
  174. /package/dist/{store → components/store}/ObservationStore.d.ts +0 -0
  175. /package/dist/{store → components/store}/SelectionStore.d.ts +0 -0
  176. /package/dist/{store → components/store}/ThemeStore.d.ts +0 -0
  177. /package/dist/{store → components/store}/TooltipStore.d.ts +0 -0
  178. /package/dist/{store → components/store}/createStore.d.ts +0 -0
  179. /package/dist/{store → components/store}/useObservation.d.ts +0 -0
  180. /package/dist/{store → components/store}/useSelection.d.ts +0 -0
  181. /package/dist/{stream → components/stream}/MarginalGraphics.d.ts +0 -0
  182. /package/dist/{stream → components/stream}/NetworkCanvasHitTester.d.ts +0 -0
  183. /package/dist/{stream → components/stream}/OrdinalCanvasHitTester.d.ts +0 -0
  184. /package/dist/{stream → components/stream}/ParticlePool.d.ts +0 -0
  185. /package/dist/{stream → components/stream}/StreamNetworkFrame.d.ts +0 -0
  186. /package/dist/{stream → components/stream}/StreamOrdinalFrame.d.ts +0 -0
  187. /package/dist/{stream → components/stream}/StreamXYFrame.d.ts +0 -0
  188. /package/dist/{stream → components/stream}/keyboardNav.d.ts +0 -0
  189. /package/dist/{stream → components/stream}/layouts/chordLayoutPlugin.d.ts +0 -0
  190. /package/dist/{stream → components/stream}/layouts/hierarchyLayoutPlugin.d.ts +0 -0
  191. /package/dist/{stream → components/stream}/layouts/sankeyLayoutPlugin.d.ts +0 -0
  192. /package/dist/{stream → components/stream}/ordinalSceneBuilders/barScene.d.ts +0 -0
  193. /package/dist/{stream → components/stream}/ordinalSceneBuilders/connectorScene.d.ts +0 -0
  194. /package/dist/{stream → components/stream}/ordinalSceneBuilders/pieScene.d.ts +0 -0
  195. /package/dist/{stream → components/stream}/ordinalSceneBuilders/pointScene.d.ts +0 -0
  196. /package/dist/{stream → components/stream}/ordinalSceneBuilders/statisticalScene.d.ts +0 -0
  197. /package/dist/{stream → components/stream}/ordinalSceneBuilders/timelineScene.d.ts +0 -0
  198. /package/dist/{stream → components/stream}/ordinalSceneBuilders/types.d.ts +0 -0
  199. /package/dist/{stream → components/stream}/renderers/barCanvasRenderer.d.ts +0 -0
  200. /package/dist/{stream → components/stream}/renderers/boxplotCanvasRenderer.d.ts +0 -0
  201. /package/dist/{stream → components/stream}/renderers/candlestickCanvasRenderer.d.ts +0 -0
  202. /package/dist/{stream → components/stream}/renderers/connectorCanvasRenderer.d.ts +0 -0
  203. /package/dist/{stream → components/stream}/renderers/networkArcRenderer.d.ts +0 -0
  204. /package/dist/{stream → components/stream}/renderers/networkCircleRenderer.d.ts +0 -0
  205. /package/dist/{stream → components/stream}/renderers/networkEdgeRenderer.d.ts +0 -0
  206. /package/dist/{stream → components/stream}/renderers/networkParticleRenderer.d.ts +0 -0
  207. /package/dist/{stream → components/stream}/renderers/networkRectRenderer.d.ts +0 -0
  208. /package/dist/{stream → components/stream}/renderers/pointCanvasRenderer.d.ts +0 -0
  209. /package/dist/{stream → components/stream}/renderers/swarmCanvasRenderer.d.ts +0 -0
  210. /package/dist/{stream → components/stream}/renderers/types.d.ts +0 -0
  211. /package/dist/{stream → components/stream}/renderers/violinCanvasRenderer.d.ts +0 -0
  212. /package/dist/{stream → components/stream}/renderers/waterfallCanvasRenderer.d.ts +0 -0
  213. /package/dist/{stream → components/stream}/renderers/wedgeCanvasRenderer.d.ts +0 -0
  214. /package/dist/{stream → components/stream}/useResponsiveSize.d.ts +0 -0
  215. /package/dist/{types → components/types}/annotationTypes.d.ts +0 -0
  216. /package/dist/{types → components/types}/generalTypes.d.ts +0 -0
  217. /package/dist/{types → components/types}/interactionTypes.d.ts +0 -0
  218. /package/dist/{types → components/types}/networkTypes.d.ts +0 -0
  219. /package/dist/{types → components/types}/ordinalTypes.d.ts +0 -0
@@ -1,5 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { StreamXYFrameProps } from "../../stream/types";
3
+ import type { RealtimeFrameHandle } from "../../realtime/types";
4
+ import type { LegendInteractionMode, LegendPosition } from "../shared/hooks";
3
5
  import type { BaseChartProps, AxisConfig, ChartAccessor } from "../shared/types";
4
6
  import { type TooltipProp } from "../../Tooltip/Tooltip";
5
7
  /**
@@ -13,7 +15,7 @@ export interface StackedAreaChartProps<TDatum extends Record<string, any> = Reco
13
15
  * [{x: 1, y: 10, category: 'A'}, {x: 2, y: 20, category: 'A'}, {x: 1, y: 15, category: 'B'}]
14
16
  * ```
15
17
  */
16
- data: TDatum[];
18
+ data?: TDatum[];
17
19
  /**
18
20
  * Field name or function to access x values
19
21
  * @default "x"
@@ -93,6 +95,17 @@ export interface StackedAreaChartProps<TDatum extends Record<string, any> = Reco
93
95
  * @default true (when multiple areas)
94
96
  */
95
97
  showLegend?: boolean;
98
+ /**
99
+ * Legend interaction mode.
100
+ * - "highlight": hover dims non-hovered categories to 30% opacity
101
+ * - "isolate": click toggles category visibility with checkmark indicators
102
+ * - "none": static legend (default)
103
+ */
104
+ legendInteraction?: LegendInteractionMode;
105
+ /**
106
+ * Legend position
107
+ */
108
+ legendPosition?: LegendPosition;
96
109
  /**
97
110
  * Tooltip configuration
98
111
  */
@@ -132,7 +145,7 @@ export interface StackedAreaChartProps<TDatum extends Record<string, any> = Reco
132
145
  * />
133
146
  * ```
134
147
  */
135
- export declare function StackedAreaChart<TDatum extends Record<string, any> = Record<string, any>>(props: StackedAreaChartProps<TDatum>): React.JSX.Element;
136
- export declare namespace StackedAreaChart {
137
- var displayName: string;
138
- }
148
+ export declare const StackedAreaChart: {
149
+ <TDatum extends Record<string, any> = Record<string, any>>(props: StackedAreaChartProps<TDatum> & React.RefAttributes<RealtimeFrameHandle>): React.ReactElement | null;
150
+ displayName?: string;
151
+ };
@@ -1,5 +1,10 @@
1
1
  /**
2
- * Export a semiotic chart to SVG or PNG from the browser.
2
+ * Export a semiotic chart to PNG (default) or SVG from the browser.
3
+ *
4
+ * PNG export composites the canvas data layer underneath the SVG overlay,
5
+ * producing a complete image. SVG export captures only the SVG overlay
6
+ * (axes, labels, annotations) since canvas content cannot be represented
7
+ * as SVG.
3
8
  *
4
9
  * @example
5
10
  * ```tsx
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Merge external data into GeoJSON features by joining on a key field.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * const enriched = mergeData(worldCountries, myCSV, {
7
+ * featureKey: "properties.iso_a3",
8
+ * dataKey: "country_code"
9
+ * })
10
+ * ```
11
+ *
12
+ * Cross-pollination: This pattern (key-based data join) could be extracted
13
+ * to a shared utility for any data merge operation in Semiotic.
14
+ */
15
+ export declare function mergeData<T extends Record<string, any>>(features: GeoJSON.Feature[], data: T[], options: {
16
+ featureKey: string;
17
+ dataKey: string;
18
+ }): GeoJSON.Feature[];
@@ -0,0 +1,10 @@
1
+ export type ReferenceGeography = "world-110m" | "world-50m" | "land-110m" | "land-50m";
2
+ /**
3
+ * Resolve a string reference to GeoJSON features.
4
+ * Uses dynamic import so bundlers can tree-shake/code-split the data.
5
+ */
6
+ export declare function resolveReferenceGeography(name: ReferenceGeography): Promise<GeoJSON.Feature[]>;
7
+ /**
8
+ * Check whether a value is a known reference geography string.
9
+ */
10
+ export declare function isReferenceGeography(value: unknown): value is ReferenceGeography;
@@ -0,0 +1,13 @@
1
+ import { type ReferenceGeography } from "./referenceGeography";
2
+ export type AreasProp = GeoJSON.Feature[] | ReferenceGeography;
3
+ /**
4
+ * Hook that resolves an `areas` prop — either GeoJSON features passed directly,
5
+ * or a string reference ("world-110m", etc.) that triggers an async load.
6
+ *
7
+ * Returns `null` while loading, resolved features when ready.
8
+ *
9
+ * When `areas` is already an array, the value is returned synchronously via
10
+ * useMemo (no stale-frame lag between prop changes). The useState+useEffect
11
+ * path is only used for async reference string resolution.
12
+ */
13
+ export declare function useReferenceAreas(areas: AreasProp | undefined): GeoJSON.Feature[] | null;
@@ -10,6 +10,7 @@ export declare class RingBuffer<T> {
10
10
  peek(): T | undefined;
11
11
  peekOldest(): T | undefined;
12
12
  [Symbol.iterator](): Iterator<T>;
13
+ forEach(callback: (value: T, index: number) => void): void;
13
14
  toArray(): T[];
14
15
  resize(newCapacity: number): T[];
15
16
  clear(): void;
@@ -8,6 +8,16 @@ export interface LineStyle {
8
8
  strokeWidth?: number;
9
9
  strokeDasharray?: string;
10
10
  }
11
+ /**
12
+ * Anchoring mode for streaming annotations.
13
+ * - `"fixed"` (default): anchored to specific datum coordinates; disappears when out of view.
14
+ * - `"latest"`: annotation attaches to the most recent datum in the buffer.
15
+ * On each frame, the annotation's position is re-resolved to the latest data point.
16
+ * Useful for "current value" labels.
17
+ * - `"sticky"`: annotation stays at its last known pixel position after the target datum
18
+ * is evicted from the window. It freezes in place rather than disappearing.
19
+ */
20
+ export type AnnotationAnchorMode = "fixed" | "latest" | "sticky";
11
21
  export interface AnnotationContext {
12
22
  scales?: {
13
23
  x?: ScaleLinear<number, number>;
@@ -30,6 +40,13 @@ export interface AnnotationContext {
30
40
  y: number;
31
41
  r: number;
32
42
  }[];
43
+ /** Curve interpolation type from the parent chart */
44
+ curve?: string;
45
+ /** Cache of last known pixel positions for sticky annotations, keyed by annotation index */
46
+ stickyPositionCache?: Map<number, {
47
+ x: number;
48
+ y: number;
49
+ }>;
33
50
  }
34
51
  export interface CrosshairStyle {
35
52
  stroke?: string;
@@ -0,0 +1,61 @@
1
+ export { LineChart } from "./charts/xy/LineChart";
2
+ export { AreaChart } from "./charts/xy/AreaChart";
3
+ export { StackedAreaChart } from "./charts/xy/StackedAreaChart";
4
+ export { Scatterplot } from "./charts/xy/Scatterplot";
5
+ export { ConnectedScatterplot } from "./charts/xy/ConnectedScatterplot";
6
+ export { BubbleChart } from "./charts/xy/BubbleChart";
7
+ export { Heatmap } from "./charts/xy/Heatmap";
8
+ export { ScatterplotMatrix } from "./charts/xy/ScatterplotMatrix";
9
+ export { LinkedCharts } from "./LinkedCharts";
10
+ export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
11
+ export { BarChart } from "./charts/ordinal/BarChart";
12
+ export { StackedBarChart } from "./charts/ordinal/StackedBarChart";
13
+ export { GroupedBarChart } from "./charts/ordinal/GroupedBarChart";
14
+ export { SwarmPlot } from "./charts/ordinal/SwarmPlot";
15
+ export { BoxPlot } from "./charts/ordinal/BoxPlot";
16
+ export { Histogram } from "./charts/ordinal/Histogram";
17
+ export { ViolinPlot } from "./charts/ordinal/ViolinPlot";
18
+ export { DotPlot } from "./charts/ordinal/DotPlot";
19
+ export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
20
+ export { PieChart } from "./charts/ordinal/PieChart";
21
+ export { DonutChart } from "./charts/ordinal/DonutChart";
22
+ export { ForceDirectedGraph } from "./charts/network/ForceDirectedGraph";
23
+ export { ChordDiagram } from "./charts/network/ChordDiagram";
24
+ export { SankeyDiagram } from "./charts/network/SankeyDiagram";
25
+ export { TreeDiagram } from "./charts/network/TreeDiagram";
26
+ export { Treemap } from "./charts/network/Treemap";
27
+ export { CirclePack } from "./charts/network/CirclePack";
28
+ export { OrbitDiagram } from "./charts/network/OrbitDiagram";
29
+ export { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
30
+ export { RealtimeHistogram } from "./charts/realtime/RealtimeHistogram";
31
+ export { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
32
+ export { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
33
+ export { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
34
+ export { TooltipProvider } from "./store/TooltipStore";
35
+ export { MultiLineTooltip } from "./Tooltip/Tooltip";
36
+ export { ThemeProvider, useTheme } from "./ThemeProvider";
37
+ export { exportChart } from "./export/exportChart";
38
+ export { ChartContainer } from "./ChartContainer";
39
+ export type { ChartContainerProps, ChartContainerHandle } from "./ChartContainer";
40
+ export { ChartGrid } from "./ChartGrid";
41
+ export type { ChartGridProps } from "./ChartGrid";
42
+ export { ContextLayout } from "./ContextLayout";
43
+ export type { ContextLayoutProps } from "./ContextLayout";
44
+ export { CategoryColorProvider, useCategoryColors } from "./CategoryColors";
45
+ export type { CategoryColorMap, CategoryColorProviderProps } from "./CategoryColors";
46
+ export { DetailsPanel } from "./DetailsPanel";
47
+ export type { DetailsPanelProps } from "./DetailsPanel";
48
+ export { validateProps } from "./charts/shared/validateProps";
49
+ export type { ValidationResult } from "./charts/shared/validateProps";
50
+ export { diagnoseConfig } from "./charts/shared/diagnoseConfig";
51
+ export type { Diagnosis, DiagnosisResult } from "./charts/shared/diagnoseConfig";
52
+ export type { AnomalyConfig, ForecastConfig } from "./charts/shared/statisticalOverlays";
53
+ export { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
54
+ export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
55
+ export { serializeSelections, deserializeSelections } from "./export/selectionSerializer";
56
+ export type { SerializedSelections, SerializedSelection, SerializedFieldSelection } from "./export/selectionSerializer";
57
+ export { fromVegaLite } from "./data/fromVegaLite";
58
+ export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
59
+ export { useChartObserver } from "./store/useObservation";
60
+ export type { UseChartObserverOptions, UseChartObserverResult } from "./store/useObservation";
61
+ export type { ChartObservation, OnObservationCallback, HoverObservation, HoverEndObservation, BrushObservation, BrushEndObservation, SelectionObservation, SelectionEndObservation, ClickObservation, ClickEndObservation } from "./store/ObservationStore";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Semiotic data transform utilities.
3
+ * Import from "semiotic/data"
4
+ */
5
+ export { bin, rollup, groupBy, pivot } from "./data/transforms";
6
+ export { fromVegaLite } from "./data/fromVegaLite";
7
+ export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
8
+ export { mergeData } from "./geo/mergeData";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Geo entry point — geographic visualization: choropleth, proportional symbol, flow maps.
3
+ * Import from "semiotic/geo" instead of the full bundle to reduce bundle size.
4
+ */
5
+ import StreamGeoFrame from "./stream/StreamGeoFrame";
6
+ export { StreamGeoFrame };
7
+ export { ChoroplethMap } from "./charts/geo/ChoroplethMap";
8
+ export { ProportionalSymbolMap } from "./charts/geo/ProportionalSymbolMap";
9
+ export { FlowMap } from "./charts/geo/FlowMap";
10
+ export { DistanceCartogram } from "./charts/geo/DistanceCartogram";
11
+ export type { StreamGeoFrameProps, StreamGeoFrameHandle, GeoAreaSceneNode, GeoSceneNode, GeoScales, ProjectionProp, ProjectionName, GraticuleConfig, DistanceCartogramConfig, GeoPipelineConfig } from "./stream/geoTypes";
12
+ export type { GeoParticleStyle } from "./stream/GeoParticlePool";
13
+ export { mergeData } from "./geo/mergeData";
14
+ export { resolveReferenceGeography } from "./geo/referenceGeography";
15
+ export type { ReferenceGeography } from "./geo/referenceGeography";
16
+ export type { AreasProp } from "./geo/useReferenceAreas";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Network entry point — force graphs, sankey, chord, trees, treemaps, circle packing.
3
+ * Import from "semiotic/network" instead of the full bundle to reduce bundle size.
4
+ */
5
+ import StreamNetworkFrame from "./stream/StreamNetworkFrame";
6
+ export { StreamNetworkFrame };
7
+ export { ForceDirectedGraph } from "./charts/network/ForceDirectedGraph";
8
+ export { SankeyDiagram } from "./charts/network/SankeyDiagram";
9
+ export { ChordDiagram } from "./charts/network/ChordDiagram";
10
+ export { TreeDiagram } from "./charts/network/TreeDiagram";
11
+ export { Treemap } from "./charts/network/Treemap";
12
+ export { CirclePack } from "./charts/network/CirclePack";
13
+ export { OrbitDiagram } from "./charts/network/OrbitDiagram";
14
+ export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, ThresholdAlertConfig } from "./stream/networkTypes";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Ordinal entry point — bar charts, pie charts, distribution charts.
3
+ * Import from "semiotic/ordinal" instead of the full bundle to reduce bundle size.
4
+ */
5
+ import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
6
+ export { StreamOrdinalFrame };
7
+ export { BarChart } from "./charts/ordinal/BarChart";
8
+ export { StackedBarChart } from "./charts/ordinal/StackedBarChart";
9
+ export { GroupedBarChart } from "./charts/ordinal/GroupedBarChart";
10
+ export { SwarmPlot } from "./charts/ordinal/SwarmPlot";
11
+ export { BoxPlot } from "./charts/ordinal/BoxPlot";
12
+ export { Histogram } from "./charts/ordinal/Histogram";
13
+ export { ViolinPlot } from "./charts/ordinal/ViolinPlot";
14
+ export { DotPlot } from "./charts/ordinal/DotPlot";
15
+ export { PieChart } from "./charts/ordinal/PieChart";
16
+ export { DonutChart } from "./charts/ordinal/DonutChart";
17
+ export { RidgelinePlot } from "./charts/ordinal/RidgelinePlot";
18
+ export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Realtime entry point — for streaming/realtime canvas-first visualizations.
3
+ * Import from "semiotic/realtime" instead of the full bundle to reduce bundle size.
4
+ */
5
+ import StreamXYFrame from "./stream/StreamXYFrame";
6
+ import StreamNetworkFrame from "./stream/StreamNetworkFrame";
7
+ import { RingBuffer } from "./realtime/RingBuffer";
8
+ import { IncrementalExtent } from "./realtime/IncrementalExtent";
9
+ import { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
10
+ import { RealtimeHistogram } from "./charts/realtime/RealtimeHistogram";
11
+ import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
12
+ import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
13
+ import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
14
+ export { StreamXYFrame, StreamNetworkFrame, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
15
+ export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
16
+ export type { RealtimeHistogramProps } from "./charts/realtime/RealtimeHistogram";
17
+ export type { RealtimeSwarmChartProps } from "./charts/realtime/RealtimeSwarmChart";
18
+ export type { RealtimeWaterfallChartProps } from "./charts/realtime/RealtimeWaterfallChart";
19
+ export type { RealtimeHeatmapProps } from "./charts/realtime/RealtimeHeatmap";
20
+ export type { ArrowOfTime, WindowMode, ThresholdType, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, AnnotationContext, CrosshairStyle, HoverAnnotationConfig, HoverData } from "./realtime/types";
21
+ export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType } from "./stream/types";
22
+ export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType } from "./stream/networkTypes";
@@ -0,0 +1 @@
1
+ export { renderToStaticSVG, renderXYToStaticSVG, renderOrdinalToStaticSVG, renderNetworkToStaticSVG, renderGeoToStaticSVG } from "./server/renderToStaticSVG";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * XY entry point — line, area, scatter, heatmap, and bubble charts.
3
+ * Import from "semiotic/xy" instead of the full bundle to reduce bundle size.
4
+ */
5
+ import StreamXYFrame from "./stream/StreamXYFrame";
6
+ export { StreamXYFrame };
7
+ export { LineChart } from "./charts/xy/LineChart";
8
+ export { AreaChart } from "./charts/xy/AreaChart";
9
+ export { StackedAreaChart } from "./charts/xy/StackedAreaChart";
10
+ export { Scatterplot } from "./charts/xy/Scatterplot";
11
+ export { ConnectedScatterplot } from "./charts/xy/ConnectedScatterplot";
12
+ export { BubbleChart } from "./charts/xy/BubbleChart";
13
+ export { Heatmap } from "./charts/xy/Heatmap";
14
+ export { ScatterplotMatrix } from "./charts/xy/ScatterplotMatrix";
15
+ export { MinimapChart } from "./charts/xy/MinimapChart";
16
+ export { QuadrantChart } from "./charts/xy/QuadrantChart";
17
+ export type { StreamXYFrameProps, StreamXYFrameHandle } from "./stream/types";
@@ -0,0 +1,57 @@
1
+ import StreamXYFrame from "./stream/StreamXYFrame";
2
+ import StreamOrdinalFrame from "./stream/StreamOrdinalFrame";
3
+ import StreamNetworkFrame from "./stream/StreamNetworkFrame";
4
+ import { Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, PieChart, DonutChart, GroupedBarChart, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart } from "./charts";
5
+ import { LinkedCharts } from "./LinkedCharts";
6
+ import { ThemeProvider, useTheme } from "./ThemeProvider";
7
+ import { exportChart } from "./export/exportChart";
8
+ import { toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX } from "./export/chartConfig";
9
+ import { serializeSelections, deserializeSelections } from "./export/selectionSerializer";
10
+ import { fromVegaLite } from "./data/fromVegaLite";
11
+ import { ChartErrorBoundary } from "./ChartErrorBoundary";
12
+ import { ChartContainer } from "./ChartContainer";
13
+ import { ChartGrid } from "./ChartGrid";
14
+ import { CategoryColorProvider, useCategoryColors } from "./CategoryColors";
15
+ import { ContextLayout } from "./ContextLayout";
16
+ import { DetailsPanel } from "./DetailsPanel";
17
+ import { Tooltip, MultiLineTooltip, normalizeTooltip } from "./Tooltip/Tooltip";
18
+ import { RingBuffer } from "./realtime/RingBuffer";
19
+ import { IncrementalExtent } from "./realtime/IncrementalExtent";
20
+ import { RealtimeLineChart } from "./charts/realtime/RealtimeLineChart";
21
+ import { RealtimeTemporalHistogram, RealtimeHistogram } from "./charts/realtime/RealtimeHistogram";
22
+ import { RealtimeSwarmChart } from "./charts/realtime/RealtimeSwarmChart";
23
+ import { RealtimeWaterfallChart } from "./charts/realtime/RealtimeWaterfallChart";
24
+ import { RealtimeHeatmap } from "./charts/realtime/RealtimeHeatmap";
25
+ export { StreamXYFrame, StreamOrdinalFrame, StreamNetworkFrame, Scatterplot, ConnectedScatterplot, LineChart, AreaChart, StackedAreaChart, Heatmap, BubbleChart, BarChart, StackedBarChart, SwarmPlot, BoxPlot, Histogram, ViolinPlot, RidgelinePlot, DotPlot, ForceDirectedGraph, ChordDiagram, SankeyDiagram, TreeDiagram, PieChart, DonutChart, GroupedBarChart, Treemap, CirclePack, OrbitDiagram, ScatterplotMatrix, MinimapChart, QuadrantChart, LinkedCharts, ThemeProvider, useTheme, exportChart, toConfig, fromConfig, toURL, fromURL, copyConfig, configToJSX, serializeSelections, deserializeSelections, fromVegaLite, ChartErrorBoundary, ChartContainer, ChartGrid, CategoryColorProvider, useCategoryColors, ContextLayout, DetailsPanel, Tooltip, MultiLineTooltip, normalizeTooltip, RingBuffer, IncrementalExtent, RealtimeLineChart, RealtimeTemporalHistogram, RealtimeHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap };
26
+ export { ScatterplotProps, ConnectedScatterplotProps, LineChartProps, AreaChartProps, StackedAreaChartProps, HeatmapProps, BubbleChartProps, BarChartProps, StackedBarChartProps, SwarmPlotProps, BoxPlotProps, HistogramProps, ViolinPlotProps, DotPlotProps, PieChartProps, DonutChartProps, GroupedBarChartProps, RidgelinePlotProps, OrbitDiagramProps, OrbitNode, ForceDirectedGraphProps, ChordDiagramProps, SankeyDiagramProps, TreeDiagramProps, TreemapProps, CirclePackProps, ScatterplotMatrixProps, MinimapChartProps, MinimapConfig, QuadrantChartProps, QuadrantsConfig, QuadrantConfig, CenterlineStyle, BaseChartProps, AxisConfig, Accessor, ChartAccessor, ChartMode } from "./charts";
27
+ export type { StreamXYFrameProps, StreamXYFrameHandle, StreamChartType, RuntimeMode, SceneNode, Changeset, StreamScales, StreamLayout, CurveType, CanvasRendererFn } from "./stream/types";
28
+ export type { StreamRendererFn } from "./stream/renderers/types";
29
+ export type { StreamOrdinalFrameProps, StreamOrdinalFrameHandle, OrdinalChartType, OrdinalScales, OrdinalSceneNode } from "./stream/ordinalTypes";
30
+ export type { StreamNetworkFrameProps, StreamNetworkFrameHandle, NetworkChartType, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, ThresholdAlertConfig } from "./stream/networkTypes";
31
+ export type { SelectionConfig, LinkedHoverProp, LinkedBrushProp } from "./charts/shared/types";
32
+ export type { LinkedChartsProps } from "./LinkedCharts";
33
+ export { useSelection, useLinkedHover, useBrushSelection, useFilteredData } from "./LinkedCharts";
34
+ export type { UseSelectionOptions, UseSelectionResult, UseLinkedHoverOptions, UseLinkedHoverResult, UseBrushSelectionOptions, UseBrushSelectionResult } from "./LinkedCharts";
35
+ export { useChartObserver } from "./LinkedCharts";
36
+ export type { UseChartObserverOptions, UseChartObserverResult } from "./LinkedCharts";
37
+ export type { ChartObservation, OnObservationCallback } from "./store/ObservationStore";
38
+ export type { ResolutionMode, SelectionClause, Selection } from "./store/SelectionStore";
39
+ export type { SemioticTheme } from "./ThemeProvider";
40
+ export { LIGHT_THEME, DARK_THEME } from "./ThemeProvider";
41
+ export type { ChartErrorBoundaryProps } from "./ChartErrorBoundary";
42
+ export type { ChartContainerProps, ChartContainerHandle } from "./ChartContainer";
43
+ export type { ChartGridProps } from "./ChartGrid";
44
+ export type { CategoryColorMap, CategoryColorProviderProps } from "./CategoryColors";
45
+ export type { ContextLayoutProps } from "./ContextLayout";
46
+ export type { DetailsPanelProps } from "./DetailsPanel";
47
+ export type { ChartConfig, ToConfigOptions, CopyFormat } from "./export/chartConfig";
48
+ export type { VegaLiteSpec, VegaLiteEncoding } from "./data/fromVegaLite";
49
+ export type { SerializedSelections, SerializedSelection, SerializedFieldSelection } from "./export/selectionSerializer";
50
+ export { smartTickFormat } from "./charts/shared/formatUtils";
51
+ export type { TooltipProp, TooltipConfig, TooltipField, MultiLineTooltipConfig } from "./Tooltip/Tooltip";
52
+ export type { ArrowOfTime, WindowMode, ThresholdType, LineStyle, BarStyle, WaterfallStyle, SwarmStyle, AnnotationContext, AnnotationAnchorMode, CrosshairStyle, HoverAnnotationConfig, HoverData } from "./realtime/types";
53
+ export type { RealtimeLineChartProps } from "./charts/realtime/RealtimeLineChart";
54
+ export type { RealtimeTemporalHistogramProps, RealtimeHistogramProps } from "./charts/realtime/RealtimeHistogram";
55
+ export type { RealtimeSwarmChartProps } from "./charts/realtime/RealtimeSwarmChart";
56
+ export type { RealtimeWaterfallChartProps } from "./charts/realtime/RealtimeWaterfallChart";
57
+ export type { RealtimeHeatmapProps } from "./charts/realtime/RealtimeHeatmap";
@@ -1,9 +1,18 @@
1
+ /**
2
+ * Server-side rendering of Semiotic charts to standalone SVG strings.
3
+ *
4
+ * Uses the shared SceneToSVG converters (same code used by Stream Frames
5
+ * for SSR) plus PipelineStore / OrdinalPipelineStore / NetworkPipelineStore
6
+ * for scene graph computation.
7
+ */
1
8
  import type { StreamXYFrameProps } from "../stream/types";
2
9
  import type { StreamNetworkFrameProps } from "../stream/networkTypes";
3
10
  import type { StreamOrdinalFrameProps } from "../stream/ordinalTypes";
4
- type FrameType = "xy" | "ordinal" | "network";
5
- export declare function renderToStaticSVG(frameType: FrameType, props: StreamXYFrameProps | StreamNetworkFrameProps | StreamOrdinalFrameProps): string;
11
+ import type { StreamGeoFrameProps } from "../stream/geoTypes";
12
+ type FrameType = "xy" | "ordinal" | "network" | "geo";
13
+ export declare function renderToStaticSVG(frameType: FrameType, props: StreamXYFrameProps | StreamNetworkFrameProps | StreamOrdinalFrameProps | StreamGeoFrameProps): string;
6
14
  export declare function renderXYToStaticSVG(props: StreamXYFrameProps): string;
7
15
  export declare function renderOrdinalToStaticSVG(props: StreamOrdinalFrameProps): string;
8
16
  export declare function renderNetworkToStaticSVG(props: StreamNetworkFrameProps): string;
17
+ export declare function renderGeoToStaticSVG(props: StreamGeoFrameProps): string;
9
18
  export {};
@@ -0,0 +1,50 @@
1
+ import * as React from "react";
2
+ /** Scene node type used by the accessible data table — accepts any frame's scene nodes */
3
+ type AnySceneNode = {
4
+ type: string;
5
+ [key: string]: any;
6
+ };
7
+ /**
8
+ * Compute an aria-label describing the chart type and data shape from the scene graph.
9
+ */
10
+ export declare function computeCanvasAriaLabel(scene: AnySceneNode[], chartType: string): string;
11
+ /**
12
+ * Compute an aria-label for network charts from scene nodes and edges.
13
+ */
14
+ export declare function computeNetworkAriaLabel(nodeCount: number, edgeCount: number, chartType: string): string;
15
+ interface AccessibleDataTableProps {
16
+ scene: AnySceneNode[];
17
+ chartType: string;
18
+ }
19
+ /**
20
+ * Visually-hidden data table for screen readers, generated from the scene graph.
21
+ * Renders up to 50 rows with a truncation note.
22
+ */
23
+ export declare function AccessibleDataTable({ scene, chartType }: AccessibleDataTableProps): React.JSX.Element | null;
24
+ interface NetworkAccessibleDataTableProps {
25
+ nodes: Array<{
26
+ datum?: any;
27
+ id?: string;
28
+ cx?: number;
29
+ cy?: number;
30
+ x?: number;
31
+ y?: number;
32
+ }>;
33
+ edges: Array<{
34
+ datum?: any;
35
+ source?: string;
36
+ target?: string;
37
+ }>;
38
+ chartType: string;
39
+ }
40
+ /**
41
+ * Visually-hidden data table for network charts.
42
+ */
43
+ export declare function NetworkAccessibleDataTable({ nodes, edges, chartType }: NetworkAccessibleDataTableProps): React.JSX.Element | null;
44
+ /**
45
+ * Visually-hidden aria-live region that mirrors tooltip text for screen readers.
46
+ */
47
+ export declare function AriaLiveTooltip({ hoverPoint }: {
48
+ hoverPoint: any;
49
+ }): React.JSX.Element;
50
+ export {};
@@ -1,5 +1,6 @@
1
- import type { SceneNode } from "./types";
1
+ import type { SceneNode, PointSceneNode } from "./types";
2
2
  import type { RingBuffer } from "../realtime/RingBuffer";
3
+ import type { Quadtree } from "d3-quadtree";
3
4
  export interface HitResult {
4
5
  node: SceneNode;
5
6
  datum: any;
@@ -10,8 +11,13 @@ export interface HitResult {
10
11
  /**
11
12
  * Find the nearest scene node to the given pixel coordinates.
12
13
  * Dispatches to type-specific hit testers for optimal performance.
14
+ *
15
+ * When a quadtree spatial index is provided (for scatter/bubble charts with
16
+ * many points), point hit testing uses O(log n) quadtree.find() instead of
17
+ * iterating all nodes. Non-point node types (line, rect, area, etc.) still
18
+ * use the linear scan.
13
19
  */
14
- export declare function findNearestNode(scene: SceneNode[], px: number, py: number, maxDistance?: number): HitResult | null;
20
+ export declare function findNearestNode(scene: SceneNode[], px: number, py: number, maxDistance?: number, pointQuadtree?: Quadtree<PointSceneNode> | null): HitResult | null;
15
21
  /**
16
22
  * Binary search for nearest point by time value in a RingBuffer.
17
23
  */
@@ -0,0 +1,64 @@
1
+ import type { Changeset } from "./types";
2
+ export type ChangesetCallback<T> = (changeset: Changeset<T>) => void;
3
+ export declare class DataSourceAdapter<T = Record<string, any>> {
4
+ private callback;
5
+ private lastBoundedData;
6
+ private chunkTimer;
7
+ private chunkThreshold;
8
+ private chunkSize;
9
+ /** Buffer for batching high-frequency push() calls */
10
+ private pushBuffer;
11
+ /** Whether a microtask flush is already scheduled */
12
+ private flushScheduled;
13
+ constructor(callback: ChangesetCallback<T>, options?: {
14
+ chunkThreshold?: number;
15
+ chunkSize?: number;
16
+ });
17
+ /** Update chunking options without recreating the adapter. */
18
+ updateChunkOptions(options: {
19
+ chunkThreshold?: number;
20
+ chunkSize?: number;
21
+ }): void;
22
+ /** Clear the dedup cache so the next setBoundedData call re-ingests even the same reference.
23
+ * Also cancels any in-flight progressive chunking and discards buffered pushes. */
24
+ clearLastData(): void;
25
+ /**
26
+ * Ingest a bounded data array (from props).
27
+ *
28
+ * Small datasets emit a single changeset synchronously.
29
+ * Large datasets (> CHUNK_THRESHOLD) are split into chunks that render
30
+ * progressively: the first chunk fires immediately (bounded: true to
31
+ * reset + seed the buffer), subsequent chunks arrive on successive
32
+ * animation frames (bounded: false so they append without clearing).
33
+ */
34
+ setBoundedData(data: T[]): void;
35
+ /**
36
+ * Flush all buffered push data as a single changeset.
37
+ * Called automatically via microtask after push()/pushMany().
38
+ */
39
+ private flushPushBuffer;
40
+ /** Schedule a microtask flush if one isn't already pending. */
41
+ private scheduleFlush;
42
+ /**
43
+ * Push a single datum (streaming mode).
44
+ * Data is buffered and flushed as a single changeset via microtask,
45
+ * so rapid sequential push() calls within the same task are batched
46
+ * into one callback invocation.
47
+ */
48
+ push(datum: T): void;
49
+ /**
50
+ * Push multiple data (streaming batch).
51
+ * Like push(), data is buffered and flushed via microtask. Multiple
52
+ * pushMany() calls within the same task are coalesced.
53
+ */
54
+ pushMany(data: T[]): void;
55
+ /**
56
+ * Immediately flush any buffered push data without waiting for the microtask.
57
+ * Useful when you need the data to be processed synchronously (e.g., in tests).
58
+ */
59
+ flush(): void;
60
+ /**
61
+ * Reset the adapter state.
62
+ */
63
+ clear(): void;
64
+ }
@@ -0,0 +1,19 @@
1
+ import type { GeoSceneNode } from "./geoTypes";
2
+ import type { PointSceneNode } from "./types";
3
+ import type { Quadtree } from "d3-quadtree";
4
+ export interface GeoHitResult {
5
+ node: GeoSceneNode;
6
+ distance: number;
7
+ }
8
+ /**
9
+ * Hit test geo scene nodes.
10
+ *
11
+ * Strategy:
12
+ * 1. Points first (topmost visual layer) — quadtree if available, else linear scan
13
+ * 2. Geo areas via ctx.isPointInPath(Path2D) — reverse order for top-layer-wins
14
+ * 3. Lines via closest-segment distance
15
+ *
16
+ * The `hitCtx` parameter is a shared offscreen canvas context used for
17
+ * isPointInPath checks without polluting the visible canvas.
18
+ */
19
+ export declare function findNearestGeoNode(nodes: GeoSceneNode[], mouseX: number, mouseY: number, maxDistance: number, hitCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, pointQuadtree?: Quadtree<PointSceneNode>): GeoHitResult | null;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * GeoParticlePool — particle system for geo line paths.
3
+ *
4
+ * Unlike the network ParticlePool (which uses bezier curves), this
5
+ * travels particles along polyline paths (arrays of screen-space points).
6
+ * Used by StreamGeoFrame to animate flow lines on maps.
7
+ */
8
+ export interface GeoParticle {
9
+ /** Progress along the polyline [0, 1] */
10
+ t: number;
11
+ /** Perpendicular offset from path centerline [-0.5, 0.5] */
12
+ offset: number;
13
+ /** Which line index this particle travels */
14
+ lineIndex: number;
15
+ active: boolean;
16
+ x: number;
17
+ y: number;
18
+ }
19
+ export interface GeoParticleStyle {
20
+ /** Particle radius @default 2 */
21
+ radius?: number;
22
+ /** Particle color: a CSS color string, "source" to inherit from line stroke, or a function `(datum) => string` */
23
+ color?: string | ((datum: any) => string);
24
+ /** Particle opacity @default 0.7 */
25
+ opacity?: number;
26
+ /** Speed multiplier @default 1 */
27
+ speedMultiplier?: number;
28
+ /** Max particles per line @default 30 */
29
+ maxPerLine?: number;
30
+ /** Spawn rate (probability per frame per line) @default 0.15 */
31
+ spawnRate?: number;
32
+ }
33
+ export declare class GeoParticlePool {
34
+ particles: GeoParticle[];
35
+ private capacity;
36
+ constructor(capacity: number);
37
+ spawn(lineIndex: number): GeoParticle | null;
38
+ /**
39
+ * Advance all active particles.
40
+ * @param paths - array of polyline paths, one per line index
41
+ * @param lineWidths - strokeWidth per line (for perpendicular offset scaling)
42
+ */
43
+ step(deltaTime: number, speed: number, paths: [number, number][][], lineWidths: number[]): void;
44
+ countForLine(lineIndex: number): number;
45
+ clear(): void;
46
+ }