semiotic 2.0.3 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +828 -0
- package/README.md +215 -37
- package/ai/cli.js +48 -0
- package/ai/dist/ai/componentRegistry.js +45 -0
- package/ai/dist/ai/mcp-server.js +99 -0
- package/ai/dist/ai/renderHOCToSVG.js +77 -0
- package/ai/dist/src/components/Annotation.js +358 -0
- package/ai/dist/src/components/AnnotationLayer/AnnotationLayer.js +369 -0
- package/ai/dist/src/components/Axis/Axis.js +374 -0
- package/ai/dist/src/components/Axis/axisTitle.js +14 -0
- package/ai/dist/src/components/Axis/index.js +7 -0
- package/ai/dist/src/components/Axis/summaryGraphic.js +37 -0
- package/ai/dist/src/components/Brush.js +84 -0
- package/ai/dist/src/components/ChartErrorBoundary.js +91 -0
- package/ai/dist/src/components/DividedLine.js +65 -0
- package/ai/dist/src/components/Legend.js +140 -0
- package/ai/dist/src/components/LinkedCharts.js +95 -0
- package/ai/dist/src/components/ThemeProvider.js +79 -0
- package/ai/dist/src/components/Tooltip/Tooltip.js +309 -0
- package/ai/dist/src/components/TooltipPositioner/index.js +132 -0
- package/ai/dist/src/components/annotationLayerBehavior/annotationHandling.js +73 -0
- package/ai/dist/src/components/annotationLayerBehavior/d3labeler.js +254 -0
- package/ai/dist/src/components/annotationRules/baseRules.js +150 -0
- package/ai/dist/src/components/annotationRules/networkframeRules.js +196 -0
- package/ai/dist/src/components/annotationRules/xyframeRules.js +297 -0
- package/ai/dist/src/components/batchWork.js +35 -0
- package/ai/dist/src/components/charts/index.js +109 -0
- package/ai/dist/src/components/charts/network/ChordDiagram.js +142 -0
- package/ai/dist/src/components/charts/network/CirclePack.js +108 -0
- package/ai/dist/src/components/charts/network/ForceDirectedGraph.js +121 -0
- package/ai/dist/src/components/charts/network/SankeyDiagram.js +155 -0
- package/ai/dist/src/components/charts/network/TreeDiagram.js +110 -0
- package/ai/dist/src/components/charts/network/Treemap.js +106 -0
- package/ai/dist/src/components/charts/ordinal/BarChart.js +156 -0
- package/ai/dist/src/components/charts/ordinal/BoxPlot.js +139 -0
- package/ai/dist/src/components/charts/ordinal/DonutChart.js +130 -0
- package/ai/dist/src/components/charts/ordinal/DotPlot.js +126 -0
- package/ai/dist/src/components/charts/ordinal/GroupedBarChart.js +129 -0
- package/ai/dist/src/components/charts/ordinal/Histogram.js +132 -0
- package/ai/dist/src/components/charts/ordinal/PieChart.js +128 -0
- package/ai/dist/src/components/charts/ordinal/RidgelinePlot.js +130 -0
- package/ai/dist/src/components/charts/ordinal/StackedBarChart.js +130 -0
- package/ai/dist/src/components/charts/ordinal/SwarmPlot.js +147 -0
- package/ai/dist/src/components/charts/ordinal/ViolinPlot.js +138 -0
- package/ai/dist/src/components/charts/realtime/RealtimeHeatmap.js +79 -0
- package/ai/dist/src/components/charts/realtime/RealtimeHistogram.js +114 -0
- package/ai/dist/src/components/charts/realtime/RealtimeLineChart.js +93 -0
- package/ai/dist/src/components/charts/realtime/RealtimeSwarmChart.js +105 -0
- package/ai/dist/src/components/charts/realtime/RealtimeWaterfallChart.js +106 -0
- package/ai/dist/src/components/charts/shared/ChartError.js +72 -0
- package/ai/dist/src/components/charts/shared/colorUtils.js +138 -0
- package/ai/dist/src/components/charts/shared/formatUtils.js +213 -0
- package/ai/dist/src/components/charts/shared/hooks.js +49 -0
- package/ai/dist/src/components/charts/shared/legendUtils.js +57 -0
- package/ai/dist/src/components/charts/shared/selectionUtils.js +67 -0
- package/ai/dist/src/components/charts/shared/tooltipUtils.js +79 -0
- package/ai/dist/src/components/charts/shared/types.js +2 -0
- package/ai/dist/src/components/charts/shared/validateChartData.js +82 -0
- package/ai/dist/src/components/charts/shared/validateProps.js +736 -0
- package/ai/dist/src/components/charts/xy/AreaChart.js +230 -0
- package/ai/dist/src/components/charts/xy/BubbleChart.js +251 -0
- package/ai/dist/src/components/charts/xy/Heatmap.js +235 -0
- package/ai/dist/src/components/charts/xy/LineChart.js +307 -0
- package/ai/dist/src/components/charts/xy/MinimapChart.js +298 -0
- package/ai/dist/src/components/charts/xy/Scatterplot.js +172 -0
- package/ai/dist/src/components/charts/xy/ScatterplotMatrix.js +426 -0
- package/ai/dist/src/components/charts/xy/StackedAreaChart.js +231 -0
- package/ai/dist/src/components/constants/coordinateNames.js +11 -0
- package/ai/dist/src/components/constants/frame_props.js +251 -0
- package/ai/dist/src/components/data/dataFunctions.js +487 -0
- package/ai/dist/src/components/data/multiAccessorUtils.js +14 -0
- package/ai/dist/src/components/data/transforms.js +143 -0
- package/ai/dist/src/components/data/unflowedFunctions.js +5 -0
- package/ai/dist/src/components/export/exportChart.js +121 -0
- package/ai/dist/src/components/generic_utilities/functions.js +5 -0
- package/ai/dist/src/components/geometry/areaDrawing.js +312 -0
- package/ai/dist/src/components/geometry/contourLayout.js +73 -0
- package/ai/dist/src/components/geometry/hexbinLayout.js +163 -0
- package/ai/dist/src/components/geometry/lineDrawing.js +356 -0
- package/ai/dist/src/components/geometry/sankeyLinks.js +331 -0
- package/ai/dist/src/components/geometry/summaryLayouts.js +136 -0
- package/ai/dist/src/components/index.js +18 -0
- package/ai/dist/src/components/processing/InteractionItems.js +223 -0
- package/ai/dist/src/components/processing/hierarchyUtils.js +104 -0
- package/ai/dist/src/components/processing/layouts/chordLayout.js +58 -0
- package/ai/dist/src/components/processing/layouts/forceLayout.js +142 -0
- package/ai/dist/src/components/processing/layouts/hierarchyLayout.js +31 -0
- package/ai/dist/src/components/processing/layouts/index.js +32 -0
- package/ai/dist/src/components/processing/layouts/sankeyLayout.js +96 -0
- package/ai/dist/src/components/processing/layouts/simpleLayouts.js +34 -0
- package/ai/dist/src/components/processing/layouts/types.js +2 -0
- package/ai/dist/src/components/processing/networkDefaults.js +39 -0
- package/ai/dist/src/components/realtime/BinAccumulator.js +36 -0
- package/ai/dist/src/components/realtime/IncrementalExtent.js +55 -0
- package/ai/dist/src/components/realtime/RingBuffer.js +104 -0
- package/ai/dist/src/components/realtime/renderers/barRenderer.js +133 -0
- package/ai/dist/src/components/realtime/renderers/candlestickRenderer.js +7 -0
- package/ai/dist/src/components/realtime/renderers/lineRenderer.js +164 -0
- package/ai/dist/src/components/realtime/renderers/swarmRenderer.js +91 -0
- package/ai/dist/src/components/realtime/renderers/types.js +2 -0
- package/ai/dist/src/components/realtime/renderers/waterfallRenderer.js +163 -0
- package/ai/dist/src/components/realtime/types.js +2 -0
- package/ai/dist/src/components/semiotic-ai.js +89 -0
- package/ai/dist/src/components/semiotic-data.js +12 -0
- package/ai/dist/src/components/semiotic-network.js +38 -0
- package/ai/dist/src/components/semiotic-ordinal.js +28 -0
- package/ai/dist/src/components/semiotic-realtime.js +30 -0
- package/ai/dist/src/components/semiotic-server.js +8 -0
- package/ai/dist/src/components/semiotic-xy.js +35 -0
- package/ai/dist/src/components/semiotic.js +109 -0
- package/ai/dist/src/components/server/renderToStaticSVG.js +594 -0
- package/ai/dist/src/components/store/SelectionStore.js +91 -0
- package/ai/dist/src/components/store/ThemeStore.js +78 -0
- package/ai/dist/src/components/store/TooltipStore.js +13 -0
- package/ai/dist/src/components/store/createStore.js +81 -0
- package/ai/dist/src/components/store/useSelection.js +133 -0
- package/ai/dist/src/components/stream/CanvasHitTester.js +164 -0
- package/ai/dist/src/components/stream/DataSourceAdapter.js +99 -0
- package/ai/dist/src/components/stream/MarginalGraphics.js +266 -0
- package/ai/dist/src/components/stream/NetworkCanvasHitTester.js +228 -0
- package/ai/dist/src/components/stream/NetworkPipelineStore.js +498 -0
- package/ai/dist/src/components/stream/NetworkSVGOverlay.js +70 -0
- package/ai/dist/src/components/stream/NetworkSceneGraph.js +38 -0
- package/ai/dist/src/components/stream/OrdinalCanvasHitTester.js +146 -0
- package/ai/dist/src/components/stream/OrdinalPipelineStore.js +786 -0
- package/ai/dist/src/components/stream/OrdinalSVGOverlay.js +130 -0
- package/ai/dist/src/components/stream/ParticlePool.js +174 -0
- package/ai/dist/src/components/stream/PipelineStore.js +1243 -0
- package/ai/dist/src/components/stream/SVGOverlay.js +129 -0
- package/ai/dist/src/components/stream/SceneGraph.js +132 -0
- package/ai/dist/src/components/stream/StreamNetworkFrame.js +561 -0
- package/ai/dist/src/components/stream/StreamOrdinalFrame.js +492 -0
- package/ai/dist/src/components/stream/StreamXYFrame.js +590 -0
- package/ai/dist/src/components/stream/accessorUtils.js +20 -0
- package/ai/dist/src/components/stream/index.js +32 -0
- package/ai/dist/src/components/stream/layouts/chordLayoutPlugin.js +352 -0
- package/ai/dist/src/components/stream/layouts/forceLayoutPlugin.js +230 -0
- package/ai/dist/src/components/stream/layouts/hierarchyLayoutPlugin.js +568 -0
- package/ai/dist/src/components/stream/layouts/index.js +28 -0
- package/ai/dist/src/components/stream/layouts/sankeyLayoutPlugin.js +245 -0
- package/ai/dist/src/components/stream/networkTypes.js +17 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/barScene.js +126 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/connectorScene.js +62 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/pieScene.js +33 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/pointScene.js +63 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/statisticalScene.js +278 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/timelineScene.js +30 -0
- package/ai/dist/src/components/stream/ordinalSceneBuilders/types.js +2 -0
- package/ai/dist/src/components/stream/ordinalTypes.js +2 -0
- package/ai/dist/src/components/stream/renderers/areaCanvasRenderer.js +48 -0
- package/ai/dist/src/components/stream/renderers/barCanvasRenderer.js +70 -0
- package/ai/dist/src/components/stream/renderers/boxplotCanvasRenderer.js +75 -0
- package/ai/dist/src/components/stream/renderers/candlestickCanvasRenderer.js +28 -0
- package/ai/dist/src/components/stream/renderers/connectorCanvasRenderer.js +47 -0
- package/ai/dist/src/components/stream/renderers/heatmapCanvasRenderer.js +31 -0
- package/ai/dist/src/components/stream/renderers/lineCanvasRenderer.js +140 -0
- package/ai/dist/src/components/stream/renderers/networkArcRenderer.js +38 -0
- package/ai/dist/src/components/stream/renderers/networkCircleRenderer.js +37 -0
- package/ai/dist/src/components/stream/renderers/networkEdgeRenderer.js +102 -0
- package/ai/dist/src/components/stream/renderers/networkParticleRenderer.js +63 -0
- package/ai/dist/src/components/stream/renderers/networkRectRenderer.js +35 -0
- package/ai/dist/src/components/stream/renderers/pointCanvasRenderer.js +38 -0
- package/ai/dist/src/components/stream/renderers/swarmCanvasRenderer.js +10 -0
- package/ai/dist/src/components/stream/renderers/types.js +2 -0
- package/ai/dist/src/components/stream/renderers/violinCanvasRenderer.js +47 -0
- package/ai/dist/src/components/stream/renderers/waterfallCanvasRenderer.js +38 -0
- package/ai/dist/src/components/stream/renderers/wedgeCanvasRenderer.js +33 -0
- package/ai/dist/src/components/stream/types.js +2 -0
- package/ai/dist/src/components/types/annotationTypes.js +2 -0
- package/ai/dist/src/components/types/canvasTypes.js +2 -0
- package/ai/dist/src/components/types/generalTypes.js +2 -0
- package/ai/dist/src/components/types/interactionTypes.js +2 -0
- package/ai/dist/src/components/types/legendTypes.js +2 -0
- package/ai/dist/src/components/types/networkTypes.js +2 -0
- package/ai/dist/src/components/types/ordinalTypes.js +2 -0
- package/ai/dist/src/components/types/xyTypes.js +2 -0
- package/ai/dist/src/components/useBoundingRect.js +24 -0
- package/ai/dist/src/components/visualizationLayerBehavior/axis.js +301 -0
- package/ai/dist/src/components/visualizationLayerBehavior/general.js +435 -0
- package/ai/dist/src/setupTests.js +4 -0
- package/ai/examples.md +489 -0
- package/ai/schema.json +1338 -0
- package/ai/system-prompt.md +41 -0
- package/dist/AnnotationLayer/AnnotationLayer.d.ts +0 -1
- package/dist/Axis/axisTitle.d.ts +3 -3
- package/dist/Axis/summaryGraphic.d.ts +1 -1
- package/dist/ChartErrorBoundary.d.ts +39 -0
- package/dist/LinkedCharts.d.ts +42 -0
- package/dist/ThemeProvider.d.ts +12 -0
- package/dist/Tooltip/Tooltip.d.ts +141 -0
- package/dist/TooltipPositioner/index.d.ts +1 -1
- package/dist/annotationLayerBehavior/annotationHandling.d.ts +2 -2
- package/dist/annotationRules/networkframeRules.d.ts +2 -2
- package/dist/annotationRules/xyframeRules.d.ts +2 -2
- package/dist/batchWork.d.ts +1 -1
- package/dist/charts/index.d.ts +74 -0
- package/dist/charts/network/ChordDiagram.d.ts +36 -0
- package/dist/charts/network/CirclePack.d.ts +32 -0
- package/dist/charts/network/ForceDirectedGraph.d.ts +38 -0
- package/dist/charts/network/SankeyDiagram.d.ts +38 -0
- package/dist/charts/network/TreeDiagram.d.ts +34 -0
- package/dist/charts/network/Treemap.d.ts +33 -0
- package/dist/charts/ordinal/BarChart.d.ts +32 -0
- package/dist/charts/ordinal/BoxPlot.d.ts +27 -0
- package/dist/charts/ordinal/DonutChart.d.ts +23 -0
- package/dist/charts/ordinal/DotPlot.d.ts +27 -0
- package/dist/charts/ordinal/GroupedBarChart.d.ts +26 -0
- package/dist/charts/ordinal/Histogram.d.ts +26 -0
- package/dist/charts/ordinal/PieChart.d.ts +21 -0
- package/dist/charts/ordinal/RidgelinePlot.d.ts +34 -0
- package/dist/charts/ordinal/StackedBarChart.d.ts +27 -0
- package/dist/charts/ordinal/SwarmPlot.d.ts +29 -0
- package/dist/charts/ordinal/ViolinPlot.d.ts +28 -0
- package/dist/charts/realtime/RealtimeHeatmap.d.ts +95 -0
- package/dist/charts/realtime/RealtimeHistogram.d.ts +119 -0
- package/dist/charts/realtime/RealtimeLineChart.d.ts +98 -0
- package/dist/charts/realtime/RealtimeSwarmChart.d.ts +100 -0
- package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +97 -0
- package/dist/charts/shared/ChartError.d.ts +19 -0
- package/dist/charts/shared/colorUtils.d.ts +62 -0
- package/dist/charts/shared/formatUtils.d.ts +94 -0
- package/dist/charts/shared/hooks.d.ts +20 -0
- package/dist/charts/shared/legendUtils.d.ts +32 -0
- package/dist/charts/shared/selectionUtils.d.ts +51 -0
- package/dist/charts/shared/tooltipUtils.d.ts +18 -0
- package/dist/charts/shared/types.d.ts +97 -0
- package/dist/charts/shared/validateChartData.d.ts +41 -0
- package/dist/charts/shared/validateProps.d.ts +18 -0
- package/dist/charts/xy/AreaChart.d.ts +130 -0
- package/dist/charts/xy/BubbleChart.d.ts +164 -0
- package/dist/charts/xy/Heatmap.d.ts +156 -0
- package/dist/charts/xy/LineChart.d.ts +196 -0
- package/dist/charts/xy/MinimapChart.d.ts +73 -0
- package/dist/charts/xy/Scatterplot.d.ts +55 -0
- package/dist/charts/xy/ScatterplotMatrix.d.ts +71 -0
- package/dist/charts/xy/StackedAreaChart.d.ts +134 -0
- package/dist/constants/frame_props.d.ts +9 -0
- package/dist/data/dataFunctions.d.ts +10 -11
- package/dist/data/transforms.d.ts +45 -0
- package/dist/export/exportChart.d.ts +16 -0
- package/dist/{svg → geometry}/areaDrawing.d.ts +3 -13
- package/dist/geometry/contourLayout.d.ts +6 -0
- package/dist/geometry/hexbinLayout.d.ts +7 -0
- package/dist/{svg → geometry}/lineDrawing.d.ts +7 -35
- package/dist/geometry/sankeyLinks.d.ts +2 -0
- package/dist/geometry/summaryLayouts.d.ts +45 -0
- package/dist/index.d.ts +1 -125
- package/dist/network.js +7495 -0
- package/dist/network.js.map +1 -0
- package/dist/network.min.js +1 -0
- package/dist/network.module.js +7458 -0
- package/dist/network.module.js.map +1 -0
- package/dist/network.module.min.js +1 -0
- package/dist/ordinal.js +6497 -0
- package/dist/ordinal.js.map +1 -0
- package/dist/ordinal.min.js +1 -0
- package/dist/ordinal.module.js +6465 -0
- package/dist/ordinal.module.js.map +1 -0
- package/dist/ordinal.module.min.js +1 -0
- package/dist/processing/InteractionItems.d.ts +5 -4
- package/dist/processing/hierarchyUtils.d.ts +16 -0
- package/dist/processing/layouts/chordLayout.d.ts +2 -0
- package/dist/processing/layouts/forceLayout.d.ts +3 -0
- package/dist/processing/layouts/hierarchyLayout.d.ts +10 -0
- package/dist/processing/layouts/index.d.ts +8 -0
- package/dist/processing/layouts/sankeyLayout.d.ts +8 -0
- package/dist/processing/layouts/simpleLayouts.d.ts +7 -0
- package/dist/processing/layouts/types.d.ts +17 -0
- package/dist/processing/networkDefaults.d.ts +36 -0
- package/dist/realtime/BinAccumulator.d.ts +8 -0
- package/dist/realtime/IncrementalExtent.d.ts +13 -0
- package/dist/realtime/RingBuffer.d.ts +19 -0
- package/dist/realtime/renderers/barRenderer.d.ts +2 -0
- package/dist/realtime/renderers/candlestickRenderer.d.ts +2 -0
- package/dist/realtime/renderers/lineRenderer.d.ts +2 -0
- package/dist/realtime/renderers/swarmRenderer.d.ts +2 -0
- package/dist/realtime/renderers/types.d.ts +9 -0
- package/dist/realtime/renderers/waterfallRenderer.d.ts +3 -0
- package/dist/realtime/types.d.ts +113 -0
- package/dist/realtime.js +7072 -0
- package/dist/realtime.js.map +1 -0
- package/dist/realtime.min.js +1 -0
- package/dist/realtime.module.js +7043 -0
- package/dist/realtime.module.js.map +1 -0
- package/dist/realtime.module.min.js +1 -0
- package/dist/semiotic-ai.d.ts +36 -0
- package/dist/semiotic-ai.js +13323 -0
- package/dist/semiotic-ai.js.map +1 -0
- package/dist/semiotic-ai.min.js +1 -0
- package/dist/semiotic-ai.module.js +13264 -0
- package/dist/semiotic-ai.module.js.map +1 -0
- package/dist/semiotic-ai.module.min.js +1 -0
- package/dist/semiotic-data.d.ts +5 -0
- package/dist/semiotic-data.js +141 -0
- package/dist/semiotic-data.js.map +1 -0
- package/dist/semiotic-data.min.js +1 -0
- package/dist/semiotic-data.module.js +136 -0
- package/dist/semiotic-data.module.js.map +1 -0
- package/dist/semiotic-data.module.min.js +1 -0
- package/dist/semiotic-network.d.ts +23 -0
- package/dist/semiotic-ordinal.d.ts +19 -0
- package/dist/semiotic-realtime.d.ts +22 -0
- package/dist/semiotic-server.d.ts +1 -0
- package/dist/semiotic-xy.d.ts +21 -0
- package/dist/semiotic.d.ts +41 -28
- package/dist/semiotic.js +16257 -13130
- package/dist/semiotic.js.map +1 -0
- package/dist/semiotic.min.js +1 -0
- package/dist/semiotic.module.js +16198 -13100
- package/dist/semiotic.module.js.map +1 -0
- package/dist/semiotic.module.min.js +1 -0
- package/dist/server/renderToStaticSVG.d.ts +9 -0
- package/dist/server.js +5191 -0
- package/dist/server.js.map +1 -0
- package/dist/server.min.js +1 -0
- package/dist/server.module.js +5166 -0
- package/dist/server.module.js.map +1 -0
- package/dist/server.module.min.js +1 -0
- package/dist/store/SelectionStore.d.ts +29 -0
- package/dist/store/ThemeStore.d.ts +26 -0
- package/dist/store/useSelection.d.ts +66 -0
- package/dist/stream/CanvasHitTester.d.ts +18 -0
- package/dist/stream/DataSourceAdapter.d.ts +32 -0
- package/dist/stream/MarginalGraphics.d.ts +19 -0
- package/dist/stream/NetworkCanvasHitTester.d.ts +14 -0
- package/dist/stream/NetworkPipelineStore.d.ts +74 -0
- package/dist/stream/NetworkSVGOverlay.d.ts +40 -0
- package/dist/stream/NetworkSceneGraph.d.ts +14 -0
- package/dist/stream/OrdinalCanvasHitTester.d.ts +9 -0
- package/dist/stream/OrdinalPipelineStore.d.ts +65 -0
- package/dist/stream/OrdinalSVGOverlay.d.ts +34 -0
- package/dist/stream/ParticlePool.d.ts +28 -0
- package/dist/stream/PipelineStore.d.ts +161 -0
- package/dist/stream/SVGOverlay.d.ts +37 -0
- package/dist/stream/SceneGraph.d.ts +16 -0
- package/dist/stream/StreamNetworkFrame.d.ts +4 -0
- package/dist/stream/StreamOrdinalFrame.d.ts +4 -0
- package/dist/stream/StreamXYFrame.d.ts +4 -0
- package/dist/stream/accessorUtils.d.ts +2 -0
- package/dist/stream/index.d.ts +16 -0
- package/dist/stream/layouts/chordLayoutPlugin.d.ts +8 -0
- package/dist/stream/layouts/forceLayoutPlugin.d.ts +9 -0
- package/dist/stream/layouts/hierarchyLayoutPlugin.d.ts +17 -0
- package/dist/stream/layouts/index.d.ts +11 -0
- package/dist/stream/layouts/sankeyLayoutPlugin.d.ts +8 -0
- package/dist/stream/networkTypes.d.ts +346 -0
- package/dist/stream/ordinalSceneBuilders/barScene.d.ts +4 -0
- package/dist/stream/ordinalSceneBuilders/connectorScene.d.ts +3 -0
- package/dist/stream/ordinalSceneBuilders/pieScene.d.ts +3 -0
- package/dist/stream/ordinalSceneBuilders/pointScene.d.ts +4 -0
- package/dist/stream/ordinalSceneBuilders/statisticalScene.d.ts +6 -0
- package/dist/stream/ordinalSceneBuilders/timelineScene.d.ts +3 -0
- package/dist/stream/ordinalSceneBuilders/types.d.ts +21 -0
- package/dist/stream/ordinalTypes.d.ts +225 -0
- package/dist/stream/renderers/areaCanvasRenderer.d.ts +7 -0
- package/dist/stream/renderers/barCanvasRenderer.d.ts +7 -0
- package/dist/stream/renderers/boxplotCanvasRenderer.d.ts +2 -0
- package/dist/stream/renderers/candlestickCanvasRenderer.d.ts +2 -0
- package/dist/stream/renderers/connectorCanvasRenderer.d.ts +2 -0
- package/dist/stream/renderers/heatmapCanvasRenderer.d.ts +6 -0
- package/dist/stream/renderers/lineCanvasRenderer.d.ts +8 -0
- package/dist/stream/renderers/networkArcRenderer.d.ts +5 -0
- package/dist/stream/renderers/networkCircleRenderer.d.ts +5 -0
- package/dist/stream/renderers/networkEdgeRenderer.d.ts +10 -0
- package/dist/stream/renderers/networkParticleRenderer.d.ts +11 -0
- package/dist/stream/renderers/networkRectRenderer.d.ts +5 -0
- package/dist/stream/renderers/pointCanvasRenderer.d.ts +7 -0
- package/dist/stream/renderers/swarmCanvasRenderer.d.ts +7 -0
- package/dist/stream/renderers/types.d.ts +7 -0
- package/dist/stream/renderers/violinCanvasRenderer.d.ts +2 -0
- package/dist/stream/renderers/waterfallCanvasRenderer.d.ts +8 -0
- package/dist/stream/renderers/wedgeCanvasRenderer.d.ts +2 -0
- package/dist/stream/types.d.ts +307 -0
- package/dist/types/annotationTypes.d.ts +13 -18
- package/dist/types/canvasTypes.d.ts +1 -1
- package/dist/types/generalTypes.d.ts +41 -36
- package/dist/types/interactionTypes.d.ts +7 -9
- package/dist/types/legendTypes.d.ts +2 -2
- package/dist/types/networkTypes.d.ts +40 -30
- package/dist/types/ordinalTypes.d.ts +27 -18
- package/dist/types/xyTypes.d.ts +1 -95
- package/dist/visualizationLayerBehavior/axis.d.ts +3 -5
- package/dist/visualizationLayerBehavior/general.d.ts +8 -12
- package/dist/xy.js +6993 -0
- package/dist/xy.js.map +1 -0
- package/dist/xy.min.js +1 -0
- package/dist/xy.module.js +6957 -0
- package/dist/xy.module.js.map +1 -0
- package/dist/xy.module.min.js +1 -0
- package/package.json +123 -67
- package/dist/AnnotationLayer/helpers.d.ts +0 -6
- package/dist/AnnotationLayer/index.d.ts +0 -2
- package/dist/FacetController.d.ts +0 -12
- package/dist/Frame.d.ts +0 -2
- package/dist/InteractionLayer.d.ts +0 -3
- package/dist/Mark/Mark.d.ts +0 -3
- package/dist/Mark/Mark.types.d.ts +0 -10
- package/dist/Mark/constants/markTransition.d.ts +0 -10
- package/dist/Mark/markBehavior/drawing.d.ts +0 -13
- package/dist/MiniMap.d.ts +0 -14
- package/dist/MinimapXYFrame.d.ts +0 -10
- package/dist/NetworkFrame.d.ts +0 -4
- package/dist/OrdinalFrame.d.ts +0 -4
- package/dist/ResponsiveFrame.d.ts +0 -22
- package/dist/ResponsiveMinimapXYFrame.d.ts +0 -6
- package/dist/ResponsiveNetworkFrame.d.ts +0 -6
- package/dist/ResponsiveOrdinalFrame.d.ts +0 -6
- package/dist/ResponsiveXYFrame.d.ts +0 -6
- package/dist/SpanOrDiv.d.ts +0 -10
- package/dist/SparkFrame.d.ts +0 -14
- package/dist/SparkNetworkFrame.d.ts +0 -5
- package/dist/SparkOrdinalFrame.d.ts +0 -5
- package/dist/SparkXYFrame.d.ts +0 -5
- package/dist/VisualizationLayer.d.ts +0 -33
- package/dist/XYFrame.d.ts +0 -4
- package/dist/annotationRules/orframeRules.d.ts +0 -105
- package/dist/components/Annotation.d.ts +0 -3
- package/dist/components/AnnotationLayer/AnnotationLayer.d.ts +0 -26
- package/dist/components/Axis/Axis.d.ts +0 -7
- package/dist/components/Axis/axisTitle.d.ts +0 -10
- package/dist/components/Axis/index.d.ts +0 -2
- package/dist/components/Axis/summaryGraphic.d.ts +0 -17
- package/dist/components/Brush.d.ts +0 -12
- package/dist/components/DividedLine.d.ts +0 -16
- package/dist/components/FacetController.d.ts +0 -12
- package/dist/components/Frame.d.ts +0 -2
- package/dist/components/InteractionLayer.d.ts +0 -3
- package/dist/components/Legend.d.ts +0 -3
- package/dist/components/Mark/Mark.d.ts +0 -3
- package/dist/components/Mark/Mark.types.d.ts +0 -10
- package/dist/components/Mark/markBehavior/drawing.d.ts +0 -13
- package/dist/components/MiniMap.d.ts +0 -14
- package/dist/components/MinimapXYFrame.d.ts +0 -10
- package/dist/components/NetworkFrame.d.ts +0 -4
- package/dist/components/OrdinalFrame.d.ts +0 -4
- package/dist/components/ResponsiveFrame.d.ts +0 -22
- package/dist/components/ResponsiveMinimapXYFrame.d.ts +0 -6
- package/dist/components/ResponsiveNetworkFrame.d.ts +0 -6
- package/dist/components/ResponsiveOrdinalFrame.d.ts +0 -6
- package/dist/components/ResponsiveXYFrame.d.ts +0 -6
- package/dist/components/SpanOrDiv.d.ts +0 -10
- package/dist/components/SparkFrame.d.ts +0 -14
- package/dist/components/SparkNetworkFrame.d.ts +0 -5
- package/dist/components/SparkOrdinalFrame.d.ts +0 -5
- package/dist/components/SparkXYFrame.d.ts +0 -5
- package/dist/components/TooltipPositioner/index.d.ts +0 -7
- package/dist/components/VisualizationLayer.d.ts +0 -33
- package/dist/components/XYFrame.d.ts +0 -4
- package/dist/components/annotationLayerBehavior/annotationHandling.d.ts +0 -19
- package/dist/components/annotationLayerBehavior/d3labeler.d.ts +0 -9
- package/dist/components/annotationRules/baseRules.d.ts +0 -25
- package/dist/components/annotationRules/networkframeRules.d.ts +0 -48
- package/dist/components/annotationRules/orframeRules.d.ts +0 -105
- package/dist/components/annotationRules/xyframeRules.d.ts +0 -117
- package/dist/components/batchWork.d.ts +0 -6
- package/dist/components/constants/coordinateNames.d.ts +0 -8
- package/dist/components/constants/frame_props.d.ts +0 -4
- package/dist/components/constants/jsx.d.ts +0 -19
- package/dist/components/data/dataFunctions.d.ts +0 -46
- package/dist/components/data/multiAccessorUtils.d.ts +0 -1
- package/dist/components/data/unflowedFunctions.d.ts +0 -1
- package/dist/components/generic_utilities/functions.d.ts +0 -1
- package/dist/components/index.d.ts +0 -125
- package/dist/components/interactionLayerBehavior/InteractionCanvas.d.ts +0 -20
- package/dist/components/processing/InteractionItems.d.ts +0 -12
- package/dist/components/processing/network.d.ts +0 -114
- package/dist/components/processing/ordinal.d.ts +0 -102
- package/dist/components/processing/xyDrawing.d.ts +0 -135
- package/dist/components/semiotic.d.ts +0 -35
- package/dist/components/store/TooltipStore.d.ts +0 -2
- package/dist/components/store/createStore.d.ts +0 -1
- package/dist/components/svg/SvgHelper.d.ts +0 -37
- package/dist/components/svg/areaDrawing.d.ts +0 -31
- package/dist/components/svg/ckmeans.d.ts +0 -69
- package/dist/components/svg/frameFunctions.d.ts +0 -119
- package/dist/components/svg/lineDrawing.d.ts +0 -99
- package/dist/components/svg/networkDrawing.d.ts +0 -134
- package/dist/components/svg/pieceDrawing.d.ts +0 -13
- package/dist/components/svg/pieceLayouts.d.ts +0 -71
- package/dist/components/svg/summaryLayouts.d.ts +0 -74
- package/dist/components/types/annotationTypes.d.ts +0 -140
- package/dist/components/types/canvasTypes.d.ts +0 -9
- package/dist/components/types/generalTypes.d.ts +0 -236
- package/dist/components/types/interactionTypes.d.ts +0 -74
- package/dist/components/types/legendTypes.d.ts +0 -20
- package/dist/components/types/networkTypes.d.ts +0 -165
- package/dist/components/types/ordinalTypes.d.ts +0 -103
- package/dist/components/types/xyTypes.d.ts +0 -118
- package/dist/components/useBoundingRect.d.ts +0 -2
- package/dist/components/useDerivedStateFromProps.d.ts +0 -1
- package/dist/components/useLegacyUnmountCallback.d.ts +0 -1
- package/dist/components/visualizationLayerBehavior/axis.d.ts +0 -38
- package/dist/components/visualizationLayerBehavior/general.d.ts +0 -84
- package/dist/constants/jsx.d.ts +0 -19
- package/dist/interactionLayerBehavior/InteractionCanvas.d.ts +0 -20
- package/dist/processing/network.d.ts +0 -114
- package/dist/processing/ordinal.d.ts +0 -102
- package/dist/processing/xyDrawing.d.ts +0 -135
- package/dist/setupTests.d.ts +0 -1
- package/dist/svg/SvgHelper.d.ts +0 -37
- package/dist/svg/ckmeans.d.ts +0 -69
- package/dist/svg/frameFunctions.d.ts +0 -119
- package/dist/svg/networkDrawing.d.ts +0 -134
- package/dist/svg/pieceDrawing.d.ts +0 -13
- package/dist/svg/pieceLayouts.d.ts +0 -71
- package/dist/svg/summaryLayouts.d.ts +0 -74
- package/dist/useDerivedStateFromProps.d.ts +0 -1
- package/dist/useLegacyUnmountCallback.d.ts +0 -1
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
# Semiotic — AI Assistant Guide
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
- Install: `npm install semiotic`
|
|
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 }`
|
|
9
|
+
- 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
|
|
11
|
+
|
|
12
|
+
## 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
|
|
15
|
+
- Every HOC accepts `frameProps` to pass through to the underlying Stream Frame
|
|
16
|
+
|
|
17
|
+
## Component Reference
|
|
18
|
+
|
|
19
|
+
### XY Charts (import from "semiotic" or "semiotic/xy")
|
|
20
|
+
|
|
21
|
+
#### LineChart
|
|
22
|
+
Line traces with curve interpolation, area fill, and point markers. Use for time series, trends, and continuous data.
|
|
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)
|
|
35
|
+
|
|
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
|
+
```
|
|
113
|
+
|
|
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
|
+
```
|
|
185
|
+
|
|
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
|
+
```
|
|
324
|
+
|
|
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)
|
|
341
|
+
|
|
342
|
+
```jsx
|
|
343
|
+
<SankeyDiagram edges={flows} sourceAccessor="from" targetAccessor="to" valueAccessor="amount" />
|
|
344
|
+
```
|
|
345
|
+
|
|
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)
|
|
360
|
+
|
|
361
|
+
```jsx
|
|
362
|
+
<ChordDiagram edges={trades} sourceAccessor="exporter" targetAccessor="importer" valueAccessor="volume" />
|
|
363
|
+
```
|
|
364
|
+
|
|
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)
|
|
379
|
+
|
|
380
|
+
```jsx
|
|
381
|
+
<TreeDiagram data={orgChart} childrenAccessor="reports" nodeIdAccessor="name" orientation="horizontal" />
|
|
382
|
+
```
|
|
383
|
+
|
|
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)
|
|
400
|
+
|
|
401
|
+
```jsx
|
|
402
|
+
<Treemap data={fileSystem} childrenAccessor="children" valueAccessor="size" colorByDepth />
|
|
403
|
+
```
|
|
404
|
+
|
|
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)
|
|
421
|
+
|
|
422
|
+
```jsx
|
|
423
|
+
<CirclePack data={taxonomy} childrenAccessor="children" valueAccessor="count" colorByDepth />
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Realtime Charts (import from "semiotic" or "semiotic/realtime")
|
|
427
|
+
|
|
428
|
+
All realtime charts use a ref-based push API and render on canvas for high performance.
|
|
429
|
+
|
|
430
|
+
```jsx
|
|
431
|
+
const chartRef = useRef()
|
|
432
|
+
// Push data at any frequency
|
|
433
|
+
chartRef.current.push({ time: Date.now(), value: reading })
|
|
434
|
+
```
|
|
435
|
+
|
|
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)
|
|
450
|
+
|
|
451
|
+
```jsx
|
|
452
|
+
<RealtimeLineChart ref={chartRef} timeAccessor="time" valueAccessor="value" windowSize={200} />
|
|
453
|
+
```
|
|
454
|
+
|
|
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)
|
|
471
|
+
|
|
472
|
+
```jsx
|
|
473
|
+
<RealtimeTemporalHistogram ref={chartRef} binSize={1000} timeAccessor="time" valueAccessor="count" />
|
|
474
|
+
```
|
|
475
|
+
|
|
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)
|
|
491
|
+
|
|
492
|
+
```jsx
|
|
493
|
+
<RealtimeSwarmChart ref={chartRef} timeAccessor="time" valueAccessor="latency" categoryAccessor="service" />
|
|
494
|
+
```
|
|
495
|
+
|
|
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)
|
|
512
|
+
|
|
513
|
+
```jsx
|
|
514
|
+
<RealtimeWaterfallChart ref={chartRef} timeAccessor="time" valueAccessor="delta" />
|
|
515
|
+
```
|
|
516
|
+
|
|
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)
|
|
531
|
+
|
|
532
|
+
```jsx
|
|
533
|
+
<RealtimeHeatmap ref={chartRef} timeAccessor="x" valueAccessor="y" heatmapXBins={20} aggregation="count" />
|
|
534
|
+
```
|
|
535
|
+
|
|
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()`
|
|
563
|
+
|
|
564
|
+
```jsx
|
|
565
|
+
import { StreamNetworkFrame } from "semiotic"
|
|
566
|
+
|
|
567
|
+
const chartRef = useRef()
|
|
568
|
+
chartRef.current.push({ source: "Salary", target: "Budget", value: 5000 })
|
|
569
|
+
|
|
570
|
+
<StreamNetworkFrame ref={chartRef} chartType="sankey" size={[800, 400]} showParticles edgeOpacity={0.4} />
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
### Coordinated Views (import from "semiotic" or "semiotic/ai")
|
|
574
|
+
|
|
575
|
+
#### LinkedCharts
|
|
576
|
+
Context provider for coordinated chart views. Wraps any number of charts at any depth.
|
|
577
|
+
|
|
578
|
+
Props: `selections` (Record<string, { resolution?: "union"|"intersect"|"crossfilter" }>)
|
|
579
|
+
|
|
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
|
+
```
|
|
589
|
+
|
|
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)
|
|
618
|
+
|
|
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
|
+
```
|
|
639
|
+
|
|
640
|
+
### Realtime Visual Encoding
|
|
641
|
+
|
|
642
|
+
All streaming charts support visual encodings that communicate change over time:
|
|
643
|
+
|
|
644
|
+
```jsx
|
|
645
|
+
// Decay: older data fades out (linear, exponential, or step)
|
|
646
|
+
<StreamXYFrame decay={{ type: "exponential", halfLife: 100, minOpacity: 0.1 }} />
|
|
647
|
+
|
|
648
|
+
// Pulse: newly inserted data flashes with a glow
|
|
649
|
+
<StreamXYFrame pulse={{ duration: 500, color: "rgba(255,255,255,0.6)", glowRadius: 4 }} />
|
|
650
|
+
|
|
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"
|
|
672
|
+
|
|
673
|
+
<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
|
+
|
|
728
|
+
### Coordinated views
|
|
729
|
+
```jsx
|
|
730
|
+
// Cross-highlighting: hover one chart, highlight matching data in others
|
|
731
|
+
<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" }} />
|
|
738
|
+
</LinkedCharts>
|
|
739
|
+
```
|
|
740
|
+
|
|
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")
|
|
762
|
+
|
|
763
|
+
Global theming for all Semiotic charts. Opt-in — no changes to existing behavior without wrapping.
|
|
764
|
+
|
|
765
|
+
```jsx
|
|
766
|
+
import { ThemeProvider } from "semiotic"
|
|
767
|
+
|
|
768
|
+
// Dark mode preset
|
|
769
|
+
<ThemeProvider theme="dark">
|
|
770
|
+
<LineChart data={d} xAccessor="x" yAccessor="y" />
|
|
771
|
+
</ThemeProvider>
|
|
772
|
+
|
|
773
|
+
// Custom theme
|
|
774
|
+
<ThemeProvider theme={{ colors: { primary: "#e41a1c", background: "#f5f5f5" } }}>
|
|
775
|
+
<BarChart data={d} categoryAccessor="cat" valueAccessor="val" />
|
|
776
|
+
</ThemeProvider>
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
Presets: `"light"` (default), `"dark"`. Use `useTheme()` hook to read the current theme.
|
|
780
|
+
|
|
781
|
+
### Data Transforms (import from "semiotic/data")
|
|
782
|
+
|
|
783
|
+
Pure helper functions for common data transformations:
|
|
784
|
+
|
|
785
|
+
```jsx
|
|
786
|
+
import { bin, rollup, groupBy, pivot } from "semiotic/data"
|
|
787
|
+
|
|
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
|
+
```
|
|
793
|
+
|
|
794
|
+
### Browser Export (import from "semiotic" or "semiotic/ai")
|
|
795
|
+
|
|
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
|
+
```
|
|
813
|
+
|
|
814
|
+
## 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.
|