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,594 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.renderToStaticSVG = renderToStaticSVG;
37
- exports.renderXYToStaticSVG = renderXYToStaticSVG;
38
- exports.renderOrdinalToStaticSVG = renderOrdinalToStaticSVG;
39
- exports.renderNetworkToStaticSVG = renderNetworkToStaticSVG;
40
- const React = __importStar(require("react"));
41
- const ReactDOMServer = __importStar(require("react-dom/server"));
42
- const d3_shape_1 = require("d3-shape");
43
- const PipelineStore_1 = require("../stream/PipelineStore");
44
- const layouts_1 = require("../stream/layouts");
45
- const OrdinalPipelineStore_1 = require("../stream/OrdinalPipelineStore");
46
- // ── Scene graph → SVG conversion ──────────────────────────────────────────
47
- function sceneNodeToSVG(node, i) {
48
- switch (node.type) {
49
- case "line": {
50
- const n = node;
51
- if (n.path.length === 0)
52
- return null;
53
- const d = "M" + n.path.map(([x, y]) => `${x},${y}`).join("L");
54
- return (React.createElement("path", { key: `line-${i}`, d: d, fill: "none", stroke: n.style.stroke || "#4e79a7", strokeWidth: n.style.strokeWidth || 2, strokeDasharray: n.style.strokeDasharray, opacity: n.style.opacity }));
55
- }
56
- case "area": {
57
- const n = node;
58
- if (n.topPath.length === 0)
59
- return null;
60
- const top = n.topPath.map(([x, y]) => `${x},${y}`).join("L");
61
- const bottom = [...n.bottomPath].reverse().map(([x, y]) => `${x},${y}`).join("L");
62
- const d = `M${top}L${bottom}Z`;
63
- return (React.createElement("path", { key: `area-${i}`, d: d, fill: n.style.fill || "#4e79a7", fillOpacity: n.style.fillOpacity ?? n.style.opacity ?? 0.7, stroke: n.style.stroke, strokeWidth: n.style.strokeWidth }));
64
- }
65
- case "point": {
66
- const n = node;
67
- return (React.createElement("circle", { key: `point-${i}`, cx: n.x, cy: n.y, r: n.r, fill: n.style.fill || "#4e79a7", opacity: n.style.opacity ?? 0.8, stroke: n.style.stroke, strokeWidth: n.style.strokeWidth }));
68
- }
69
- case "rect": {
70
- const n = node;
71
- return (React.createElement("rect", { key: `rect-${i}`, x: n.x, y: n.y, width: n.w, height: n.h, fill: n.style.fill || "#4e79a7", opacity: n.style.opacity, stroke: n.style.stroke, strokeWidth: n.style.strokeWidth }));
72
- }
73
- case "heatcell": {
74
- const n = node;
75
- return (React.createElement("rect", { key: `heatcell-${i}`, x: n.x, y: n.y, width: n.w, height: n.h, fill: n.fill }));
76
- }
77
- case "candlestick": {
78
- const n = node;
79
- const bodyTop = Math.min(n.openY, n.closeY);
80
- const bodyHeight = Math.max(Math.abs(n.openY - n.closeY), 1);
81
- const bodyColor = n.isUp ? n.upColor : n.downColor;
82
- return (React.createElement("g", { key: `candle-${i}` },
83
- React.createElement("line", { x1: n.x, y1: n.highY, x2: n.x, y2: n.lowY, stroke: n.wickColor, strokeWidth: n.wickWidth }),
84
- React.createElement("rect", { x: n.x - n.bodyWidth / 2, y: bodyTop, width: n.bodyWidth, height: bodyHeight, fill: bodyColor, stroke: bodyColor, strokeWidth: 1 })));
85
- }
86
- default:
87
- return null;
88
- }
89
- }
90
- function defaultTickFormat(v) {
91
- return String(Math.round(v * 100) / 100);
92
- }
93
- function generateAxesSVG(scales, layout, props) {
94
- const xTicks = scales.x.ticks(5).map(v => ({
95
- pixel: scales.x(v),
96
- label: (props.xFormat || props.tickFormatTime || defaultTickFormat)(v)
97
- }));
98
- const yTicks = scales.y.ticks(5).map(v => ({
99
- pixel: scales.y(v),
100
- label: (props.yFormat || props.tickFormatValue || defaultTickFormat)(v)
101
- }));
102
- return (React.createElement("g", { className: "stream-axes" },
103
- React.createElement("line", { x1: 0, y1: layout.height, x2: layout.width, y2: layout.height, stroke: "#ccc", strokeWidth: 1 }),
104
- xTicks.map((tick, i) => (React.createElement("g", { key: `xtick-${i}`, transform: `translate(${tick.pixel},${layout.height})` },
105
- React.createElement("line", { y2: 5, stroke: "#ccc", strokeWidth: 1 }),
106
- React.createElement("text", { y: 18, textAnchor: "middle", fontSize: 10, fill: "#666" }, tick.label)))),
107
- props.xLabel && (React.createElement("text", { x: layout.width / 2, y: layout.height + 40, textAnchor: "middle", fontSize: 12, fill: "#333" }, props.xLabel)),
108
- React.createElement("line", { x1: 0, y1: 0, x2: 0, y2: layout.height, stroke: "#ccc", strokeWidth: 1 }),
109
- yTicks.map((tick, i) => (React.createElement("g", { key: `ytick-${i}`, transform: `translate(0,${tick.pixel})` },
110
- React.createElement("line", { x2: -5, stroke: "#ccc", strokeWidth: 1 }),
111
- React.createElement("text", { x: -8, textAnchor: "end", dominantBaseline: "middle", fontSize: 10, fill: "#666" }, tick.label)))),
112
- props.yLabel && (React.createElement("text", { x: -(props.margin?.left ?? 40) + 15, y: layout.height / 2, textAnchor: "middle", fontSize: 12, fill: "#333", transform: `rotate(-90, ${-(props.margin?.left ?? 40) + 15}, ${layout.height / 2})` }, props.yLabel))));
113
- }
114
- // ── StreamXYFrame SSR ─────────────────────────────────────────────────────
115
- function renderStreamXYFrame(props) {
116
- const defaultMargin = { top: 20, right: 20, bottom: 30, left: 40 };
117
- const size = props.size || [500, 300];
118
- const margin = { ...defaultMargin, ...props.margin };
119
- const width = size[0] - margin.left - margin.right;
120
- const height = size[1] - margin.top - margin.bottom;
121
- const isStreaming = props.runtimeMode === "streaming" ||
122
- ["bar", "swarm", "waterfall"].includes(props.chartType);
123
- const pipelineConfig = {
124
- chartType: props.chartType,
125
- windowSize: props.windowSize ?? 200,
126
- windowMode: props.windowMode ?? "sliding",
127
- arrowOfTime: isStreaming ? (props.arrowOfTime ?? "right") : "right",
128
- extentPadding: props.extentPadding ?? 0.1,
129
- xAccessor: isStreaming ? undefined : props.xAccessor,
130
- yAccessor: isStreaming ? undefined : props.yAccessor,
131
- timeAccessor: isStreaming ? props.timeAccessor : undefined,
132
- valueAccessor: props.valueAccessor,
133
- colorAccessor: props.colorAccessor,
134
- sizeAccessor: props.sizeAccessor,
135
- groupAccessor: props.groupAccessor,
136
- categoryAccessor: props.categoryAccessor,
137
- lineDataAccessor: props.lineDataAccessor,
138
- xExtent: props.xExtent,
139
- yExtent: props.yExtent,
140
- sizeRange: props.sizeRange,
141
- binSize: props.binSize,
142
- normalize: props.normalize,
143
- boundsAccessor: props.boundsAccessor,
144
- boundsStyle: props.boundsStyle,
145
- openAccessor: props.openAccessor,
146
- highAccessor: props.highAccessor,
147
- lowAccessor: props.lowAccessor,
148
- closeAccessor: props.closeAccessor,
149
- candlestickStyle: props.candlestickStyle,
150
- lineStyle: props.lineStyle,
151
- pointStyle: props.pointStyle,
152
- areaStyle: props.areaStyle,
153
- colorScheme: props.colorScheme,
154
- barColors: props.barColors
155
- };
156
- const store = new PipelineStore_1.PipelineStore(pipelineConfig);
157
- // Ingest bounded data
158
- if (props.data) {
159
- store.ingest({ inserts: props.data, bounded: true });
160
- }
161
- // Compute scene graph
162
- store.computeScene({ width, height });
163
- if (!store.scales || store.scene.length === 0) {
164
- // No data — return empty SVG
165
- return ReactDOMServer.renderToStaticMarkup(React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stream-xy-frame", width: size[0], height: size[1] }));
166
- }
167
- // Convert scene nodes to SVG
168
- const dataMarks = store.scene
169
- .map((node, i) => sceneNodeToSVG(node, i))
170
- .filter(Boolean);
171
- // Generate axes
172
- const showAxes = props.showAxes !== false;
173
- const axes = showAxes
174
- ? generateAxesSVG(store.scales, { width, height }, props)
175
- : null;
176
- // Title
177
- const title = props.title && typeof props.title === "string" ? (React.createElement("text", { x: size[0] / 2, y: 16, textAnchor: "middle", fontSize: 14, fontWeight: "bold", fill: "#333" }, props.title)) : null;
178
- // Background
179
- const bg = props.background ? (React.createElement("rect", { x: 0, y: 0, width: width, height: height, fill: props.background })) : null;
180
- const svgElement = (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `stream-xy-frame${props.className ? ` ${props.className}` : ""}`, width: size[0], height: size[1] },
181
- React.createElement("g", { transform: `translate(${margin.left},${margin.top})` },
182
- bg,
183
- dataMarks,
184
- axes),
185
- title));
186
- return ReactDOMServer.renderToStaticMarkup(svgElement);
187
- }
188
- // ── Network scene graph → SVG conversion ──────────────────────────────────
189
- function networkSceneNodeToSVG(node, i) {
190
- switch (node.type) {
191
- case "circle": {
192
- const n = node;
193
- return (React.createElement("circle", { key: `net-circle-${i}`, cx: n.cx, cy: n.cy, r: n.r, fill: n.style.fill || "#4e79a7", stroke: n.style.stroke, strokeWidth: n.style.strokeWidth, opacity: n.style.opacity }));
194
- }
195
- case "rect": {
196
- const n = node;
197
- return (React.createElement("rect", { key: `net-rect-${i}`, x: n.x, y: n.y, width: n.w, height: n.h, fill: n.style.fill || "#4e79a7", stroke: n.style.stroke, strokeWidth: n.style.strokeWidth, opacity: n.style.opacity }));
198
- }
199
- case "arc": {
200
- const n = node;
201
- const arcPath = (0, d3_shape_1.arc)()
202
- .innerRadius(n.innerR)
203
- .outerRadius(n.outerR)
204
- .startAngle(n.startAngle)
205
- .endAngle(n.endAngle)({}) || "";
206
- return (React.createElement("path", { key: `net-arc-${i}`, d: arcPath, transform: `translate(${n.cx},${n.cy})`, fill: n.style.fill || "#4e79a7", stroke: n.style.stroke, strokeWidth: n.style.strokeWidth, opacity: n.style.opacity }));
207
- }
208
- default:
209
- return null;
210
- }
211
- }
212
- function networkSceneEdgeToSVG(edge, i) {
213
- switch (edge.type) {
214
- case "line": {
215
- const e = edge;
216
- return (React.createElement("line", { key: `net-edge-line-${i}`, x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2, stroke: e.style.stroke || "#999", strokeWidth: e.style.strokeWidth || 1, opacity: e.style.opacity }));
217
- }
218
- case "bezier": {
219
- const e = edge;
220
- return (React.createElement("path", { key: `net-edge-bezier-${i}`, d: e.pathD, fill: e.style.fill || "#999", fillOpacity: e.style.fillOpacity, stroke: e.style.stroke || "none", strokeWidth: e.style.strokeWidth, opacity: e.style.opacity }));
221
- }
222
- case "ribbon": {
223
- const e = edge;
224
- return (React.createElement("path", { key: `net-edge-ribbon-${i}`, d: e.pathD, fill: e.style.fill || "#999", fillOpacity: e.style.fillOpacity, stroke: e.style.stroke || "none", strokeWidth: e.style.strokeWidth, opacity: e.style.opacity }));
225
- }
226
- case "curved": {
227
- const e = edge;
228
- return (React.createElement("path", { key: `net-edge-curved-${i}`, d: e.pathD, fill: e.style.fill || "none", stroke: e.style.stroke || "#999", strokeWidth: e.style.strokeWidth || 1, opacity: e.style.opacity }));
229
- }
230
- default:
231
- return null;
232
- }
233
- }
234
- function networkLabelToSVG(label, i) {
235
- return (React.createElement("text", { key: `net-label-${i}`, x: label.x, y: label.y, textAnchor: label.anchor || "middle", dominantBaseline: (label.baseline || "auto"), fontSize: label.fontSize || 11, fontWeight: label.fontWeight, fill: label.fill || "#333", stroke: label.stroke, strokeWidth: label.strokeWidth, paintOrder: label.paintOrder }, label.text));
236
- }
237
- // ── Helper functions for building RealtimeNodes/Edges from props ──────────
238
- function resolveAccessor(accessor, defaultKey) {
239
- if (!accessor)
240
- return (d) => d[defaultKey];
241
- if (typeof accessor === "function")
242
- return accessor;
243
- return (d) => d[accessor];
244
- }
245
- function buildRealtimeNodes(propsNodes, config) {
246
- const nodeIDFn = resolveAccessor(config.nodeIDAccessor, "id");
247
- return propsNodes.map((d) => ({
248
- id: String(nodeIDFn(d)),
249
- x: 0,
250
- y: 0,
251
- x0: 0,
252
- x1: 0,
253
- y0: 0,
254
- y1: 0,
255
- width: 0,
256
- height: 0,
257
- value: 0,
258
- data: d
259
- }));
260
- }
261
- function buildRealtimeEdges(propsEdges, config) {
262
- const sourceFn = resolveAccessor(config.sourceAccessor, "source");
263
- const targetFn = resolveAccessor(config.targetAccessor, "target");
264
- const valueFn = resolveAccessor(config.valueAccessor, "value");
265
- return propsEdges.map((d) => ({
266
- source: String(sourceFn(d)),
267
- target: String(targetFn(d)),
268
- value: Number(valueFn(d)) || 1,
269
- y0: 0,
270
- y1: 0,
271
- sankeyWidth: 0,
272
- data: d
273
- }));
274
- }
275
- // ── Stream-first network renderer ─────────────────────────────────────────
276
- const HIERARCHICAL_TYPES = new Set([
277
- "tree",
278
- "cluster",
279
- "treemap",
280
- "circlepack",
281
- "partition"
282
- ]);
283
- function renderNetworkFrame(props) {
284
- const chartType = props.chartType || "force";
285
- const size = props.size || [500, 500];
286
- const defaultMargin = { top: 20, right: 20, bottom: 20, left: 20 };
287
- const margin = { ...defaultMargin, ...props.margin };
288
- const innerWidth = size[0] - margin.left - margin.right;
289
- const innerHeight = size[1] - margin.top - margin.bottom;
290
- const plugin = (0, layouts_1.getLayoutPlugin)(chartType);
291
- if (!plugin) {
292
- throw new Error(`No layout plugin found for chart type: "${chartType}". ` +
293
- `Supported types: force, sankey, chord, tree, cluster, treemap, circlepack, partition.`);
294
- }
295
- // Build pipeline config from props
296
- const config = {
297
- chartType,
298
- nodeIDAccessor: props.nodeIDAccessor,
299
- sourceAccessor: props.sourceAccessor,
300
- targetAccessor: props.targetAccessor,
301
- valueAccessor: props.valueAccessor,
302
- childrenAccessor: props.childrenAccessor,
303
- hierarchySum: props.hierarchySum,
304
- orientation: props.orientation,
305
- nodeAlign: props.nodeAlign,
306
- nodePaddingRatio: props.nodePaddingRatio,
307
- nodeWidth: props.nodeWidth,
308
- iterations: props.iterations,
309
- forceStrength: props.forceStrength,
310
- padAngle: props.padAngle,
311
- groupWidth: props.groupWidth,
312
- sortGroups: props.sortGroups,
313
- edgeSort: props.edgeSort,
314
- treeOrientation: props.treeOrientation,
315
- edgeType: props.edgeType,
316
- padding: props.padding,
317
- paddingTop: props.paddingTop,
318
- nodeStyle: props.nodeStyle,
319
- edgeStyle: props.edgeStyle,
320
- nodeLabel: props.nodeLabel,
321
- showLabels: props.showLabels,
322
- colorBy: props.colorBy,
323
- colorScheme: props.colorScheme,
324
- edgeColorBy: props.edgeColorBy,
325
- edgeOpacity: props.edgeOpacity,
326
- colorByDepth: props.colorByDepth,
327
- nodeSize: props.nodeSize,
328
- nodeSizeRange: props.nodeSizeRange
329
- };
330
- let nodes;
331
- let edges;
332
- if (HIERARCHICAL_TYPES.has(chartType)) {
333
- // Hierarchical layouts: single root object from props.data or props.edges
334
- const hierarchyRoot = props.data || props.edges;
335
- if (!hierarchyRoot || Array.isArray(hierarchyRoot)) {
336
- // No valid hierarchy root — return empty SVG
337
- return ReactDOMServer.renderToStaticMarkup(React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stream-network-frame", width: size[0], height: size[1] }));
338
- }
339
- // The hierarchy plugin expects the root via config.__hierarchyRoot
340
- ;
341
- config.__hierarchyRoot = hierarchyRoot;
342
- // computeLayout will populate these arrays from the hierarchy
343
- nodes = [];
344
- edges = [];
345
- }
346
- else {
347
- // Graph layouts (force, sankey, chord): nodes + edges arrays
348
- const propsNodes = props.nodes || [];
349
- const propsEdges = Array.isArray(props.edges) ? props.edges : [];
350
- if (propsNodes.length === 0 && propsEdges.length === 0) {
351
- return ReactDOMServer.renderToStaticMarkup(React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stream-network-frame", width: size[0], height: size[1] }));
352
- }
353
- nodes = buildRealtimeNodes(propsNodes, config);
354
- edges = buildRealtimeEdges(propsEdges, config);
355
- }
356
- // Run layout
357
- plugin.computeLayout(nodes, edges, config, [innerWidth, innerHeight]);
358
- // Build scene graph
359
- const { sceneNodes, sceneEdges, labels } = plugin.buildScene(nodes, edges, config, [innerWidth, innerHeight]);
360
- // Convert scene graph to SVG elements
361
- const edgeElements = sceneEdges
362
- .map((edge, i) => networkSceneEdgeToSVG(edge, i))
363
- .filter(Boolean);
364
- const nodeElements = sceneNodes
365
- .map((node, i) => networkSceneNodeToSVG(node, i))
366
- .filter(Boolean);
367
- const labelElements = labels
368
- .map((label, i) => networkLabelToSVG(label, i))
369
- .filter(Boolean);
370
- // Title
371
- const title = props.title && typeof props.title === "string" ? (React.createElement("text", { x: size[0] / 2, y: 16, textAnchor: "middle", fontSize: 14, fontWeight: "bold", fill: "#333" }, props.title)) : null;
372
- // Background
373
- const bg = props.background ? (React.createElement("rect", { x: 0, y: 0, width: innerWidth, height: innerHeight, fill: props.background })) : null;
374
- const svgElement = (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `stream-network-frame${props.className ? ` ${props.className}` : ""}`, width: size[0], height: size[1] },
375
- React.createElement("g", { transform: `translate(${margin.left},${margin.top})` },
376
- bg,
377
- edgeElements,
378
- nodeElements,
379
- labelElements),
380
- title));
381
- return ReactDOMServer.renderToStaticMarkup(svgElement);
382
- }
383
- // ── Ordinal scene graph → SVG conversion ─────────────────────────────
384
- function ordinalSceneNodeToSVG(node, i) {
385
- switch (node.type) {
386
- case "rect": {
387
- const n = node;
388
- return (React.createElement("rect", { key: `ord-rect-${i}`, x: n.x, y: n.y, width: n.w, height: n.h, fill: n.style.fill || "#4e79a7", opacity: n.style.opacity, stroke: n.style.stroke, strokeWidth: n.style.strokeWidth }));
389
- }
390
- case "point": {
391
- const n = node;
392
- return (React.createElement("circle", { key: `ord-point-${i}`, cx: n.x, cy: n.y, r: n.r, fill: n.style.fill || "#4e79a7", opacity: n.style.opacity ?? 0.8, stroke: n.style.stroke, strokeWidth: n.style.strokeWidth }));
393
- }
394
- case "wedge": {
395
- const n = node;
396
- const arcPath = (0, d3_shape_1.arc)()
397
- .innerRadius(n.innerRadius)
398
- .outerRadius(n.outerRadius)
399
- .startAngle(n.startAngle)
400
- .endAngle(n.endAngle)({}) || "";
401
- return (React.createElement("path", { key: `ord-wedge-${i}`, d: arcPath, transform: `translate(${n.cx},${n.cy})`, fill: n.style.fill || "#4e79a7", stroke: n.style.stroke, strokeWidth: n.style.strokeWidth, opacity: n.style.opacity }));
402
- }
403
- case "boxplot": {
404
- const n = node;
405
- const halfW = n.columnWidth / 2;
406
- if (n.projection === "vertical") {
407
- return (React.createElement("g", { key: `ord-boxplot-${i}` },
408
- React.createElement("line", { x1: n.x, y1: n.minPos, x2: n.x, y2: n.maxPos, stroke: n.style.stroke || "#333", strokeWidth: 1 }),
409
- React.createElement("rect", { x: n.x - halfW, y: Math.min(n.q1Pos, n.q3Pos), width: n.columnWidth, height: Math.abs(n.q3Pos - n.q1Pos), fill: n.style.fill || "#4e79a7", fillOpacity: n.style.fillOpacity ?? 0.6, stroke: n.style.stroke || "#333", strokeWidth: 1 }),
410
- React.createElement("line", { x1: n.x - halfW, y1: n.medianPos, x2: n.x + halfW, y2: n.medianPos, stroke: n.style.stroke || "#333", strokeWidth: 2 }),
411
- React.createElement("line", { x1: n.x - halfW * 0.5, y1: n.minPos, x2: n.x + halfW * 0.5, y2: n.minPos, stroke: n.style.stroke || "#333", strokeWidth: 1 }),
412
- React.createElement("line", { x1: n.x - halfW * 0.5, y1: n.maxPos, x2: n.x + halfW * 0.5, y2: n.maxPos, stroke: n.style.stroke || "#333", strokeWidth: 1 })));
413
- }
414
- else {
415
- // horizontal
416
- return (React.createElement("g", { key: `ord-boxplot-${i}` },
417
- React.createElement("line", { x1: n.minPos, y1: n.y, x2: n.maxPos, y2: n.y, stroke: n.style.stroke || "#333", strokeWidth: 1 }),
418
- React.createElement("rect", { x: Math.min(n.q1Pos, n.q3Pos), y: n.y - halfW, width: Math.abs(n.q3Pos - n.q1Pos), height: n.columnWidth, fill: n.style.fill || "#4e79a7", fillOpacity: n.style.fillOpacity ?? 0.6, stroke: n.style.stroke || "#333", strokeWidth: 1 }),
419
- React.createElement("line", { x1: n.medianPos, y1: n.y - halfW, x2: n.medianPos, y2: n.y + halfW, stroke: n.style.stroke || "#333", strokeWidth: 2 }),
420
- React.createElement("line", { x1: n.minPos, y1: n.y - halfW * 0.5, x2: n.minPos, y2: n.y + halfW * 0.5, stroke: n.style.stroke || "#333", strokeWidth: 1 }),
421
- React.createElement("line", { x1: n.maxPos, y1: n.y - halfW * 0.5, x2: n.maxPos, y2: n.y + halfW * 0.5, stroke: n.style.stroke || "#333", strokeWidth: 1 })));
422
- }
423
- }
424
- case "violin": {
425
- const n = node;
426
- const elements = [
427
- React.createElement("path", { key: `ord-violin-path-${i}`, d: n.pathString, transform: n.translateX || n.translateY ? `translate(${n.translateX},${n.translateY})` : undefined, fill: n.style.fill || "#4e79a7", fillOpacity: n.style.fillOpacity ?? 0.6, stroke: n.style.stroke || "#333", strokeWidth: n.style.strokeWidth || 1 })
428
- ];
429
- if (n.iqrLine && n.bounds) {
430
- const b = n.bounds;
431
- const midX = b.x + b.width / 2;
432
- const midY = b.y + b.height / 2;
433
- const isVerticalViolin = b.height > b.width;
434
- if (isVerticalViolin) {
435
- elements.push(React.createElement("line", { key: `ord-violin-iqr-${i}`, x1: midX, y1: n.iqrLine.q1Pos, x2: midX, y2: n.iqrLine.q3Pos, stroke: n.style.stroke || "#333", strokeWidth: 2 }), React.createElement("circle", { key: `ord-violin-med-${i}`, cx: midX, cy: n.iqrLine.medianPos, r: 3, fill: "white", stroke: n.style.stroke || "#333", strokeWidth: 1 }));
436
- }
437
- else {
438
- elements.push(React.createElement("line", { key: `ord-violin-iqr-${i}`, x1: n.iqrLine.q1Pos, y1: midY, x2: n.iqrLine.q3Pos, y2: midY, stroke: n.style.stroke || "#333", strokeWidth: 2 }), React.createElement("circle", { key: `ord-violin-med-${i}`, cx: n.iqrLine.medianPos, cy: midY, r: 3, fill: "white", stroke: n.style.stroke || "#333", strokeWidth: 1 }));
439
- }
440
- }
441
- return React.createElement("g", { key: `ord-violin-${i}` }, elements);
442
- }
443
- case "connector": {
444
- const n = node;
445
- return (React.createElement("line", { key: `ord-conn-${i}`, x1: n.x1, y1: n.y1, x2: n.x2, y2: n.y2, stroke: n.style.stroke || "#999", strokeWidth: n.style.strokeWidth || 1, opacity: n.style.opacity ?? 0.5 }));
446
- }
447
- default:
448
- return null;
449
- }
450
- }
451
- function generateOrdinalAxesSVG(store, layout, props) {
452
- const scales = store.scales;
453
- if (!scales)
454
- return null;
455
- // Skip axes for radial projection (pie/donut)
456
- if (scales.projection === "radial")
457
- return null;
458
- const isVertical = scales.projection === "vertical";
459
- const columns = store.columns;
460
- const categoryTicks = Object.values(columns).map(col => ({
461
- pixel: col.middle,
462
- label: (props.oFormat || String)(col.name)
463
- }));
464
- const rTicks = scales.r.ticks(5).map(v => ({
465
- pixel: scales.r(v),
466
- label: (props.rFormat || defaultTickFormat)(v)
467
- }));
468
- if (isVertical) {
469
- // Vertical: categories on x-axis, values on y-axis
470
- return (React.createElement("g", { className: "ordinal-axes" },
471
- React.createElement("line", { x1: 0, y1: layout.height, x2: layout.width, y2: layout.height, stroke: "#ccc", strokeWidth: 1 }),
472
- categoryTicks.map((tick, i) => (React.createElement("g", { key: `oxtick-${i}`, transform: `translate(${tick.pixel},${layout.height})` },
473
- React.createElement("line", { y2: 5, stroke: "#ccc", strokeWidth: 1 }),
474
- React.createElement("text", { y: 18, textAnchor: "middle", fontSize: 10, fill: "#666" }, tick.label)))),
475
- props.oLabel && (React.createElement("text", { x: layout.width / 2, y: layout.height + 40, textAnchor: "middle", fontSize: 12, fill: "#333" }, props.oLabel)),
476
- React.createElement("line", { x1: 0, y1: 0, x2: 0, y2: layout.height, stroke: "#ccc", strokeWidth: 1 }),
477
- rTicks.map((tick, i) => (React.createElement("g", { key: `oytick-${i}`, transform: `translate(0,${tick.pixel})` },
478
- React.createElement("line", { x2: -5, stroke: "#ccc", strokeWidth: 1 }),
479
- React.createElement("text", { x: -8, textAnchor: "end", dominantBaseline: "middle", fontSize: 10, fill: "#666" }, tick.label)))),
480
- props.rLabel && (React.createElement("text", { x: -(props.margin?.left ?? 40) + 15, y: layout.height / 2, textAnchor: "middle", fontSize: 12, fill: "#333", transform: `rotate(-90, ${-(props.margin?.left ?? 40) + 15}, ${layout.height / 2})` }, props.rLabel))));
481
- }
482
- else {
483
- // Horizontal: categories on y-axis, values on x-axis
484
- return (React.createElement("g", { className: "ordinal-axes" },
485
- React.createElement("line", { x1: 0, y1: layout.height, x2: layout.width, y2: layout.height, stroke: "#ccc", strokeWidth: 1 }),
486
- rTicks.map((tick, i) => (React.createElement("g", { key: `oxtick-${i}`, transform: `translate(${tick.pixel},${layout.height})` },
487
- React.createElement("line", { y2: 5, stroke: "#ccc", strokeWidth: 1 }),
488
- React.createElement("text", { y: 18, textAnchor: "middle", fontSize: 10, fill: "#666" }, tick.label)))),
489
- props.rLabel && (React.createElement("text", { x: layout.width / 2, y: layout.height + 40, textAnchor: "middle", fontSize: 12, fill: "#333" }, props.rLabel)),
490
- React.createElement("line", { x1: 0, y1: 0, x2: 0, y2: layout.height, stroke: "#ccc", strokeWidth: 1 }),
491
- categoryTicks.map((tick, i) => (React.createElement("g", { key: `oytick-${i}`, transform: `translate(0,${tick.pixel})` },
492
- React.createElement("line", { x2: -5, stroke: "#ccc", strokeWidth: 1 }),
493
- React.createElement("text", { x: -8, textAnchor: "end", dominantBaseline: "middle", fontSize: 10, fill: "#666" }, tick.label)))),
494
- props.oLabel && (React.createElement("text", { x: -(props.margin?.left ?? 40) + 15, y: layout.height / 2, textAnchor: "middle", fontSize: 12, fill: "#333", transform: `rotate(-90, ${-(props.margin?.left ?? 40) + 15}, ${layout.height / 2})` }, props.oLabel))));
495
- }
496
- }
497
- // ── StreamOrdinalFrame SSR ───────────────────────────────────────────
498
- function renderOrdinalFrame(props) {
499
- const defaultMargin = { top: 20, right: 20, bottom: 30, left: 40 };
500
- const size = props.size || [500, 400];
501
- const margin = { ...defaultMargin, ...props.margin };
502
- const width = size[0] - margin.left - margin.right;
503
- const height = size[1] - margin.top - margin.bottom;
504
- const projection = props.projection || "vertical";
505
- const isRadial = projection === "radial";
506
- const pipelineConfig = {
507
- chartType: props.chartType,
508
- windowSize: props.windowSize ?? 10000,
509
- windowMode: props.windowMode ?? "sliding",
510
- extentPadding: props.extentPadding ?? 0.05,
511
- projection,
512
- oAccessor: props.oAccessor,
513
- rAccessor: props.rAccessor,
514
- colorAccessor: props.colorAccessor,
515
- stackBy: props.stackBy,
516
- groupBy: props.groupBy,
517
- categoryAccessor: props.categoryAccessor,
518
- valueAccessor: props.valueAccessor,
519
- timeAccessor: props.timeAccessor,
520
- rExtent: props.rExtent,
521
- oExtent: props.oExtent,
522
- barPadding: props.barPadding,
523
- innerRadius: props.innerRadius,
524
- normalize: props.normalize,
525
- startAngle: props.startAngle,
526
- bins: props.bins,
527
- showOutliers: props.showOutliers,
528
- showIQR: props.showIQR,
529
- amplitude: props.amplitude,
530
- oSort: props.oSort,
531
- connectorAccessor: props.connectorAccessor,
532
- connectorStyle: props.connectorStyle,
533
- dynamicColumnWidth: props.dynamicColumnWidth,
534
- pieceStyle: props.pieceStyle,
535
- summaryStyle: props.summaryStyle,
536
- colorScheme: props.colorScheme,
537
- barColors: props.barColors
538
- };
539
- const store = new OrdinalPipelineStore_1.OrdinalPipelineStore(pipelineConfig);
540
- // Ingest bounded data
541
- if (props.data) {
542
- store.ingest({ inserts: props.data, bounded: true });
543
- }
544
- // Compute scene graph
545
- store.computeScene({ width, height });
546
- if (!store.scales || store.scene.length === 0) {
547
- return ReactDOMServer.renderToStaticMarkup(React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "stream-ordinal-frame", width: size[0], height: size[1] }));
548
- }
549
- // Convert scene nodes to SVG
550
- const dataMarks = store.scene
551
- .map((node, i) => ordinalSceneNodeToSVG(node, i))
552
- .filter(Boolean);
553
- // Generate axes
554
- const showAxes = props.showAxes !== false;
555
- const axes = showAxes
556
- ? generateOrdinalAxesSVG(store, { width, height }, props)
557
- : null;
558
- // Title
559
- const title = props.title && typeof props.title === "string" ? (React.createElement("text", { x: size[0] / 2, y: 16, textAnchor: "middle", fontSize: 14, fontWeight: "bold", fill: "#333" }, props.title)) : null;
560
- // Background
561
- const bg = props.background ? (React.createElement("rect", { x: 0, y: 0, width: width, height: height, fill: props.background })) : null;
562
- // For radial projection, translate to center
563
- const translateX = isRadial ? margin.left + width / 2 : margin.left;
564
- const translateY = isRadial ? margin.top + height / 2 : margin.top;
565
- const svgElement = (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: `stream-ordinal-frame${props.className ? ` ${props.className}` : ""}`, width: size[0], height: size[1] },
566
- React.createElement("g", { transform: `translate(${translateX},${translateY})` },
567
- bg,
568
- dataMarks,
569
- axes),
570
- title));
571
- return ReactDOMServer.renderToStaticMarkup(svgElement);
572
- }
573
- // ── Public API ────────────────────────────────────────────────────────────
574
- function renderToStaticSVG(frameType, props) {
575
- switch (frameType) {
576
- case "xy":
577
- return renderStreamXYFrame(props);
578
- case "ordinal":
579
- return renderOrdinalFrame(props);
580
- case "network":
581
- return renderNetworkFrame(props);
582
- default:
583
- throw new Error(`Unknown frame type: ${frameType}. Must be "xy", "ordinal", or "network".`);
584
- }
585
- }
586
- function renderXYToStaticSVG(props) {
587
- return renderStreamXYFrame(props);
588
- }
589
- function renderOrdinalToStaticSVG(props) {
590
- return renderOrdinalFrame(props);
591
- }
592
- function renderNetworkToStaticSVG(props) {
593
- return renderNetworkFrame(props);
594
- }