semiotic 3.8.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/CLAUDE.md +12 -9
  2. package/README.md +39 -39
  3. package/ai/dist/mcp-server.js +98 -17
  4. package/ai/schema.json +1 -1
  5. package/ai/surface-manifest.json +3 -2
  6. package/ai/system-prompt.md +3 -2
  7. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
  8. package/dist/components/AccessibleNavTree.d.ts +7 -1
  9. package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
  10. package/dist/components/ai/useNavigationSync.d.ts +17 -2
  11. package/dist/components/chartContainerMobile.d.ts +9 -0
  12. package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
  13. package/dist/components/charts/geo/DistanceCartogram.d.ts +14 -2
  14. package/dist/components/charts/geo/FlowMap.d.ts +10 -6
  15. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +14 -2
  16. package/dist/components/charts/index.d.ts +6 -0
  17. package/dist/components/charts/network/ChordDiagram.d.ts +9 -1
  18. package/dist/components/charts/network/ForceDirectedGraph.d.ts +11 -0
  19. package/dist/components/charts/network/SankeyDiagram.d.ts +9 -1
  20. package/dist/components/charts/ordinal/BarChart.d.ts +21 -0
  21. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +11 -0
  22. package/dist/components/charts/ordinal/StackedBarChart.d.ts +11 -0
  23. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +7 -0
  24. package/dist/components/charts/physics/EventDropChart.d.ts +7 -0
  25. package/dist/components/charts/physics/GaltonBoardChart.d.ts +8 -0
  26. package/dist/components/charts/physics/PhysicsCustomChart.d.ts +4 -25
  27. package/dist/components/charts/physics/PhysicsPileChart.d.ts +7 -0
  28. package/dist/components/charts/physics/physicsChartShared.d.ts +17 -1
  29. package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
  30. package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
  31. package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
  32. package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
  33. package/dist/components/charts/shared/annotationRules.d.ts +2 -1
  34. package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
  35. package/dist/components/charts/shared/chartSpecCore.d.ts +3 -3
  36. package/dist/components/charts/shared/datumTypes.d.ts +2 -0
  37. package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +2 -0
  38. package/dist/components/charts/shared/formatUtils.d.ts +3 -3
  39. package/dist/components/charts/shared/hatchFill.d.ts +87 -0
  40. package/dist/components/charts/shared/hooks.d.ts +7 -6
  41. package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
  42. package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
  43. package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
  44. package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
  45. package/dist/components/charts/shared/sparseArray.d.ts +1 -1
  46. package/dist/components/charts/shared/streamPropsHelpers.d.ts +6 -4
  47. package/dist/components/charts/shared/styleRules.d.ts +205 -0
  48. package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
  49. package/dist/components/charts/shared/types.d.ts +9 -6
  50. package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
  51. package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
  52. package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
  53. package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
  54. package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
  55. package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
  56. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +24 -1
  57. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  58. package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
  59. package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
  60. package/dist/components/charts/shared/validateChartData.d.ts +7 -5
  61. package/dist/components/charts/shared/validationMap.d.ts +11 -2
  62. package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
  63. package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
  64. package/dist/components/charts/value/targetPresentation.d.ts +22 -0
  65. package/dist/components/charts/value/types.d.ts +5 -6
  66. package/dist/components/charts/xy/AreaChart.d.ts +8 -0
  67. package/dist/components/charts/xy/BubbleChart.d.ts +9 -0
  68. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
  69. package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
  70. package/dist/components/charts/xy/Heatmap.d.ts +2 -2
  71. package/dist/components/charts/xy/LineChart.d.ts +11 -0
  72. package/dist/components/charts/xy/QuadrantChart.d.ts +7 -0
  73. package/dist/components/charts/xy/Scatterplot.d.ts +10 -0
  74. package/dist/components/charts/xy/StackedAreaChart.d.ts +7 -0
  75. package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
  76. package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
  77. package/dist/components/controls/SentenceFilter.d.ts +97 -0
  78. package/dist/components/data/fromVegaLite.d.ts +19 -9
  79. package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
  80. package/dist/components/semiotic-ai.d.ts +3 -1
  81. package/dist/components/semiotic-controls.d.ts +2 -0
  82. package/dist/components/semiotic-geo.d.ts +4 -0
  83. package/dist/components/semiotic-network.d.ts +4 -0
  84. package/dist/components/semiotic-ordinal.d.ts +6 -0
  85. package/dist/components/semiotic-physics.d.ts +4 -0
  86. package/dist/components/semiotic-rough.d.ts +4 -0
  87. package/dist/components/semiotic-utils-core.d.ts +4 -0
  88. package/dist/components/semiotic-xy.d.ts +4 -0
  89. package/dist/components/semiotic.d.ts +9 -1
  90. package/dist/components/server/optionalImageTypes.d.ts +37 -0
  91. package/dist/components/server/serverChartConfigShared.d.ts +9 -5
  92. package/dist/components/server/serverChartConfigs.d.ts +4 -4
  93. package/dist/components/server/staticAnnotations.d.ts +6 -3
  94. package/dist/components/server/staticLegend.d.ts +1 -1
  95. package/dist/components/server/staticNetwork.d.ts +4 -4
  96. package/dist/components/server/staticSVGChrome.d.ts +2 -2
  97. package/dist/components/store/ObservationStore.d.ts +21 -1
  98. package/dist/components/stream/AccessibleDataTable.d.ts +4 -10
  99. package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
  100. package/dist/components/stream/CanvasHitTester.d.ts +4 -4
  101. package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
  102. package/dist/components/stream/FrameRuntime.d.ts +57 -0
  103. package/dist/components/stream/GeoParticlePool.d.ts +1 -1
  104. package/dist/components/stream/GeoPipelineStore.d.ts +43 -12
  105. package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
  106. package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
  107. package/dist/components/stream/NetworkPipelineStore.d.ts +24 -21
  108. package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
  109. package/dist/components/stream/NetworkSVGOverlay.d.ts +6 -0
  110. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
  111. package/dist/components/stream/OrdinalPipelineStore.d.ts +13 -13
  112. package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
  113. package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
  114. package/dist/components/stream/ParticlePool.d.ts +1 -1
  115. package/dist/components/stream/PipelineStore.d.ts +12 -16
  116. package/dist/components/stream/SVGOverlay.d.ts +6 -0
  117. package/dist/components/stream/SceneGraph.d.ts +3 -3
  118. package/dist/components/stream/accessorUtils.d.ts +2 -2
  119. package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
  120. package/dist/components/stream/frameGraphics.d.ts +4 -0
  121. package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
  122. package/dist/components/stream/geoPipelineHelpers.d.ts +3 -3
  123. package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
  124. package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
  125. package/dist/components/stream/geoTypes.d.ts +48 -15
  126. package/dist/components/stream/hitTestUtils.d.ts +2 -2
  127. package/dist/components/stream/hoverUtils.d.ts +4 -2
  128. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +1 -0
  129. package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
  130. package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
  131. package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
  132. package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
  133. package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
  134. package/dist/components/stream/networkFrameObservations.d.ts +15 -0
  135. package/dist/components/stream/networkFramePaint.d.ts +11 -2
  136. package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
  137. package/dist/components/stream/networkPipelineConfig.d.ts +2 -2
  138. package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
  139. package/dist/components/stream/networkTypes.d.ts +37 -56
  140. package/dist/components/stream/ordinalCanvasRenderers.d.ts +2 -2
  141. package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +20 -1
  142. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
  143. package/dist/components/stream/ordinalTypes.d.ts +30 -3
  144. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +2 -0
  145. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +6 -0
  146. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +21 -6
  147. package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
  148. package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
  149. package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +19 -1
  150. package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +3 -1
  151. package/dist/components/stream/pipelineConfig.d.ts +4 -2
  152. package/dist/components/stream/pipelineDecay.d.ts +2 -2
  153. package/dist/components/stream/pipelinePulse.d.ts +2 -2
  154. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +23 -2
  155. package/dist/components/stream/pipelineTransitions.d.ts +1 -1
  156. package/dist/components/stream/pipelineUpdateContract.d.ts +7 -0
  157. package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
  158. package/dist/components/stream/renderBackend.d.ts +27 -0
  159. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
  160. package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
  161. package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
  162. package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
  163. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +31 -4
  164. package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
  165. package/dist/components/stream/streamThemeTypes.d.ts +14 -0
  166. package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
  167. package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
  168. package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
  169. package/dist/components/stream/titleLayout.d.ts +31 -0
  170. package/dist/components/stream/types.d.ts +30 -65
  171. package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
  172. package/dist/components/stream/useFrame.d.ts +23 -0
  173. package/dist/components/stream/useLegendCategoryEmission.d.ts +3 -3
  174. package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
  175. package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
  176. package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
  177. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -5
  178. package/dist/controls.min.js +1 -1
  179. package/dist/controls.module.min.js +1 -1
  180. package/dist/forceLayoutWorker.js +1 -1
  181. package/dist/geo.min.js +1 -1
  182. package/dist/geo.module.min.js +1 -1
  183. package/dist/network.min.js +1 -1
  184. package/dist/network.module.min.js +1 -1
  185. package/dist/ordinal.min.js +1 -1
  186. package/dist/ordinal.module.min.js +1 -1
  187. package/dist/physics.min.js +1 -1
  188. package/dist/physics.module.min.js +1 -1
  189. package/dist/physicsWorker.js +1 -1
  190. package/dist/realtime.min.js +1 -1
  191. package/dist/realtime.module.min.js +1 -1
  192. package/dist/rough.min.js +1 -0
  193. package/dist/rough.module.min.js +1 -0
  194. package/dist/semiotic-ai-core.min.js +1 -1
  195. package/dist/semiotic-ai-core.module.min.js +1 -1
  196. package/dist/semiotic-ai.d.ts +3 -1
  197. package/dist/semiotic-ai.min.js +1 -1
  198. package/dist/semiotic-ai.module.min.js +1 -1
  199. package/dist/semiotic-controls.d.ts +2 -0
  200. package/dist/semiotic-data.min.js +1 -1
  201. package/dist/semiotic-data.module.min.js +1 -1
  202. package/dist/semiotic-experimental.min.js +1 -1
  203. package/dist/semiotic-experimental.module.min.js +1 -1
  204. package/dist/semiotic-geo.d.ts +4 -0
  205. package/dist/semiotic-network.d.ts +4 -0
  206. package/dist/semiotic-ordinal.d.ts +6 -0
  207. package/dist/semiotic-physics.d.ts +4 -0
  208. package/dist/semiotic-realtime-core.min.js +1 -1
  209. package/dist/semiotic-realtime-core.module.min.js +1 -1
  210. package/dist/semiotic-realtime-react.min.js +1 -1
  211. package/dist/semiotic-realtime-react.module.min.js +1 -1
  212. package/dist/semiotic-rough.d.ts +4 -0
  213. package/dist/semiotic-server-edge.min.js +1 -1
  214. package/dist/semiotic-server-edge.module.min.js +1 -1
  215. package/dist/semiotic-server-node.min.js +1 -1
  216. package/dist/semiotic-server-node.module.min.js +1 -1
  217. package/dist/semiotic-utils-core.d.ts +4 -0
  218. package/dist/semiotic-utils-core.min.js +1 -1
  219. package/dist/semiotic-utils-core.module.min.js +1 -1
  220. package/dist/semiotic-utils.min.js +1 -1
  221. package/dist/semiotic-utils.module.min.js +1 -1
  222. package/dist/semiotic-value.min.js +1 -1
  223. package/dist/semiotic-value.module.min.js +1 -1
  224. package/dist/semiotic-xy.d.ts +4 -0
  225. package/dist/semiotic.d.ts +9 -1
  226. package/dist/semiotic.min.js +1 -1
  227. package/dist/semiotic.module.min.js +1 -1
  228. package/dist/server.min.js +1 -1
  229. package/dist/server.module.min.js +1 -1
  230. package/dist/test-utils/capturedFrameProps.d.ts +67 -0
  231. package/dist/test-utils/frameMock.d.ts +12 -9
  232. package/dist/xy.min.js +1 -1
  233. package/dist/xy.module.min.js +1 -1
  234. package/package.json +26 -7
@@ -17,7 +17,7 @@ export declare class ParticlePool {
17
17
  * Spawn a new particle on the given edge.
18
18
  * Returns the particle if a free slot was found, null otherwise.
19
19
  */
20
- spawn(edgeIndex: number): Particle | null;
20
+ spawn(edgeIndex: number, random?: () => number): Particle | null;
21
21
  /**
22
22
  * Advance all active particles by deltaTime.
23
23
  * Recycles particles that have completed their journey (t >= 1).
@@ -26,10 +26,18 @@ import type { CustomLayoutSelection } from "./customLayoutSelection";
26
26
  import { type CustomLayoutFailureDiagnostic } from "./customLayoutFailure";
27
27
  import { type PipelineConfig } from "./pipelineConfig";
28
28
  import type { UpdateResult } from "./pipelineUpdateContract";
29
+ import { type UpdateResultStore } from "./pipelineUpdateStore";
30
+ import { PipelineStoreUpdateResults } from "./pipelineStoreUpdateResults";
29
31
  export type { PipelineConfig } from "./pipelineConfig";
30
32
  export type { ChangeSet, Invalidation, RevisionSet, UpdateResult, } from "./pipelineUpdateContract";
31
33
  export { DEFAULT_GROWING_MAX_CAPACITY, GROWING_CAPACITY_WARN_THRESHOLD } from "./pipelineConfig";
32
- export declare class PipelineStore {
34
+ export declare class PipelineStore implements UpdateResultStore {
35
+ getLastUpdateResult: () => UpdateResult;
36
+ getUpdateSnapshot: () => UpdateResult;
37
+ subscribeUpdateResult: (listener: () => void) => () => void;
38
+ setLayoutSelection: (selection: CustomLayoutSelection | null) => void;
39
+ markStylePaintPending: () => void;
40
+ consumeStylePaintPending: () => boolean;
33
41
  private buffer;
34
42
  private xExtent;
35
43
  private yExtent;
@@ -64,6 +72,8 @@ export declare class PipelineStore {
64
72
  /** Exit nodes awaiting fade-out removal */
65
73
  exitNodes: SceneNode[];
66
74
  lastIngestTime: number;
75
+ /** Keep ingest, pulse, staleness, and transition timestamps on one clock. */
76
+ private currentTime;
67
77
  /** Unified color map cache keyed by sorted category set — shared across point, swarm, etc. */
68
78
  private _colorMapCache;
69
79
  /** groupData() result cache. The line/area/stacked-area builders all re-bucket
@@ -96,7 +106,7 @@ export declare class PipelineStore {
96
106
  private _bufferDirty;
97
107
  private needsFullRebuild;
98
108
  private lastLayout;
99
- private updateResults;
109
+ protected updateResults: PipelineStoreUpdateResults;
100
110
  scales: StreamScales | null;
101
111
  scene: SceneNode[];
102
112
  version: number;
@@ -230,8 +240,6 @@ export declare class PipelineStore {
230
240
  */
231
241
  private getBufferArray;
232
242
  getData(): Datum[];
233
- /** Most recent additive update result for revision-aware hosts and tests. */
234
- getLastUpdateResult(): UpdateResult;
235
243
  /**
236
244
  * Remove data points by ID. Requires pointIdAccessor to be configured.
237
245
  * Returns the removed items. Marks the store dirty for scene rebuild.
@@ -255,19 +263,7 @@ export declare class PipelineStore {
255
263
  getXAccessor(): (d: Datum) => number;
256
264
  getYAccessor(): (d: Datum) => number;
257
265
  getCategoryAccessor(): ((d: Datum) => string) | undefined;
258
- /** Update the selection the layout reads at the next rebuild, without
259
- * triggering one. The frame then either repaints (restyle) or rebuilds. */
260
- setLayoutSelection(selection: CustomLayoutSelection | null): void;
261
266
  private applyCustomRestyle;
262
- /**
263
- * "Styles changed, repaint the data canvas without rebuilding the scene."
264
- * Set by {@link restyleScene}; consumed once per frame by the render loop.
265
- * Kept separate from the dirty flag so a style-only selection change repaints
266
- * without forcing a layout/scene rebuild (the point of the restyle fast path).
267
- */
268
- private _stylePaintPending;
269
- /** Consume the style-only repaint signal (see {@link _stylePaintPending}). */
270
- consumeStylePaintPending(): boolean;
271
267
  /**
272
268
  * Re-apply the custom layout's `restyle` to the existing scene for
273
269
  * `selection`, off each node's base style — no relayout, no quadtree rebuild
@@ -5,6 +5,8 @@ import type { AnnotationContext } from "../realtime/types";
5
5
  import type { ReactNode } from "react";
6
6
  import type { LegendGroup, GradientLegendConfig, LegendLayout } from "../types/legendTypes";
7
7
  import { type AutoPlaceAnnotations } from "../recipes/annotationLayout";
8
+ import type { OnObservationCallback } from "../store/ObservationStore";
9
+ import { type OnAnnotationActivateCallback } from "../charts/shared/annotationActivation";
8
10
  export type AxisConfig = XYFrameAxisConfig;
9
11
  interface SVGOverlayProps {
10
12
  width: number;
@@ -59,6 +61,10 @@ interface SVGOverlayProps {
59
61
  xValues?: number[];
60
62
  yValues?: number[];
61
63
  annotations?: Datum[];
64
+ onAnnotationActivate?: OnAnnotationActivateCallback;
65
+ onObservation?: OnObservationCallback;
66
+ chartId?: string;
67
+ chartType?: string;
62
68
  autoPlaceAnnotations?: AutoPlaceAnnotations;
63
69
  svgAnnotationRules?: (annotation: Datum, index: number, context: AnnotationContext) => ReactNode;
64
70
  annotationFrame?: number;
@@ -1,4 +1,4 @@
1
- import type { SceneNode, LineSceneNode, AreaSceneNode, PointSceneNode, SymbolSceneNode, RectSceneNode, HeatcellSceneNode, Style, StreamScales, CurveType } from "./types";
1
+ import type { SceneNode, SceneDatum, LineSceneNode, AreaSceneNode, PointSceneNode, SymbolSceneNode, RectSceneNode, HeatcellSceneNode, Style, StreamScales, CurveType } from "./types";
2
2
  import type { SymbolName } from "./symbolPath";
3
3
  import type { Datum } from "../charts/shared/datumTypes";
4
4
  export declare function buildLineNode(data: Datum[], scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, style: Style, group?: string): LineSceneNode;
@@ -38,8 +38,8 @@ export declare function buildPointNode(datum: Datum, scales: StreamScales, xGet:
38
38
  /** Build a {@link SymbolSceneNode} — the glyph sibling of {@link buildPointNode}.
39
39
  * `size` is the d3-symbol area (px²); convert from a target radius with πr². */
40
40
  export declare function buildSymbolNode(datum: Datum, scales: StreamScales, xGet: (d: Datum) => number, yGet: (d: Datum) => number, size: number, symbolType: SymbolName, style: Style, pointId?: string): SymbolSceneNode | null;
41
- export declare function buildRectNode(x: number, y: number, w: number, h: number, style: Style, datum: any, group?: string): RectSceneNode;
42
- export declare function buildHeatcellNode(x: number, y: number, w: number, h: number, fill: string, datum: any, options?: {
41
+ export declare function buildRectNode(x: number, y: number, w: number, h: number, style: Style, datum: SceneDatum, group?: string): RectSceneNode;
42
+ export declare function buildHeatcellNode(x: number, y: number, w: number, h: number, fill: string, datum: Datum, options?: {
43
43
  value?: number;
44
44
  showValues?: boolean;
45
45
  valueFormat?: (v: number) => string;
@@ -24,8 +24,8 @@
24
24
  * its identity changing, bump the pipeline config's `accessorRevision` to force
25
25
  * re-derivation.
26
26
  */
27
- export declare function accessorsEquivalent(a: string | ((...args: any[]) => any) | undefined, b: string | ((...args: any[]) => any) | undefined): boolean;
27
+ export declare function accessorsEquivalent<TDatum, TResult>(a: string | ((datum: TDatum, index?: number) => TResult) | undefined, b: string | ((datum: TDatum, index?: number) => TResult) | undefined): boolean;
28
28
  export type CoercibleNumber = number | Date | string;
29
29
  export declare function resolveAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => CoercibleNumber) | undefined, fallback: string): (d: T) => number;
30
- export declare function resolveRawAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => unknown) | undefined, fallback: string): (d: T) => unknown;
30
+ export declare function resolveRawAccessor<T extends Record<string, unknown>, TResult>(accessor: string | ((d: T) => TResult) | undefined, fallback: string): (d: T) => TResult;
31
31
  export declare function resolveStringAccessor<T extends Record<string, unknown>>(accessor: string | ((d: T) => string) | undefined, fallback?: string): ((d: T) => string) | undefined;
@@ -9,14 +9,14 @@
9
9
  * `StreamOrdinalFrame` (and any future frame with the same need)
10
10
  * can share the same plumbing rather than re-implementing it.
11
11
  */
12
- import type { Datum } from "../charts/shared/datumTypes";
12
+ import type { Datum, DatumValue } from "../charts/shared/datumTypes";
13
13
  export interface ResolvedAnnotationAccessor {
14
14
  /** String key the annotation context will read on each datum. */
15
15
  key: string | undefined;
16
16
  /** Accessor function when the user supplied one (synthetic key
17
17
  * gets baked from this); `null` when the user supplied a string
18
18
  * or nothing. */
19
- fn: ((d: Datum) => any) | null;
19
+ fn: ((d: Datum) => DatumValue) | null;
20
20
  }
21
21
  /**
22
22
  * Resolve an accessor pair to the (key, fn) shape the annotation
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from "react";
2
+ import type { FrameGraphicsContext, FrameGraphicsProp } from "./types";
3
+ /** Resolve a static or scale-aware SVG graphics layer for a frame family. */
4
+ export declare function resolveFrameGraphics<S>(graphics: FrameGraphicsProp<S> | undefined, size: number[], margin: FrameGraphicsContext<S>["margin"], scales: S | null): ReactNode;
@@ -0,0 +1,45 @@
1
+ import type { Dispatch, KeyboardEvent, SetStateAction } from "react";
2
+ import type { HoverData } from "../realtime/types";
3
+ import type { SemanticClickBehavior, SemanticHoverBehavior } from "../charts/shared/semanticInteractions";
4
+ import type { PipelineStore } from "./PipelineStore";
5
+ import type { OrdinalPipelineStore } from "./OrdinalPipelineStore";
6
+ import type { GeoPipelineStore } from "./GeoPipelineStore";
7
+ import type { SceneNode } from "./types";
8
+ import type { OrdinalSceneNode } from "./ordinalTypes";
9
+ import type { GeoSceneNode } from "./geoTypes";
10
+ import { type NavPoint } from "./keyboardNav";
11
+ type RefValue<Value> = {
12
+ current: Value;
13
+ };
14
+ type SetHoverPoint = Dispatch<SetStateAction<HoverData | null>>;
15
+ type FocusedNavPoint = Pick<NavPoint, "shape" | "w" | "h" | "pathData">;
16
+ interface KeyboardInteractionParams<Store, Node = unknown> {
17
+ storeRef: RefValue<Store | null>;
18
+ hoverRef: RefValue<HoverData | null>;
19
+ hoveredNodeRef?: RefValue<Node | null>;
20
+ setHoverPoint: SetHoverPoint;
21
+ customHoverBehavior: SemanticHoverBehavior<HoverData>;
22
+ customClickBehavior: SemanticClickBehavior<HoverData>;
23
+ scheduleRender: () => void;
24
+ }
25
+ export declare function useXYKeyboardNavigation(params: KeyboardInteractionParams<PipelineStore, SceneNode>): {
26
+ kbFocusIndexRef: import("react").RefObject<number>;
27
+ focusedNavPointRef: import("react").RefObject<FocusedNavPoint | null>;
28
+ onKeyDown: (event: KeyboardEvent) => void;
29
+ };
30
+ interface OrdinalKeyboardParams extends KeyboardInteractionParams<OrdinalPipelineStore, OrdinalSceneNode> {
31
+ chartType: string;
32
+ oAccessor: unknown;
33
+ rAccessor: unknown;
34
+ }
35
+ export declare function useOrdinalKeyboardNavigation({ chartType, oAccessor, rAccessor, ...params }: OrdinalKeyboardParams): {
36
+ kbFocusIndexRef: import("react").RefObject<number>;
37
+ focusedNavPointRef: import("react").RefObject<FocusedNavPoint | null>;
38
+ onKeyDown: (event: KeyboardEvent) => void;
39
+ };
40
+ export declare function useGeoKeyboardNavigation({ storeRef, hoverRef, hoveredNodeRef, setHoverPoint, customHoverBehavior, customClickBehavior, scheduleRender }: KeyboardInteractionParams<GeoPipelineStore, GeoSceneNode>): {
41
+ kbFocusIndexRef: import("react").RefObject<number>;
42
+ focusedNavPointRef: import("react").RefObject<FocusedNavPoint | null>;
43
+ onKeyDown: (event: KeyboardEvent) => void;
44
+ };
45
+ export {};
@@ -9,8 +9,8 @@ import type { Style } from "./types";
9
9
  import type { Datum } from "../charts/shared/datumTypes";
10
10
  export declare function resolveProjection(prop: ProjectionProp | undefined): GeoProjection;
11
11
  export declare function makeGeoNumericAccessor(acc: string | ((d: Datum) => number) | undefined, fallback: string): (d: Datum) => number;
12
- export declare function makeLineDataAccessor(acc: string | ((d: Datum) => any[]) | undefined): (d: Datum) => any[];
13
- export declare function resolveGeoStyle(styleProp: Style | ((d: Datum) => Style) | undefined, datum: any, defaults: Style): Style;
12
+ export declare function makeLineDataAccessor(acc: string | ((d: Datum) => Datum[]) | undefined): (d: Datum) => Datum[];
13
+ export declare function resolveGeoStyle<TDatum extends object>(styleProp: Style | ((d: TDatum) => Style) | undefined, datum: TDatum, defaults: Style): Style;
14
14
  export declare function themedDefaultArea(config: GeoPipelineConfig): Style;
15
15
  export declare function themedDefaultPoint(config: GeoPipelineConfig): Style & {
16
16
  r?: number;
@@ -43,4 +43,4 @@ export declare function buildOffsetGeoPath(screenPath: [number, number][], strok
43
43
  * Bidirectional pairs (A->B and B->A) naturally separate because their
44
44
  * left-hand normals point to opposite sides.
45
45
  */
46
- export declare function buildOffsetPath(start: [number, number], end: [number, number], _flow: any, _allFlows: any[], strokeWidth: number): [number, number][];
46
+ export declare function buildOffsetPath(start: [number, number], end: [number, number], _flow: Datum, _allFlows: Datum[], strokeWidth: number): [number, number][];
@@ -0,0 +1,34 @@
1
+ import { type ChangeSet, type Invalidation, type UpdateResult } from "./pipelineUpdateContract";
2
+ /** Whether a config patch must re-derive its retained Geo data resources. */
3
+ export type GeoRetainedDataEffect = "preserve" | "rebuild";
4
+ export interface GeoConfigPatchDependency {
5
+ readonly retainedData: GeoRetainedDataEffect;
6
+ readonly invalidations: readonly Invalidation[];
7
+ }
8
+ /**
9
+ * Geo's key-level config-patch dependency table. `windowSize` is a retained
10
+ * resource rebuild: its `data` revision is added only when an active stream
11
+ * actually resizes, so a bounded config-only patch is never reported as an
12
+ * ingest.
13
+ */
14
+ export declare const GEO_CONFIG_PATCH_DEPENDENCIES: Readonly<Record<string, GeoConfigPatchDependency>>;
15
+ export interface GeoConfigPatchClassification {
16
+ readonly retainedData: GeoRetainedDataEffect;
17
+ readonly invalidations: ReadonlySet<Invalidation>;
18
+ }
19
+ /** Union the declared effects for a patch after its effective keys are known. */
20
+ export declare function classifyGeoConfigPatch(keys: readonly string[]): GeoConfigPatchClassification;
21
+ type DataChangeKind = Extract<ChangeSet["kind"], "ingest" | "replace" | "remove" | "update" | "clear">;
22
+ /** Result bookkeeping and explicit config-patch dependency policy for Geo. */
23
+ export declare class GeoPipelineUpdateResults {
24
+ private tracker;
25
+ get last(): UpdateResult;
26
+ subscribe(listener: () => void): () => void;
27
+ recordData(kind: DataChangeKind, count?: number): UpdateResult;
28
+ recordNoop(kind: DataChangeKind | "restyle"): UpdateResult;
29
+ recordRestyle(hasCustomRestyle: boolean): UpdateResult;
30
+ recordConfig(keys: readonly string[], options?: {
31
+ retainedDataChanged?: boolean;
32
+ }): UpdateResult;
33
+ }
34
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { GeoPath, GeoPermissibleObjects, GeoProjection } from "d3-geo";
2
+ import type { GeoPipelineConfig, GeoSceneNode } from "./geoTypes";
3
+ import type { StreamLayout } from "./types";
4
+ import type { Datum } from "../charts/shared/datumTypes";
5
+ interface GeoSceneBuildInput {
6
+ config: GeoPipelineConfig;
7
+ projection: GeoProjection;
8
+ path: GeoPath<void, GeoPermissibleObjects>;
9
+ areas: GeoJSON.Feature[];
10
+ points: Datum[];
11
+ lines: Datum[];
12
+ layout: StreamLayout;
13
+ }
14
+ /** Builds the built-in geo scene independently of store-owned custom layout state. */
15
+ export declare function buildBuiltInGeoScene({ config, projection, path, areas, points, lines, layout }: GeoSceneBuildInput): GeoSceneNode[];
16
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { GeoProjection, GeoPath, GeoPermissibleObjects } from "d3-geo";
3
3
  import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
4
- import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, SceneDatum, PointSceneNode, GlyphSceneNode, ThemeSemanticColors, SceneAccessibilityMetadata } from "./types";
4
+ import type { Style, DecayConfig, PulseConfig, TransitionConfig, StalenessConfig, SceneDatum, PointSceneNode, GlyphSceneNode, ThemeSemanticColors, SceneAccessibilityMetadata, SceneRenderMode } from "./types";
5
5
  import type { AnimateProp } from "./pipelineTransitionUtils";
6
6
  import type { HoverAnnotationConfig, HoverData } from "../realtime/types";
7
7
  import type { GeoParticleStyle } from "./GeoParticlePool";
@@ -11,6 +11,9 @@ import type { MarginType } from "../types/marginType";
11
11
  import type { GeoCustomLayout } from "./geoCustomLayout";
12
12
  import type { CustomLayoutSelection } from "./customLayoutSelection";
13
13
  import type { CustomLayoutFailureDiagnostic } from "./customLayoutFailure";
14
+ import type { OnObservationCallback } from "../store/ObservationStore";
15
+ import type { SemanticClickBehavior, SemanticHoverBehavior } from "../charts/shared/semanticInteractions";
16
+ import type { OnAnnotationActivateCallback } from "../charts/shared/annotationActivation";
14
17
  export type ProjectionProp = GeoProjection | ProjectionName | ProjectionConfig;
15
18
  export type ProjectionName = "mercator" | "equalEarth" | "albersUsa" | "orthographic" | "naturalEarth" | "equirectangular";
16
19
  export interface ProjectionConfig {
@@ -69,7 +72,7 @@ export interface GeoLineSceneNode {
69
72
  export type GeoSceneNode = GeoAreaSceneNode | PointSceneNode | GlyphSceneNode | GeoLineSceneNode;
70
73
  export interface GeoScales {
71
74
  projection: GeoProjection;
72
- geoPath: GeoPath<any, GeoPermissibleObjects>;
75
+ geoPath: GeoPath<void, GeoPermissibleObjects>;
73
76
  projectedPoint: (lon: number, lat: number) => [number, number] | null;
74
77
  invertedPoint: (px: number, py: number) => [number, number] | null;
75
78
  }
@@ -77,19 +80,20 @@ export interface GeoPipelineConfig {
77
80
  projection: ProjectionProp;
78
81
  projectionExtent?: [[number, number], [number, number]];
79
82
  /**
80
- * Auto-fit padding as a **fraction** of the plot (0–0.5), not pixels.
81
- * `0.1` insets the fitted geography 10% from each edge. A value `>= 1` is
82
- * almost always a pixel mistake and collapses the projection off-canvas.
83
+ * Projection-fit padding as a finite fraction of the plot, not pixels.
84
+ * Valid values are in `[0, 0.5)`; `0.1` insets automatic fitting 10% from
85
+ * each edge. `null` and `undefined` use `0`; other values throw `RangeError`
86
+ * at the config boundary. Ignored when `projectionExtent` is supplied.
83
87
  * @default 0
84
88
  */
85
- fitPadding?: number;
89
+ fitPadding?: number | null;
86
90
  xAccessor?: string | ((d: Datum) => number);
87
91
  yAccessor?: string | ((d: Datum) => number);
88
92
  lineDataAccessor?: string | ((d: Datum) => Datum[]);
89
93
  lineType?: "geo" | "line";
90
94
  /** Flow rendering style: "basic" (straight/great-circle), "offset" (bidirectional offset), "arc" (curved arcs) @default "basic" */
91
95
  flowStyle?: "basic" | "offset" | "arc";
92
- areaStyle?: Style | ((d: Datum) => Style);
96
+ areaStyle?: Style | ((d: GeoJSON.Feature) => Style);
93
97
  pointStyle?: (d: Datum) => Style & {
94
98
  r?: number;
95
99
  };
@@ -103,6 +107,10 @@ export interface GeoPipelineConfig {
103
107
  themeDiverging?: string;
104
108
  graticule?: boolean | GraticuleConfig;
105
109
  projectionTransform?: DistanceCartogramConfig;
110
+ /** Maximum retained points and lines after the store enters streaming mode. @default 500 */
111
+ windowSize?: number;
112
+ /** Logical clock used for Geo pulse and transition work. */
113
+ clock?: import("./FrameRuntime").FrameClock;
106
114
  decay?: DecayConfig;
107
115
  pulse?: PulseConfig;
108
116
  transition?: TransitionConfig;
@@ -125,12 +133,13 @@ export interface StreamGeoFrameProps<T = Datum> {
125
133
  projection: ProjectionProp;
126
134
  projectionExtent?: [[number, number], [number, number]];
127
135
  /**
128
- * Auto-fit padding as a **fraction** of the plot (0–0.5), not pixels.
129
- * `0.1` insets the fitted geography 10% from each edge. A value `>= 1` is
130
- * almost always a pixel mistake and collapses the projection off-canvas.
136
+ * Projection-fit padding as a finite fraction of the plot, not pixels.
137
+ * Valid values are in `[0, 0.5)`; `0.1` insets automatic fitting 10% from
138
+ * each edge. `null` and `undefined` use `0`; other values throw `RangeError`
139
+ * at the config boundary. Ignored when `projectionExtent` is supplied.
131
140
  * @default 0
132
141
  */
133
- fitPadding?: number;
142
+ fitPadding?: number | null;
134
143
  areas?: GeoJSON.Feature[];
135
144
  points?: T[];
136
145
  lines?: T[];
@@ -190,7 +199,11 @@ export interface StreamGeoFrameProps<T = Datum> {
190
199
  className?: string;
191
200
  background?: string;
192
201
  runtimeMode?: "bounded" | "streaming";
193
- areaStyle?: Style | ((d: Datum) => Style);
202
+ /** Maximum retained points and lines after imperative streaming begins. @default 500 */
203
+ windowSize?: number;
204
+ /** Optional scene paint backend. Exact projected geometry remains interactive. */
205
+ renderMode?: SceneRenderMode<GeoSceneNode>;
206
+ areaStyle?: Style | ((d: GeoJSON.Feature) => Style);
194
207
  pointStyle?: (d: Datum) => Style & {
195
208
  r?: number;
196
209
  };
@@ -214,9 +227,17 @@ export interface StreamGeoFrameProps<T = Datum> {
214
227
  * @default false
215
228
  */
216
229
  allowTooltipOverflow?: boolean;
217
- customClickBehavior?: (d: HoverData | null) => void;
218
- customHoverBehavior?: (d: HoverData | null) => void;
230
+ customClickBehavior?: SemanticClickBehavior<HoverData>;
231
+ customHoverBehavior?: SemanticHoverBehavior<HoverData>;
232
+ /** Structured interaction observations, including semantic focus/activate. */
233
+ onObservation?: OnObservationCallback;
234
+ /** @internal HOC observation callback forwarded only to annotation widgets. */
235
+ annotationObservationCallback?: OnObservationCallback;
236
+ /** Chart instance identifier included in observation events. */
237
+ chartId?: string;
219
238
  annotations?: Datum[];
239
+ /** Observe activation of widget annotations without replacing widget behavior. */
240
+ onAnnotationActivate?: OnAnnotationActivateCallback;
220
241
  autoPlaceAnnotations?: AutoPlaceAnnotations;
221
242
  decay?: DecayConfig;
222
243
  pulse?: PulseConfig;
@@ -226,6 +247,18 @@ export interface StreamGeoFrameProps<T = Datum> {
226
247
  * Set `{ intro: false }` to disable the intro animation. */
227
248
  animate?: AnimateProp;
228
249
  staleness?: StalenessConfig;
250
+ /** Optional rAF seam for deterministic host scheduling. */
251
+ frameScheduler?: import("./useFrame").FrameScheduler;
252
+ /** Monotonic wall-clock seam for deterministic replay, tests, or evidence capture. */
253
+ clock?: import("./FrameRuntime").FrameClock;
254
+ /** Injectable random source for frame-local stochastic work. */
255
+ random?: import("./FrameRuntime").FrameRandom;
256
+ /** Serializable deterministic random seed. Ignored when `random` is supplied. */
257
+ seed?: number;
258
+ /** Freeze logical animation time and cancel queued work while paused. */
259
+ paused?: boolean;
260
+ /** Freeze logical animation time while the page is hidden. Defaults to true for Geo frames. */
261
+ suspendWhenHidden?: boolean;
229
262
  backgroundGraphics?: ReactNode;
230
263
  foregroundGraphics?: ReactNode;
231
264
  title?: string | ReactNode;
@@ -271,7 +304,7 @@ export interface StreamGeoFrameHandle {
271
304
  getLines(): Datum[];
272
305
  clear(): void;
273
306
  getProjection(): GeoProjection | null;
274
- getGeoPath(): GeoPath<any, GeoPermissibleObjects> | null;
307
+ getGeoPath(): GeoPath<void, GeoPermissibleObjects> | null;
275
308
  /** Get cartogram layout info (center position, max cost, radius) */
276
309
  getCartogramLayout(): {
277
310
  cx: number;
@@ -27,11 +27,11 @@ export declare function getHitRadius(nodeRadius: number | undefined, maxDistance
27
27
  * Convert a value to a Date if possible. Returns null for non-date values.
28
28
  * Treats numbers > 1e9 as millisecond timestamps.
29
29
  */
30
- export declare function toDate(value: any): Date | null;
30
+ export declare function toDate(value: Date | number | string | null | undefined): Date | null;
31
31
  /**
32
32
  * Detect whether a tick marks a time boundary (new month or year) compared to the previous tick.
33
33
  */
34
- export declare function isTimeLandmark(value: any, prevValue: any): boolean;
34
+ export declare function isTimeLandmark(value: Date | number | string | null | undefined, prevValue: Date | number | string | null | undefined): boolean;
35
35
  /**
36
36
  * Normalize an angle to the [0, 2π) range.
37
37
  */
@@ -7,6 +7,8 @@
7
7
  * property flattening that are handled at the call site.
8
8
  */
9
9
  import type { HoverData } from "../realtime/types";
10
+ import type { Datum } from "../charts/shared/datumTypes";
11
+ export type RawHoverDatum = Datum | Datum[] | null;
10
12
  /**
11
13
  * Minimal shape a Stream Frame's internal hover handler needs from a pointer
12
14
  * event. React.MouseEvent satisfies this structurally, as does the plain
@@ -22,7 +24,7 @@ export interface HoverPointerCoords {
22
24
  }
23
25
  export declare const TOUCH_HIT_RADIUS = 24;
24
26
  export declare function getPointerHitRadius(baseRadius: number, pointerType?: string): number;
25
- export declare function normalizeHoverDatum(rawDatum: any): any;
27
+ export declare function normalizeHoverDatum(rawDatum: RawHoverDatum): Datum | null;
26
28
  /**
27
29
  * Build a HoverData object from a raw datum and pixel coordinates.
28
30
  * The raw datum is preserved as `hover.data` for tooltip / callback
@@ -30,4 +32,4 @@ export declare function normalizeHoverDatum(rawDatum: any): any;
30
32
  * relevant to a specific frame family — `category`, `stats`,
31
33
  * `nodeOrEdge`, `xValue`, etc. — is layered in via `extra`.
32
34
  */
33
- export declare function buildHoverData(rawDatum: any, x: number, y: number, extra?: Partial<HoverData>): HoverData;
35
+ export declare function buildHoverData(rawDatum: RawHoverDatum, x: number, y: number, extra?: Partial<HoverData>): HoverData;
@@ -17,6 +17,7 @@ export interface FrameForceWorkerRequest {
17
17
  chartType: "force";
18
18
  iterations?: number;
19
19
  forceStrength?: number;
20
+ seed?: number;
20
21
  };
21
22
  size: [number, number];
22
23
  }
@@ -20,7 +20,7 @@ export declare function parseColor(color: string): [number, number, number];
20
20
  * Uses perceived luminance (ITU-R BT.601).
21
21
  */
22
22
  export declare function contrastTextColor(bgColor: string): string;
23
- export declare function resolveChildrenAccessor(accessor: string | ((d: Datum) => any[]) | undefined): ((d: Datum) => any[]) | undefined;
24
- export declare function resolveNodeId(d: any, config: NetworkPipelineConfig, index: number): string;
23
+ export declare function resolveChildrenAccessor(accessor: string | ((d: Datum) => Datum[]) | undefined): ((d: Datum) => Datum[]) | undefined;
24
+ export declare function resolveNodeId(d: Datum, config: NetworkPipelineConfig, index: number): string;
25
25
  export declare function resolveLabelFn(nodeLabel: string | ((d: Datum) => string) | undefined): ((d: Datum) => string) | null;
26
26
  export declare function resolveDefaultNodeSize(nodeSize: number | string | ((d: Datum) => number) | undefined): number;
@@ -0,0 +1,23 @@
1
+ import type { NetworkLayoutResult } from "./networkCustomLayout";
2
+ import { type CustomLayoutFailureDiagnostic } from "./customLayoutFailure";
3
+ import type { NetworkPipelineConfig, RealtimeEdge, RealtimeNode } from "./networkTypes";
4
+ interface NetworkCustomLayoutRunInput {
5
+ config: NetworkPipelineConfig;
6
+ customLayout: NonNullable<NetworkPipelineConfig["customNetworkLayout"]>;
7
+ size: [number, number];
8
+ nodes: RealtimeNode[];
9
+ edges: RealtimeEdge[];
10
+ previousResult: NetworkLayoutResult | null;
11
+ revision: number;
12
+ }
13
+ export type NetworkCustomLayoutRunResult = {
14
+ kind: "success";
15
+ result: NetworkLayoutResult;
16
+ } | {
17
+ kind: "failure";
18
+ diagnostic: CustomLayoutFailureDiagnostic;
19
+ preservedLastGoodScene: boolean;
20
+ };
21
+ /** Runs user-provided network layout code behind the common failure boundary. */
22
+ export declare function runNetworkCustomLayout({ config, customLayout, size, nodes, edges, previousResult, revision }: NetworkCustomLayoutRunInput): NetworkCustomLayoutRunResult;
23
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { CustomLayoutSelection } from "./customLayoutSelection";
2
+ import type { NetworkLayoutResult } from "./networkCustomLayout";
3
+ import type { NetworkSceneEdge, NetworkSceneNode } from "./networkTypes";
4
+ import type { Style } from "./types";
5
+ export declare function snapshotNetworkCustomStyles(nodes: NetworkSceneNode[], edges: NetworkSceneEdge[]): WeakMap<object, Style>;
6
+ interface NetworkRestyleInput {
7
+ nodes: NetworkSceneNode[];
8
+ edges: NetworkSceneEdge[];
9
+ restyle: NetworkLayoutResult["restyle"];
10
+ restyleEdge: NetworkLayoutResult["restyleEdge"];
11
+ baseStyles: WeakMap<object, Style>;
12
+ selection: CustomLayoutSelection | null;
13
+ }
14
+ export declare function restyleNetworkCustomScene({ nodes, edges, restyle, restyleEdge, baseStyles, selection }: NetworkRestyleInput): boolean;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether the network paint loop needs another animation frame.
3
+ *
4
+ * Particles are continuous only for sankey and custom layouts; pulse and
5
+ * pipeline animations apply to every chart type.
6
+ */
7
+ export declare function shouldContinueNetworkAnimation(chartType: string, hasCustomNetworkLayout: boolean, showParticles: boolean, hasPulse: boolean, isStoreAnimating: boolean): boolean;
@@ -0,0 +1,39 @@
1
+ import type { Datum } from "../charts/shared/datumTypes";
2
+ import type { EdgePush, RealtimeEdge, RealtimeNode } from "./networkTypes";
3
+ import type { CustomLayoutFailureDiagnostic } from "./customLayoutFailure";
4
+ import type { NetworkLayoutResult } from "./networkCustomLayout";
5
+ /** Imperative API exposed by `StreamNetworkFrame` refs. */
6
+ export interface StreamNetworkFrameHandle {
7
+ push(edge: EdgePush): void;
8
+ pushMany(edges: EdgePush[]): void;
9
+ /** Remove a node by ID. Also removes connected edges. */
10
+ removeNode(id: string): boolean;
11
+ /** Remove edges by source+target, or by edge ID when edgeIdAccessor is configured. */
12
+ removeEdge(sourceIdOrEdgeId: string, targetId?: string): boolean;
13
+ /** Update a node's data by ID. Returns previous data. */
14
+ updateNode(id: string, updater: (data: Datum) => Datum): Datum | null;
15
+ /** Update all edges between source+target. Returns array of previous data. */
16
+ updateEdge(sourceId: string, targetId: string, updater: (data: Datum) => Datum): Datum[];
17
+ clear(): void;
18
+ getTopology(): {
19
+ nodes: RealtimeNode[];
20
+ edges: RealtimeEdge[];
21
+ };
22
+ getTopologyDiff(): {
23
+ addedNodes: string[];
24
+ removedNodes: string[];
25
+ addedEdges: string[];
26
+ removedEdges: string[];
27
+ };
28
+ relayout(): void;
29
+ getTension(): number;
30
+ /** The most recent custom layout result (sceneNodes/sceneEdges/overlays as
31
+ * returned by `customNetworkLayout`) - host readback so pages that need the
32
+ * computed placement do not re-run the layout. Null before the first layout
33
+ * or when no custom layout is configured. A failed retry retains the prior
34
+ * good result; inspect `getLayoutFailure()` to distinguish recovery. */
35
+ getCustomLayout(): NetworkLayoutResult | null;
36
+ /** The latest custom-layout failure, if any. Cleared by a successful layout,
37
+ * removing the custom layout, or `clear()`. */
38
+ getLayoutFailure(): CustomLayoutFailureDiagnostic | null;
39
+ }
@@ -0,0 +1,15 @@
1
+ import { type SemanticClickBehavior, type SemanticHoverBehavior } from "../charts/shared/semanticInteractions";
2
+ import type { HoverData } from "../realtime/types";
3
+ import type { OnObservationCallback } from "../store/ObservationStore";
4
+ interface NetworkObservationBehaviorOptions {
5
+ customHoverBehavior?: SemanticHoverBehavior<HoverData>;
6
+ customClickBehavior?: SemanticClickBehavior<HoverData>;
7
+ onObservation?: OnObservationCallback;
8
+ chartId?: string;
9
+ }
10
+ /** Adds the standard observation vocabulary to the network behavior callbacks. */
11
+ export declare function useNetworkObservationBehaviors({ customHoverBehavior: customHoverBehaviorProp, customClickBehavior: customClickBehaviorProp, onObservation, chartId }: NetworkObservationBehaviorOptions): {
12
+ customHoverBehavior: SemanticHoverBehavior<HoverData>;
13
+ customClickBehavior: SemanticClickBehavior<HoverData>;
14
+ };
15
+ export {};
@@ -1,21 +1,30 @@
1
1
  import type { NetworkPipelineStore } from "./NetworkPipelineStore";
2
- import type { NetworkPipelineConfig, ParticleStyle, RealtimeEdge } from "./networkTypes";
2
+ import type { SceneRevisionDiagnostics } from "./sceneRevisionDiagnostics";
3
+ import type { NetworkPipelineConfig, ParticleStyle, RealtimeEdge, NetworkSceneNode, NetworkSceneEdge } from "./networkTypes";
3
4
  import type { MarginType } from "../types/marginType";
4
- import type { DecayConfig, PulseConfig, StalenessConfig } from "./types";
5
+ import type { DecayConfig, PulseConfig, StalenessConfig, SceneRenderMode } from "./types";
5
6
  export interface NetworkFramePaintContext {
6
7
  canvas: HTMLCanvasElement;
7
8
  store: NetworkPipelineStore;
9
+ sceneRevisionDiagnostics?: SceneRevisionDiagnostics;
8
10
  size: [number, number];
9
11
  margin: MarginType;
10
12
  adjustedWidth: number;
11
13
  adjustedHeight: number;
12
14
  background?: string;
15
+ renderMode?: SceneRenderMode<NetworkSceneNode | NetworkSceneEdge>;
16
+ /** Skip opaque canvas fill when an SVG backgroundGraphics layer is present. */
17
+ hasBackgroundGraphics?: boolean;
13
18
  dirtyRef: {
14
19
  current: boolean;
15
20
  };
16
21
  lastFrameTimeRef: {
17
22
  current: number;
18
23
  };
24
+ /** FrameRuntime logical timestamp for this paint. */
25
+ now: number;
26
+ /** FrameRuntime random source for particle placement/spawn sampling. */
27
+ random: () => number;
19
28
  reducedMotion: boolean;
20
29
  showParticles: boolean;
21
30
  isContinuous: boolean;