semiotic 3.8.0 → 3.8.2

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 (331) hide show
  1. package/CLAUDE.md +14 -9
  2. package/README.md +56 -55
  3. package/ai/behaviorContracts.cjs +9 -0
  4. package/ai/dist/mcp-server.js +240 -30
  5. package/ai/schema.json +616 -42
  6. package/ai/surface-manifest.json +3 -2
  7. package/ai/system-prompt.md +7 -3
  8. package/dist/__tests__/scenarios/mcpProtocolTypes.d.ts +20 -0
  9. package/dist/chunk-OrdinalBrushOverlay-PXHQYDB2.module.min.js +2 -0
  10. package/dist/chunk-XYBrushOverlay-ECZJJLAJ.module.min.js +1 -0
  11. package/dist/chunk-XYBrushOverlay-EP2SV3UI.module.min.js +2 -0
  12. package/dist/chunk-chunk-255KDHW5.module.min.js +1 -0
  13. package/dist/chunk-chunk-27HVVXS6.module.min.js +1 -0
  14. package/dist/chunk-chunk-2CXCXRB4.module.min.js +1 -0
  15. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +2 -0
  16. package/dist/chunk-chunk-2UN3ANRN.module.min.js +2 -0
  17. package/dist/chunk-chunk-2VUEY5TH.module.min.js +1 -0
  18. package/dist/chunk-chunk-2WVCH4PL.module.min.js +1 -0
  19. package/dist/chunk-chunk-5UKL5W76.module.min.js +2 -0
  20. package/dist/chunk-chunk-5WEFWNUW.module.min.js +2 -0
  21. package/dist/chunk-chunk-6F6GEAQU.module.min.js +1 -0
  22. package/dist/chunk-chunk-7LHMKRKE.module.min.js +2 -0
  23. package/dist/chunk-chunk-BHYTYMY2.module.min.js +2 -0
  24. package/dist/chunk-chunk-C6EJ4IOD.module.min.js +2 -0
  25. package/dist/chunk-chunk-CA3YDW6F.module.min.js +1 -0
  26. package/dist/chunk-chunk-CP3EN6KZ.module.min.js +1 -0
  27. package/dist/chunk-chunk-CYIML3AV.module.min.js +2 -0
  28. package/dist/chunk-chunk-DNY43POY.module.min.js +1 -0
  29. package/dist/chunk-chunk-DSNGDNJY.module.min.js +1 -0
  30. package/dist/chunk-chunk-E7MIQX7D.module.min.js +2 -0
  31. package/dist/chunk-chunk-EMO5NUGE.module.min.js +1 -0
  32. package/dist/chunk-chunk-ES4DCG3L.module.min.js +1 -0
  33. package/dist/chunk-chunk-FAKO3RGQ.module.min.js +2 -0
  34. package/dist/chunk-chunk-FYY2ACNJ.module.min.js +2 -0
  35. package/dist/chunk-chunk-G7WFWHAD.module.min.js +2 -0
  36. package/dist/chunk-chunk-GMQ5AYTD.module.min.js +1 -0
  37. package/dist/chunk-chunk-H4PPRW6N.module.min.js +1 -0
  38. package/dist/chunk-chunk-IFYPMWKY.module.min.js +1 -0
  39. package/dist/chunk-chunk-J3ELI22J.module.min.js +1 -0
  40. package/dist/chunk-chunk-J3QOW4OE.module.min.js +0 -0
  41. package/dist/chunk-chunk-J3XWETBJ.module.min.js +2 -0
  42. package/dist/chunk-chunk-JCG72SGW.module.min.js +2 -0
  43. package/dist/{semiotic-ai-chunk-OG7BQUUW.module.min.js → chunk-chunk-JJ2OOIET.module.min.js} +0 -1
  44. package/dist/chunk-chunk-KTWEBFMX.module.min.js +2 -0
  45. package/dist/chunk-chunk-L6D3I3V7.module.min.js +2 -0
  46. package/dist/chunk-chunk-M337NY6L.module.min.js +1 -0
  47. package/dist/chunk-chunk-NO4MCQVD.module.min.js +1 -0
  48. package/dist/chunk-chunk-ODUZEEBH.module.min.js +2 -0
  49. package/dist/chunk-chunk-P6UBCMSQ.module.min.js +2 -0
  50. package/dist/chunk-chunk-Q2YADC2V.module.min.js +2 -0
  51. package/dist/chunk-chunk-QRIBHZYW.module.min.js +1 -0
  52. package/dist/chunk-chunk-QSQVBIJA.module.min.js +1 -0
  53. package/dist/chunk-chunk-RCF52Z42.module.min.js +2 -0
  54. package/dist/chunk-chunk-RH5TSQPH.module.min.js +1 -0
  55. package/dist/chunk-chunk-ROP4HI7H.module.min.js +2 -0
  56. package/dist/chunk-chunk-RZH7VZYS.module.min.js +2 -0
  57. package/dist/chunk-chunk-SIRIJ3DY.module.min.js +1 -0
  58. package/dist/chunk-chunk-STZFFTAN.module.min.js +2 -0
  59. package/dist/chunk-chunk-SV4XAZ3Q.module.min.js +1 -0
  60. package/dist/chunk-chunk-T27ZEV6A.module.min.js +1 -0
  61. package/dist/chunk-chunk-U3AGQ5EF.module.min.js +2 -0
  62. package/dist/chunk-chunk-U66USBWU.module.min.js +1 -0
  63. package/dist/chunk-chunk-VVCA3DB7.module.min.js +1 -0
  64. package/dist/chunk-chunk-W3DB2MN4.module.min.js +2 -0
  65. package/dist/chunk-chunk-WCX6U47H.module.min.js +2 -0
  66. package/dist/chunk-chunk-WDIN4LRC.module.min.js +1 -0
  67. package/dist/chunk-chunk-XEVJDUTH.module.min.js +1 -0
  68. package/dist/chunk-chunk-XOYX77KF.module.min.js +2 -0
  69. package/dist/chunk-chunk-YCQYG6J5.module.min.js +2 -0
  70. package/dist/chunk-chunk-YHNZCPOZ.module.min.js +2 -0
  71. package/dist/chunk-chunk-YWZB3KPI.module.min.js +2 -0
  72. package/dist/chunk-chunk-Z5KXAVQD.module.min.js +2 -0
  73. package/dist/chunk-chunk-ZCNBUZPL.module.min.js +2 -0
  74. package/dist/chunk-chunk-ZLKRTF5N.module.min.js +2 -0
  75. package/dist/chunk-chunk-ZTNVDWAK.module.min.js +2 -0
  76. package/dist/chunk-statisticalOverlays-6MVAK5RW.module.min.js +2 -0
  77. package/dist/components/AccessibleNavTree.d.ts +7 -1
  78. package/dist/components/ai/chartClinicMetadata.generated.d.ts +15 -0
  79. package/dist/components/ai/useNavigationSync.d.ts +17 -2
  80. package/dist/components/chartContainerMobile.d.ts +9 -0
  81. package/dist/components/charts/geo/ChoroplethMap.d.ts +19 -2
  82. package/dist/components/charts/geo/DistanceCartogram.d.ts +14 -2
  83. package/dist/components/charts/geo/FlowMap.d.ts +10 -6
  84. package/dist/components/charts/geo/ProportionalSymbolMap.d.ts +14 -2
  85. package/dist/components/charts/index.d.ts +6 -0
  86. package/dist/components/charts/network/ChordDiagram.d.ts +9 -1
  87. package/dist/components/charts/network/ForceDirectedGraph.d.ts +11 -0
  88. package/dist/components/charts/network/SankeyDiagram.d.ts +9 -1
  89. package/dist/components/charts/ordinal/BarChart.d.ts +21 -0
  90. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +11 -0
  91. package/dist/components/charts/ordinal/StackedBarChart.d.ts +11 -0
  92. package/dist/components/charts/physics/CollisionSwarmChart.d.ts +7 -0
  93. package/dist/components/charts/physics/EventDropChart.d.ts +7 -0
  94. package/dist/components/charts/physics/GaltonBoardChart.d.ts +8 -0
  95. package/dist/components/charts/physics/PhysicalFlowChart.d.ts +7 -0
  96. package/dist/components/charts/physics/PhysicsCustomChart.d.ts +4 -25
  97. package/dist/components/charts/physics/PhysicsPileChart.d.ts +7 -0
  98. package/dist/components/charts/physics/physicsChartShared.d.ts +17 -1
  99. package/dist/components/charts/physics/physicsCustomLayout.d.ts +32 -0
  100. package/dist/components/charts/shared/AnnotationLabel.d.ts +88 -0
  101. package/dist/components/charts/shared/annotationActivation.d.ts +35 -0
  102. package/dist/components/charts/shared/annotationLabelLayout.d.ts +5 -0
  103. package/dist/components/charts/shared/annotationRules.d.ts +2 -1
  104. package/dist/components/charts/shared/auditAccessibilityText.d.ts +13 -0
  105. package/dist/components/charts/shared/chartSelectionUtils.d.ts +4 -0
  106. package/dist/components/charts/shared/chartSpecCore.d.ts +3 -3
  107. package/dist/components/charts/shared/datumTypes.d.ts +2 -0
  108. package/dist/components/charts/shared/diagnoseAnnotationChecks.d.ts +2 -0
  109. package/dist/components/charts/shared/formatUtils.d.ts +3 -3
  110. package/dist/components/charts/shared/hatchFill.d.ts +87 -0
  111. package/dist/components/charts/shared/hooks.d.ts +7 -6
  112. package/dist/components/charts/shared/knownChartComponents.d.ts +9 -0
  113. package/dist/components/charts/shared/leastSquaresRegression.d.ts +16 -0
  114. package/dist/components/charts/shared/mergeShapeStyle.d.ts +3 -2
  115. package/dist/components/charts/shared/semanticInteractions.d.ts +42 -0
  116. package/dist/components/charts/shared/sparseArray.d.ts +1 -1
  117. package/dist/components/charts/shared/streamPropsHelpers.d.ts +6 -4
  118. package/dist/components/charts/shared/styleRules.d.ts +205 -0
  119. package/dist/components/charts/shared/tooltipUtils.d.ts +22 -9
  120. package/dist/components/charts/shared/types.d.ts +9 -6
  121. package/dist/components/charts/shared/useAreaSeriesSetup.d.ts +16 -2
  122. package/dist/components/charts/shared/useChartSetup.d.ts +2 -2
  123. package/dist/components/charts/shared/useCustomChartSetup.d.ts +3 -0
  124. package/dist/components/charts/shared/useFrameImperativeHandle.d.ts +1 -2
  125. package/dist/components/charts/shared/useLikertAggregation.d.ts +4 -4
  126. package/dist/components/charts/shared/useOrdinalBrush.d.ts +2 -1
  127. package/dist/components/charts/shared/useOrdinalPieceStyle.d.ts +24 -1
  128. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  129. package/dist/components/charts/shared/useXYLineStyle.d.ts +10 -0
  130. package/dist/components/charts/shared/useXYPointStyle.d.ts +19 -1
  131. package/dist/components/charts/shared/validateChartData.d.ts +7 -5
  132. package/dist/components/charts/shared/validationMap.d.ts +11 -2
  133. package/dist/components/charts/shared/validationMap.generated.d.ts +6 -0
  134. package/dist/components/charts/shared/withChartWrapper.d.ts +4 -3
  135. package/dist/components/charts/value/targetPresentation.d.ts +22 -0
  136. package/dist/components/charts/value/types.d.ts +5 -6
  137. package/dist/components/charts/xy/AreaChart.d.ts +8 -0
  138. package/dist/components/charts/xy/BubbleChart.d.ts +9 -0
  139. package/dist/components/charts/xy/ConnectedScatterplot.d.ts +7 -0
  140. package/dist/components/charts/xy/DifferenceChart.d.ts +1 -52
  141. package/dist/components/charts/xy/Heatmap.d.ts +2 -2
  142. package/dist/components/charts/xy/LineChart.d.ts +11 -0
  143. package/dist/components/charts/xy/QuadrantChart.d.ts +7 -0
  144. package/dist/components/charts/xy/Scatterplot.d.ts +10 -0
  145. package/dist/components/charts/xy/StackedAreaChart.d.ts +7 -0
  146. package/dist/components/charts/xy/differenceSegments.d.ts +49 -0
  147. package/dist/components/charts/xy/scatterplotMatrixInteractionTypes.d.ts +12 -0
  148. package/dist/components/controls/SentenceFilter.d.ts +97 -0
  149. package/dist/components/data/fromVegaLite.d.ts +19 -9
  150. package/dist/components/rough/createRoughRenderMode.d.ts +46 -0
  151. package/dist/components/semiotic-ai.d.ts +3 -1
  152. package/dist/components/semiotic-controls.d.ts +2 -0
  153. package/dist/components/semiotic-geo.d.ts +4 -0
  154. package/dist/components/semiotic-network.d.ts +4 -0
  155. package/dist/components/semiotic-ordinal.d.ts +6 -0
  156. package/dist/components/semiotic-physics.d.ts +4 -0
  157. package/dist/components/semiotic-rough.d.ts +4 -0
  158. package/dist/components/semiotic-utils-core.d.ts +4 -0
  159. package/dist/components/semiotic-xy.d.ts +4 -0
  160. package/dist/components/semiotic.d.ts +9 -1
  161. package/dist/components/server/optionalImageTypes.d.ts +37 -0
  162. package/dist/components/server/serverChartConfigShared.d.ts +9 -5
  163. package/dist/components/server/serverChartConfigs.d.ts +4 -4
  164. package/dist/components/server/staticAnnotations.d.ts +6 -3
  165. package/dist/components/server/staticLegend.d.ts +1 -1
  166. package/dist/components/server/staticNetwork.d.ts +4 -4
  167. package/dist/components/server/staticSVGChrome.d.ts +5 -4
  168. package/dist/components/store/ObservationStore.d.ts +21 -1
  169. package/dist/components/stream/AccessibleDataTable.d.ts +4 -10
  170. package/dist/components/stream/AriaLiveTooltip.d.ts +9 -0
  171. package/dist/components/stream/CanvasHitTester.d.ts +4 -4
  172. package/dist/components/stream/DataSourceAdapter.d.ts +1 -1
  173. package/dist/components/stream/FrameRuntime.d.ts +57 -0
  174. package/dist/components/stream/GeoParticlePool.d.ts +1 -1
  175. package/dist/components/stream/GeoPipelineStore.d.ts +43 -12
  176. package/dist/components/stream/GeoSVGOverlay.d.ts +64 -0
  177. package/dist/components/stream/NetworkCanvasHitTester.d.ts +2 -1
  178. package/dist/components/stream/NetworkPipelineStore.d.ts +24 -21
  179. package/dist/components/stream/NetworkSSRFrame.d.ts +17 -0
  180. package/dist/components/stream/NetworkSVGOverlay.d.ts +6 -0
  181. package/dist/components/stream/OrdinalBrushOverlay.d.ts +1 -2
  182. package/dist/components/stream/OrdinalBrushOverlayLazy.d.ts +9 -0
  183. package/dist/components/stream/OrdinalCanvasHitTester.d.ts +2 -2
  184. package/dist/components/stream/OrdinalPipelineStore.d.ts +13 -13
  185. package/dist/components/stream/OrdinalSVGOverlay.d.ts +9 -1
  186. package/dist/components/stream/OrdinalStyleResolver.d.ts +12 -0
  187. package/dist/components/stream/ParticlePool.d.ts +1 -1
  188. package/dist/components/stream/PipelineStore.d.ts +12 -16
  189. package/dist/components/stream/SVGOverlay.d.ts +6 -0
  190. package/dist/components/stream/SceneGraph.d.ts +3 -3
  191. package/dist/components/stream/XYBrushOverlayLazy.d.ts +17 -0
  192. package/dist/components/stream/accessorUtils.d.ts +2 -2
  193. package/dist/components/stream/annotationAccessorResolver.d.ts +2 -2
  194. package/dist/components/stream/frameGraphics.d.ts +4 -0
  195. package/dist/components/stream/frameKeyboardNavigation.d.ts +45 -0
  196. package/dist/components/stream/geoPipelineHelpers.d.ts +3 -3
  197. package/dist/components/stream/geoPipelineUpdateResults.d.ts +34 -0
  198. package/dist/components/stream/geoSceneBuilder.d.ts +16 -0
  199. package/dist/components/stream/geoTypes.d.ts +48 -15
  200. package/dist/components/stream/hitTestUtils.d.ts +2 -2
  201. package/dist/components/stream/hoverUtils.d.ts +4 -2
  202. package/dist/components/stream/layouts/forceLayoutWorkerClient.d.ts +1 -0
  203. package/dist/components/stream/layouts/hierarchyUtils.d.ts +2 -2
  204. package/dist/components/stream/networkCustomLayoutRunner.d.ts +23 -0
  205. package/dist/components/stream/networkCustomRestyle.d.ts +15 -0
  206. package/dist/components/stream/networkFrameAnimation.d.ts +7 -0
  207. package/dist/components/stream/networkFrameHandleTypes.d.ts +39 -0
  208. package/dist/components/stream/networkFrameObservations.d.ts +15 -0
  209. package/dist/components/stream/networkFramePaint.d.ts +11 -2
  210. package/dist/components/stream/networkInteractionTypes.d.ts +26 -0
  211. package/dist/components/stream/networkPipelineConfig.d.ts +2 -2
  212. package/dist/components/stream/networkPipelineUpdateResults.d.ts +38 -0
  213. package/dist/components/stream/networkTypes.d.ts +37 -56
  214. package/dist/components/stream/ordinalCanvasRenderers.d.ts +2 -2
  215. package/dist/components/stream/ordinalPipelineUpdateResults.d.ts +20 -1
  216. package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -2
  217. package/dist/components/stream/ordinalTypes.d.ts +30 -3
  218. package/dist/components/stream/physics/PhysicsPipelineStore.d.ts +2 -0
  219. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +6 -0
  220. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +21 -6
  221. package/dist/components/stream/physics/physicsFrameObservations.d.ts +19 -0
  222. package/dist/components/stream/physics/physicsFrameSetup.d.ts +4 -0
  223. package/dist/components/stream/physics/physicsPipelineUpdateResults.d.ts +19 -1
  224. package/dist/components/stream/physics/usePhysicsFrameLifecyclePolicy.d.ts +3 -1
  225. package/dist/components/stream/pipelineConfig.d.ts +4 -2
  226. package/dist/components/stream/pipelineDecay.d.ts +2 -2
  227. package/dist/components/stream/pipelinePulse.d.ts +2 -2
  228. package/dist/components/stream/pipelineStoreUpdateResults.d.ts +23 -2
  229. package/dist/components/stream/pipelineTransitions.d.ts +1 -1
  230. package/dist/components/stream/pipelineUpdateContract.d.ts +7 -0
  231. package/dist/components/stream/pipelineUpdateStore.d.ts +21 -0
  232. package/dist/components/stream/renderBackend.d.ts +27 -0
  233. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +15 -1
  234. package/dist/components/stream/renderers/geoCanvasRenderer.d.ts +3 -2
  235. package/dist/components/stream/renderers/networkParticleRenderer.d.ts +1 -1
  236. package/dist/components/stream/sceneRenderBackendTypes.d.ts +28 -0
  237. package/dist/components/stream/sceneRevisionDiagnostics.d.ts +31 -4
  238. package/dist/components/stream/streamSemanticTypes.d.ts +16 -0
  239. package/dist/components/stream/streamThemeTypes.d.ts +14 -0
  240. package/dist/components/stream/svgOverlayUtils.d.ts +10 -0
  241. package/dist/components/stream/test-utils/frameScheduler.d.ts +12 -0
  242. package/dist/components/stream/test-utils/revisionConsumption.d.ts +13 -0
  243. package/dist/components/stream/titleLayout.d.ts +31 -0
  244. package/dist/components/stream/types.d.ts +30 -65
  245. package/dist/components/stream/useCanvasFrameHost.d.ts +71 -0
  246. package/dist/components/stream/useFrame.d.ts +23 -0
  247. package/dist/components/stream/useLegendCategoryEmission.d.ts +3 -3
  248. package/dist/components/stream/useSemanticFrameInteractions.d.ts +22 -0
  249. package/dist/components/stream/useUpdateResultSnapshot.d.ts +7 -0
  250. package/dist/components/stream/xyFrameAxisTypes.d.ts +50 -0
  251. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -5
  252. package/dist/controls.min.js +1 -1
  253. package/dist/controls.module.min.js +1 -1
  254. package/dist/forceLayoutWorker.js +1 -1
  255. package/dist/geo.min.js +1 -1
  256. package/dist/geo.module.min.js +1 -1
  257. package/dist/network.min.js +1 -1
  258. package/dist/network.module.min.js +1 -1
  259. package/dist/ordinal.min.js +1 -1
  260. package/dist/ordinal.module.min.js +1 -1
  261. package/dist/physics-matter.min.js +1 -1
  262. package/dist/physics-matter.module.min.js +1 -1
  263. package/dist/physics-rapier.min.js +1 -1
  264. package/dist/physics-rapier.module.min.js +1 -1
  265. package/dist/physics.min.js +1 -1
  266. package/dist/physics.module.min.js +1 -1
  267. package/dist/physicsWorker.js +1 -1
  268. package/dist/realtime.min.js +1 -1
  269. package/dist/realtime.module.min.js +1 -1
  270. package/dist/rough.min.js +1 -0
  271. package/dist/rough.module.min.js +1 -0
  272. package/dist/semiotic-ai-core.min.js +1 -1
  273. package/dist/semiotic-ai-core.module.min.js +1 -1
  274. package/dist/semiotic-ai.d.ts +3 -1
  275. package/dist/semiotic-ai.min.js +1 -1
  276. package/dist/semiotic-ai.module.min.js +1 -1
  277. package/dist/semiotic-controls.d.ts +2 -0
  278. package/dist/semiotic-data.min.js +1 -1
  279. package/dist/semiotic-data.module.min.js +1 -1
  280. package/dist/semiotic-experimental.min.js +1 -1
  281. package/dist/semiotic-experimental.module.min.js +1 -1
  282. package/dist/semiotic-geo.d.ts +4 -0
  283. package/dist/semiotic-network.d.ts +4 -0
  284. package/dist/semiotic-ordinal.d.ts +6 -0
  285. package/dist/semiotic-physics.d.ts +4 -0
  286. package/dist/semiotic-realtime-core.min.js +1 -1
  287. package/dist/semiotic-realtime-core.module.min.js +1 -1
  288. package/dist/semiotic-realtime-react.min.js +1 -1
  289. package/dist/semiotic-realtime-react.module.min.js +1 -1
  290. package/dist/semiotic-recipes-core.min.js +1 -1
  291. package/dist/semiotic-recipes-core.module.min.js +1 -1
  292. package/dist/semiotic-recipes-react.min.js +1 -1
  293. package/dist/semiotic-recipes-react.module.min.js +1 -1
  294. package/dist/semiotic-recipes.min.js +1 -1
  295. package/dist/semiotic-recipes.module.min.js +1 -1
  296. package/dist/semiotic-rough.d.ts +4 -0
  297. package/dist/semiotic-server-edge.min.js +1 -1
  298. package/dist/semiotic-server-edge.module.min.js +1 -1
  299. package/dist/semiotic-server-node.min.js +1 -1
  300. package/dist/semiotic-server-node.module.min.js +1 -1
  301. package/dist/semiotic-themes-core.min.js +1 -1
  302. package/dist/semiotic-themes-core.module.min.js +1 -1
  303. package/dist/semiotic-themes-react.min.js +1 -1
  304. package/dist/semiotic-themes-react.module.min.js +1 -1
  305. package/dist/semiotic-themes.min.js +1 -1
  306. package/dist/semiotic-themes.module.min.js +1 -1
  307. package/dist/semiotic-utils-core.d.ts +4 -0
  308. package/dist/semiotic-utils-core.min.js +1 -1
  309. package/dist/semiotic-utils-core.module.min.js +1 -1
  310. package/dist/semiotic-utils-react.min.js +1 -1
  311. package/dist/semiotic-utils-react.module.min.js +1 -1
  312. package/dist/semiotic-utils.min.js +1 -1
  313. package/dist/semiotic-utils.module.min.js +1 -1
  314. package/dist/semiotic-value.min.js +1 -1
  315. package/dist/semiotic-value.module.min.js +1 -1
  316. package/dist/semiotic-xy.d.ts +4 -0
  317. package/dist/semiotic.d.ts +9 -1
  318. package/dist/semiotic.min.js +1 -1
  319. package/dist/semiotic.module.min.js +1 -1
  320. package/dist/server.min.js +1 -1
  321. package/dist/server.module.min.js +1 -1
  322. package/dist/test-utils/capturedFrameProps.d.ts +67 -0
  323. package/dist/test-utils/frameMock.d.ts +12 -9
  324. package/dist/xy.min.js +1 -1
  325. package/dist/xy.module.min.js +1 -1
  326. package/package.json +29 -10
  327. package/dist/semiotic-ai-statisticalOverlays-CY4WKR4A.module.min.js +0 -2
  328. package/dist/semiotic-chunk-3FSVZ46U.module.min.js +0 -2
  329. package/dist/semiotic-statisticalOverlays-UOMSFKVJ.module.min.js +0 -2
  330. package/dist/xy-chunk-IWD6IB6V.module.min.js +0 -2
  331. package/dist/xy-statisticalOverlays-7RWG6LJT.module.min.js +0 -2
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { Datum } from "../shared/datumTypes";
3
+ import type { StyleRule } from "../shared/styleRules";
3
4
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
4
5
  import { type PhysicalFlowCoordinateMode, type PhysicalFlowPathConstraint, type PhysicalFlowRawPath } from "./physicsChartUtils";
5
6
  import { type PhysicsFrameHandle } from "./physicsHocHandle";
@@ -28,6 +29,12 @@ export interface PhysicalFlowChartProps<TNode extends Datum = Datum, TLink exten
28
29
  showNodeLabels?: boolean;
29
30
  showSensors?: boolean;
30
31
  colorBy?: ChartAccessor<TLink, string>;
32
+ /**
33
+ * Declarative, threshold-aware particle styling. Ordered `{ when, style }`
34
+ * rules layer over the `colorBy` fill; last applicable rule wins. `ctx` =
35
+ * `{ value, category }`, where value is throughput and category is colorBy.
36
+ */
37
+ styleRules?: StyleRule[];
31
38
  seed?: number;
32
39
  tooltip?: TooltipProp;
33
40
  paused?: boolean;
@@ -1,16 +1,17 @@
1
1
  import * as React from "react";
2
2
  import type { ReactNode } from "react";
3
- import { type ScaleLinear } from "d3-scale";
3
+ import type { ScaleLinear } from "d3-scale";
4
4
  import type { ThemeSemanticColors } from "../../stream/types";
5
5
  import { type PhysicsSemanticItem, type StreamPhysicsBodyForce, type StreamPhysicsFrameProps, type StreamPhysicsRegionEffect } from "../../stream/physics/StreamPhysicsFrame";
6
6
  import type { PhysicsController } from "../../stream/physics/PhysicsControllers";
7
- import { PhysicsPipelineStore, type PhysicsPipelineConfig, type PhysicsQueuedSpawn, type PhysicsSpawnPacingOptions } from "../../stream/physics/PhysicsPipelineStore";
7
+ import type { PhysicsPipelineStore, PhysicsPipelineConfig, PhysicsQueuedSpawn, PhysicsSpawnPacingOptions } from "../../stream/physics/PhysicsPipelineStore";
8
8
  import type { PhysicsColliderSpec, PhysicsSpringSpec } from "../../stream/physics/PhysicsKernel";
9
9
  import type { Datum } from "../shared/datumTypes";
10
10
  import type { BaseChartProps, ChartAccessor } from "../shared/types";
11
- import { type PhysicsChartArea } from "./physicsChartUtils";
11
+ import type { PhysicsChartArea } from "./physicsChartUtils";
12
12
  import { type PhysicsDatumSpawnResult, type PhysicsFrameHandle } from "./physicsHocHandle";
13
13
  import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type TooltipProp } from "./physicsHocUtils";
14
+ export { resolveCustomLayout } from "./physicsCustomLayout";
14
15
  export interface PhysicsCustomLayoutContext<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> {
15
16
  data: TDatum[];
16
17
  scales: {
@@ -91,28 +92,6 @@ export interface PhysicsCustomChartProps<TDatum extends Datum = Datum, TConfig e
91
92
  */
92
93
  frameProps?: PhysicsHocFrameProps<"config">;
93
94
  }
94
- interface ResolvedPhysicsCustomLayout<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> {
95
- config: PhysicsPipelineConfig;
96
- context: PhysicsCustomLayoutContext<TDatum, TConfig>;
97
- initialSpawnPacing?: PhysicsSpawnPacingOptions;
98
- initialSpawns: PhysicsQueuedSpawn[];
99
- result: PhysicsCustomLayoutResult;
100
- }
101
- export declare function resolveCustomLayout<TDatum extends Datum, TConfig extends object>(options: {
102
- chartId?: string;
103
- colorScheme?: string | string[] | Record<string, string>;
104
- config?: PhysicsPipelineConfig;
105
- data: TDatum[];
106
- layout: PhysicsCustomLayout<TDatum, TConfig>;
107
- layoutConfig?: TConfig;
108
- onObservation?: BaseChartProps["onObservation"];
109
- semantic: ThemeSemanticColors;
110
- skipLayout?: boolean;
111
- size: [number, number];
112
- themeCategorical: string[];
113
- xExtent?: [number, number];
114
- yExtent?: [number, number];
115
- }): ResolvedPhysicsCustomLayout<TDatum, TConfig>;
116
95
  export declare const PhysicsCustomChart: {
117
96
  <TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>>(props: PhysicsCustomChartProps<TDatum, TConfig> & React.RefAttributes<PhysicsFrameHandle>): React.ReactElement | null;
118
97
  displayName?: string;
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { Datum } from "../shared/datumTypes";
3
3
  import type { BaseChartProps, ChartAccessor, ChartMode } from "../shared/types";
4
+ import type { StyleRule } from "../shared/styleRules";
4
5
  import { type PhysicsFrameHandle } from "./physicsHocHandle";
5
6
  import { type PhysicsHocFrameProps, type PhysicsSharedChartProps, type PhysicsSimulationMode, type TooltipProp } from "./physicsHocUtils";
6
7
  export interface PhysicsPileChartProps<TDatum extends Datum = Datum> extends Omit<BaseChartProps, "margin" | "mode">, PhysicsSharedChartProps {
@@ -19,6 +20,12 @@ export interface PhysicsPileChartProps<TDatum extends Datum = Datum> extends Omi
19
20
  unitValue?: number;
20
21
  ballRadius?: number;
21
22
  colorBy?: ChartAccessor<TDatum, string>;
23
+ /**
24
+ * Declarative, threshold-aware body styling. Ordered `{ when, style }`
25
+ * rules; last applicable rule wins. `ctx` = `{ value, category }`. A rule
26
+ * `fill` may be a color or a HatchFill. Layers over the colorBy-derived fill.
27
+ */
28
+ styleRules?: StyleRule[];
22
29
  seed?: number;
23
30
  showProjection?: boolean;
24
31
  sediment?: boolean;
@@ -1,6 +1,7 @@
1
1
  import type { Datum } from "../shared/datumTypes";
2
2
  import type { ChartAccessor } from "../shared/types";
3
3
  import type { Style } from "../../stream/types";
4
+ import { type StyleRule } from "../shared/styleRules";
4
5
  import type { PhysicsColliderSpec } from "../../stream/physics/PhysicsKernel";
5
6
  import type { PhysicsPipelineConfig, PhysicsQueuedSpawn, PhysicsSpawnPacingOptions } from "../../stream/physics/PhysicsPipelineStore";
6
7
  import type { PhysicsSemanticItem } from "../../stream/physics/StreamPhysicsTypes";
@@ -27,7 +28,22 @@ export interface PhysicsChartArea {
27
28
  }
28
29
  export declare function physicsChartArea(size: [number, number]): PhysicsChartArea;
29
30
  export declare function hashStringColor(value: unknown): string;
30
- export declare function styleFromColorAccessor<TDatum extends Datum>(colorBy: ChartAccessor<TDatum, string> | undefined, fallback?: string): (body: {
31
+ export interface PhysicsStyleRuleOptions {
32
+ /** Declarative style rules, merged on top of the colorBy-derived body fill. */
33
+ styleRules?: ReadonlyArray<StyleRule>;
34
+ /** Numeric field/accessor a threshold rule compares against (defaults to `value`). */
35
+ valueAccessor?: string | ((d: Datum) => unknown);
36
+ }
37
+ /**
38
+ * Build a per-body `bodyStyle` from a `colorBy` accessor. When `styleRules`
39
+ * are supplied, the merged rule style layers on top of the colorBy-derived
40
+ * fill (last-applicable rule wins) — the physics counterpart to the ordinal
41
+ * bar `styleRules`. Rules resolve against the body's original `datum`; `ctx` =
42
+ * `{ value, category }` where `category` is the colorBy group. Because every
43
+ * colorBy-driven physics HOC and its SSR config funnel through this helper,
44
+ * one call wires rules for all of them.
45
+ */
46
+ export declare function styleFromColorAccessor<TDatum extends Datum>(colorBy: ChartAccessor<TDatum, string> | undefined, fallback?: string, opts?: PhysicsStyleRuleOptions): (body: {
31
47
  datum?: unknown;
32
48
  }) => Style;
33
49
  export declare function baseConfig(seed: number, colliders: PhysicsColliderSpec[], chartType: string, kernel?: Partial<NonNullable<PhysicsPipelineConfig["kernel"]>>): PhysicsPipelineConfig;
@@ -0,0 +1,32 @@
1
+ import type { ThemeSemanticColors } from "../../stream/types";
2
+ import { type PhysicsPipelineConfig, type PhysicsQueuedSpawn, type PhysicsSpawnPacingOptions } from "../../stream/physics/PhysicsPipelineStore";
3
+ import type { Datum } from "../shared/datumTypes";
4
+ import type { BaseChartProps } from "../shared/types";
5
+ import type { PhysicsCustomLayout, PhysicsCustomLayoutContext, PhysicsCustomLayoutResult } from "./PhysicsCustomChart";
6
+ interface ResolvedPhysicsCustomLayout<TDatum extends Datum = Datum, TConfig extends object = Record<string, unknown>> {
7
+ config: PhysicsPipelineConfig;
8
+ context: PhysicsCustomLayoutContext<TDatum, TConfig>;
9
+ initialSpawnPacing?: PhysicsSpawnPacingOptions;
10
+ initialSpawns: PhysicsQueuedSpawn[];
11
+ result: PhysicsCustomLayoutResult;
12
+ }
13
+ /**
14
+ * Resolve the pure PhysicsCustomChart layout contract without importing the
15
+ * React HOC. Shared by the component and the static server renderer.
16
+ */
17
+ export declare function resolveCustomLayout<TDatum extends Datum, TConfig extends object>(options: {
18
+ chartId?: string;
19
+ colorScheme?: string | string[] | Record<string, string>;
20
+ config?: PhysicsPipelineConfig;
21
+ data: TDatum[];
22
+ layout: PhysicsCustomLayout<TDatum, TConfig>;
23
+ layoutConfig?: TConfig;
24
+ onObservation?: BaseChartProps["onObservation"];
25
+ semantic: ThemeSemanticColors;
26
+ skipLayout?: boolean;
27
+ size: [number, number];
28
+ themeCategorical: string[];
29
+ xExtent?: [number, number];
30
+ yExtent?: [number, number];
31
+ }): ResolvedPhysicsCustomLayout<TDatum, TConfig>;
32
+ export {};
@@ -0,0 +1,88 @@
1
+ /**
2
+ * `<AnnotationLabel>` — the single, shared renderer for the text label of a
3
+ * region-bounding annotation (threshold lines, bands, enclosures, category
4
+ * highlights) across every frame and the server SSR path.
5
+ *
6
+ * Two problems it solves:
7
+ * 1. **Legibility.** A label sitting over dense marks needs a backdrop to
8
+ * stay readable. Historically the region rules hand-rolled a
9
+ * `paint-order: stroke` white "halo" inline — and only some of them, and
10
+ * the client and server disagreed (client `y-threshold` had a halo, the
11
+ * server's didn't). This component makes the halo a first-class,
12
+ * consistent option and adds a genuine semitransparent **box** backdrop
13
+ * (the rounded panel behind a label like "Fast-scaling · 10").
14
+ * 2. **Duplication.** Client (`annotationRules.tsx`) and server
15
+ * (`staticAnnotations.tsx`) both emit label `<text>`; routing both through
16
+ * one component removes the drift.
17
+ *
18
+ * `background` is the knob:
19
+ * - `"halo"` / `true` — a stroke halo (default for region annotations; matches
20
+ * the legacy look byte-for-byte when `haloColor`/`haloWidth` are unset)
21
+ * - `"box"` — a filled, optionally-semitransparent rounded rect behind the text
22
+ * - `"none"` / `false` — plain text
23
+ * - a config object — fine-grained control over either treatment
24
+ *
25
+ * The box's geometry is derived from an *estimated* text width (SVG can't
26
+ * measure text without a live DOM, and the server path has none), which is
27
+ * accurate enough for a padded backdrop and identical on both backends.
28
+ */
29
+ import * as React from "react";
30
+ export interface AnnotationLabelBackgroundConfig {
31
+ /** Backdrop treatment. @default "halo" */
32
+ type?: "halo" | "box";
33
+ /**
34
+ * Backdrop paint. For `"halo"` it is the outline color (defaults to the
35
+ * plot background so the halo "erases" marks under the text). For `"box"`
36
+ * it is the panel fill.
37
+ * @default "var(--semiotic-bg, #ffffff)"
38
+ */
39
+ fill?: string;
40
+ /** Box fill opacity (box mode only). @default 0.85 */
41
+ opacity?: number;
42
+ /** Box inner padding in px — number (uniform) or `{x,y}`. @default {x:6,y:3} */
43
+ padding?: number | {
44
+ x: number;
45
+ y: number;
46
+ };
47
+ /** Box corner radius in px. @default 3 */
48
+ radius?: number;
49
+ /** Box border color (box mode only). */
50
+ stroke?: string;
51
+ /** Box border width in px. @default 0 */
52
+ strokeWidth?: number;
53
+ /** Halo stroke width in px (halo mode only). @default 3 */
54
+ haloWidth?: number;
55
+ }
56
+ export type AnnotationLabelBackground = boolean | "halo" | "box" | "none" | AnnotationLabelBackgroundConfig;
57
+ export interface AnnotationLabelProps {
58
+ x: number;
59
+ y: number;
60
+ text: string | number;
61
+ /** Text color. */
62
+ fill: string;
63
+ fontSize?: number;
64
+ fontWeight?: string | number;
65
+ fontFamily?: string;
66
+ textAnchor?: "start" | "middle" | "end";
67
+ dominantBaseline?: React.SVGAttributes<SVGTextElement>["dominantBaseline"];
68
+ /**
69
+ * Backdrop treatment. Defaults to `"halo"` (the legacy region-label look).
70
+ * Pass `"box"` for a semitransparent panel, `"none"` for plain text, or a
71
+ * config object for fine control.
72
+ */
73
+ background?: AnnotationLabelBackground;
74
+ className?: string;
75
+ }
76
+ /**
77
+ * Rough width of a rendered label. SVG offers no synchronous text metrics
78
+ * (and the server has no DOM at all), so we estimate from character count.
79
+ * ~0.6em per glyph is a reasonable average for the sans-serif UI faces this
80
+ * library ships; the box carries padding, so a small error is invisible.
81
+ */
82
+ export declare function estimateLabelWidth(text: string | number, fontSize: number): number;
83
+ /**
84
+ * Render an annotation's text label with an optional legibility backdrop.
85
+ * Emits a bare `<text>` (halo/none) or a `<g>` with a backing `<rect>` + text
86
+ * (box). Safe on both the client SVG overlay and the server static SVG path.
87
+ */
88
+ export declare function AnnotationLabel(props: AnnotationLabelProps): React.ReactElement;
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import type { Datum } from "./datumTypes";
3
+ import type { OnObservationCallback, ObservationInputType } from "../../store/ObservationStore";
4
+ export type ChartAnnotation = Datum;
5
+ export interface AnnotationActivationEvent {
6
+ annotation: ChartAnnotation;
7
+ annotationId?: string;
8
+ chartId?: string;
9
+ inputType: ObservationInputType;
10
+ }
11
+ export type OnAnnotationActivateCallback = (event: AnnotationActivationEvent) => void;
12
+ export interface AnnotationActivationOptions {
13
+ onAnnotationActivate?: OnAnnotationActivateCallback;
14
+ onObservation?: OnObservationCallback;
15
+ chartId?: string;
16
+ chartType?: string;
17
+ }
18
+ /** Route annotation activation to both a direct callback and the observation store. */
19
+ export declare function useAnnotationActivationOptions(options: AnnotationActivationOptions): AnnotationActivationOptions;
20
+ /**
21
+ * Resolve a durable annotation identity without ever falling back to array
22
+ * position. Provenance stable IDs are accepted for agent-authored notes.
23
+ */
24
+ export declare function annotationStableId(annotation: ChartAnnotation): string | undefined;
25
+ /**
26
+ * Event props for a widget's existing HTML boundary. Capture phase observes
27
+ * arbitrary descendant controls without replacing their behavior or adding a
28
+ * nested interactive element.
29
+ */
30
+ export declare function annotationActivationProps(annotation: ChartAnnotation, options?: AnnotationActivationOptions): React.HTMLAttributes<HTMLDivElement> & {
31
+ "data-semiotic-annotation-id"?: string;
32
+ "data-semiotic-annotation-widget": "";
33
+ };
34
+ /** True when a bubbled frame click originated inside a widget annotation. */
35
+ export declare function isAnnotationActivationTarget(target: EventTarget | null): boolean;
@@ -0,0 +1,5 @@
1
+ export declare const TOP_LABEL_BASELINE = 16;
2
+ /** Keep a horizontal-threshold label inside the plot when its rule is near the top. */
3
+ export declare function thresholdLabelY(y: number, height: number): number;
4
+ /** Place a horizontal-band label just inside its visible top edge. */
5
+ export declare function bandLabelY(y0: number, y1: number): number;
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import type { AnnotationContext } from "../../realtime/types";
3
3
  import type { Datum } from "./datumTypes";
4
+ import { type AnnotationActivationOptions } from "./annotationActivation";
4
5
  export { applyAnnotationEmphasis, type AnnotationRenderPair } from "./annotationHierarchy";
5
6
  type AnnotationRule = (annotation: Datum, index: number, context: AnnotationContext) => React.ReactNode | null;
6
7
  /**
@@ -17,4 +18,4 @@ type AnnotationRule = (annotation: Datum, index: number, context: AnnotationCont
17
18
  * through to the default rule, preserving the existing override contract.
18
19
  */
19
20
  export declare function renderAnnotationPass(annotations: ReadonlyArray<Datum>, defaultRule: AnnotationRule, userRule: AnnotationRule | undefined, context: AnnotationContext): React.ReactNode[];
20
- export declare function createDefaultAnnotationRules(_frameType: "xy" | "ordinal" | "network"): (annotation: Datum, index: number, context: AnnotationContext) => React.ReactNode | null;
21
+ export declare function createDefaultAnnotationRules(_frameType: "xy" | "ordinal" | "network", activation?: AnnotationActivationOptions): (annotation: Datum, index: number, context: AnnotationContext) => React.ReactNode | null;
@@ -0,0 +1,13 @@
1
+ import type { A11yFinding } from "./auditAccessibility";
2
+ import type { Datum } from "./datumTypes";
3
+ export declare function isNonEmptyString(value: unknown): value is string;
4
+ /**
5
+ * Only declared chart props can be credited as rendered accessibility text.
6
+ * This keeps the audit aligned with the generated prop schema and validation.
7
+ */
8
+ export declare function assessAccessibilityText(component: string, props: Datum): {
9
+ hasTitle: boolean;
10
+ hasDescription: boolean;
11
+ hasSummary: boolean;
12
+ unsupportedFinding: A11yFinding | undefined;
13
+ };
@@ -0,0 +1,4 @@
1
+ import type { Datum } from "./datumTypes";
2
+ export declare function resolveHoverXPosition(interactionDatum: Datum, datum: Datum | null | undefined, xField: string): number | null;
3
+ export declare function observationDatum(interactionDatum: Datum): Datum;
4
+ export declare function hasOwnEnumerableKey(value: object | undefined | null): boolean;
@@ -6,9 +6,9 @@
6
6
  * - `src/components/charts/shared/validationMap.ts` (runtime prop validation)
7
7
  * - `ai/componentMetadata.cjs` (category buckets)
8
8
  *
9
- * Today, `validationMap.ts` is derived directly from this registry, and
10
- * `ai/schema.json` is generated from it — run `npm run docs:chart-specs:schema`
11
- * to refresh the schema after editing a spec. `componentMetadata.cjs` is still
9
+ * Today, `validationMap.generated.ts` and `ai/schema.json` are generated from
10
+ * this registry — run `npm run docs:chart-specs:schema` to refresh both after
11
+ * editing a spec. `componentMetadata.cjs` is still
12
12
  * hand-edited but gated for parity by the registry: `check:chart-specs` (run
13
13
  * via `npm run check:chart-specs`) regenerates each chart's schema/
14
14
  * validation/metadata entries with the pure functions in
@@ -18,3 +18,5 @@
18
18
  * reason" referenced by the lint policy for `@typescript-eslint/no-explicit-any`.
19
19
  */
20
20
  export type Datum = Record<string, any>;
21
+ /** Values that can be returned by a chart accessor or stored in a datum field. */
22
+ export type DatumValue = string | number | boolean | Date | Datum | Datum[] | null | undefined;
@@ -1,4 +1,6 @@
1
1
  import type { Datum } from "./datumTypes";
2
2
  import type { Diagnosis } from "./diagnoseTypes";
3
+ /** Interactive widgets need durable identity for replay and normalized events. */
4
+ export declare function checkInteractiveAnnotationIds(_component: string, props: Datum, out: Diagnosis[]): void;
3
5
  export declare function checkAnnotationConnectors(_component: string, props: Datum, out: Diagnosis[]): void;
4
6
  export declare function checkAnnotationDensity(_component: string, props: Datum, out: Diagnosis[]): void;
@@ -58,7 +58,7 @@ export declare function formatAxis(type?: "number" | "date" | "percent" | "curre
58
58
  * )
59
59
  * ```
60
60
  */
61
- export declare function createTooltip(fields: string[], formatters?: Record<string, (v: any) => string>, labels?: Record<string, string>): (d: Datum) => React.JSX.Element;
61
+ export declare function createTooltip(fields: string[], formatters?: Record<string, (value: string | number | Date) => string>, labels?: Record<string, string>): (d: Datum) => React.JSX.Element;
62
62
  /**
63
63
  * Formats large numbers with K/M/B suffixes
64
64
  *
@@ -85,7 +85,7 @@ export declare function formatLargeNumber(value: number, decimals?: number): str
85
85
  *
86
86
  * Used as the default axis tickFormat when no explicit format is provided.
87
87
  */
88
- export declare function smartTickFormat(value: any): string;
88
+ export declare function smartTickFormat(value: string | number | Date | null | undefined): string;
89
89
  type TimeGranularity = "seconds" | "minutes" | "hours" | "days" | "months" | "years";
90
90
  /**
91
91
  * Creates a hierarchical time axis formatter.
@@ -112,7 +112,7 @@ type TimeGranularity = "seconds" | "minutes" | "hours" | "days" | "months" | "ye
112
112
  * <LineChart data={ts} xFormat={adaptiveTimeTicks("minutes")} />
113
113
  * ```
114
114
  */
115
- export declare function adaptiveTimeTicks(granularity?: TimeGranularity): (value: any, index?: number, allTicks?: number[]) => string;
115
+ export declare function adaptiveTimeTicks(granularity?: TimeGranularity): (value: string | number | Date, index?: number, allTicks?: number[]) => string;
116
116
  /**
117
117
  * Truncates text to specified length with ellipsis
118
118
  *
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Declarative hatch-fill descriptor — a single value that renders as a
3
+ * diagonal-line pattern on BOTH rendering backends.
4
+ *
5
+ * The library historically had two disjoint hatch primitives: a canvas
6
+ * `createHatchPattern` (→ `CanvasPattern`) and an SVG `<pattern>` builder
7
+ * (`hatchFill` recipe / `createSVGHatchPattern`). A caller had to know
8
+ * which medium they were painting into and hand-produce the right thing —
9
+ * which is why a `CanvasPattern` returned from a `pieceStyle` silently
10
+ * collapses to a solid color in SSR (`svgFill` drops non-string fills).
11
+ *
12
+ * `HatchFill` closes that gap: it is a plain, serializable descriptor that
13
+ * can be set directly as `style.fill`. The canvas renderer resolves it to a
14
+ * `CanvasPattern` (`resolveHatchCanvasPattern`); the SVG serializer resolves
15
+ * it to a `<pattern>` def + `url(#id)` (`hatchPatternDef` / `hatchFillId`).
16
+ * One declaration, both mediums — so a bar hatched via a style rule looks
17
+ * identical whether it is drawn to canvas in the browser or serialized to
18
+ * SVG on the server.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * <BarChart
23
+ * styleRules={[
24
+ * { when: { gt: 10 }, style: { fill: { type: "hatch", background: "#ffd166", stroke: "#e0a92a" } } },
25
+ * ]}
26
+ * />
27
+ * ```
28
+ */
29
+ import * as React from "react";
30
+ /**
31
+ * A declarative diagonal-hatch fill. Assign it anywhere a `style.fill`
32
+ * is accepted (`pieceStyle`, `styleRules`, annotation region `fill`).
33
+ * Backend-agnostic: resolved to a `CanvasPattern` for canvas and an SVG
34
+ * `<pattern>` for SSR / the SVG overlay.
35
+ */
36
+ export interface HatchFill {
37
+ /** Discriminator — marks this fill as a hatch descriptor. */
38
+ type: "hatch";
39
+ /** Tile background color painted under the lines. @default "transparent" */
40
+ background?: string;
41
+ /** Color of the diagonal lines. @default "#000" */
42
+ stroke?: string;
43
+ /** Width of the diagonal lines in px. @default 1.5 */
44
+ lineWidth?: number;
45
+ /** Spacing between lines in px. @default 6 */
46
+ spacing?: number;
47
+ /** Angle of the lines in degrees (0 = horizontal, 45 = diagonal). @default 45 */
48
+ angle?: number;
49
+ /** Opacity applied to the hatch lines (SVG `<line>` stroke opacity). @default 1 */
50
+ lineOpacity?: number;
51
+ }
52
+ /** Type guard — is a resolved `style.fill` a `HatchFill` descriptor? */
53
+ export declare function isHatchFill(fill: unknown): fill is HatchFill;
54
+ /**
55
+ * Stable, content-derived key for a hatch descriptor. Used to cache canvas
56
+ * patterns and to mint deterministic SVG `<pattern>` ids so identical
57
+ * descriptors dedupe rather than proliferate.
58
+ */
59
+ export declare function hatchFillKey(h: HatchFill): string;
60
+ /** Deterministic, SVG-id-safe identifier for a hatch descriptor. */
61
+ export declare function hatchFillId(prefix: string, h: HatchFill): string;
62
+ /**
63
+ * Resolve a `HatchFill` descriptor to a `CanvasPattern` for the given
64
+ * context. Cached by descriptor content + DPR. Returns `null` only when
65
+ * the environment can't create a pattern (SSR/test) — callers fall back
66
+ * to the descriptor's `background` color.
67
+ */
68
+ export declare function resolveHatchCanvasPattern(h: HatchFill, ctx: CanvasRenderingContext2D): CanvasPattern | null;
69
+ /**
70
+ * Render a `HatchFill` descriptor as an SVG `<pattern>` element.
71
+ * Place the returned element inside `<defs>` (or anywhere valid) and set
72
+ * `fill="url(#id)"` on the target shape. Mirrors the canvas tile exactly:
73
+ * parallel lines rotated by `angle` so the two backends read identically.
74
+ */
75
+ export declare function hatchPatternDef(h: HatchFill, id: string): React.ReactElement;
76
+ /**
77
+ * Resolve a `style.fill` for an SVG shape. Returns the paint string to use
78
+ * plus, when the fill is a `HatchFill`, the `<pattern>` def to inject.
79
+ *
80
+ * @param fill the raw `style.fill` (string color, `HatchFill`, or `CanvasPattern`)
81
+ * @param idBase prefix for the generated pattern id (should be node-unique-ish)
82
+ * @param fallback solid color used when `fill` is null/undefined or a raw CanvasPattern
83
+ */
84
+ export declare function resolveSvgFill(fill: string | HatchFill | CanvasPattern | null | undefined, idBase: string, fallback?: string): {
85
+ fill: string;
86
+ def?: React.ReactElement;
87
+ };
@@ -7,6 +7,7 @@ import type { TransitionConfig } from "../../stream/types";
7
7
  import type { Datum } from "./datumTypes";
8
8
  import type { MobileVisualizationContract } from "./auditMobileVisualization";
9
9
  import type { ResponsiveRule } from "./responsiveRules";
10
+ import type { SemanticClickBehavior, SemanticHoverBehavior } from "./semanticInteractions";
10
11
  /**
11
12
  * Default fill color used when no colorBy is specified
12
13
  */
@@ -46,13 +47,13 @@ export declare function resolveDefaultFill(color: string | undefined, themeCateg
46
47
  * Resolve an accessor (string key or function) into a function.
47
48
  * Used across chart components to normalize `valueAccessor`, `categoryAccessor`, etc.
48
49
  */
49
- export declare function resolveAccessor<T = any>(accessor: string | ((d: Datum, i?: number) => T)): (d: Datum) => T;
50
+ export declare function resolveAccessor<T = string | number | boolean | Date | Datum | null | undefined>(accessor: string | ((d: Datum, i?: number) => T)): (d: Datum) => T;
50
51
  /**
51
52
  * Hook to create a color scale from data and colorBy configuration.
52
53
  * Returns undefined when colorBy is absent or data is empty (push API mode).
53
54
  * Supports both string and function accessors for colorBy.
54
55
  */
55
- export declare function useColorScale(data: Array<Datum>, colorBy: string | ((d: any, i?: number) => any) | undefined, colorScheme?: string | string[] | Record<string, string>): ((v: string) => string) | undefined;
56
+ export declare function useColorScale(data: Array<Datum>, colorBy: string | ((d: Datum, i?: number) => string | number) | undefined, colorScheme?: string | string[] | Record<string, string>): ((v: string) => string) | undefined;
56
57
  /**
57
58
  * Hook to sort data by a value accessor.
58
59
  * Used by BarChart and DotPlot.
@@ -83,7 +84,7 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
83
84
  onObservation?: OnObservationCallback;
84
85
  chartType?: string;
85
86
  chartId?: string;
86
- onClick?: (datum: any, event: {
87
+ onClick?: (datum: Datum, event: {
87
88
  x: number;
88
89
  y: number;
89
90
  }) => void;
@@ -93,8 +94,8 @@ export declare function useChartSelection({ selection, linkedHover, fallbackFiel
93
94
  }): {
94
95
  activeSelectionHook: SelectionHookResult | null;
95
96
  hoverSelectionHook: SelectionHookResult | null;
96
- customHoverBehavior: (d: Datum | null) => void;
97
- customClickBehavior: (d: Datum | null) => void;
97
+ customHoverBehavior: SemanticHoverBehavior;
98
+ customClickBehavior: SemanticClickBehavior;
98
99
  /** Stable ID for this chart instance, used to suppress linked crosshair on source chart */
99
100
  crosshairSourceId: string;
100
101
  };
@@ -172,7 +173,7 @@ interface ChartModeInput {
172
173
  categoryLabel?: string;
173
174
  valueLabel?: string;
174
175
  /** When truthy, enableHover is forced true regardless of mode (LinkedCharts needs hover) */
175
- linkedHover?: any;
176
+ linkedHover?: LinkedHoverProp;
176
177
  /** Optional mobile interaction policy surfaced through useChartMode for custom wrappers. */
177
178
  mobileInteraction?: MobileInteractionProp;
178
179
  /** Optional mobile semantic contract surfaced through useChartMode for custom wrappers. */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AUTO-GENERATED from chartSpecs.ts by scripts/regenerate-schema.ts.
3
+ * Do not edit by hand; run `npm run docs:chart-specs:schema`.
4
+ *
5
+ * This compact registry is intentionally separate from validation metadata:
6
+ * config serialization only needs chart-name membership.
7
+ */
8
+ export declare const KNOWN_CHART_COMPONENTS: readonly ["BarChart", "StackedBarChart", "GroupedBarChart", "SwarmPlot", "BoxPlot", "Histogram", "ViolinPlot", "RidgelinePlot", "DotPlot", "PieChart", "DonutChart", "GaugeChart", "FunnelChart", "SwimlaneChart", "LikertChart", "LineChart", "AreaChart", "DifferenceChart", "StackedAreaChart", "Scatterplot", "BubbleChart", "Heatmap", "QuadrantChart", "MultiAxisLineChart", "CandlestickChart", "ConnectedScatterplot", "ScatterplotMatrix", "MinimapChart", "ForceDirectedGraph", "SankeyDiagram", "ProcessSankey", "ChordDiagram", "TreeDiagram", "Treemap", "CirclePack", "OrbitDiagram", "ChoroplethMap", "ProportionalSymbolMap", "FlowMap", "DistanceCartogram", "RealtimeLineChart", "RealtimeHistogram", "TemporalHistogram", "RealtimeSwarmChart", "RealtimeWaterfallChart", "RealtimeHeatmap", "GaltonBoardChart", "EventDropChart", "PhysicsPileChart", "CollisionSwarmChart", "GauntletChart", "ProcessFlowChart", "PhysicalFlowChart", "BigNumber"];
9
+ export declare function isKnownChartComponent(componentName: string): boolean;
@@ -0,0 +1,16 @@
1
+ export type RegressionPoint = [number, number];
2
+ export interface LeastSquaresResult {
3
+ points: RegressionPoint[];
4
+ /**
5
+ * Linear: `[slope, intercept]`. Polynomial: highest power first, matching
6
+ * the historical `regression` package result consumed by annotations.
7
+ */
8
+ equation: number[];
9
+ }
10
+ /** Fit a two-parameter least-squares line with two-decimal output rounding. */
11
+ export declare function linearRegression(data: ReadonlyArray<readonly [number, number | null]>): LeastSquaresResult;
12
+ /**
13
+ * Fit an order-N polynomial using normal equations. Coefficients and predicted
14
+ * points use the former dependency's two-decimal rounding and equation order.
15
+ */
16
+ export declare function polynomialRegression(data: ReadonlyArray<readonly [number, number | null]>, order?: number): LeastSquaresResult;
@@ -27,7 +27,8 @@ export interface PrimitiveStyleOverrides {
27
27
  strokeWidth?: number;
28
28
  opacity?: number;
29
29
  }
30
- type StyleFnArg = (...args: any[]) => Datum;
30
+ type StyleArgument = Datum | string | number | boolean | Date | null | undefined;
31
+ type StyleFn<TArgs extends StyleArgument[]> = (...args: TArgs) => Datum;
31
32
  /** Returns true when at least one override key has a non-undefined value. */
32
33
  export declare function hasPrimitiveOverrides(overrides: PrimitiveStyleOverrides): boolean;
33
34
  /**
@@ -39,5 +40,5 @@ export declare function hasPrimitiveOverrides(overrides: PrimitiveStyleOverrides
39
40
  * keeps the memoization-stable identity path hot for the common case
40
41
  * where a designer has set nothing.
41
42
  */
42
- export declare function mergeShapeStyle<F extends StyleFnArg>(styleFn: F | undefined, overrides: PrimitiveStyleOverrides): F;
43
+ export declare function mergeShapeStyle<TArgs extends StyleArgument[] = []>(styleFn: StyleFn<TArgs> | undefined, overrides: PrimitiveStyleOverrides): StyleFn<TArgs>;
43
44
  export {};
@@ -0,0 +1,42 @@
1
+ import type { Datum } from "./datumTypes";
2
+ import type { KeyboardEvent as ReactKeyboardEvent } from "react";
3
+ import type { OnObservationCallback, ObservationInputType } from "../../store/ObservationStore";
4
+ /** Extra context supplied by Stream Frames to their existing behavior hooks. */
5
+ export interface SemanticInteractionContext {
6
+ type: "focus" | "activate";
7
+ inputType: ObservationInputType;
8
+ }
9
+ export type SemanticHoverBehavior<T = Datum> = (datum: T | null, context?: SemanticInteractionContext) => void;
10
+ export type SemanticClickBehavior<T = Datum> = (datum: T | null, context?: SemanticInteractionContext) => void;
11
+ export declare function observationInputType(pointerType?: string): "pointer" | "touch";
12
+ /**
13
+ * Stream Frame keyboard navigation lives on a focusable chart wrapper. Let
14
+ * native controls rendered inside that wrapper (notably widget annotations)
15
+ * handle their own keys before the chart consumes Enter, Space, or arrows.
16
+ */
17
+ export declare function isInteractiveKeyboardTarget(event: Pick<ReactKeyboardEvent, "target" | "currentTarget">): boolean;
18
+ /**
19
+ * Emit the legacy hover event and its semantic focus companion when present.
20
+ * Keeping both makes the semantic vocabulary additive for existing consumers.
21
+ */
22
+ export declare function emitHoverObservations(options: {
23
+ onObservation?: OnObservationCallback;
24
+ datum: Datum | null;
25
+ x?: number;
26
+ y?: number;
27
+ chartType: string;
28
+ chartId?: string;
29
+ context?: SemanticInteractionContext;
30
+ timestamp?: number;
31
+ }): void;
32
+ /** Emit the legacy click event and its semantic activation companion. */
33
+ export declare function emitClickObservations(options: {
34
+ onObservation?: OnObservationCallback;
35
+ datum: Datum | null;
36
+ x?: number;
37
+ y?: number;
38
+ chartType: string;
39
+ chartId?: string;
40
+ context?: SemanticInteractionContext;
41
+ timestamp?: number;
42
+ }): void;
@@ -24,4 +24,4 @@
24
24
  * mutation throws in strict mode rather than corrupting later reads.
25
25
  */
26
26
  export declare const EMPTY_ARRAY: readonly unknown[];
27
- export declare function filterSparseArray<T>(input: readonly T[] | undefined | null): T[];
27
+ export declare function filterSparseArray<T extends object>(input: readonly (T | null | undefined)[] | undefined | null): T[];