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,278 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildBoxplotScene = buildBoxplotScene;
4
- exports.buildViolinScene = buildViolinScene;
5
- exports.buildHistogramScene = buildHistogramScene;
6
- exports.buildRidgelineScene = buildRidgelineScene;
7
- const d3_array_1 = require("d3-array");
8
- const SceneGraph_1 = require("../SceneGraph");
9
- function buildBoxplotScene(ctx, layout) {
10
- const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
11
- const { r: rScale, projection } = scales;
12
- const nodes = [];
13
- const isVertical = projection === "vertical";
14
- const showOutliers = config.showOutliers !== false;
15
- for (const col of Object.values(columns)) {
16
- const values = col.pieceData
17
- .map(d => getR(d))
18
- .filter(v => v != null && !isNaN(v))
19
- .sort((a, b) => a - b);
20
- if (values.length === 0)
21
- continue;
22
- const min = values[0];
23
- const max = values[values.length - 1];
24
- const q1 = (0, d3_array_1.quantile)(values, 0.25) ?? min;
25
- const median = (0, d3_array_1.quantile)(values, 0.5) ?? (min + max) / 2;
26
- const q3 = (0, d3_array_1.quantile)(values, 0.75) ?? max;
27
- // IQR-based whiskers
28
- const iqr = q3 - q1;
29
- const lowerFence = q1 - 1.5 * iqr;
30
- const upperFence = q3 + 1.5 * iqr;
31
- const whiskerMin = values.find(v => v >= lowerFence) ?? min;
32
- const whiskerMax = [...values].reverse().find(v => v <= upperFence) ?? max;
33
- const style = resolveSummaryStyle(col.pieceData[0], col.name);
34
- const outliers = [];
35
- if (showOutliers) {
36
- for (const d of col.pieceData) {
37
- const v = getR(d);
38
- if (v < lowerFence || v > upperFence) {
39
- const px = isVertical ? col.middle : rScale(v);
40
- const py = isVertical ? rScale(v) : col.middle;
41
- outliers.push({ px, py, value: v, datum: d });
42
- }
43
- }
44
- }
45
- nodes.push({
46
- type: "boxplot",
47
- x: isVertical ? col.middle : 0,
48
- y: isVertical ? 0 : col.middle,
49
- projection: isVertical ? "vertical" : "horizontal",
50
- columnWidth: col.width * 0.6,
51
- minPos: rScale(whiskerMin),
52
- q1Pos: rScale(q1),
53
- medianPos: rScale(median),
54
- q3Pos: rScale(q3),
55
- maxPos: rScale(whiskerMax),
56
- stats: { min: whiskerMin, q1, median, q3, max: whiskerMax },
57
- style,
58
- datum: col.pieceData,
59
- category: col.name,
60
- outliers
61
- });
62
- // Add outlier points
63
- if (showOutliers) {
64
- for (const o of outliers) {
65
- nodes.push({
66
- type: "point",
67
- x: o.px,
68
- y: o.py,
69
- r: 3,
70
- style: { fill: style.fill || "#999", opacity: 0.6 },
71
- datum: o.datum
72
- });
73
- }
74
- }
75
- }
76
- return nodes;
77
- }
78
- function buildViolinScene(ctx, layout) {
79
- const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
80
- const { r: rScale, projection } = scales;
81
- const nodes = [];
82
- const isVertical = projection === "vertical";
83
- const bins = config.bins || 20;
84
- const showIQR = config.showIQR !== false;
85
- for (const col of Object.values(columns)) {
86
- const values = col.pieceData
87
- .map(d => getR(d))
88
- .filter(v => v != null && !isNaN(v))
89
- .sort((a, b) => a - b);
90
- if (values.length < 2)
91
- continue;
92
- const vMin = values[0];
93
- const vMax = values[values.length - 1];
94
- const binWidth = (vMax - vMin) / bins || 1;
95
- // Build histogram bins
96
- const counts = new Array(bins).fill(0);
97
- for (const v of values) {
98
- const idx = Math.min(Math.floor((v - vMin) / binWidth), bins - 1);
99
- counts[idx]++;
100
- }
101
- const maxCount = Math.max(...counts, 1);
102
- // Build symmetric violin path
103
- const halfWidth = col.width / 2 * 0.9;
104
- let pathStr = "";
105
- if (isVertical) {
106
- // Right side (top to bottom)
107
- for (let i = 0; i < bins; i++) {
108
- const y = rScale(vMin + (i + 0.5) * binWidth);
109
- const w = (counts[i] / maxCount) * halfWidth;
110
- pathStr += i === 0 ? `M ${col.middle + w} ${y}` : ` L ${col.middle + w} ${y}`;
111
- }
112
- // Left side (bottom to top)
113
- for (let i = bins - 1; i >= 0; i--) {
114
- const y = rScale(vMin + (i + 0.5) * binWidth);
115
- const w = (counts[i] / maxCount) * halfWidth;
116
- pathStr += ` L ${col.middle - w} ${y}`;
117
- }
118
- pathStr += " Z";
119
- }
120
- else {
121
- // Top side (left to right)
122
- for (let i = 0; i < bins; i++) {
123
- const x = rScale(vMin + (i + 0.5) * binWidth);
124
- const w = (counts[i] / maxCount) * halfWidth;
125
- pathStr += i === 0 ? `M ${x} ${col.middle - w}` : ` L ${x} ${col.middle - w}`;
126
- }
127
- // Bottom side (right to left)
128
- for (let i = bins - 1; i >= 0; i--) {
129
- const x = rScale(vMin + (i + 0.5) * binWidth);
130
- const w = (counts[i] / maxCount) * halfWidth;
131
- pathStr += ` L ${x} ${col.middle + w}`;
132
- }
133
- pathStr += " Z";
134
- }
135
- const style = resolveSummaryStyle(col.pieceData[0], col.name);
136
- // IQR overlay
137
- let iqrLine;
138
- if (showIQR && values.length >= 4) {
139
- const q1 = (0, d3_array_1.quantile)(values, 0.25) ?? vMin;
140
- const median = (0, d3_array_1.quantile)(values, 0.5) ?? (vMin + vMax) / 2;
141
- const q3 = (0, d3_array_1.quantile)(values, 0.75) ?? vMax;
142
- iqrLine = {
143
- q1Pos: rScale(q1),
144
- medianPos: rScale(median),
145
- q3Pos: rScale(q3)
146
- };
147
- }
148
- const violinBounds = isVertical
149
- ? { x: col.x, y: Math.min(rScale(vMax), rScale(vMin)), width: col.width, height: Math.abs(rScale(vMax) - rScale(vMin)) }
150
- : { x: Math.min(rScale(vMin), rScale(vMax)), y: col.x, width: Math.abs(rScale(vMax) - rScale(vMin)), height: col.width };
151
- nodes.push({
152
- type: "violin",
153
- pathString: pathStr,
154
- translateX: 0,
155
- translateY: 0,
156
- bounds: violinBounds,
157
- iqrLine,
158
- style,
159
- datum: col.pieceData,
160
- category: col.name
161
- });
162
- }
163
- return nodes;
164
- }
165
- function buildHistogramScene(ctx, layout) {
166
- const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
167
- const { r: rScale } = scales;
168
- const nodes = [];
169
- const numBins = config.bins || 25;
170
- const isRelative = config.normalize;
171
- // Histograms always render horizontally: categories on y-axis, value bins on x-axis
172
- for (const col of Object.values(columns)) {
173
- const values = col.pieceData
174
- .map(d => getR(d))
175
- .filter(v => v != null && !isNaN(v));
176
- if (values.length === 0)
177
- continue;
178
- const vMin = Math.min(...values);
179
- const vMax = Math.max(...values);
180
- const binWidth = (vMax - vMin) / numBins || 1;
181
- const counts = new Array(numBins).fill(0);
182
- for (const v of values) {
183
- const idx = Math.min(Math.floor((v - vMin) / binWidth), numBins - 1);
184
- counts[idx]++;
185
- }
186
- const total = values.length;
187
- const maxCount = Math.max(...counts, 1);
188
- const style = resolveSummaryStyle(col.pieceData[0], col.name);
189
- for (let i = 0; i < numBins; i++) {
190
- if (counts[i] === 0)
191
- continue;
192
- const normCount = isRelative ? counts[i] / total : counts[i] / maxCount;
193
- // Bar height proportional to count, within the column band
194
- const barH = normCount * col.width * 0.9;
195
- // Bin position on the value (x) axis
196
- const binStart = rScale(vMin + i * binWidth);
197
- const binEnd = rScale(vMin + (i + 1) * binWidth);
198
- const x = Math.min(binStart, binEnd);
199
- const w = Math.abs(binEnd - binStart);
200
- // Align bar to baseline (bottom of the column band)
201
- const y = col.x + col.width - barH;
202
- nodes.push((0, SceneGraph_1.buildRectNode)(x, y, w, barH, style, { bin: i, count: counts[i], range: [vMin + i * binWidth, vMin + (i + 1) * binWidth], category: col.name }, col.name));
203
- }
204
- }
205
- return nodes;
206
- }
207
- function buildRidgelineScene(ctx, layout) {
208
- const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
209
- const { r: rScale, projection } = scales;
210
- const nodes = [];
211
- const numBins = config.bins || 20;
212
- const isHorizontal = projection === "horizontal";
213
- // Amplitude controls how far the density extends (can overlap neighbors)
214
- const amplitude = config.amplitude || 1.5;
215
- for (const col of Object.values(columns)) {
216
- const values = col.pieceData
217
- .map(d => getR(d))
218
- .filter(v => v != null && !isNaN(v))
219
- .sort((a, b) => a - b);
220
- if (values.length < 2)
221
- continue;
222
- const vMin = values[0];
223
- const vMax = values[values.length - 1];
224
- const binWidth = (vMax - vMin) / numBins || 1;
225
- // Build histogram bins
226
- const counts = new Array(numBins).fill(0);
227
- for (const v of values) {
228
- const idx = Math.min(Math.floor((v - vMin) / binWidth), numBins - 1);
229
- counts[idx]++;
230
- }
231
- const maxCount = Math.max(...counts, 1);
232
- const style = resolveSummaryStyle(col.pieceData[0], col.name);
233
- const halfBand = col.width * amplitude;
234
- // Build one-sided area path (density extends in one direction from baseline)
235
- let pathStr = "";
236
- if (isHorizontal) {
237
- // Horizontal: categories on y, values on x
238
- // Baseline is the bottom of the column band, density extends upward
239
- const baseline = col.x + col.width;
240
- // Start at baseline
241
- pathStr = `M ${rScale(vMin)} ${baseline}`;
242
- // Density curve going upward (negative y)
243
- for (let i = 0; i < numBins; i++) {
244
- const x = rScale(vMin + (i + 0.5) * binWidth);
245
- const h = (counts[i] / maxCount) * halfBand;
246
- pathStr += ` L ${x} ${baseline - h}`;
247
- }
248
- // Close back to baseline
249
- pathStr += ` L ${rScale(vMax)} ${baseline} Z`;
250
- }
251
- else {
252
- // Vertical: categories on x, values on y
253
- // Baseline is the left of the column band, density extends rightward
254
- const baseline = col.x;
255
- pathStr = `M ${baseline} ${rScale(vMin)}`;
256
- for (let i = 0; i < numBins; i++) {
257
- const y = rScale(vMin + (i + 0.5) * binWidth);
258
- const w = (counts[i] / maxCount) * halfBand;
259
- pathStr += ` L ${baseline + w} ${y}`;
260
- }
261
- pathStr += ` L ${baseline} ${rScale(vMax)} Z`;
262
- }
263
- const ridgeBounds = isHorizontal
264
- ? { x: Math.min(rScale(vMin), rScale(vMax)), y: col.x, width: Math.abs(rScale(vMax) - rScale(vMin)), height: col.width }
265
- : { x: col.x, y: Math.min(rScale(vMax), rScale(vMin)), width: col.width, height: Math.abs(rScale(vMax) - rScale(vMin)) };
266
- nodes.push({
267
- type: "violin",
268
- pathString: pathStr,
269
- translateX: 0,
270
- translateY: 0,
271
- bounds: ridgeBounds,
272
- style: { ...style, fillOpacity: style.fillOpacity ?? 0.5 },
273
- datum: col.pieceData,
274
- category: col.name
275
- });
276
- }
277
- return nodes;
278
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildTimelineScene = buildTimelineScene;
4
- const SceneGraph_1 = require("../SceneGraph");
5
- function buildTimelineScene(ctx, layout) {
6
- const { scales, columns, getRawRange, resolvePieceStyle } = ctx;
7
- const { r: rScale, projection } = scales;
8
- const nodes = [];
9
- const isHorizontal = projection === "horizontal";
10
- for (const col of Object.values(columns)) {
11
- for (const d of col.pieceData) {
12
- const range = getRawRange(d);
13
- if (!range)
14
- continue;
15
- const [start, end] = range;
16
- const style = resolvePieceStyle(d, col.name);
17
- if (isHorizontal) {
18
- const x0 = rScale(Math.min(start, end));
19
- const x1 = rScale(Math.max(start, end));
20
- nodes.push((0, SceneGraph_1.buildRectNode)(x0, col.x, x1 - x0, col.width, style, d, col.name));
21
- }
22
- else {
23
- const y0 = rScale(Math.max(start, end));
24
- const y1 = rScale(Math.min(start, end));
25
- nodes.push((0, SceneGraph_1.buildRectNode)(col.x, y0, col.width, y1 - y0, style, d, col.name));
26
- }
27
- }
28
- }
29
- return nodes;
30
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.areaCanvasRenderer = void 0;
4
- /**
5
- * Canvas area renderer.
6
- * Renders AreaSceneNode as filled regions between topPath and bottomPath.
7
- * Supports both overlapping areas and stacked areas.
8
- */
9
- const areaCanvasRenderer = (ctx, nodes, scales, layout) => {
10
- const areaNodes = nodes.filter((n) => n.type === "area");
11
- for (const node of areaNodes) {
12
- if (node.topPath.length < 2)
13
- continue;
14
- ctx.beginPath();
15
- // Draw top path forward
16
- const [startX, startY] = node.topPath[0];
17
- ctx.moveTo(startX, startY);
18
- for (let i = 1; i < node.topPath.length; i++) {
19
- ctx.lineTo(node.topPath[i][0], node.topPath[i][1]);
20
- }
21
- // Draw bottom path backward to close the area
22
- for (let i = node.bottomPath.length - 1; i >= 0; i--) {
23
- ctx.lineTo(node.bottomPath[i][0], node.bottomPath[i][1]);
24
- }
25
- ctx.closePath();
26
- // Fill
27
- const fillOpacity = node.style.fillOpacity ?? 0.7;
28
- ctx.globalAlpha = fillOpacity;
29
- ctx.fillStyle = node.style.fill || "#4e79a7";
30
- ctx.fill();
31
- // Stroke on top
32
- if (node.style.stroke && node.style.stroke !== "none") {
33
- ctx.globalAlpha = 1;
34
- ctx.strokeStyle = node.style.stroke;
35
- ctx.lineWidth = node.style.strokeWidth || 2;
36
- ctx.setLineDash([]);
37
- // Only stroke the top path (not the baseline)
38
- ctx.beginPath();
39
- ctx.moveTo(node.topPath[0][0], node.topPath[0][1]);
40
- for (let i = 1; i < node.topPath.length; i++) {
41
- ctx.lineTo(node.topPath[i][0], node.topPath[i][1]);
42
- }
43
- ctx.stroke();
44
- }
45
- ctx.globalAlpha = 1;
46
- }
47
- };
48
- exports.areaCanvasRenderer = areaCanvasRenderer;
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.barCanvasRenderer = void 0;
4
- /**
5
- * Canvas bar renderer.
6
- * Renders RectSceneNode as filled rectangles. Supports icon/isotype mode
7
- * where an image is stamped repeatedly to fill the bar instead of a solid fill.
8
- */
9
- const barCanvasRenderer = (ctx, nodes, scales, layout) => {
10
- const rectNodes = nodes.filter((n) => n.type === "rect");
11
- for (const node of rectNodes) {
12
- if (node.style.opacity != null) {
13
- ctx.globalAlpha = node.style.opacity;
14
- }
15
- if (node.style.icon) {
16
- // Icon/isotype mode: stamp the image to fill the bar
17
- drawIconBar(ctx, node);
18
- }
19
- else {
20
- // Standard solid fill
21
- ctx.fillStyle = node.style.fill || "#007bff";
22
- ctx.fillRect(node.x, node.y, node.w, node.h);
23
- if (node.style.stroke) {
24
- ctx.strokeStyle = node.style.stroke;
25
- ctx.lineWidth = node.style.strokeWidth || 1;
26
- ctx.strokeRect(node.x, node.y, node.w, node.h);
27
- }
28
- }
29
- // Pulse overlay
30
- if (node._pulseIntensity && node._pulseIntensity > 0) {
31
- ctx.globalAlpha = node._pulseIntensity * 0.3;
32
- ctx.fillStyle = node._pulseColor || "rgba(255,255,255,0.6)";
33
- ctx.fillRect(node.x, node.y, node.w, node.h);
34
- }
35
- ctx.globalAlpha = 1;
36
- }
37
- };
38
- exports.barCanvasRenderer = barCanvasRenderer;
39
- function drawIconBar(ctx, node) {
40
- const icon = node.style.icon;
41
- const padding = node.style.iconPadding || 2;
42
- // Determine icon size: fit within the bar width
43
- const iconSize = Math.min(node.w, node.w) - padding;
44
- if (iconSize <= 0)
45
- return;
46
- // Determine if bar is primarily vertical or horizontal
47
- const isVerticalBar = node.h > node.w;
48
- ctx.save();
49
- ctx.beginPath();
50
- ctx.rect(node.x, node.y, node.w, node.h);
51
- ctx.clip();
52
- if (isVerticalBar) {
53
- // Stamp icons from bottom to top
54
- const step = iconSize + padding;
55
- const startY = node.y + node.h - iconSize;
56
- const centerX = node.x + (node.w - iconSize) / 2;
57
- for (let y = startY; y >= node.y - iconSize; y -= step) {
58
- ctx.drawImage(icon, centerX, y, iconSize, iconSize);
59
- }
60
- }
61
- else {
62
- // Stamp icons from left to right
63
- const step = iconSize + padding;
64
- const centerY = node.y + (node.h - iconSize) / 2;
65
- for (let x = node.x; x < node.x + node.w; x += step) {
66
- ctx.drawImage(icon, x, centerY, iconSize, iconSize);
67
- }
68
- }
69
- ctx.restore();
70
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.boxplotCanvasRenderer = void 0;
4
- const boxplotCanvasRenderer = (ctx, nodes, _scales, _layout) => {
5
- const boxNodes = nodes.filter((n) => n.type === "boxplot");
6
- for (const node of boxNodes) {
7
- const halfWidth = node.columnWidth / 2;
8
- const isVert = node.projection === "vertical";
9
- const fillColor = node.style.fill || "#007bff";
10
- const strokeColor = node.style.stroke || "#333";
11
- const lineWidth = node.style.strokeWidth || 1;
12
- const opacity = node.style.fillOpacity ?? node.style.opacity ?? 0.6;
13
- ctx.save();
14
- // Whisker line (min to max)
15
- ctx.strokeStyle = strokeColor;
16
- ctx.lineWidth = lineWidth;
17
- ctx.beginPath();
18
- if (isVert) {
19
- ctx.moveTo(node.x, node.minPos);
20
- ctx.lineTo(node.x, node.maxPos);
21
- }
22
- else {
23
- ctx.moveTo(node.minPos, node.y);
24
- ctx.lineTo(node.maxPos, node.y);
25
- }
26
- ctx.stroke();
27
- // Whisker caps
28
- ctx.beginPath();
29
- if (isVert) {
30
- ctx.moveTo(node.x - halfWidth * 0.4, node.minPos);
31
- ctx.lineTo(node.x + halfWidth * 0.4, node.minPos);
32
- ctx.moveTo(node.x - halfWidth * 0.4, node.maxPos);
33
- ctx.lineTo(node.x + halfWidth * 0.4, node.maxPos);
34
- }
35
- else {
36
- ctx.moveTo(node.minPos, node.y - halfWidth * 0.4);
37
- ctx.lineTo(node.minPos, node.y + halfWidth * 0.4);
38
- ctx.moveTo(node.maxPos, node.y - halfWidth * 0.4);
39
- ctx.lineTo(node.maxPos, node.y + halfWidth * 0.4);
40
- }
41
- ctx.stroke();
42
- // IQR box (q1 to q3)
43
- ctx.globalAlpha = opacity;
44
- ctx.fillStyle = fillColor;
45
- if (isVert) {
46
- const boxTop = Math.min(node.q1Pos, node.q3Pos);
47
- const boxH = Math.abs(node.q3Pos - node.q1Pos);
48
- ctx.fillRect(node.x - halfWidth, boxTop, node.columnWidth, boxH);
49
- ctx.globalAlpha = 1;
50
- ctx.strokeRect(node.x - halfWidth, boxTop, node.columnWidth, boxH);
51
- }
52
- else {
53
- const boxLeft = Math.min(node.q1Pos, node.q3Pos);
54
- const boxW = Math.abs(node.q3Pos - node.q1Pos);
55
- ctx.fillRect(boxLeft, node.y - halfWidth, boxW, node.columnWidth);
56
- ctx.globalAlpha = 1;
57
- ctx.strokeRect(boxLeft, node.y - halfWidth, boxW, node.columnWidth);
58
- }
59
- // Median line
60
- ctx.strokeStyle = "#fff";
61
- ctx.lineWidth = 2;
62
- ctx.beginPath();
63
- if (isVert) {
64
- ctx.moveTo(node.x - halfWidth, node.medianPos);
65
- ctx.lineTo(node.x + halfWidth, node.medianPos);
66
- }
67
- else {
68
- ctx.moveTo(node.medianPos, node.y - halfWidth);
69
- ctx.lineTo(node.medianPos, node.y + halfWidth);
70
- }
71
- ctx.stroke();
72
- ctx.restore();
73
- }
74
- };
75
- exports.boxplotCanvasRenderer = boxplotCanvasRenderer;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.candlestickCanvasRenderer = void 0;
4
- const candlestickCanvasRenderer = (ctx, nodes, _scales, _layout) => {
5
- for (const node of nodes) {
6
- if (node.type !== "candlestick")
7
- continue;
8
- const n = node;
9
- // Draw wick (high-low line)
10
- ctx.beginPath();
11
- ctx.moveTo(n.x, n.highY);
12
- ctx.lineTo(n.x, n.lowY);
13
- ctx.strokeStyle = n.wickColor;
14
- ctx.lineWidth = n.wickWidth;
15
- ctx.stroke();
16
- // Draw body (open-close rect)
17
- const bodyTop = Math.min(n.openY, n.closeY);
18
- const bodyHeight = Math.abs(n.openY - n.closeY);
19
- const bodyColor = n.isUp ? n.upColor : n.downColor;
20
- ctx.fillStyle = bodyColor;
21
- ctx.fillRect(n.x - n.bodyWidth / 2, bodyTop, n.bodyWidth, Math.max(bodyHeight, 1));
22
- // Body border
23
- ctx.strokeStyle = bodyColor;
24
- ctx.lineWidth = 1;
25
- ctx.strokeRect(n.x - n.bodyWidth / 2, bodyTop, n.bodyWidth, Math.max(bodyHeight, 1));
26
- }
27
- };
28
- exports.candlestickCanvasRenderer = candlestickCanvasRenderer;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connectorCanvasRenderer = void 0;
4
- const connectorCanvasRenderer = (ctx, nodes, _scales, _layout) => {
5
- const connectorNodes = nodes.filter((n) => n.type === "connector");
6
- if (connectorNodes.length === 0)
7
- return;
8
- // Group connectors by their group key so we can draw filled polygons
9
- const groups = new Map();
10
- for (const node of connectorNodes) {
11
- const key = node.group || "_default";
12
- if (!groups.has(key))
13
- groups.set(key, []);
14
- groups.get(key).push(node);
15
- }
16
- for (const [, segments] of groups) {
17
- if (segments.length === 0)
18
- continue;
19
- const firstStyle = segments[0].style;
20
- const hasFill = firstStyle.fill && firstStyle.fill !== "none";
21
- // Draw filled polygon if fill is specified (e.g. radar plot)
22
- if (hasFill) {
23
- ctx.beginPath();
24
- ctx.moveTo(segments[0].x1, segments[0].y1);
25
- for (const seg of segments) {
26
- ctx.lineTo(seg.x2, seg.y2);
27
- }
28
- ctx.closePath();
29
- ctx.globalAlpha = firstStyle.fillOpacity ?? firstStyle.opacity ?? 0.3;
30
- ctx.fillStyle = firstStyle.fill;
31
- ctx.fill();
32
- ctx.globalAlpha = 1;
33
- }
34
- // Draw stroke lines
35
- for (const node of segments) {
36
- ctx.beginPath();
37
- ctx.moveTo(node.x1, node.y1);
38
- ctx.lineTo(node.x2, node.y2);
39
- ctx.strokeStyle = node.style.stroke || node.style.fill || "#999";
40
- ctx.lineWidth = node.style.strokeWidth || 1;
41
- ctx.globalAlpha = node.style.opacity ?? 0.5;
42
- ctx.stroke();
43
- ctx.globalAlpha = 1;
44
- }
45
- }
46
- };
47
- exports.connectorCanvasRenderer = connectorCanvasRenderer;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.heatmapCanvasRenderer = void 0;
4
- /**
5
- * Canvas heatmap renderer.
6
- * Renders HeatcellSceneNode as filled rectangles with color encoding.
7
- */
8
- const heatmapCanvasRenderer = (ctx, nodes, scales, layout) => {
9
- const heatNodes = nodes.filter((n) => n.type === "heatcell");
10
- for (const node of heatNodes) {
11
- // Apply decay opacity if present (stored as style.opacity by applyDecay)
12
- const nodeStyle = node.style;
13
- if (nodeStyle?.opacity != null) {
14
- ctx.globalAlpha = nodeStyle.opacity;
15
- }
16
- ctx.fillStyle = node.fill;
17
- ctx.fillRect(node.x, node.y, node.w, node.h);
18
- // Cell border
19
- ctx.strokeStyle = "#fff";
20
- ctx.lineWidth = 1;
21
- ctx.strokeRect(node.x, node.y, node.w, node.h);
22
- // Pulse overlay
23
- if (node._pulseIntensity && node._pulseIntensity > 0) {
24
- ctx.globalAlpha = node._pulseIntensity * 0.3;
25
- ctx.fillStyle = node._pulseColor || "rgba(255,255,255,0.6)";
26
- ctx.fillRect(node.x, node.y, node.w, node.h);
27
- }
28
- ctx.globalAlpha = 1;
29
- }
30
- };
31
- exports.heatmapCanvasRenderer = heatmapCanvasRenderer;