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
package/CLAUDE.md CHANGED
@@ -1,828 +1,168 @@
1
1
  # Semiotic — AI Assistant Guide
2
2
 
3
3
  ## Quick Start
4
- - Install: `npm install semiotic`
4
+ - Install: `npm install semiotic@3.0.0-beta.4`
5
5
  - Import from `semiotic` or granular: `semiotic/xy`, `semiotic/ordinal`, `semiotic/network`, `semiotic/realtime`, `semiotic/ai`, `semiotic/data`
6
- - `semiotic/ai` exports the 28 HOC chart components (including RealtimeHeatmap) + TooltipProvider + MultiLineTooltip + ThemeProvider + exportChart + `validateProps`
7
- - `semiotic/data` exports data transform helpers: `bin`, `rollup`, `groupBy`, `pivot`
8
- - `validateProps(componentName, props)` — validate props before rendering, returns `{ valid, errors }`
6
+ - `semiotic/ai` exports HOC charts + TooltipProvider + MultiLineTooltip + ThemeProvider + exportChart + validateProps + useChartObserver + DetailsPanel + ChartContainer
7
+ - `semiotic/data` exports: `bin`, `rollup`, `groupBy`, `pivot`
9
8
  - CLI: `npx semiotic-ai [--schema|--compact|--examples]` — dump AI context to stdout
10
- - MCP: `npx semiotic-mcp` — MCP server that renders charts to static SVG
9
+ - MCP: `npx semiotic-mcp` — MCP server rendering charts to static SVG
11
10
 
12
11
  ## Architecture
13
- - **HOC Charts** (recommended): Simple props, sensible defaults — use these
14
- - **Stream Frames** (advanced): `StreamXYFrame`, `StreamOrdinalFrame`, `StreamNetworkFrame` — full control, only when HOCs aren't enough
12
+ - **HOC Charts** (recommended): Simple props, sensible defaults
13
+ - **Stream Frames** (advanced): `StreamXYFrame`, `StreamOrdinalFrame`, `StreamNetworkFrame`
15
14
  - Every HOC accepts `frameProps` to pass through to the underlying Stream Frame
15
+ - TypeScript `strict: true`; all charts have `role="img"` + `aria-label`
16
16
 
17
17
  ## Component Reference
18
18
 
19
- ### XY Charts (import from "semiotic" or "semiotic/xy")
19
+ ### Common props (all HOCs unless noted)
20
+ `title` (string), `width` (number, 600), `height` (number, 400), `margin` (object), `className` (string), `enableHover` (boolean, true), `tooltip` (fn), `showLegend` (boolean), `showGrid` (boolean, false), `frameProps` (object), `onObservation` (fn), `chartId` (string)
20
21
 
21
- #### LineChart
22
- Line traces with curve interpolation, area fill, and point markers. Use for time series, trends, and continuous data.
22
+ ### XY Charts (from "semiotic" or "semiotic/xy")
23
23
 
24
- Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
25
- `lineBy` (string|fn), `lineDataAccessor` (string, "coordinates"),
26
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
27
- `curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom", "linear"),
28
- `lineWidth` (number, 2), `showPoints` (boolean, false), `pointRadius` (number, 3),
29
- `fillArea` (boolean, false), `areaOpacity` (number, 0.3),
30
- `xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
31
- `title` (string), `width` (number, 600), `height` (number, 400),
32
- `enableHover` (boolean, true), `tooltip` (fn),
33
- `showLegend` (boolean), `showGrid` (boolean, false),
34
- `margin` (object), `className` (string), `frameProps` (object)
24
+ **LineChart** `data` (required), `xAccessor` ("x"), `yAccessor` ("y"), `lineBy`, `lineDataAccessor` ("coordinates"), `colorBy`, `colorScheme` ("category10"), `curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom"), `lineWidth` (2), `showPoints` (false), `pointRadius` (3), `fillArea` (false), `areaOpacity` (0.3), `xLabel`, `yLabel`, `xFormat`, `yFormat`
35
25
 
36
- ```jsx
37
- <LineChart data={sales} xAccessor="month" yAccessor="revenue" curve="monotoneX" />
38
- ```
39
-
40
- #### AreaChart
41
- Filled area under a line with optional stroke. Use for showing volume or magnitude over time.
42
-
43
- Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
44
- `areaBy` (string|fn), `lineDataAccessor` (string, "coordinates"),
45
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
46
- `curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom", "monotoneX"),
47
- `areaOpacity` (number, 0.7), `showLine` (boolean, true), `lineWidth` (number, 2),
48
- `xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
49
- `title` (string), `width` (number, 600), `height` (number, 400),
50
- `enableHover` (boolean, true), `tooltip` (fn),
51
- `showLegend` (boolean), `showGrid` (boolean, false),
52
- `margin` (object), `className` (string), `frameProps` (object)
53
-
54
- ```jsx
55
- <AreaChart data={temps} xAccessor="date" yAccessor="temp" areaBy="city" />
56
- ```
57
-
58
- #### StackedAreaChart
59
- Stacked area chart with optional normalization to 100%. Use for part-to-whole trends over time.
60
-
61
- Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
62
- `areaBy` (string|fn), `lineDataAccessor` (string, "coordinates"),
63
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
64
- `curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom", "monotoneX"),
65
- `areaOpacity` (number, 0.7), `showLine` (boolean, true), `lineWidth` (number, 2),
66
- `normalize` (boolean, false),
67
- `xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
68
- `title` (string), `width` (number, 600), `height` (number, 400),
69
- `enableHover` (boolean, true), `tooltip` (fn),
70
- `showLegend` (boolean), `showGrid` (boolean, false),
71
- `margin` (object), `className` (string), `frameProps` (object)
72
-
73
- ```jsx
74
- <StackedAreaChart data={revenue} xAccessor="quarter" yAccessor="amount" areaBy="product" normalize />
75
- ```
76
-
77
- #### Scatterplot
78
- Individual data points plotted by x/y position with optional size and color encoding.
79
-
80
- Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
81
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
82
- `sizeBy` (string|fn), `sizeRange` ([number, number], [3, 15]),
83
- `pointRadius` (number, 5), `pointOpacity` (number, 0.8),
84
- `xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
85
- `title` (string), `width` (number, 600), `height` (number, 400),
86
- `enableHover` (boolean, true), `tooltip` (fn),
87
- `showLegend` (boolean), `showGrid` (boolean, false),
88
- `marginalGraphics` ({ top?, bottom?, left?, right? } — each "histogram"|"violin"|"ridgeline"|"boxplot" or { type, bins?, fill?, fillOpacity?, stroke?, strokeWidth? }),
89
- `margin` (object), `className` (string), `frameProps` (object)
90
-
91
- ```jsx
92
- <Scatterplot data={iris} xAccessor="sepalLength" yAccessor="petalLength" colorBy="species" />
93
- ```
94
-
95
- #### BubbleChart
96
- Like Scatterplot but with required size dimension. Use when a third numeric variable matters.
97
-
98
- Props: `data` (TDatum[], required), `sizeBy` (string|fn, **required**),
99
- `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
100
- `sizeRange` ([number, number], [5, 40]),
101
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
102
- `bubbleOpacity` (number, 0.6), `bubbleStrokeWidth` (number, 1), `bubbleStrokeColor` (string, "white"),
103
- `xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
104
- `title` (string), `width` (number, 600), `height` (number, 400),
105
- `enableHover` (boolean, true), `tooltip` (fn),
106
- `showLegend` (boolean), `showGrid` (boolean, false),
107
- `marginalGraphics` ({ top?, bottom?, left?, right? } — each "histogram"|"violin"|"ridgeline"|"boxplot" or { type, bins?, fill?, fillOpacity?, stroke?, strokeWidth? }),
108
- `margin` (object), `className` (string), `frameProps` (object)
109
-
110
- ```jsx
111
- <BubbleChart data={countries} xAccessor="gdp" yAccessor="life" sizeBy="population" colorBy="continent" />
112
- ```
26
+ **AreaChart** — Same as LineChart plus: `areaBy`, `areaOpacity` (0.7), `showLine` (true), curve default "monotoneX"
113
27
 
114
- #### Heatmap
115
- Grid/matrix visualization with color-encoded cell values.
116
-
117
- Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
118
- `valueAccessor` (string|fn, "value"),
119
- `colorScheme` ("blues"|"reds"|"greens"|"viridis"|"custom", "blues"),
120
- `customColorScale` (any), `showValues` (boolean, false), `valueFormat` (fn),
121
- `cellBorderColor` (string, "#fff"), `cellBorderWidth` (number, 1),
122
- `xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
123
- `title` (string), `width` (number, 600), `height` (number, 400),
124
- `enableHover` (boolean, true), `tooltip` (fn),
125
- `margin` (object), `className` (string), `frameProps` (object)
126
-
127
- ```jsx
128
- <Heatmap data={correlations} xAccessor="var1" yAccessor="var2" valueAccessor="r" colorScheme="viridis" />
129
- ```
130
-
131
- ### Ordinal/Categorical Charts (import from "semiotic" or "semiotic/ordinal")
132
-
133
- #### BarChart
134
- Vertical or horizontal bars for categorical comparisons.
135
-
136
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
137
- `orientation` ("vertical"|"horizontal", "vertical"),
138
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
139
- `sort` (boolean|"asc"|"desc"|fn, false), `barPadding` (number, 5),
140
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
141
- `title` (string), `width` (number, 600), `height` (number, 400),
142
- `enableHover` (boolean, true), `tooltip` (fn),
143
- `showLegend` (boolean), `showGrid` (boolean, false),
144
- `margin` (object), `className` (string), `frameProps` (object)
145
-
146
- ```jsx
147
- <BarChart data={sales} categoryAccessor="region" valueAccessor="total" orientation="horizontal" />
148
- ```
149
-
150
- #### StackedBarChart
151
- Stacked bars for part-to-whole comparisons across categories.
152
-
153
- Props: `data` (TDatum[], required), `stackBy` (string|fn, **required**),
154
- `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
155
- `orientation` ("vertical"|"horizontal", "vertical"),
156
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
157
- `normalize` (boolean, false), `barPadding` (number, 5),
158
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
159
- `title` (string), `width` (number, 600), `height` (number, 400),
160
- `enableHover` (boolean, true), `tooltip` (fn),
161
- `showLegend` (boolean, true), `showGrid` (boolean, false),
162
- `margin` (object), `className` (string), `frameProps` (object)
163
-
164
- ```jsx
165
- <StackedBarChart data={survey} categoryAccessor="question" stackBy="response" valueAccessor="count" />
166
- ```
167
-
168
- #### GroupedBarChart
169
- Side-by-side bars for comparing sub-categories within categories.
170
-
171
- Props: `data` (TDatum[], required), `groupBy` (string|fn, **required**),
172
- `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
173
- `orientation` ("vertical"|"horizontal", "vertical"),
174
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
175
- `barPadding` (number, 5),
176
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
177
- `title` (string), `width` (number, 600), `height` (number, 400),
178
- `enableHover` (boolean, true), `tooltip` (fn),
179
- `showLegend` (boolean, true), `showGrid` (boolean, false),
180
- `margin` (object), `className` (string), `frameProps` (object)
181
-
182
- ```jsx
183
- <GroupedBarChart data={results} categoryAccessor="year" groupBy="product" valueAccessor="revenue" />
184
- ```
28
+ **StackedAreaChart** — Same as AreaChart plus: `normalize` (false)
185
29
 
186
- #### SwarmPlot
187
- Beeswarm/jittered dot plot showing individual data points within categories.
188
-
189
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
190
- `orientation` ("vertical"|"horizontal", "vertical"),
191
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
192
- `sizeBy` (string|fn), `sizeRange` ([number, number], [3, 8]),
193
- `pointRadius` (number, 4), `pointOpacity` (number, 0.7), `categoryPadding` (number, 20),
194
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
195
- `title` (string), `width` (number, 600), `height` (number, 400),
196
- `enableHover` (boolean, true), `tooltip` (fn),
197
- `showLegend` (boolean), `showGrid` (boolean, false),
198
- `margin` (object), `className` (string), `frameProps` (object)
199
-
200
- ```jsx
201
- <SwarmPlot data={salaries} categoryAccessor="department" valueAccessor="salary" colorBy="level" />
202
- ```
203
-
204
- #### BoxPlot
205
- Box-and-whisker plots showing statistical distribution per category.
206
-
207
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
208
- `orientation` ("vertical"|"horizontal", "vertical"),
209
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
210
- `showOutliers` (boolean, true), `outlierRadius` (number, 3), `categoryPadding` (number, 20),
211
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
212
- `title` (string), `width` (number, 600), `height` (number, 400),
213
- `enableHover` (boolean, true), `tooltip` (fn),
214
- `showLegend` (boolean), `showGrid` (boolean, false),
215
- `margin` (object), `className` (string), `frameProps` (object)
216
-
217
- ```jsx
218
- <BoxPlot data={scores} categoryAccessor="subject" valueAccessor="score" showOutliers />
219
- ```
220
-
221
- #### Histogram
222
- Binned frequency distribution chart showing how values are distributed across bins per category. Always renders horizontally.
223
-
224
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
225
- `bins` (number, 25), `relative` (boolean, false),
226
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
227
- `categoryPadding` (number, 20),
228
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
229
- `title` (string), `width` (number, 600), `height` (number, 400),
230
- `enableHover` (boolean, true), `tooltip` (fn),
231
- `showLegend` (boolean), `showGrid` (boolean, false),
232
- `margin` (object), `className` (string), `frameProps` (object)
233
-
234
- ```jsx
235
- <Histogram data={measurements} categoryAccessor="group" valueAccessor="value" bins={15} />
236
- ```
237
-
238
- #### ViolinPlot
239
- Violin plots showing full distribution shape (kernel density) per category with optional IQR lines.
240
-
241
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
242
- `orientation` ("vertical"|"horizontal", "vertical"),
243
- `bins` (number, 25), `curve` (string, "catmullRom"), `showIQR` (boolean, true),
244
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
245
- `categoryPadding` (number, 20),
246
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
247
- `title` (string), `width` (number, 600), `height` (number, 400),
248
- `enableHover` (boolean, true), `tooltip` (fn),
249
- `showLegend` (boolean), `showGrid` (boolean, false),
250
- `margin` (object), `className` (string), `frameProps` (object)
251
-
252
- ```jsx
253
- <ViolinPlot data={salaries} categoryAccessor="department" valueAccessor="salary" showIQR colorBy="department" />
254
- ```
255
-
256
- #### DotPlot
257
- Cleveland-style dot plot for comparing values across categories.
258
-
259
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
260
- `orientation` ("vertical"|"horizontal", "horizontal"),
261
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
262
- `sort` (boolean|"asc"|"desc"|fn, true), `dotRadius` (number, 5), `categoryPadding` (number, 10),
263
- `categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
264
- `title` (string), `width` (number, 600), `height` (number, 400),
265
- `enableHover` (boolean, true), `tooltip` (fn),
266
- `showLegend` (boolean), `showGrid` (boolean, true),
267
- `margin` (object), `className` (string), `frameProps` (object)
268
-
269
- ```jsx
270
- <DotPlot data={rankings} categoryAccessor="team" valueAccessor="wins" sort="desc" />
271
- ```
272
-
273
- #### PieChart
274
- Proportional slices in a circle.
275
-
276
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
277
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
278
- `startAngle` (number, 0), `slicePadding` (number, 2),
279
- `title` (string), `width` (number, 400), `height` (number, 400),
280
- `enableHover` (boolean, true), `tooltip` (fn),
281
- `showLegend` (boolean, true),
282
- `margin` (object), `className` (string), `frameProps` (object)
283
-
284
- ```jsx
285
- <PieChart data={market} categoryAccessor="brand" valueAccessor="share" />
286
- ```
287
-
288
- #### DonutChart
289
- Pie chart with a hole in the center. Supports center content.
290
-
291
- Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
292
- `innerRadius` (number, 60), `centerContent` (ReactNode),
293
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
294
- `startAngle` (number, 0), `slicePadding` (number, 2),
295
- `title` (string), `width` (number, 400), `height` (number, 400),
296
- `enableHover` (boolean, true), `tooltip` (fn),
297
- `showLegend` (boolean, true),
298
- `margin` (object), `className` (string), `frameProps` (object)
299
-
300
- ```jsx
301
- <DonutChart data={budget} categoryAccessor="category" valueAccessor="amount" centerContent={<span>$42K</span>} />
302
- ```
303
-
304
- ### Network Charts (import from "semiotic" or "semiotic/network")
305
-
306
- #### ForceDirectedGraph
307
- Physics-based node-link diagram. Use for relationships, social networks, knowledge graphs.
308
-
309
- Props: `nodes` (TNode[], required), `edges` (TEdge[], required),
310
- `nodeIDAccessor` (string|fn, "id"), `sourceAccessor` (string|fn, "source"), `targetAccessor` (string|fn, "target"),
311
- `nodeLabel` (string|fn), `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
312
- `nodeSize` (number|string|fn, 8), `nodeSizeRange` ([number, number], [5, 20]),
313
- `edgeWidth` (number|string|fn, 1), `edgeColor` (string, "#999"), `edgeOpacity` (number, 0.6),
314
- `iterations` (number, 300), `forceStrength` (number, 0.1),
315
- `showLabels` (boolean, false),
316
- `title` (string), `width` (number, 600), `height` (number, 600),
317
- `enableHover` (boolean, true), `tooltip` (fn),
318
- `showLegend` (boolean, true),
319
- `margin` (object), `className` (string), `frameProps` (object)
320
-
321
- ```jsx
322
- <ForceDirectedGraph nodes={people} edges={friendships} colorBy="team" nodeSize={8} showLabels />
323
- ```
30
+ **Scatterplot** — `data` (required), `xAccessor` ("x"), `yAccessor` ("y"), `colorBy`, `colorScheme`, `sizeBy`, `sizeRange` ([3,15]), `pointRadius` (5), `pointOpacity` (0.8), `xLabel`, `yLabel`, `marginalGraphics` ({top?,bottom?,left?,right?} — "histogram"|"violin"|"ridgeline"|"boxplot" or config object)
324
31
 
325
- #### SankeyDiagram
326
- Flow diagram showing weighted connections between nodes. Use for flows, budgets, process mapping.
327
-
328
- Props: `edges` (TEdge[], required), `nodes` (TNode[]),
329
- `sourceAccessor` (string|fn, "source"), `targetAccessor` (string|fn, "target"),
330
- `valueAccessor` (string|fn, "value"), `nodeIdAccessor` (string|fn, "id"),
331
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
332
- `edgeColorBy` ("source"|"target"|"gradient"|fn, "source"),
333
- `orientation` ("horizontal"|"vertical", "horizontal"),
334
- `nodeAlign` ("justify"|"left"|"right"|"center", "justify"),
335
- `nodePaddingRatio` (number, 0.05), `nodeWidth` (number, 15),
336
- `nodeLabel` (string|fn), `showLabels` (boolean, true),
337
- `edgeOpacity` (number, 0.5), `edgeSort` (fn),
338
- `title` (string), `width` (number, 800), `height` (number, 600),
339
- `enableHover` (boolean, true), `tooltip` (fn),
340
- `margin` (object), `className` (string), `frameProps` (object)
32
+ **BubbleChart** — Like Scatterplot with `sizeBy` (required), `sizeRange` ([5,40]), `bubbleOpacity` (0.6), `bubbleStrokeWidth` (1), `bubbleStrokeColor` ("white"), `marginalGraphics`
341
33
 
342
- ```jsx
343
- <SankeyDiagram edges={flows} sourceAccessor="from" targetAccessor="to" valueAccessor="amount" />
344
- ```
34
+ **Heatmap** — `data` (required), `xAccessor` ("x"), `yAccessor` ("y"), `valueAccessor` ("value"), `colorScheme` ("blues"|"reds"|"greens"|"viridis"|"custom"), `customColorScale`, `showValues` (false), `valueFormat`, `cellBorderColor` ("#fff"), `cellBorderWidth` (1)
345
35
 
346
- #### ChordDiagram
347
- Circular diagram showing inter-relationships between groups.
348
-
349
- Props: `edges` (TEdge[], required), `nodes` (TNode[]),
350
- `sourceAccessor` (string|fn, "source"), `targetAccessor` (string|fn, "target"),
351
- `valueAccessor` (string|fn, "value"), `nodeIdAccessor` (string|fn, "id"),
352
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
353
- `edgeColorBy` ("source"|"target"|fn, "source"),
354
- `padAngle` (number, 0.01), `groupWidth` (number, 20), `sortGroups` (fn),
355
- `nodeLabel` (string|fn), `showLabels` (boolean, true),
356
- `edgeOpacity` (number, 0.5),
357
- `title` (string), `width` (number, 600), `height` (number, 600),
358
- `enableHover` (boolean, true), `tooltip` (fn),
359
- `margin` (object), `className` (string), `frameProps` (object)
36
+ ### Ordinal Charts (from "semiotic" or "semiotic/ordinal")
360
37
 
361
- ```jsx
362
- <ChordDiagram edges={trades} sourceAccessor="exporter" targetAccessor="importer" valueAccessor="volume" />
363
- ```
38
+ **BarChart** — `data` (required), `categoryAccessor` ("category"), `valueAccessor` ("value"), `orientation` ("vertical"|"horizontal"), `colorBy`, `colorScheme`, `sort` (boolean|"asc"|"desc"|fn), `barPadding` (5), `categoryLabel`, `valueLabel`, `valueFormat`
364
39
 
365
- #### TreeDiagram
366
- Hierarchical tree layout. Supports tree, cluster, partition, and radial orientations.
367
-
368
- Props: `data` (TNode, required — single root node with children),
369
- `layout` ("tree"|"cluster"|"partition"|"treemap"|"circlepack", "tree"),
370
- `orientation` ("vertical"|"horizontal"|"radial", "vertical"),
371
- `childrenAccessor` (string|fn, "children"), `valueAccessor` (string|fn, "value"),
372
- `nodeIdAccessor` (string|fn, "name"),
373
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
374
- `colorByDepth` (boolean, false), `edgeStyle` ("line"|"curve", "curve"),
375
- `nodeLabel` (string|fn), `showLabels` (boolean, true), `nodeSize` (number, 5),
376
- `title` (string), `width` (number, 600), `height` (number, 600),
377
- `enableHover` (boolean, true), `tooltip` (fn),
378
- `margin` (object), `className` (string), `frameProps` (object)
40
+ **StackedBarChart** — BarChart props plus `stackBy` (required), `normalize` (false)
379
41
 
380
- ```jsx
381
- <TreeDiagram data={orgChart} childrenAccessor="reports" nodeIdAccessor="name" orientation="horizontal" />
382
- ```
42
+ **GroupedBarChart** — BarChart props plus `groupBy` (required)
383
43
 
384
- #### Treemap
385
- Space-filling rectangular hierarchy visualization. Labels are centered in cells.
386
- Hover shows ancestor breadcrumb path (grandparent → parent → **node**) with outline.
387
- `colorByDepth` uses a pastel palette keyed to hierarchy depth.
388
-
389
- Props: `data` (TNode, required — single root node with children),
390
- `childrenAccessor` (string|fn, "children"), `valueAccessor` (string|fn, "value"),
391
- `nodeIdAccessor` (string|fn, "name"),
392
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
393
- `colorByDepth` (boolean, false),
394
- `showLabels` (boolean, true), `labelMode` ("leaf"|"parent"|"all", "leaf"),
395
- `nodeLabel` (string|fn),
396
- `padding` (number, 4), `paddingTop` (number, 0 — auto 18 when labelMode="parent"),
397
- `title` (string), `width` (number, 600), `height` (number, 600),
398
- `enableHover` (boolean, true), `tooltip` (fn),
399
- `margin` (object), `className` (string), `frameProps` (object)
44
+ **SwarmPlot** — `data` (required), `categoryAccessor`, `valueAccessor`, `orientation`, `colorBy`, `sizeBy`, `sizeRange` ([3,8]), `pointRadius` (4), `pointOpacity` (0.7), `categoryPadding` (20)
400
45
 
401
- ```jsx
402
- <Treemap data={fileSystem} childrenAccessor="children" valueAccessor="size" colorByDepth />
403
- ```
46
+ **BoxPlot** — `data` (required), `categoryAccessor`, `valueAccessor`, `orientation`, `colorBy`, `showOutliers` (true), `outlierRadius` (3), `categoryPadding` (20)
404
47
 
405
- #### CirclePack
406
- Nested circles representing hierarchical data. Leaf labels are centered; parent labels
407
- are top-center with white-outlined black text. Circles smaller than 15px radius hide labels.
408
- Hover shows ancestor breadcrumb path (grandparent → parent → **node**) with circle outline.
409
- `colorByDepth` uses a pastel palette keyed to hierarchy depth (same as Treemap).
410
-
411
- Props: `data` (TNode, required — single root node with children),
412
- `childrenAccessor` (string|fn, "children"), `valueAccessor` (string|fn, "value"),
413
- `nodeIdAccessor` (string|fn, "name"),
414
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
415
- `colorByDepth` (boolean, false),
416
- `showLabels` (boolean, true), `nodeLabel` (string|fn),
417
- `circleOpacity` (number, 0.7), `padding` (number, 4),
418
- `title` (string), `width` (number, 600), `height` (number, 600),
419
- `enableHover` (boolean, true), `tooltip` (fn),
420
- `margin` (object), `className` (string), `frameProps` (object)
48
+ **Histogram** — `data` (required), `categoryAccessor`, `valueAccessor`, `bins` (25), `relative` (false), `categoryPadding` (20). Always horizontal.
421
49
 
422
- ```jsx
423
- <CirclePack data={taxonomy} childrenAccessor="children" valueAccessor="count" colorByDepth />
424
- ```
50
+ **ViolinPlot** — `data` (required), `categoryAccessor`, `valueAccessor`, `orientation`, `bins` (25), `curve` ("catmullRom"), `showIQR` (true), `categoryPadding` (20)
425
51
 
426
- ### Realtime Charts (import from "semiotic" or "semiotic/realtime")
52
+ **DotPlot** `data` (required), `categoryAccessor`, `valueAccessor`, `orientation` ("horizontal"), `sort` (true), `dotRadius` (5), `categoryPadding` (10), `showGrid` default true
427
53
 
428
- All realtime charts use a ref-based push API and render on canvas for high performance.
54
+ **PieChart** `data` (required), `categoryAccessor`, `valueAccessor`, `colorBy`, `startAngle` (0), `slicePadding` (2), width/height default 400
429
55
 
430
- ```jsx
431
- const chartRef = useRef()
432
- // Push data at any frequency
433
- chartRef.current.push({ time: Date.now(), value: reading })
434
- ```
56
+ **DonutChart** — PieChart props plus `innerRadius` (60), `centerContent` (ReactNode)
435
57
 
436
- #### RealtimeLineChart
437
- Streaming line chart rendered on canvas.
438
-
439
- Props: `size` ([number, number], [500, 300]),
440
- `timeAccessor` (string|fn), `valueAccessor` (string|fn),
441
- `windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
442
- `arrowOfTime` ("left"|"right", "right"),
443
- `stroke` (string, "#007bff"), `strokeWidth` (number, 2), `strokeDasharray` (string),
444
- `timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
445
- `showAxes` (boolean, true), `background` (string),
446
- `enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
447
- `annotations` (object[]), `svgAnnotationRules` (fn),
448
- `tickFormatTime` (fn), `tickFormatValue` (fn),
449
- `margin` (object), `className` (string)
58
+ ### Network Charts (from "semiotic" or "semiotic/network")
450
59
 
451
- ```jsx
452
- <RealtimeLineChart ref={chartRef} timeAccessor="time" valueAccessor="value" windowSize={200} />
453
- ```
60
+ **ForceDirectedGraph** — `nodes` (required), `edges` (required), `nodeIDAccessor` ("id"), `sourceAccessor` ("source"), `targetAccessor` ("target"), `nodeLabel`, `colorBy`, `nodeSize` (8), `nodeSizeRange` ([5,20]), `edgeWidth` (1), `edgeColor` ("#999"), `edgeOpacity` (0.6), `iterations` (300), `forceStrength` (0.1), `showLabels` (false). Width/height default 600.
454
61
 
455
- #### RealtimeTemporalHistogram
456
- Streaming temporal histogram with time-binned aggregation. (Previously RealtimeHistogram.)
457
-
458
- Props: `binSize` (number, **required**),
459
- `size` ([number, number], [500, 300]),
460
- `timeAccessor` (string|fn), `valueAccessor` (string|fn),
461
- `categoryAccessor` (string|fn), `colors` (Record<string, string>),
462
- `windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
463
- `arrowOfTime` ("left"|"right", "right"),
464
- `fill` (string), `stroke` (string), `strokeWidth` (number), `gap` (number),
465
- `timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
466
- `showAxes` (boolean, true), `background` (string),
467
- `enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
468
- `annotations` (object[]), `svgAnnotationRules` (fn),
469
- `tickFormatTime` (fn), `tickFormatValue` (fn),
470
- `margin` (object), `className` (string)
62
+ **SankeyDiagram** — `edges` (required), `nodes` (optional), `sourceAccessor`, `targetAccessor`, `valueAccessor` ("value"), `nodeIdAccessor` ("id"), `colorBy`, `edgeColorBy` ("source"|"target"|"gradient"|fn), `orientation` ("horizontal"|"vertical"), `nodeAlign` ("justify"|"left"|"right"|"center"), `nodePaddingRatio` (0.05), `nodeWidth` (15), `nodeLabel`, `showLabels` (true), `edgeOpacity` (0.5), `edgeSort`. Default 800x600.
471
63
 
472
- ```jsx
473
- <RealtimeTemporalHistogram ref={chartRef} binSize={1000} timeAccessor="time" valueAccessor="count" />
474
- ```
64
+ **ChordDiagram** — `edges` (required), `nodes`, `sourceAccessor`, `targetAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorBy`, `edgeColorBy`, `padAngle` (0.01), `groupWidth` (20), `sortGroups`, `nodeLabel`, `showLabels` (true), `edgeOpacity` (0.5)
475
65
 
476
- #### RealtimeSwarmChart
477
- Streaming swarm/scatter chart showing individual data points.
478
-
479
- Props: `size` ([number, number], [500, 300]),
480
- `timeAccessor` (string|fn), `valueAccessor` (string|fn),
481
- `categoryAccessor` (string|fn), `colors` (Record<string, string>),
482
- `windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
483
- `arrowOfTime` ("left"|"right", "right"),
484
- `radius` (number), `fill` (string), `opacity` (number), `stroke` (string), `strokeWidth` (number),
485
- `timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
486
- `showAxes` (boolean, true), `background` (string),
487
- `enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
488
- `annotations` (object[]), `svgAnnotationRules` (fn),
489
- `tickFormatTime` (fn), `tickFormatValue` (fn),
490
- `margin` (object), `className` (string)
66
+ **TreeDiagram** — `data` (required, single root with children), `layout` ("tree"|"cluster"|"partition"|"treemap"|"circlepack"), `orientation` ("vertical"|"horizontal"|"radial"), `childrenAccessor` ("children"), `valueAccessor`, `nodeIdAccessor` ("name"), `colorBy`, `colorByDepth` (false), `edgeStyle` ("line"|"curve"), `nodeLabel`, `showLabels` (true), `nodeSize` (5)
491
67
 
492
- ```jsx
493
- <RealtimeSwarmChart ref={chartRef} timeAccessor="time" valueAccessor="latency" categoryAccessor="service" />
494
- ```
68
+ **Treemap** — `data` (required, root with children), `childrenAccessor`, `valueAccessor`, `nodeIdAccessor` ("name"), `colorBy`, `colorByDepth` (false), `showLabels` (true), `labelMode` ("leaf"|"parent"|"all"), `nodeLabel`, `padding` (4), `paddingTop` (0, auto 18 for "parent"). Hover shows ancestor breadcrumb.
495
69
 
496
- #### RealtimeWaterfallChart
497
- Streaming waterfall chart showing positive/negative changes over time.
498
-
499
- Props: `size` ([number, number], [500, 300]),
500
- `timeAccessor` (string|fn), `valueAccessor` (string|fn),
501
- `windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
502
- `arrowOfTime` ("left"|"right", "right"),
503
- `positiveColor` (string), `negativeColor` (string),
504
- `connectorStroke` (string), `connectorWidth` (number),
505
- `gap` (number), `stroke` (string), `strokeWidth` (number),
506
- `timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
507
- `showAxes` (boolean, true), `background` (string),
508
- `enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
509
- `annotations` (object[]), `svgAnnotationRules` (fn),
510
- `tickFormatTime` (fn), `tickFormatValue` (fn),
511
- `margin` (object), `className` (string)
70
+ **CirclePack** — `data` (required), `childrenAccessor`, `valueAccessor`, `nodeIdAccessor`, `colorBy`, `colorByDepth` (false), `showLabels` (true), `nodeLabel`, `circleOpacity` (0.7), `padding` (4). Labels hidden below 15px radius. Hover shows ancestor breadcrumb.
512
71
 
513
- ```jsx
514
- <RealtimeWaterfallChart ref={chartRef} timeAccessor="time" valueAccessor="delta" />
515
- ```
72
+ ### Realtime Charts (from "semiotic" or "semiotic/realtime")
516
73
 
517
- #### RealtimeHeatmap
518
- Streaming 2D heatmap with grid binning and configurable aggregation (count, sum, mean).
519
-
520
- Props: `size` ([number, number], [500, 300]),
521
- `timeAccessor` (string|fn), `valueAccessor` (string|fn),
522
- `heatmapXBins` (number, 20), `heatmapYBins` (number, 20),
523
- `aggregation` ("count"|"sum"|"mean", "count"),
524
- `windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
525
- `arrowOfTime` ("left"|"right", "right"),
526
- `timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
527
- `showAxes` (boolean, true), `background` (string),
528
- `enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
529
- `decay` (DecayConfig), `pulse` (PulseConfig), `staleness` (StalenessConfig),
530
- `margin` (object), `className` (string)
74
+ All use ref-based push API + canvas rendering: `chartRef.current.push({ time, value })`
531
75
 
532
- ```jsx
533
- <RealtimeHeatmap ref={chartRef} timeAccessor="x" valueAccessor="y" heatmapXBins={20} aggregation="count" />
534
- ```
76
+ **RealtimeLineChart** — `size` ([500,300]), `timeAccessor`, `valueAccessor`, `windowSize` (200), `windowMode` ("sliding"|"stepping"), `arrowOfTime` ("left"|"right"), `stroke`, `strokeWidth`, `strokeDasharray`, `timeExtent`, `valueExtent`, `extentPadding`, `showAxes`, `background`, `enableHover`, `tooltipContent`, `onHover`, `annotations`, `svgAnnotationRules`, `tickFormatTime`, `tickFormatValue`
535
77
 
536
- #### Streaming Sankey
537
- Streaming Sankey diagram using `StreamNetworkFrame` with `chartType="sankey"`. Topology grows
538
- over time via push API. Particles animate along links proportional to flow value. Tension model
539
- batches relayouts for smooth performance.
540
-
541
- Use `StreamNetworkFrame` directly with `chartType="sankey"` and `showParticles` for streaming
542
- Sankey visualizations.
543
-
544
- Props (on `StreamNetworkFrame`): `chartType` ("sankey", **required for streaming sankey**),
545
- `size` ([number, number], [800, 600]),
546
- `sourceAccessor` (string, "source"), `targetAccessor` (string, "target"),
547
- `valueAccessor` (string, "value"),
548
- `orientation` ("horizontal"|"vertical", "horizontal"),
549
- `nodeAlign` ("justify"|"left"|"right"|"center", "justify"),
550
- `nodePaddingRatio` (number, 0.05), `nodeWidth` (number, 15),
551
- `showParticles` (boolean, true),
552
- `particleStyle` ({ radius?, color?, opacity?, speedMultiplier?, maxPerEdge?, spawnRate? }),
553
- `tensionConfig` ({ threshold?, newNode?, newEdge?, weightChange?, transitionDuration? }),
554
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
555
- `edgeColorBy` ("source"|"target"|fn, "source"), `edgeOpacity` (number, 0.5),
556
- `nodeLabel` (string|fn), `showLabels` (boolean, true),
557
- `enableHover` (boolean, true), `tooltipContent` (fn),
558
- `onTopologyChange` (fn), `background` (string),
559
- `margin` (object), `className` (string)
560
-
561
- Ref handle: `push({ source, target, value })`, `pushMany(edges)`, `clear()`,
562
- `getTopology()`, `relayout()`, `getTension()`
78
+ **RealtimeTemporalHistogram** RealtimeLineChart props plus `binSize` (required), `categoryAccessor`, `colors`, `fill`, `gap`, `decay`, `pulse`, `staleness`, `transition`
563
79
 
564
- ```jsx
565
- import { StreamNetworkFrame } from "semiotic"
80
+ **RealtimeSwarmChart** — RealtimeLineChart props plus `categoryAccessor`, `colors`, `radius`, `fill`, `opacity`
566
81
 
567
- const chartRef = useRef()
568
- chartRef.current.push({ source: "Salary", target: "Budget", value: 5000 })
82
+ **RealtimeWaterfallChart** RealtimeLineChart props plus `positiveColor`, `negativeColor`, `connectorStroke`, `connectorWidth`, `gap`
569
83
 
570
- <StreamNetworkFrame ref={chartRef} chartType="sankey" size={[800, 400]} showParticles edgeOpacity={0.4} />
571
- ```
84
+ **RealtimeHeatmap** RealtimeLineChart props plus `heatmapXBins` (20), `heatmapYBins` (20), `aggregation` ("count"|"sum"|"mean"), `linkedHover`, `decay`, `pulse`, `staleness`
572
85
 
573
- ### Coordinated Views (import from "semiotic" or "semiotic/ai")
86
+ **Streaming Sankey** Use `StreamNetworkFrame` with `chartType="sankey"`, `showParticles`, `particleStyle`, `tensionConfig`, `thresholds`, `onTopologyChange`. Ref: `push()`, `pushMany()`, `clear()`, `getTopology()`, `relayout()`, `getTension()`
574
87
 
575
- #### LinkedCharts
576
- Context provider for coordinated chart views. Wraps any number of charts at any depth.
88
+ ### Realtime Visual Encoding (all streaming charts)
89
+ - `decay` older data fades (`{ type, halfLife, minOpacity }`)
90
+ - `pulse` — new data flashes (`{ duration, color, glowRadius }`)
91
+ - `transition` — smooth interpolation (`{ duration, easing }`)
92
+ - `staleness` — stale feed detection (`{ threshold, dimOpacity, showBadge }`)
577
93
 
578
- Props: `selections` (Record<string, { resolution?: "union"|"intersect"|"crossfilter" }>)
94
+ ### Coordinated Views (from "semiotic" or "semiotic/ai")
579
95
 
580
- ```jsx
581
- <LinkedCharts selections={{ dash: { resolution: "crossfilter" } }}>
582
- <Scatterplot data={d} xAccessor="x" yAccessor="y"
583
- linkedHover={{ name: "hl", fields: ["cat"] }}
584
- selection={{ name: "hl" }} />
585
- <BarChart data={agg} categoryAccessor="cat" valueAccessor="total"
586
- selection={{ name: "hl" }} />
587
- </LinkedCharts>
588
- ```
96
+ **LinkedCharts** — Wraps charts for coordination. Props: `selections` (Record with resolution: "union"|"intersect"|"crossfilter")
589
97
 
590
- **Chart coordination props** (available on all XY and ordinal HOCs inside LinkedCharts):
591
- - `selection` ({ name, unselectedOpacity?, unselectedStyle?, selectedStyle? }) — consume a named selection
592
- - `linkedHover` (boolean | string | { name?, fields }) — produce hover selections
593
- - `linkedBrush` (string | { name, xField?, yField? }) — produce brush selections (Scatterplot, BubbleChart only)
594
-
595
- **Hooks** (for custom coordinated views):
596
- - `useSelection({ name, clientId?, fields? })` → { predicate, isActive, selectPoints, selectInterval, clear }
597
- - `useLinkedHover({ name?, fields })` → { onHover, predicate, isActive }
598
- - `useBrushSelection({ name, xField?, yField? })` → { brushInteraction, predicate, isActive, clear }
599
- - `useFilteredData(data, selectionName, clientId?)` → filtered T[]
600
-
601
- #### ScatterplotMatrix
602
- N×N grid of scatterplots for exploring multi-dimensional data. Diagonal shows histograms.
603
- Two mutually exclusive interaction modes: hover (default) cross-highlights the same datum
604
- across all cells with a tooltip; brush mode enables crossfilter region selection.
605
-
606
- Props: `data` (TDatum[], required), `fields` (string[], required),
607
- `fieldLabels` (Record<string, string>),
608
- `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
609
- `cellSize` (number, 150), `cellGap` (number, 4),
610
- `pointRadius` (number, 2), `pointOpacity` (number, 0.5),
611
- `diagonal` ("histogram"|"density"|"label", "histogram"),
612
- `histogramBins` (number, 20),
613
- `hoverMode` (boolean, true — cross-highlight with tooltip above hovered point),
614
- `brushMode` ("crossfilter"|"intersect"|false, "crossfilter" — active when hoverMode is false),
615
- `unselectedOpacity` (number, 0.1),
616
- `showGrid` (boolean, false), `tooltip` (fn), `showLegend` (boolean),
617
- `width` (number), `height` (number), `className` (string)
98
+ Chart coordination props (on HOCs inside LinkedCharts):
99
+ - `selection` — consume named selection
100
+ - `linkedHover` — produce hover selections
101
+ - `linkedBrush` — produce brush selections (Scatterplot/BubbleChart only)
618
102
 
619
- ```jsx
620
- // Hover mode (default): cross-highlight on hover with tooltip
621
- <ScatterplotMatrix
622
- data={iris}
623
- fields={["sepalLength", "sepalWidth", "petalLength", "petalWidth"]}
624
- colorBy="species"
625
- fieldLabels={{ sepalLength: "Sepal Length", sepalWidth: "Sepal Width", petalLength: "Petal Length", petalWidth: "Petal Width" }}
626
- cellSize={160}
627
- />
628
-
629
- // Brush mode: crossfilter region selection
630
- <ScatterplotMatrix
631
- data={iris}
632
- fields={["sepalLength", "sepalWidth", "petalLength", "petalWidth"]}
633
- colorBy="species"
634
- cellSize={160}
635
- hoverMode={false}
636
- brushMode="crossfilter"
637
- />
638
- ```
103
+ Hooks: `useSelection`, `useLinkedHover`, `useBrushSelection`, `useFilteredData`
639
104
 
640
- ### Realtime Visual Encoding
105
+ **ScatterplotMatrix** `data` (required), `fields` (required), `fieldLabels`, `colorBy`, `cellSize` (150), `cellGap` (4), `pointRadius` (2), `pointOpacity` (0.5), `diagonal` ("histogram"|"density"|"label"), `histogramBins` (20), `hoverMode` (true), `brushMode` ("crossfilter"|"intersect"|false), `unselectedOpacity` (0.1)
641
106
 
642
- All streaming charts support visual encodings that communicate change over time:
107
+ ## Key Usage Patterns
643
108
 
644
109
  ```jsx
645
- // Decay: older data fades out (linear, exponential, or step)
646
- <StreamXYFrame decay={{ type: "exponential", halfLife: 100, minOpacity: 0.1 }} />
110
+ // Multi-line data
111
+ <LineChart data={[{ id: "A", coordinates: [{x:0,y:1},{x:1,y:2}] }]} lineBy="id" xAccessor="x" yAccessor="y" />
647
112
 
648
- // Pulse: newly inserted data flashes with a glow
649
- <StreamXYFrame pulse={{ duration: 500, color: "rgba(255,255,255,0.6)", glowRadius: 4 }} />
113
+ // Hierarchical data (TreeDiagram, Treemap, CirclePack) — single root with children
114
+ <Treemap data={rootNode} childrenAccessor="children" valueAccessor="value" />
650
115
 
651
- // Transitions: smooth position interpolation on data change
652
- <StreamXYFrame transition={{ duration: 300, easing: "ease-out" }} />
653
-
654
- // Staleness: dim chart + show badge when data feed stops
655
- <StreamXYFrame staleness={{ threshold: 5000, dimOpacity: 0.5, showBadge: true }} />
656
- ```
657
-
658
- Works on StreamXYFrame, StreamOrdinalFrame, and all realtime HOCs. Features compose freely.
659
-
660
- ## Common Patterns
661
-
662
- ### Color encoding
663
- ```jsx
664
- <BarChart data={d} categoryAccessor="name" valueAccessor="value" colorBy="region" />
665
- // Custom colors:
666
- <BarChart ... colorScheme={["#e41a1c", "#377eb8", "#4daf4a"]} />
667
- ```
668
-
669
- ### Tooltips
670
- ```jsx
671
- import { MultiLineTooltip } from "semiotic"
116
+ // Network data
117
+ <SankeyDiagram nodes={nodes} edges={edges} valueAccessor="value" />
672
118
 
119
+ // Tooltips
673
120
  <LineChart ... tooltip={MultiLineTooltip({ title: "name", fields: ["value"] })} />
674
- ```
675
-
676
- ### Legends
677
- Automatic when `colorBy` is set. Control with `showLegend`.
678
-
679
- ### Grid lines
680
- ```jsx
681
- <LineChart ... showGrid={true} />
682
- ```
683
-
684
- ### Marginal graphics
685
- ```jsx
686
- // Add distribution plots in the margins of scatter/bubble charts
687
- <Scatterplot data={iris} xAccessor="sepalLength" yAccessor="petalLength"
688
- marginalGraphics={{ top: "histogram", right: "violin" }} />
689
-
690
- // With custom config
691
- <Scatterplot data={data} xAccessor="x" yAccessor="y"
692
- marginalGraphics={{
693
- top: { type: "ridgeline", fill: "#e41a1c", fillOpacity: 0.6 },
694
- left: { type: "boxplot", fill: "#377eb8" }
695
- }} />
696
- ```
697
-
698
- ### Multi-line data
699
- ```jsx
700
- // Array of line objects, each with a coordinates array:
701
- const data = [
702
- { id: "A", coordinates: [{ x: 0, y: 1 }, { x: 1, y: 2 }] },
703
- { id: "B", coordinates: [{ x: 0, y: 3 }, { x: 1, y: 1 }] }
704
- ]
705
- <LineChart data={data} lineBy="id" xAccessor="x" yAccessor="y" />
706
- ```
707
-
708
- ### Hierarchical data (TreeDiagram, Treemap, CirclePack)
709
- ```jsx
710
- // Single root object with nested children:
711
- const data = {
712
- name: "root",
713
- children: [
714
- { name: "A", value: 10 },
715
- { name: "B", children: [{ name: "B1", value: 5 }] }
716
- ]
717
- }
718
- <Treemap data={data} childrenAccessor="children" valueAccessor="value" />
719
- ```
720
-
721
- ### Network data (ForceDirectedGraph, SankeyDiagram, ChordDiagram)
722
- ```jsx
723
- const nodes = [{ id: "A" }, { id: "B" }, { id: "C" }]
724
- const edges = [{ source: "A", target: "B", value: 10 }, { source: "B", target: "C", value: 5 }]
725
- <SankeyDiagram nodes={nodes} edges={edges} valueAccessor="value" />
726
- ```
727
121
 
728
- ### Coordinated views
729
- ```jsx
730
- // Cross-highlighting: hover one chart, highlight matching data in others
122
+ // Coordinated views
731
123
  <LinkedCharts>
732
- <Scatterplot data={d} xAccessor="x" yAccessor="y" colorBy="region"
733
- linkedHover={{ name: "hl", fields: ["region"] }}
734
- selection={{ name: "hl" }} />
735
- <BarChart data={agg} categoryAccessor="region" valueAccessor="total"
736
- linkedHover={{ name: "hl", fields: ["region"] }}
737
- selection={{ name: "hl" }} />
124
+ <Scatterplot data={d} linkedHover={{ name: "hl", fields: ["cat"] }} selection={{ name: "hl" }} />
125
+ <BarChart data={agg} selection={{ name: "hl" }} />
738
126
  </LinkedCharts>
739
- ```
740
127
 
741
- ### ScatterplotMatrix (SPLOM)
742
- ```jsx
743
- // Hover cross-highlight (default)
744
- <ScatterplotMatrix
745
- data={iris}
746
- fields={["sepalLength", "sepalWidth", "petalLength", "petalWidth"]}
747
- colorBy="species"
748
- fieldLabels={{ sepalLength: "Sepal Length", sepalWidth: "Sepal Width" }}
749
- cellSize={160}
750
- />
751
- // Crossfilter brushing
752
- <ScatterplotMatrix
753
- data={iris}
754
- fields={["sepalLength", "sepalWidth", "petalLength", "petalWidth"]}
755
- colorBy="species"
756
- hoverMode={false}
757
- brushMode="crossfilter"
758
- />
759
- ```
760
-
761
- ### ThemeProvider (import from "semiotic" or "semiotic/ai")
128
+ // Marginal graphics
129
+ <Scatterplot data={d} marginalGraphics={{ top: "histogram", right: "violin" }} />
762
130
 
763
- Global theming for all Semiotic charts. Opt-in — no changes to existing behavior without wrapping.
131
+ // Theming
132
+ <ThemeProvider theme="dark"><LineChart ... /></ThemeProvider>
764
133
 
765
- ```jsx
766
- import { ThemeProvider } from "semiotic"
134
+ // Data transforms
135
+ import { bin, rollup, groupBy, pivot } from "semiotic/data"
767
136
 
768
- // Dark mode preset
769
- <ThemeProvider theme="dark">
770
- <LineChart data={d} xAccessor="x" yAccessor="y" />
771
- </ThemeProvider>
137
+ // Browser export
138
+ await exportChart(el, { format: "png", scale: 2 })
772
139
 
773
- // Custom theme
774
- <ThemeProvider theme={{ colors: { primary: "#e41a1c", background: "#f5f5f5" } }}>
775
- <BarChart data={d} categoryAccessor="cat" valueAccessor="val" />
776
- </ThemeProvider>
140
+ // Realtime
141
+ const ref = useRef()
142
+ ref.current.push({ time: Date.now(), value: 42 })
143
+ <RealtimeLineChart ref={ref} timeAccessor="time" valueAccessor="value" />
777
144
  ```
778
145
 
779
- Presets: `"light"` (default), `"dark"`. Use `useTheme()` hook to read the current theme.
146
+ ## AI Features
780
147
 
781
- ### Data Transforms (import from "semiotic/data")
148
+ **onObservation** callback on all HOCs emitting structured events: hover, hover-end, click, click-end, brush, brush-end, selection, selection-end. Each includes `{ type, datum?, x?, y?, timestamp, chartType, chartId? }`.
782
149
 
783
- Pure helper functions for common data transformations:
150
+ **useChartObserver** aggregates observations across LinkedCharts. Options: `limit` (50), `types`, `chartId`.
784
151
 
785
- ```jsx
786
- import { bin, rollup, groupBy, pivot } from "semiotic/data"
152
+ **Chart serialization** — `toConfig(name, props)` / `fromConfig(config)` for JSON round-trip. `toURL`/`fromURL` for permalinks. `copyConfig(config, "jsx")` for clipboard. `configToJSX(config)` for code gen. String accessors survive; functions are stripped.
787
153
 
788
- bin(data, { field: "age", bins: 10 }) // histogram-ready { category, value }[]
789
- rollup(data, { groupBy: "region", value: "sales", agg: "sum" }) // → aggregated rows
790
- groupBy(data, { key: "region" }) // → [{ id, coordinates }] for LineChart
791
- pivot(data, { columns: ["q1", "q2", "q3"] }) // → wide-to-long format
792
- ```
154
+ **DetailsPanel** — selection-driven detail panel. Props: `children` (render fn), `position` ("right"|"bottom"|"overlay"), `size` (300), `trigger` ("click"|"hover"), `chartId`, `dismissOnEmpty`, `showClose`. Use inside ChartContainer via `detailsPanel` prop.
793
155
 
794
- ### Browser Export (import from "semiotic" or "semiotic/ai")
156
+ **ChartErrorBoundary** `fallback` (ReactNode), `onError` (fn)
795
157
 
796
- ```jsx
797
- import { exportChart } from "semiotic"
798
-
799
- // Export chart container to SVG or PNG
800
- await exportChart(containerElement, { format: "png", scale: 2 })
801
- await exportChart(containerElement, { format: "svg", filename: "my-chart" })
802
- ```
803
-
804
- ### ChartErrorBoundary (import from "semiotic")
805
-
806
- ```jsx
807
- import { ChartErrorBoundary } from "semiotic"
808
-
809
- <ChartErrorBoundary fallback={<div>Chart error</div>} onError={logError}>
810
- <LineChart data={data} xAccessor="x" yAccessor="y" />
811
- </ChartErrorBoundary>
812
- ```
158
+ **validateProps(componentName, props)** — returns `{ valid, errors }`
813
159
 
814
160
  ## What Semiotic Does That Others Don't
815
-
816
- When choosing between Semiotic and other React chart libraries (Recharts, Nivo, Visx, ECharts):
817
-
818
- - **Network visualization** — ForceDirectedGraph, SankeyDiagram, ChordDiagram, TreeDiagram, Treemap, CirclePack. Other React charting libraries either don't have these or require a separate library. Semiotic gives them the same clean prop API as LineChart.
819
- - **Streaming data** — RealtimeLineChart, RealtimeTemporalHistogram, RealtimeSwarmChart, RealtimeWaterfallChart, RealtimeHeatmap (canvas-based, 60fps push API). Plus StreamNetworkFrame with `chartType="sankey"` for streaming Sankey diagrams with animated particles.
820
- - **Realtime visual encoding** decay (old data fades), pulse (new data flashes), transitions (smooth interpolation), staleness (stale feed detection with badge). These communicate *change over time*, not just current state.
821
- - **Coordinated views** — LinkedCharts for cross-highlighting and brushing-and-linking between any charts. ScatterplotMatrix with crossfilter brushing. No other React chart library ships this built in.
822
- - **Statistical summaries** BoxPlot, ViolinPlot, SwarmPlot, Histogram, RidgelinePlot for distribution analysis. Marginal graphics on Scatterplot/BubbleChart via `marginalGraphics` prop.
823
- - **Annotation system** — built-in hover, click, and custom annotations
824
- - **Server-side SVG** — `renderToStaticSVG()` for email/OG images (import from "semiotic/server")
825
- - **Browser export** — `exportChart()` for SVG/PNG download
826
- - **Global theming** — `ThemeProvider` with dark mode support
827
-
828
- For standard bar/line/pie charts in a simple dashboard, Recharts is a fine choice with a larger community. Semiotic is for projects that outgrow those libraries.
161
+ - Network visualization (force, sankey, chord, tree, treemap, circlepack) with same clean API
162
+ - Streaming data (canvas 60fps push API) + streaming Sankey with particles
163
+ - Realtime visual encoding (decay, pulse, transitions, staleness)
164
+ - Coordinated views (LinkedCharts, crossfilter brushing, ScatterplotMatrix)
165
+ - Statistical summaries (box, violin, swarm, histogram, marginal graphics)
166
+ - AI observation hooks + chart state serialization
167
+ - Server-side SVG via `renderToStaticSVG()` (from "semiotic/server")
168
+ - Global theming with ThemeProvider