semiotic 3.0.0-beta.2 → 3.0.0-beta.4

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 (342) hide show
  1. package/CLAUDE.md +93 -753
  2. package/README.md +92 -7
  3. package/ai/dist/componentRegistry.js +26 -0
  4. package/ai/dist/{ai/mcp-server.js → mcp-server.js} +1 -1
  5. package/ai/dist/{ai/renderHOCToSVG.js → renderHOCToSVG.js} +2 -2
  6. package/dist/ChartContainer.d.ts +60 -0
  7. package/dist/DetailsPanel.d.ts +37 -0
  8. package/dist/LinkedCharts.d.ts +2 -0
  9. package/dist/Tooltip/Tooltip.d.ts +2 -2
  10. package/dist/charts/index.d.ts +1 -1
  11. package/dist/charts/ordinal/BarChart.d.ts +1 -0
  12. package/dist/charts/ordinal/BoxPlot.d.ts +1 -0
  13. package/dist/charts/ordinal/DonutChart.d.ts +1 -0
  14. package/dist/charts/ordinal/DotPlot.d.ts +1 -0
  15. package/dist/charts/ordinal/GroupedBarChart.d.ts +1 -0
  16. package/dist/charts/ordinal/Histogram.d.ts +1 -0
  17. package/dist/charts/ordinal/PieChart.d.ts +1 -0
  18. package/dist/charts/ordinal/RidgelinePlot.d.ts +1 -0
  19. package/dist/charts/ordinal/StackedBarChart.d.ts +1 -0
  20. package/dist/charts/ordinal/SwarmPlot.d.ts +1 -0
  21. package/dist/charts/ordinal/ViolinPlot.d.ts +1 -0
  22. package/dist/charts/realtime/RealtimeHeatmap.d.ts +11 -0
  23. package/dist/charts/realtime/RealtimeHistogram.d.ts +15 -1
  24. package/dist/charts/realtime/RealtimeLineChart.d.ts +6 -0
  25. package/dist/charts/realtime/RealtimeSwarmChart.d.ts +6 -0
  26. package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +6 -0
  27. package/dist/charts/shared/annotationRules.d.ts +3 -0
  28. package/dist/charts/shared/colorUtils.d.ts +17 -11
  29. package/dist/charts/shared/hooks.d.ts +96 -1
  30. package/dist/charts/shared/loess.d.ts +13 -0
  31. package/dist/charts/shared/networkUtils.d.ts +31 -0
  32. package/dist/charts/shared/tooltipUtils.d.ts +16 -0
  33. package/dist/charts/shared/types.d.ts +17 -2
  34. package/dist/charts/shared/validateChartData.d.ts +2 -3
  35. package/dist/charts/shared/validateProps.d.ts +18 -0
  36. package/dist/charts/xy/AreaChart.d.ts +4 -0
  37. package/dist/charts/xy/BubbleChart.d.ts +6 -0
  38. package/dist/charts/xy/Heatmap.d.ts +4 -0
  39. package/dist/charts/xy/LineChart.d.ts +6 -0
  40. package/dist/charts/xy/Scatterplot.d.ts +4 -0
  41. package/dist/charts/xy/StackedAreaChart.d.ts +4 -0
  42. package/dist/data/fromVegaLite.d.ts +48 -0
  43. package/dist/export/chartConfig.d.ts +29 -0
  44. package/dist/export/selectionSerializer.d.ts +20 -0
  45. package/dist/geometry/sankeyLinks.d.ts +1 -1
  46. package/dist/network.min.js +1 -1
  47. package/dist/network.module.min.js +1 -1
  48. package/dist/ordinal.min.js +1 -1
  49. package/dist/ordinal.module.min.js +1 -1
  50. package/dist/realtime/types.d.ts +20 -6
  51. package/dist/realtime.min.js +1 -1
  52. package/dist/realtime.module.min.js +1 -1
  53. package/dist/semiotic-ai.d.ts +14 -0
  54. package/dist/semiotic-ai.min.js +1 -1
  55. package/dist/semiotic-ai.module.min.js +1 -1
  56. package/dist/semiotic-data.d.ts +2 -0
  57. package/dist/semiotic-data.min.js +1 -1
  58. package/dist/semiotic-data.module.min.js +1 -1
  59. package/dist/semiotic-network.d.ts +9 -19
  60. package/dist/semiotic-ordinal.d.ts +12 -14
  61. package/dist/semiotic-xy.d.ts +12 -18
  62. package/dist/semiotic.d.ts +16 -13
  63. package/dist/semiotic.min.js +1 -1
  64. package/dist/semiotic.module.min.js +1 -1
  65. package/dist/server.min.js +1 -1
  66. package/dist/server.module.min.js +1 -1
  67. package/dist/store/ObservationStore.d.ts +61 -0
  68. package/dist/store/SelectionStore.d.ts +9 -1
  69. package/dist/store/ThemeStore.d.ts +6 -1
  70. package/dist/store/TooltipStore.d.ts +3 -1
  71. package/dist/store/createStore.d.ts +4 -1
  72. package/dist/store/useObservation.d.ts +18 -0
  73. package/dist/stream/MarginalGraphics.d.ts +1 -1
  74. package/dist/stream/NetworkPipelineStore.d.ts +44 -0
  75. package/dist/stream/OrdinalCanvasHitTester.d.ts +1 -0
  76. package/dist/stream/OrdinalSVGOverlay.d.ts +6 -2
  77. package/dist/stream/ParticlePool.d.ts +2 -1
  78. package/dist/stream/PipelineStore.d.ts +11 -0
  79. package/dist/stream/SVGOverlay.d.ts +21 -2
  80. package/dist/stream/SceneGraph.d.ts +1 -1
  81. package/dist/stream/networkTypes.d.ts +58 -1
  82. package/dist/stream/ordinalTypes.d.ts +13 -0
  83. package/dist/stream/types.d.ts +14 -0
  84. package/dist/types/annotationTypes.d.ts +10 -0
  85. package/dist/types/networkTypes.d.ts +1 -2
  86. package/dist/xy.min.js +1 -1
  87. package/dist/xy.module.min.js +1 -1
  88. package/package.json +30 -42
  89. package/ai/dist/ai/componentRegistry.js +0 -45
  90. package/ai/dist/src/components/Annotation.js +0 -358
  91. package/ai/dist/src/components/AnnotationLayer/AnnotationLayer.js +0 -369
  92. package/ai/dist/src/components/Axis/Axis.js +0 -374
  93. package/ai/dist/src/components/Axis/axisTitle.js +0 -14
  94. package/ai/dist/src/components/Axis/index.js +0 -7
  95. package/ai/dist/src/components/Axis/summaryGraphic.js +0 -37
  96. package/ai/dist/src/components/Brush.js +0 -84
  97. package/ai/dist/src/components/ChartErrorBoundary.js +0 -91
  98. package/ai/dist/src/components/DividedLine.js +0 -65
  99. package/ai/dist/src/components/Legend.js +0 -140
  100. package/ai/dist/src/components/LinkedCharts.js +0 -95
  101. package/ai/dist/src/components/ThemeProvider.js +0 -79
  102. package/ai/dist/src/components/Tooltip/Tooltip.js +0 -309
  103. package/ai/dist/src/components/TooltipPositioner/index.js +0 -132
  104. package/ai/dist/src/components/annotationLayerBehavior/annotationHandling.js +0 -73
  105. package/ai/dist/src/components/annotationLayerBehavior/d3labeler.js +0 -254
  106. package/ai/dist/src/components/annotationRules/baseRules.js +0 -150
  107. package/ai/dist/src/components/annotationRules/networkframeRules.js +0 -196
  108. package/ai/dist/src/components/annotationRules/xyframeRules.js +0 -297
  109. package/ai/dist/src/components/batchWork.js +0 -35
  110. package/ai/dist/src/components/charts/index.js +0 -109
  111. package/ai/dist/src/components/charts/network/ChordDiagram.js +0 -142
  112. package/ai/dist/src/components/charts/network/CirclePack.js +0 -108
  113. package/ai/dist/src/components/charts/network/ForceDirectedGraph.js +0 -121
  114. package/ai/dist/src/components/charts/network/SankeyDiagram.js +0 -155
  115. package/ai/dist/src/components/charts/network/TreeDiagram.js +0 -110
  116. package/ai/dist/src/components/charts/network/Treemap.js +0 -106
  117. package/ai/dist/src/components/charts/ordinal/BarChart.js +0 -156
  118. package/ai/dist/src/components/charts/ordinal/BoxPlot.js +0 -139
  119. package/ai/dist/src/components/charts/ordinal/DonutChart.js +0 -130
  120. package/ai/dist/src/components/charts/ordinal/DotPlot.js +0 -126
  121. package/ai/dist/src/components/charts/ordinal/GroupedBarChart.js +0 -129
  122. package/ai/dist/src/components/charts/ordinal/Histogram.js +0 -132
  123. package/ai/dist/src/components/charts/ordinal/PieChart.js +0 -128
  124. package/ai/dist/src/components/charts/ordinal/RidgelinePlot.js +0 -130
  125. package/ai/dist/src/components/charts/ordinal/StackedBarChart.js +0 -130
  126. package/ai/dist/src/components/charts/ordinal/SwarmPlot.js +0 -147
  127. package/ai/dist/src/components/charts/ordinal/ViolinPlot.js +0 -138
  128. package/ai/dist/src/components/charts/realtime/RealtimeHeatmap.js +0 -79
  129. package/ai/dist/src/components/charts/realtime/RealtimeHistogram.js +0 -114
  130. package/ai/dist/src/components/charts/realtime/RealtimeLineChart.js +0 -93
  131. package/ai/dist/src/components/charts/realtime/RealtimeSwarmChart.js +0 -105
  132. package/ai/dist/src/components/charts/realtime/RealtimeWaterfallChart.js +0 -106
  133. package/ai/dist/src/components/charts/shared/ChartError.js +0 -72
  134. package/ai/dist/src/components/charts/shared/colorUtils.js +0 -138
  135. package/ai/dist/src/components/charts/shared/formatUtils.js +0 -213
  136. package/ai/dist/src/components/charts/shared/hooks.js +0 -49
  137. package/ai/dist/src/components/charts/shared/legendUtils.js +0 -57
  138. package/ai/dist/src/components/charts/shared/selectionUtils.js +0 -67
  139. package/ai/dist/src/components/charts/shared/tooltipUtils.js +0 -79
  140. package/ai/dist/src/components/charts/shared/types.js +0 -2
  141. package/ai/dist/src/components/charts/shared/validateChartData.js +0 -82
  142. package/ai/dist/src/components/charts/shared/validateProps.js +0 -736
  143. package/ai/dist/src/components/charts/xy/AreaChart.js +0 -230
  144. package/ai/dist/src/components/charts/xy/BubbleChart.js +0 -251
  145. package/ai/dist/src/components/charts/xy/Heatmap.js +0 -235
  146. package/ai/dist/src/components/charts/xy/LineChart.js +0 -307
  147. package/ai/dist/src/components/charts/xy/MinimapChart.js +0 -298
  148. package/ai/dist/src/components/charts/xy/Scatterplot.js +0 -172
  149. package/ai/dist/src/components/charts/xy/ScatterplotMatrix.js +0 -426
  150. package/ai/dist/src/components/charts/xy/StackedAreaChart.js +0 -231
  151. package/ai/dist/src/components/constants/coordinateNames.js +0 -11
  152. package/ai/dist/src/components/constants/frame_props.js +0 -251
  153. package/ai/dist/src/components/data/dataFunctions.js +0 -487
  154. package/ai/dist/src/components/data/multiAccessorUtils.js +0 -14
  155. package/ai/dist/src/components/data/transforms.js +0 -143
  156. package/ai/dist/src/components/data/unflowedFunctions.js +0 -5
  157. package/ai/dist/src/components/export/exportChart.js +0 -121
  158. package/ai/dist/src/components/generic_utilities/functions.js +0 -5
  159. package/ai/dist/src/components/geometry/areaDrawing.js +0 -312
  160. package/ai/dist/src/components/geometry/contourLayout.js +0 -73
  161. package/ai/dist/src/components/geometry/hexbinLayout.js +0 -163
  162. package/ai/dist/src/components/geometry/lineDrawing.js +0 -356
  163. package/ai/dist/src/components/geometry/sankeyLinks.js +0 -331
  164. package/ai/dist/src/components/geometry/summaryLayouts.js +0 -136
  165. package/ai/dist/src/components/index.js +0 -18
  166. package/ai/dist/src/components/processing/InteractionItems.js +0 -223
  167. package/ai/dist/src/components/processing/hierarchyUtils.js +0 -104
  168. package/ai/dist/src/components/processing/layouts/chordLayout.js +0 -58
  169. package/ai/dist/src/components/processing/layouts/forceLayout.js +0 -142
  170. package/ai/dist/src/components/processing/layouts/hierarchyLayout.js +0 -31
  171. package/ai/dist/src/components/processing/layouts/index.js +0 -32
  172. package/ai/dist/src/components/processing/layouts/sankeyLayout.js +0 -96
  173. package/ai/dist/src/components/processing/layouts/simpleLayouts.js +0 -34
  174. package/ai/dist/src/components/processing/layouts/types.js +0 -2
  175. package/ai/dist/src/components/processing/networkDefaults.js +0 -39
  176. package/ai/dist/src/components/realtime/BinAccumulator.js +0 -36
  177. package/ai/dist/src/components/realtime/IncrementalExtent.js +0 -55
  178. package/ai/dist/src/components/realtime/RingBuffer.js +0 -104
  179. package/ai/dist/src/components/realtime/renderers/barRenderer.js +0 -133
  180. package/ai/dist/src/components/realtime/renderers/candlestickRenderer.js +0 -7
  181. package/ai/dist/src/components/realtime/renderers/lineRenderer.js +0 -164
  182. package/ai/dist/src/components/realtime/renderers/swarmRenderer.js +0 -91
  183. package/ai/dist/src/components/realtime/renderers/types.js +0 -2
  184. package/ai/dist/src/components/realtime/renderers/waterfallRenderer.js +0 -163
  185. package/ai/dist/src/components/realtime/types.js +0 -2
  186. package/ai/dist/src/components/semiotic-ai.js +0 -89
  187. package/ai/dist/src/components/semiotic-data.js +0 -12
  188. package/ai/dist/src/components/semiotic-network.js +0 -38
  189. package/ai/dist/src/components/semiotic-ordinal.js +0 -28
  190. package/ai/dist/src/components/semiotic-realtime.js +0 -30
  191. package/ai/dist/src/components/semiotic-server.js +0 -8
  192. package/ai/dist/src/components/semiotic-xy.js +0 -35
  193. package/ai/dist/src/components/semiotic.js +0 -109
  194. package/ai/dist/src/components/server/renderToStaticSVG.js +0 -594
  195. package/ai/dist/src/components/store/SelectionStore.js +0 -91
  196. package/ai/dist/src/components/store/ThemeStore.js +0 -78
  197. package/ai/dist/src/components/store/TooltipStore.js +0 -13
  198. package/ai/dist/src/components/store/createStore.js +0 -81
  199. package/ai/dist/src/components/store/useSelection.js +0 -133
  200. package/ai/dist/src/components/stream/CanvasHitTester.js +0 -164
  201. package/ai/dist/src/components/stream/DataSourceAdapter.js +0 -99
  202. package/ai/dist/src/components/stream/MarginalGraphics.js +0 -266
  203. package/ai/dist/src/components/stream/NetworkCanvasHitTester.js +0 -228
  204. package/ai/dist/src/components/stream/NetworkPipelineStore.js +0 -498
  205. package/ai/dist/src/components/stream/NetworkSVGOverlay.js +0 -70
  206. package/ai/dist/src/components/stream/NetworkSceneGraph.js +0 -38
  207. package/ai/dist/src/components/stream/OrdinalCanvasHitTester.js +0 -146
  208. package/ai/dist/src/components/stream/OrdinalPipelineStore.js +0 -786
  209. package/ai/dist/src/components/stream/OrdinalSVGOverlay.js +0 -130
  210. package/ai/dist/src/components/stream/ParticlePool.js +0 -174
  211. package/ai/dist/src/components/stream/PipelineStore.js +0 -1243
  212. package/ai/dist/src/components/stream/SVGOverlay.js +0 -129
  213. package/ai/dist/src/components/stream/SceneGraph.js +0 -132
  214. package/ai/dist/src/components/stream/StreamNetworkFrame.js +0 -561
  215. package/ai/dist/src/components/stream/StreamOrdinalFrame.js +0 -492
  216. package/ai/dist/src/components/stream/StreamXYFrame.js +0 -590
  217. package/ai/dist/src/components/stream/accessorUtils.js +0 -20
  218. package/ai/dist/src/components/stream/index.js +0 -32
  219. package/ai/dist/src/components/stream/layouts/chordLayoutPlugin.js +0 -352
  220. package/ai/dist/src/components/stream/layouts/forceLayoutPlugin.js +0 -230
  221. package/ai/dist/src/components/stream/layouts/hierarchyLayoutPlugin.js +0 -568
  222. package/ai/dist/src/components/stream/layouts/index.js +0 -28
  223. package/ai/dist/src/components/stream/layouts/sankeyLayoutPlugin.js +0 -245
  224. package/ai/dist/src/components/stream/networkTypes.js +0 -17
  225. package/ai/dist/src/components/stream/ordinalSceneBuilders/barScene.js +0 -126
  226. package/ai/dist/src/components/stream/ordinalSceneBuilders/connectorScene.js +0 -62
  227. package/ai/dist/src/components/stream/ordinalSceneBuilders/pieScene.js +0 -33
  228. package/ai/dist/src/components/stream/ordinalSceneBuilders/pointScene.js +0 -63
  229. package/ai/dist/src/components/stream/ordinalSceneBuilders/statisticalScene.js +0 -278
  230. package/ai/dist/src/components/stream/ordinalSceneBuilders/timelineScene.js +0 -30
  231. package/ai/dist/src/components/stream/ordinalSceneBuilders/types.js +0 -2
  232. package/ai/dist/src/components/stream/ordinalTypes.js +0 -2
  233. package/ai/dist/src/components/stream/renderers/areaCanvasRenderer.js +0 -48
  234. package/ai/dist/src/components/stream/renderers/barCanvasRenderer.js +0 -70
  235. package/ai/dist/src/components/stream/renderers/boxplotCanvasRenderer.js +0 -75
  236. package/ai/dist/src/components/stream/renderers/candlestickCanvasRenderer.js +0 -28
  237. package/ai/dist/src/components/stream/renderers/connectorCanvasRenderer.js +0 -47
  238. package/ai/dist/src/components/stream/renderers/heatmapCanvasRenderer.js +0 -31
  239. package/ai/dist/src/components/stream/renderers/lineCanvasRenderer.js +0 -140
  240. package/ai/dist/src/components/stream/renderers/networkArcRenderer.js +0 -38
  241. package/ai/dist/src/components/stream/renderers/networkCircleRenderer.js +0 -37
  242. package/ai/dist/src/components/stream/renderers/networkEdgeRenderer.js +0 -102
  243. package/ai/dist/src/components/stream/renderers/networkParticleRenderer.js +0 -63
  244. package/ai/dist/src/components/stream/renderers/networkRectRenderer.js +0 -35
  245. package/ai/dist/src/components/stream/renderers/pointCanvasRenderer.js +0 -38
  246. package/ai/dist/src/components/stream/renderers/swarmCanvasRenderer.js +0 -10
  247. package/ai/dist/src/components/stream/renderers/types.js +0 -2
  248. package/ai/dist/src/components/stream/renderers/violinCanvasRenderer.js +0 -47
  249. package/ai/dist/src/components/stream/renderers/waterfallCanvasRenderer.js +0 -38
  250. package/ai/dist/src/components/stream/renderers/wedgeCanvasRenderer.js +0 -33
  251. package/ai/dist/src/components/stream/types.js +0 -2
  252. package/ai/dist/src/components/types/annotationTypes.js +0 -2
  253. package/ai/dist/src/components/types/canvasTypes.js +0 -2
  254. package/ai/dist/src/components/types/generalTypes.js +0 -2
  255. package/ai/dist/src/components/types/interactionTypes.js +0 -2
  256. package/ai/dist/src/components/types/legendTypes.js +0 -2
  257. package/ai/dist/src/components/types/networkTypes.js +0 -2
  258. package/ai/dist/src/components/types/ordinalTypes.js +0 -2
  259. package/ai/dist/src/components/types/xyTypes.js +0 -2
  260. package/ai/dist/src/components/useBoundingRect.js +0 -24
  261. package/ai/dist/src/components/visualizationLayerBehavior/axis.js +0 -301
  262. package/ai/dist/src/components/visualizationLayerBehavior/general.js +0 -435
  263. package/ai/dist/src/setupTests.js +0 -4
  264. package/dist/AnnotationLayer/AnnotationLayer.d.ts +0 -25
  265. package/dist/Axis/Axis.d.ts +0 -7
  266. package/dist/Axis/axisTitle.d.ts +0 -10
  267. package/dist/Axis/index.d.ts +0 -2
  268. package/dist/Axis/summaryGraphic.d.ts +0 -17
  269. package/dist/Brush.d.ts +0 -12
  270. package/dist/DividedLine.d.ts +0 -16
  271. package/dist/TooltipPositioner/index.d.ts +0 -7
  272. package/dist/annotationLayerBehavior/annotationHandling.d.ts +0 -19
  273. package/dist/annotationLayerBehavior/d3labeler.d.ts +0 -9
  274. package/dist/annotationRules/baseRules.d.ts +0 -25
  275. package/dist/annotationRules/networkframeRules.d.ts +0 -48
  276. package/dist/annotationRules/xyframeRules.d.ts +0 -117
  277. package/dist/batchWork.d.ts +0 -6
  278. package/dist/constants/coordinateNames.d.ts +0 -8
  279. package/dist/constants/frame_props.d.ts +0 -13
  280. package/dist/data/dataFunctions.d.ts +0 -45
  281. package/dist/data/multiAccessorUtils.d.ts +0 -1
  282. package/dist/data/unflowedFunctions.d.ts +0 -1
  283. package/dist/generic_utilities/functions.d.ts +0 -1
  284. package/dist/geometry/areaDrawing.d.ts +0 -21
  285. package/dist/geometry/contourLayout.d.ts +0 -6
  286. package/dist/geometry/hexbinLayout.d.ts +0 -7
  287. package/dist/geometry/lineDrawing.d.ts +0 -71
  288. package/dist/geometry/summaryLayouts.d.ts +0 -45
  289. package/dist/index.d.ts +0 -1
  290. package/dist/network.js +0 -7495
  291. package/dist/network.js.map +0 -1
  292. package/dist/network.module.js +0 -7458
  293. package/dist/network.module.js.map +0 -1
  294. package/dist/ordinal.js +0 -6497
  295. package/dist/ordinal.js.map +0 -1
  296. package/dist/ordinal.module.js +0 -6465
  297. package/dist/ordinal.module.js.map +0 -1
  298. package/dist/processing/InteractionItems.d.ts +0 -13
  299. package/dist/processing/hierarchyUtils.d.ts +0 -16
  300. package/dist/processing/layouts/chordLayout.d.ts +0 -2
  301. package/dist/processing/layouts/forceLayout.d.ts +0 -3
  302. package/dist/processing/layouts/hierarchyLayout.d.ts +0 -10
  303. package/dist/processing/layouts/index.d.ts +0 -8
  304. package/dist/processing/layouts/sankeyLayout.d.ts +0 -8
  305. package/dist/processing/layouts/simpleLayouts.d.ts +0 -7
  306. package/dist/processing/layouts/types.d.ts +0 -17
  307. package/dist/processing/networkDefaults.d.ts +0 -36
  308. package/dist/realtime/renderers/barRenderer.d.ts +0 -2
  309. package/dist/realtime/renderers/candlestickRenderer.d.ts +0 -2
  310. package/dist/realtime/renderers/lineRenderer.d.ts +0 -2
  311. package/dist/realtime/renderers/swarmRenderer.d.ts +0 -2
  312. package/dist/realtime.js +0 -7072
  313. package/dist/realtime.js.map +0 -1
  314. package/dist/realtime.module.js +0 -7043
  315. package/dist/realtime.module.js.map +0 -1
  316. package/dist/semiotic-ai.js +0 -13323
  317. package/dist/semiotic-ai.js.map +0 -1
  318. package/dist/semiotic-ai.module.js +0 -13264
  319. package/dist/semiotic-ai.module.js.map +0 -1
  320. package/dist/semiotic-data.js +0 -141
  321. package/dist/semiotic-data.js.map +0 -1
  322. package/dist/semiotic-data.module.js +0 -136
  323. package/dist/semiotic-data.module.js.map +0 -1
  324. package/dist/semiotic.js +0 -16351
  325. package/dist/semiotic.js.map +0 -1
  326. package/dist/semiotic.module.js +0 -16265
  327. package/dist/semiotic.module.js.map +0 -1
  328. package/dist/server.js +0 -5191
  329. package/dist/server.js.map +0 -1
  330. package/dist/server.module.js +0 -5166
  331. package/dist/server.module.js.map +0 -1
  332. package/dist/stream/NetworkSceneGraph.d.ts +0 -14
  333. package/dist/stream/index.d.ts +0 -16
  334. package/dist/types/canvasTypes.d.ts +0 -9
  335. package/dist/types/xyTypes.d.ts +0 -24
  336. package/dist/useBoundingRect.d.ts +0 -2
  337. package/dist/visualizationLayerBehavior/axis.d.ts +0 -36
  338. package/dist/visualizationLayerBehavior/general.d.ts +0 -80
  339. package/dist/xy.js +0 -6993
  340. package/dist/xy.js.map +0 -1
  341. package/dist/xy.module.js +0 -6957
  342. package/dist/xy.module.js.map +0 -1
@@ -1,736 +0,0 @@
1
- "use strict";
2
- /**
3
- * Static props validation for AI code-generation pipelines.
4
- *
5
- * Validates component name, required props, prop types, enum values,
6
- * unknown props (typo detection), and data shape via the existing
7
- * validateArrayData / validateObjectData / validateNetworkData helpers.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.validateProps = validateProps;
11
- const validateChartData_1 = require("./validateChartData");
12
- const validateChartData_2 = require("./validateChartData");
13
- const validateChartData_3 = require("./validateChartData");
14
- // ---------------------------------------------------------------------------
15
- // Shared prop definitions (reused across many components)
16
- // ---------------------------------------------------------------------------
17
- const commonProps = {
18
- width: { type: "number" },
19
- height: { type: "number" },
20
- margin: { type: "object" },
21
- className: { type: "string" },
22
- title: { type: "string" },
23
- enableHover: { type: "boolean" },
24
- showLegend: { type: "boolean" },
25
- showGrid: { type: "boolean" },
26
- colorBy: { type: ["string", "function"] },
27
- colorScheme: { type: ["string", "array"] },
28
- tooltip: { type: ["function", "object"] },
29
- frameProps: { type: "object" },
30
- };
31
- const xyAxisProps = {
32
- xLabel: { type: "string" },
33
- yLabel: { type: "string" },
34
- xFormat: { type: "function" },
35
- yFormat: { type: "function" },
36
- };
37
- const ordinalAxisProps = {
38
- categoryLabel: { type: "string" },
39
- valueLabel: { type: "string" },
40
- valueFormat: { type: "function" },
41
- };
42
- const curveEnum = [
43
- "linear", "monotoneX", "monotoneY", "step",
44
- "stepAfter", "stepBefore", "basis", "cardinal", "catmullRom",
45
- ];
46
- const orientationEnum = ["vertical", "horizontal"];
47
- // ---------------------------------------------------------------------------
48
- // Validation map — one entry per component
49
- // ---------------------------------------------------------------------------
50
- const VALIDATION_MAP = {
51
- // -- XY Charts --
52
- LineChart: {
53
- required: ["data"],
54
- dataShape: "array",
55
- dataAccessors: ["xAccessor", "yAccessor"],
56
- props: {
57
- ...commonProps,
58
- ...xyAxisProps,
59
- data: { type: "array" },
60
- xAccessor: { type: ["string", "function"] },
61
- yAccessor: { type: ["string", "function"] },
62
- lineBy: { type: ["string", "function"] },
63
- lineDataAccessor: { type: "string" },
64
- curve: { type: "string", enum: curveEnum },
65
- lineWidth: { type: "number" },
66
- showPoints: { type: "boolean" },
67
- pointRadius: { type: "number" },
68
- fillArea: { type: "boolean" },
69
- areaOpacity: { type: "number" },
70
- },
71
- },
72
- AreaChart: {
73
- required: ["data"],
74
- dataShape: "array",
75
- dataAccessors: ["xAccessor", "yAccessor"],
76
- props: {
77
- ...commonProps,
78
- ...xyAxisProps,
79
- data: { type: "array" },
80
- xAccessor: { type: ["string", "function"] },
81
- yAccessor: { type: ["string", "function"] },
82
- areaBy: { type: ["string", "function"] },
83
- lineDataAccessor: { type: "string" },
84
- curve: { type: "string", enum: curveEnum },
85
- areaOpacity: { type: "number" },
86
- showLine: { type: "boolean" },
87
- lineWidth: { type: "number" },
88
- },
89
- },
90
- StackedAreaChart: {
91
- required: ["data"],
92
- dataShape: "array",
93
- dataAccessors: ["xAccessor", "yAccessor"],
94
- props: {
95
- ...commonProps,
96
- ...xyAxisProps,
97
- data: { type: "array" },
98
- xAccessor: { type: ["string", "function"] },
99
- yAccessor: { type: ["string", "function"] },
100
- areaBy: { type: ["string", "function"] },
101
- lineDataAccessor: { type: "string" },
102
- curve: { type: "string", enum: curveEnum },
103
- areaOpacity: { type: "number" },
104
- showLine: { type: "boolean" },
105
- lineWidth: { type: "number" },
106
- normalize: { type: "boolean" },
107
- },
108
- },
109
- Scatterplot: {
110
- required: ["data"],
111
- dataShape: "array",
112
- dataAccessors: ["xAccessor", "yAccessor"],
113
- props: {
114
- ...commonProps,
115
- ...xyAxisProps,
116
- data: { type: "array" },
117
- xAccessor: { type: ["string", "function"] },
118
- yAccessor: { type: ["string", "function"] },
119
- sizeBy: { type: ["string", "function"] },
120
- sizeRange: { type: "array" },
121
- pointRadius: { type: "number" },
122
- pointOpacity: { type: "number" },
123
- },
124
- },
125
- BubbleChart: {
126
- required: ["data", "sizeBy"],
127
- dataShape: "array",
128
- dataAccessors: ["xAccessor", "yAccessor"],
129
- props: {
130
- ...commonProps,
131
- ...xyAxisProps,
132
- data: { type: "array" },
133
- xAccessor: { type: ["string", "function"] },
134
- yAccessor: { type: ["string", "function"] },
135
- sizeBy: { type: ["string", "function"] },
136
- sizeRange: { type: "array" },
137
- bubbleOpacity: { type: "number" },
138
- bubbleStrokeWidth: { type: "number" },
139
- bubbleStrokeColor: { type: "string" },
140
- },
141
- },
142
- Heatmap: {
143
- required: ["data"],
144
- dataShape: "array",
145
- dataAccessors: ["xAccessor", "yAccessor", "valueAccessor"],
146
- props: {
147
- ...commonProps,
148
- ...xyAxisProps,
149
- data: { type: "array" },
150
- xAccessor: { type: ["string", "function"] },
151
- yAccessor: { type: ["string", "function"] },
152
- valueAccessor: { type: ["string", "function"] },
153
- colorScheme: { type: "string", enum: ["blues", "reds", "greens", "viridis", "custom"] },
154
- customColorScale: { type: ["object", "function"] },
155
- showValues: { type: "boolean" },
156
- valueFormat: { type: "function" },
157
- cellBorderColor: { type: "string" },
158
- cellBorderWidth: { type: "number" },
159
- },
160
- },
161
- // -- Ordinal Charts --
162
- BarChart: {
163
- required: ["data"],
164
- dataShape: "array",
165
- dataAccessors: ["categoryAccessor", "valueAccessor"],
166
- props: {
167
- ...commonProps,
168
- ...ordinalAxisProps,
169
- data: { type: "array" },
170
- categoryAccessor: { type: ["string", "function"] },
171
- valueAccessor: { type: ["string", "function"] },
172
- orientation: { type: "string", enum: orientationEnum },
173
- sort: { type: ["boolean", "string", "function"] },
174
- barPadding: { type: "number" },
175
- },
176
- },
177
- StackedBarChart: {
178
- required: ["data", "stackBy"],
179
- dataShape: "array",
180
- dataAccessors: ["categoryAccessor", "valueAccessor"],
181
- props: {
182
- ...commonProps,
183
- ...ordinalAxisProps,
184
- data: { type: "array" },
185
- categoryAccessor: { type: ["string", "function"] },
186
- stackBy: { type: ["string", "function"] },
187
- valueAccessor: { type: ["string", "function"] },
188
- orientation: { type: "string", enum: orientationEnum },
189
- normalize: { type: "boolean" },
190
- barPadding: { type: "number" },
191
- },
192
- },
193
- GroupedBarChart: {
194
- required: ["data", "groupBy"],
195
- dataShape: "array",
196
- dataAccessors: ["categoryAccessor", "valueAccessor"],
197
- props: {
198
- ...commonProps,
199
- ...ordinalAxisProps,
200
- data: { type: "array" },
201
- categoryAccessor: { type: ["string", "function"] },
202
- groupBy: { type: ["string", "function"] },
203
- valueAccessor: { type: ["string", "function"] },
204
- orientation: { type: "string", enum: orientationEnum },
205
- barPadding: { type: "number" },
206
- },
207
- },
208
- SwarmPlot: {
209
- required: ["data"],
210
- dataShape: "array",
211
- dataAccessors: ["categoryAccessor", "valueAccessor"],
212
- props: {
213
- ...commonProps,
214
- ...ordinalAxisProps,
215
- data: { type: "array" },
216
- categoryAccessor: { type: ["string", "function"] },
217
- valueAccessor: { type: ["string", "function"] },
218
- orientation: { type: "string", enum: orientationEnum },
219
- sizeBy: { type: ["string", "function"] },
220
- sizeRange: { type: "array" },
221
- pointRadius: { type: "number" },
222
- pointOpacity: { type: "number" },
223
- categoryPadding: { type: "number" },
224
- },
225
- },
226
- BoxPlot: {
227
- required: ["data"],
228
- dataShape: "array",
229
- dataAccessors: ["categoryAccessor", "valueAccessor"],
230
- props: {
231
- ...commonProps,
232
- ...ordinalAxisProps,
233
- data: { type: "array" },
234
- categoryAccessor: { type: ["string", "function"] },
235
- valueAccessor: { type: ["string", "function"] },
236
- orientation: { type: "string", enum: orientationEnum },
237
- showOutliers: { type: "boolean" },
238
- outlierRadius: { type: "number" },
239
- categoryPadding: { type: "number" },
240
- },
241
- },
242
- Histogram: {
243
- required: ["data"],
244
- dataShape: "array",
245
- dataAccessors: ["categoryAccessor", "valueAccessor"],
246
- props: {
247
- ...commonProps,
248
- ...ordinalAxisProps,
249
- data: { type: "array" },
250
- categoryAccessor: { type: ["string", "function"] },
251
- valueAccessor: { type: ["string", "function"] },
252
- bins: { type: "number" },
253
- relative: { type: "boolean" },
254
- categoryPadding: { type: "number" },
255
- },
256
- },
257
- ViolinPlot: {
258
- required: ["data"],
259
- dataShape: "array",
260
- dataAccessors: ["categoryAccessor", "valueAccessor"],
261
- props: {
262
- ...commonProps,
263
- ...ordinalAxisProps,
264
- data: { type: "array" },
265
- categoryAccessor: { type: ["string", "function"] },
266
- valueAccessor: { type: ["string", "function"] },
267
- orientation: { type: "string", enum: orientationEnum },
268
- bins: { type: "number" },
269
- curve: { type: "string" },
270
- showIQR: { type: "boolean" },
271
- categoryPadding: { type: "number" },
272
- },
273
- },
274
- DotPlot: {
275
- required: ["data"],
276
- dataShape: "array",
277
- dataAccessors: ["categoryAccessor", "valueAccessor"],
278
- props: {
279
- ...commonProps,
280
- ...ordinalAxisProps,
281
- data: { type: "array" },
282
- categoryAccessor: { type: ["string", "function"] },
283
- valueAccessor: { type: ["string", "function"] },
284
- orientation: { type: "string", enum: orientationEnum },
285
- sort: { type: ["boolean", "string", "function"] },
286
- dotRadius: { type: "number" },
287
- categoryPadding: { type: "number" },
288
- },
289
- },
290
- PieChart: {
291
- required: ["data"],
292
- dataShape: "array",
293
- dataAccessors: ["categoryAccessor", "valueAccessor"],
294
- props: {
295
- ...commonProps,
296
- data: { type: "array" },
297
- categoryAccessor: { type: ["string", "function"] },
298
- valueAccessor: { type: ["string", "function"] },
299
- startAngle: { type: "number" },
300
- slicePadding: { type: "number" },
301
- },
302
- },
303
- DonutChart: {
304
- required: ["data"],
305
- dataShape: "array",
306
- dataAccessors: ["categoryAccessor", "valueAccessor"],
307
- props: {
308
- ...commonProps,
309
- data: { type: "array" },
310
- categoryAccessor: { type: ["string", "function"] },
311
- valueAccessor: { type: ["string", "function"] },
312
- innerRadius: { type: "number" },
313
- centerContent: { type: ["object", "string", "number"] },
314
- startAngle: { type: "number" },
315
- slicePadding: { type: "number" },
316
- },
317
- },
318
- // -- Network Charts --
319
- ForceDirectedGraph: {
320
- required: ["nodes", "edges"],
321
- dataShape: "network",
322
- dataAccessors: ["nodeIDAccessor", "sourceAccessor", "targetAccessor"],
323
- props: {
324
- ...commonProps,
325
- nodes: { type: "array" },
326
- edges: { type: "array" },
327
- nodeIDAccessor: { type: ["string", "function"] },
328
- sourceAccessor: { type: ["string", "function"] },
329
- targetAccessor: { type: ["string", "function"] },
330
- nodeLabel: { type: ["string", "function"] },
331
- nodeSize: { type: ["number", "string", "function"] },
332
- nodeSizeRange: { type: "array" },
333
- edgeWidth: { type: ["number", "string", "function"] },
334
- edgeColor: { type: "string" },
335
- edgeOpacity: { type: "number" },
336
- iterations: { type: "number" },
337
- forceStrength: { type: "number" },
338
- showLabels: { type: "boolean" },
339
- },
340
- },
341
- SankeyDiagram: {
342
- required: ["edges"],
343
- dataShape: "network",
344
- dataAccessors: ["sourceAccessor", "targetAccessor"],
345
- props: {
346
- ...commonProps,
347
- nodes: { type: "array" },
348
- edges: { type: "array" },
349
- sourceAccessor: { type: ["string", "function"] },
350
- targetAccessor: { type: ["string", "function"] },
351
- valueAccessor: { type: ["string", "function"] },
352
- nodeIdAccessor: { type: ["string", "function"] },
353
- edgeColorBy: { type: ["string", "function"], enum: ["source", "target", "gradient"] },
354
- orientation: { type: "string", enum: orientationEnum },
355
- nodeAlign: { type: "string", enum: ["justify", "left", "right", "center"] },
356
- nodePaddingRatio: { type: "number" },
357
- nodeWidth: { type: "number" },
358
- nodeLabel: { type: ["string", "function"] },
359
- showLabels: { type: "boolean" },
360
- edgeOpacity: { type: "number" },
361
- edgeSort: { type: "function" },
362
- },
363
- },
364
- ChordDiagram: {
365
- required: ["edges"],
366
- dataShape: "network",
367
- dataAccessors: ["sourceAccessor", "targetAccessor"],
368
- props: {
369
- ...commonProps,
370
- nodes: { type: "array" },
371
- edges: { type: "array" },
372
- sourceAccessor: { type: ["string", "function"] },
373
- targetAccessor: { type: ["string", "function"] },
374
- valueAccessor: { type: ["string", "function"] },
375
- nodeIdAccessor: { type: ["string", "function"] },
376
- edgeColorBy: { type: ["string", "function"], enum: ["source", "target"] },
377
- padAngle: { type: "number" },
378
- groupWidth: { type: "number" },
379
- sortGroups: { type: "function" },
380
- nodeLabel: { type: ["string", "function"] },
381
- showLabels: { type: "boolean" },
382
- edgeOpacity: { type: "number" },
383
- },
384
- },
385
- TreeDiagram: {
386
- required: ["data"],
387
- dataShape: "object",
388
- dataAccessors: [],
389
- props: {
390
- ...commonProps,
391
- data: { type: "object" },
392
- layout: { type: "string", enum: ["tree", "cluster", "partition", "treemap", "circlepack"] },
393
- orientation: { type: "string", enum: ["vertical", "horizontal", "radial"] },
394
- childrenAccessor: { type: ["string", "function"] },
395
- valueAccessor: { type: ["string", "function"] },
396
- nodeIdAccessor: { type: ["string", "function"] },
397
- colorByDepth: { type: "boolean" },
398
- edgeStyle: { type: "string", enum: ["line", "curve"] },
399
- nodeLabel: { type: ["string", "function"] },
400
- showLabels: { type: "boolean" },
401
- nodeSize: { type: "number" },
402
- },
403
- },
404
- Treemap: {
405
- required: ["data"],
406
- dataShape: "object",
407
- dataAccessors: [],
408
- props: {
409
- ...commonProps,
410
- data: { type: "object" },
411
- childrenAccessor: { type: ["string", "function"] },
412
- valueAccessor: { type: ["string", "function"] },
413
- nodeIdAccessor: { type: ["string", "function"] },
414
- colorByDepth: { type: "boolean" },
415
- showLabels: { type: "boolean" },
416
- nodeLabel: { type: ["string", "function"] },
417
- },
418
- },
419
- CirclePack: {
420
- required: ["data"],
421
- dataShape: "object",
422
- dataAccessors: [],
423
- props: {
424
- ...commonProps,
425
- data: { type: "object" },
426
- childrenAccessor: { type: ["string", "function"] },
427
- valueAccessor: { type: ["string", "function"] },
428
- nodeIdAccessor: { type: ["string", "function"] },
429
- colorByDepth: { type: "boolean" },
430
- showLabels: { type: "boolean" },
431
- nodeLabel: { type: ["string", "function"] },
432
- circleOpacity: { type: "number" },
433
- },
434
- },
435
- // -- Realtime Charts --
436
- RealtimeLineChart: {
437
- required: [],
438
- dataShape: "realtime",
439
- dataAccessors: [],
440
- props: {
441
- size: { type: "array" },
442
- margin: { type: "object" },
443
- className: { type: "string" },
444
- timeAccessor: { type: ["string", "function"] },
445
- valueAccessor: { type: ["string", "function"] },
446
- windowSize: { type: "number" },
447
- windowMode: { type: "string", enum: ["sliding", "stepping"] },
448
- arrowOfTime: { type: "string", enum: ["left", "right"] },
449
- stroke: { type: "string" },
450
- strokeWidth: { type: "number" },
451
- strokeDasharray: { type: "string" },
452
- timeExtent: { type: "array" },
453
- valueExtent: { type: "array" },
454
- extentPadding: { type: "number" },
455
- showAxes: { type: "boolean" },
456
- background: { type: "string" },
457
- enableHover: { type: ["boolean", "object"] },
458
- tooltipContent: { type: "function" },
459
- tooltip: { type: ["function", "object"] },
460
- onHover: { type: "function" },
461
- annotations: { type: "array" },
462
- svgAnnotationRules: { type: "function" },
463
- tickFormatTime: { type: "function" },
464
- tickFormatValue: { type: "function" },
465
- width: { type: "number" },
466
- height: { type: "number" },
467
- decay: { type: "object" },
468
- pulse: { type: "object" },
469
- staleness: { type: "object" },
470
- transition: { type: "object" },
471
- },
472
- },
473
- RealtimeHistogram: {
474
- required: ["binSize"],
475
- dataShape: "realtime",
476
- dataAccessors: [],
477
- props: {
478
- binSize: { type: "number" },
479
- size: { type: "array" },
480
- margin: { type: "object" },
481
- className: { type: "string" },
482
- timeAccessor: { type: ["string", "function"] },
483
- valueAccessor: { type: ["string", "function"] },
484
- categoryAccessor: { type: ["string", "function"] },
485
- colors: { type: "object" },
486
- windowSize: { type: "number" },
487
- windowMode: { type: "string", enum: ["sliding", "stepping"] },
488
- arrowOfTime: { type: "string", enum: ["left", "right"] },
489
- fill: { type: "string" },
490
- stroke: { type: "string" },
491
- strokeWidth: { type: "number" },
492
- gap: { type: "number" },
493
- timeExtent: { type: "array" },
494
- valueExtent: { type: "array" },
495
- extentPadding: { type: "number" },
496
- showAxes: { type: "boolean" },
497
- background: { type: "string" },
498
- enableHover: { type: ["boolean", "object"] },
499
- tooltipContent: { type: "function" },
500
- tooltip: { type: ["function", "object"] },
501
- onHover: { type: "function" },
502
- annotations: { type: "array" },
503
- svgAnnotationRules: { type: "function" },
504
- tickFormatTime: { type: "function" },
505
- tickFormatValue: { type: "function" },
506
- width: { type: "number" },
507
- height: { type: "number" },
508
- decay: { type: "object" },
509
- pulse: { type: "object" },
510
- staleness: { type: "object" },
511
- transition: { type: "object" },
512
- },
513
- },
514
- RealtimeSwarmChart: {
515
- required: [],
516
- dataShape: "realtime",
517
- dataAccessors: [],
518
- props: {
519
- size: { type: "array" },
520
- margin: { type: "object" },
521
- className: { type: "string" },
522
- timeAccessor: { type: ["string", "function"] },
523
- valueAccessor: { type: ["string", "function"] },
524
- categoryAccessor: { type: ["string", "function"] },
525
- colors: { type: "object" },
526
- windowSize: { type: "number" },
527
- windowMode: { type: "string", enum: ["sliding", "stepping"] },
528
- arrowOfTime: { type: "string", enum: ["left", "right"] },
529
- radius: { type: "number" },
530
- fill: { type: "string" },
531
- opacity: { type: "number" },
532
- stroke: { type: "string" },
533
- strokeWidth: { type: "number" },
534
- timeExtent: { type: "array" },
535
- valueExtent: { type: "array" },
536
- extentPadding: { type: "number" },
537
- showAxes: { type: "boolean" },
538
- background: { type: "string" },
539
- enableHover: { type: ["boolean", "object"] },
540
- tooltipContent: { type: "function" },
541
- tooltip: { type: ["function", "object"] },
542
- onHover: { type: "function" },
543
- annotations: { type: "array" },
544
- svgAnnotationRules: { type: "function" },
545
- tickFormatTime: { type: "function" },
546
- tickFormatValue: { type: "function" },
547
- width: { type: "number" },
548
- height: { type: "number" },
549
- decay: { type: "object" },
550
- pulse: { type: "object" },
551
- staleness: { type: "object" },
552
- transition: { type: "object" },
553
- },
554
- },
555
- RealtimeWaterfallChart: {
556
- required: [],
557
- dataShape: "realtime",
558
- dataAccessors: [],
559
- props: {
560
- size: { type: "array" },
561
- margin: { type: "object" },
562
- className: { type: "string" },
563
- timeAccessor: { type: ["string", "function"] },
564
- valueAccessor: { type: ["string", "function"] },
565
- windowSize: { type: "number" },
566
- windowMode: { type: "string", enum: ["sliding", "stepping"] },
567
- arrowOfTime: { type: "string", enum: ["left", "right"] },
568
- positiveColor: { type: "string" },
569
- negativeColor: { type: "string" },
570
- connectorStroke: { type: "string" },
571
- connectorWidth: { type: "number" },
572
- gap: { type: "number" },
573
- stroke: { type: "string" },
574
- strokeWidth: { type: "number" },
575
- timeExtent: { type: "array" },
576
- valueExtent: { type: "array" },
577
- extentPadding: { type: "number" },
578
- showAxes: { type: "boolean" },
579
- background: { type: "string" },
580
- enableHover: { type: ["boolean", "object"] },
581
- tooltipContent: { type: "function" },
582
- tooltip: { type: ["function", "object"] },
583
- onHover: { type: "function" },
584
- annotations: { type: "array" },
585
- svgAnnotationRules: { type: "function" },
586
- tickFormatTime: { type: "function" },
587
- tickFormatValue: { type: "function" },
588
- width: { type: "number" },
589
- height: { type: "number" },
590
- decay: { type: "object" },
591
- pulse: { type: "object" },
592
- staleness: { type: "object" },
593
- transition: { type: "object" },
594
- },
595
- },
596
- RealtimeHeatmap: {
597
- required: [],
598
- dataShape: "realtime",
599
- dataAccessors: [],
600
- props: {
601
- size: { type: "array" },
602
- margin: { type: "object" },
603
- className: { type: "string" },
604
- timeAccessor: { type: ["string", "function"] },
605
- valueAccessor: { type: ["string", "function"] },
606
- heatmapXBins: { type: "number" },
607
- heatmapYBins: { type: "number" },
608
- aggregation: { type: "string", enum: ["count", "sum", "mean"] },
609
- windowSize: { type: "number" },
610
- windowMode: { type: "string", enum: ["sliding", "stepping"] },
611
- arrowOfTime: { type: "string", enum: ["left", "right"] },
612
- timeExtent: { type: "array" },
613
- valueExtent: { type: "array" },
614
- extentPadding: { type: "number" },
615
- showAxes: { type: "boolean" },
616
- background: { type: "string" },
617
- enableHover: { type: ["boolean", "object"] },
618
- tooltipContent: { type: "function" },
619
- tooltip: { type: ["function", "object"] },
620
- onHover: { type: "function" },
621
- annotations: { type: "array" },
622
- svgAnnotationRules: { type: "function" },
623
- tickFormatTime: { type: "function" },
624
- tickFormatValue: { type: "function" },
625
- width: { type: "number" },
626
- height: { type: "number" },
627
- decay: { type: "object" },
628
- pulse: { type: "object" },
629
- staleness: { type: "object" },
630
- },
631
- },
632
- };
633
- // ---------------------------------------------------------------------------
634
- // Helpers
635
- // ---------------------------------------------------------------------------
636
- function checkType(value, expected) {
637
- const types = Array.isArray(expected) ? expected : [expected];
638
- const actual = Array.isArray(value) ? "array" : typeof value;
639
- return types.includes(actual);
640
- }
641
- // ---------------------------------------------------------------------------
642
- // Public API
643
- // ---------------------------------------------------------------------------
644
- /**
645
- * Validate props for a Semiotic HOC chart component.
646
- *
647
- * Checks: component name, required props, prop types, enum values,
648
- * unknown prop names (typo detection), and data shape + accessor validity.
649
- */
650
- function validateProps(componentName, props) {
651
- const errors = [];
652
- // 1. Component name check
653
- const spec = VALIDATION_MAP[componentName];
654
- if (!spec) {
655
- return {
656
- valid: false,
657
- errors: [
658
- `Unknown component "${componentName}". Valid components: ${Object.keys(VALIDATION_MAP).join(", ")}`,
659
- ],
660
- };
661
- }
662
- // 2. Required props
663
- for (const req of spec.required) {
664
- if (props[req] === undefined || props[req] === null) {
665
- errors.push(`"${req}" is required for ${componentName}.`);
666
- }
667
- }
668
- // 3. Prop types & enum values
669
- for (const [key, value] of Object.entries(props)) {
670
- if (value === undefined || value === null)
671
- continue;
672
- const def = spec.props[key];
673
- if (!def)
674
- continue; // unknown prop — checked in step 5
675
- // Type check
676
- if (!checkType(value, def.type)) {
677
- const expectedStr = Array.isArray(def.type)
678
- ? def.type.join(" | ")
679
- : def.type;
680
- errors.push(`"${key}" should be ${expectedStr}, got ${Array.isArray(value) ? "array" : typeof value}.`);
681
- continue;
682
- }
683
- // Enum check
684
- if (def.enum && typeof value === "string" && !def.enum.includes(value)) {
685
- errors.push(`"${key}" value "${value}" is not valid. Expected one of: ${def.enum.join(", ")}.`);
686
- }
687
- }
688
- // 4. Unknown props (warn on typos)
689
- const knownProps = new Set(Object.keys(spec.props));
690
- for (const key of Object.keys(props)) {
691
- if (props[key] === undefined)
692
- continue;
693
- if (!knownProps.has(key)) {
694
- errors.push(`Unknown prop "${key}" for ${componentName}. Check for typos.`);
695
- }
696
- }
697
- // 5. Data shape + accessor validation (delegate to existing helpers)
698
- if (spec.dataShape === "array") {
699
- const data = props.data;
700
- const accessors = {};
701
- for (const acc of spec.dataAccessors) {
702
- const val = props[acc];
703
- if (typeof val === "string") {
704
- accessors[acc] = val;
705
- }
706
- }
707
- const dataError = (0, validateChartData_1.validateArrayData)({
708
- componentName,
709
- data,
710
- accessors: Object.keys(accessors).length > 0 ? accessors : undefined,
711
- });
712
- if (dataError)
713
- errors.push(dataError);
714
- }
715
- else if (spec.dataShape === "object") {
716
- const dataError = (0, validateChartData_2.validateObjectData)({
717
- componentName,
718
- data: props.data,
719
- });
720
- if (dataError)
721
- errors.push(dataError);
722
- }
723
- else if (spec.dataShape === "network") {
724
- const dataError = (0, validateChartData_3.validateNetworkData)({
725
- componentName,
726
- nodes: props.nodes,
727
- edges: props.edges,
728
- nodesRequired: spec.required.includes("nodes"),
729
- edgesRequired: spec.required.includes("edges"),
730
- });
731
- if (dataError)
732
- errors.push(dataError);
733
- }
734
- // realtime charts: no data validation (ref-based push API)
735
- return { valid: errors.length === 0, errors };
736
- }