semiotic 2.0.3 → 3.0.0-beta.1
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 +530 -0
- package/README.md +190 -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 +373 -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/DividedLine.js +65 -0
- package/ai/dist/src/components/FacetController.js +259 -0
- package/ai/dist/src/components/Frame.js +139 -0
- package/ai/dist/src/components/InteractionLayer.js +328 -0
- package/ai/dist/src/components/Legend.js +140 -0
- package/ai/dist/src/components/MiniMap.js +75 -0
- package/ai/dist/src/components/MinimapXYFrame.js +99 -0
- package/ai/dist/src/components/NetworkFrame.js +335 -0
- package/ai/dist/src/components/OrdinalFrame.js +437 -0
- package/ai/dist/src/components/ResponsiveFrame.js +68 -0
- package/ai/dist/src/components/ResponsiveMinimapXYFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveNetworkFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveOrdinalFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveXYFrame.js +10 -0
- package/ai/dist/src/components/SparkFrame.js +113 -0
- package/ai/dist/src/components/SparkNetworkFrame.js +11 -0
- package/ai/dist/src/components/SparkOrdinalFrame.js +11 -0
- package/ai/dist/src/components/SparkXYFrame.js +11 -0
- package/ai/dist/src/components/Tooltip/Tooltip.js +304 -0
- package/ai/dist/src/components/TooltipPositioner/index.js +132 -0
- package/ai/dist/src/components/VisualizationLayer.js +395 -0
- package/ai/dist/src/components/XYFrame.js +524 -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 +198 -0
- package/ai/dist/src/components/annotationRules/orframeRules.js +695 -0
- package/ai/dist/src/components/annotationRules/xyframeRules.js +299 -0
- package/ai/dist/src/components/batchWork.js +35 -0
- package/ai/dist/src/components/charts/index.js +96 -0
- package/ai/dist/src/components/charts/network/ChordDiagram.js +245 -0
- package/ai/dist/src/components/charts/network/CirclePack.js +177 -0
- package/ai/dist/src/components/charts/network/ForceDirectedGraph.js +248 -0
- package/ai/dist/src/components/charts/network/SankeyDiagram.js +305 -0
- package/ai/dist/src/components/charts/network/TreeDiagram.js +268 -0
- package/ai/dist/src/components/charts/network/Treemap.js +177 -0
- package/ai/dist/src/components/charts/ordinal/BarChart.js +191 -0
- package/ai/dist/src/components/charts/ordinal/BoxPlot.js +235 -0
- package/ai/dist/src/components/charts/ordinal/DonutChart.js +178 -0
- package/ai/dist/src/components/charts/ordinal/DotPlot.js +194 -0
- package/ai/dist/src/components/charts/ordinal/GroupedBarChart.js +194 -0
- package/ai/dist/src/components/charts/ordinal/PieChart.js +155 -0
- package/ai/dist/src/components/charts/ordinal/StackedBarChart.js +213 -0
- package/ai/dist/src/components/charts/ordinal/SwarmPlot.js +219 -0
- package/ai/dist/src/components/charts/realtime/RealtimeBarChart.js +91 -0
- package/ai/dist/src/components/charts/realtime/RealtimeLineChart.js +73 -0
- package/ai/dist/src/components/charts/realtime/RealtimeSwarmChart.js +85 -0
- package/ai/dist/src/components/charts/realtime/RealtimeWaterfallChart.js +86 -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 +176 -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/types.js +2 -0
- package/ai/dist/src/components/charts/shared/validateChartData.js +82 -0
- package/ai/dist/src/components/charts/shared/validateProps.js +640 -0
- package/ai/dist/src/components/charts/xy/AreaChart.js +220 -0
- package/ai/dist/src/components/charts/xy/BubbleChart.js +222 -0
- package/ai/dist/src/components/charts/xy/Heatmap.js +230 -0
- package/ai/dist/src/components/charts/xy/LineChart.js +302 -0
- package/ai/dist/src/components/charts/xy/Scatterplot.js +136 -0
- package/ai/dist/src/components/charts/xy/StackedAreaChart.js +220 -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/constants/jsx.js +71 -0
- package/ai/dist/src/components/data/dataFunctions.js +473 -0
- package/ai/dist/src/components/data/multiAccessorUtils.js +14 -0
- package/ai/dist/src/components/data/networkPipelineCache.js +43 -0
- package/ai/dist/src/components/data/ordinalPipelineCache.js +53 -0
- package/ai/dist/src/components/data/unflowedFunctions.js +5 -0
- package/ai/dist/src/components/data/xyPipelineCache.js +49 -0
- package/ai/dist/src/components/generic_utilities/functions.js +5 -0
- package/ai/dist/src/components/index.js +145 -0
- package/ai/dist/src/components/interactionLayerBehavior/InteractionCanvas.js +128 -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/network.js +771 -0
- package/ai/dist/src/components/processing/networkDefaults.js +39 -0
- package/ai/dist/src/components/processing/networkLayoutHelpers.js +98 -0
- package/ai/dist/src/components/processing/ordinal.js +889 -0
- package/ai/dist/src/components/processing/ordinalConstants.js +23 -0
- package/ai/dist/src/components/processing/ordinalOverlays.js +88 -0
- package/ai/dist/src/components/processing/ordinalRenderPipeline.js +196 -0
- package/ai/dist/src/components/processing/xyDrawing.js +484 -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/RealtimeFrame.js +710 -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 +66 -0
- package/ai/dist/src/components/semiotic-network.js +30 -0
- package/ai/dist/src/components/semiotic-ordinal.js +28 -0
- package/ai/dist/src/components/semiotic-realtime.js +37 -0
- package/ai/dist/src/components/semiotic-server.js +8 -0
- package/ai/dist/src/components/semiotic-xy.js +41 -0
- package/ai/dist/src/components/semiotic.js +101 -0
- package/ai/dist/src/components/server/renderToStaticSVG.js +392 -0
- package/ai/dist/src/components/store/TooltipStore.js +13 -0
- package/ai/dist/src/components/store/createStore.js +77 -0
- package/ai/dist/src/components/svg/SvgHelper.js +308 -0
- package/ai/dist/src/components/svg/areaDrawing.js +312 -0
- package/ai/dist/src/components/svg/boxplotRenderer.js +441 -0
- package/ai/dist/src/components/svg/bucketizedRenderer.js +677 -0
- package/ai/dist/src/components/svg/ckbinsRenderer.js +92 -0
- package/ai/dist/src/components/svg/ckmeans.js +238 -0
- package/ai/dist/src/components/svg/contourLayout.js +73 -0
- package/ai/dist/src/components/svg/contourRenderer.js +53 -0
- package/ai/dist/src/components/svg/edgeGenerators.js +181 -0
- package/ai/dist/src/components/svg/frameFunctions.js +579 -0
- package/ai/dist/src/components/svg/graphAlgorithms.js +138 -0
- package/ai/dist/src/components/svg/hexbinLayout.js +163 -0
- package/ai/dist/src/components/svg/lineDrawing.js +427 -0
- package/ai/dist/src/components/svg/networkDrawing.js +207 -0
- package/ai/dist/src/components/svg/nodeGenerators.js +131 -0
- package/ai/dist/src/components/svg/pieceDrawing.js +110 -0
- package/ai/dist/src/components/svg/pieceLayouts.js +588 -0
- package/ai/dist/src/components/svg/sankeyLinks.js +143 -0
- package/ai/dist/src/components/svg/summaryAxis.js +48 -0
- package/ai/dist/src/components/svg/summaryLayouts.js +202 -0
- package/ai/dist/src/components/svg/swarmLayout.js +128 -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/useDerivedStateFromProps.js +25 -0
- package/ai/dist/src/components/useLegacyUnmountCallback.js +21 -0
- package/ai/dist/src/components/visualizationLayerBehavior/axis.js +249 -0
- package/ai/dist/src/components/visualizationLayerBehavior/general.js +435 -0
- package/ai/dist/src/setupTests.js +4 -0
- package/ai/examples.md +394 -0
- package/ai/schema.json +1178 -0
- package/ai/system-prompt.md +38 -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/FacetController.d.ts +1 -1
- package/dist/MinimapXYFrame.d.ts +2 -2
- package/dist/NetworkFrame.d.ts +5 -1
- package/dist/OrdinalFrame.d.ts +5 -1
- package/dist/ResponsiveFrame.d.ts +2 -2
- package/dist/ResponsiveMinimapXYFrame.d.ts +3 -6
- package/dist/ResponsiveNetworkFrame.d.ts +3 -6
- package/dist/ResponsiveOrdinalFrame.d.ts +3 -6
- package/dist/ResponsiveXYFrame.d.ts +3 -6
- package/dist/SparkFrame.d.ts +1 -1
- package/dist/SparkNetworkFrame.d.ts +3 -3
- package/dist/SparkOrdinalFrame.d.ts +3 -3
- package/dist/SparkXYFrame.d.ts +3 -3
- package/dist/Tooltip/Tooltip.d.ts +141 -0
- package/dist/TooltipPositioner/index.d.ts +1 -1
- package/dist/VisualizationLayer.d.ts +3 -3
- package/dist/XYFrame.d.ts +5 -1
- package/dist/annotationLayerBehavior/annotationHandling.d.ts +2 -2
- package/dist/annotationRules/networkframeRules.d.ts +2 -2
- package/dist/annotationRules/orframeRules.d.ts +2 -4
- package/dist/annotationRules/xyframeRules.d.ts +2 -2
- package/dist/batchWork.d.ts +1 -1
- package/dist/charts/index.d.ts +62 -0
- package/dist/charts/network/ChordDiagram.d.ts +181 -0
- package/dist/charts/network/CirclePack.d.ts +103 -0
- package/dist/charts/network/ForceDirectedGraph.d.ts +192 -0
- package/dist/charts/network/SankeyDiagram.d.ts +195 -0
- package/dist/charts/network/TreeDiagram.d.ts +200 -0
- package/dist/charts/network/Treemap.d.ts +98 -0
- package/dist/charts/ordinal/BarChart.d.ts +119 -0
- package/dist/charts/ordinal/BoxPlot.d.ts +125 -0
- package/dist/charts/ordinal/DonutChart.d.ts +95 -0
- package/dist/charts/ordinal/DotPlot.d.ts +128 -0
- package/dist/charts/ordinal/GroupedBarChart.d.ts +113 -0
- package/dist/charts/ordinal/PieChart.d.ts +83 -0
- package/dist/charts/ordinal/StackedBarChart.d.ts +119 -0
- package/dist/charts/ordinal/SwarmPlot.d.ts +137 -0
- package/dist/charts/realtime/RealtimeBarChart.d.ts +102 -0
- package/dist/charts/realtime/RealtimeLineChart.d.ts +78 -0
- package/dist/charts/realtime/RealtimeSwarmChart.d.ts +88 -0
- package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +85 -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 +82 -0
- package/dist/charts/shared/hooks.d.ts +20 -0
- package/dist/charts/shared/legendUtils.d.ts +32 -0
- package/dist/charts/shared/types.d.ts +58 -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 +127 -0
- package/dist/charts/xy/BubbleChart.d.ts +157 -0
- package/dist/charts/xy/Heatmap.d.ts +153 -0
- package/dist/charts/xy/LineChart.d.ts +193 -0
- package/dist/charts/xy/Scatterplot.d.ts +50 -0
- package/dist/charts/xy/StackedAreaChart.d.ts +131 -0
- package/dist/constants/frame_props.d.ts +9 -0
- package/dist/constants/jsx.d.ts +2 -2
- package/dist/data/dataFunctions.d.ts +11 -12
- package/dist/data/networkPipelineCache.d.ts +27 -0
- package/dist/data/ordinalPipelineCache.d.ts +33 -0
- package/dist/data/xyPipelineCache.d.ts +35 -0
- package/dist/index.d.ts +70 -62
- package/dist/interactionLayerBehavior/InteractionCanvas.d.ts +1 -1
- package/dist/network.js +8520 -0
- package/dist/network.js.map +1 -0
- package/dist/network.min.js +1 -0
- package/dist/network.module.js +8484 -0
- package/dist/network.module.js.map +1 -0
- package/dist/network.module.min.js +1 -0
- package/dist/ordinal.js +9276 -0
- package/dist/ordinal.js.map +1 -0
- package/dist/ordinal.min.js +1 -0
- package/dist/ordinal.module.js +9242 -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/network.d.ts +25 -28
- package/dist/processing/networkDefaults.d.ts +36 -0
- package/dist/processing/networkLayoutHelpers.d.ts +54 -0
- package/dist/processing/ordinal.d.ts +43 -43
- package/dist/processing/ordinalConstants.d.ts +33 -0
- package/dist/processing/ordinalOverlays.d.ts +33 -0
- package/dist/processing/ordinalRenderPipeline.d.ts +148 -0
- package/dist/processing/xyDrawing.d.ts +46 -41
- package/dist/realtime/BinAccumulator.d.ts +8 -0
- package/dist/realtime/IncrementalExtent.d.ts +13 -0
- package/dist/realtime/RealtimeFrame.d.ts +4 -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 +1598 -0
- package/dist/realtime.js.map +1 -0
- package/dist/realtime.min.js +1 -0
- package/dist/realtime.module.js +1566 -0
- package/dist/realtime.module.js.map +1 -0
- package/dist/realtime.module.min.js +1 -0
- package/dist/semiotic-ai.d.ts +28 -0
- package/dist/semiotic-ai.js +18722 -0
- package/dist/semiotic-ai.js.map +1 -0
- package/dist/semiotic-ai.min.js +1 -0
- package/dist/semiotic-ai.module.js +18668 -0
- package/dist/semiotic-ai.module.js.map +1 -0
- package/dist/semiotic-ai.module.min.js +1 -0
- package/dist/semiotic-network.d.ts +19 -0
- package/dist/semiotic-ordinal.d.ts +18 -0
- package/dist/semiotic-realtime.d.ts +23 -0
- package/dist/semiotic-server.d.ts +1 -0
- package/dist/semiotic-xy.d.ts +24 -0
- package/dist/semiotic.d.ts +19 -3
- package/dist/semiotic.js +18707 -12983
- package/dist/semiotic.js.map +1 -0
- package/dist/semiotic.min.js +1 -0
- package/dist/semiotic.module.js +18651 -12953
- 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 +8360 -0
- package/dist/server.js.map +1 -0
- package/dist/server.min.js +1 -0
- package/dist/server.module.js +8331 -0
- package/dist/server.module.js.map +1 -0
- package/dist/server.module.min.js +1 -0
- package/dist/svg/SvgHelper.d.ts +1 -5
- package/dist/svg/areaDrawing.d.ts +3 -13
- package/dist/svg/boxplotRenderer.d.ts +15 -0
- package/dist/svg/bucketizedRenderer.d.ts +16 -0
- package/dist/svg/ckbinsRenderer.d.ts +20 -0
- package/dist/svg/contourLayout.d.ts +6 -0
- package/dist/svg/contourRenderer.d.ts +12 -0
- package/dist/svg/edgeGenerators.d.ts +51 -0
- package/dist/svg/frameFunctions.d.ts +17 -28
- package/dist/svg/graphAlgorithms.d.ts +14 -0
- package/dist/svg/hexbinLayout.d.ts +7 -0
- package/dist/svg/lineDrawing.d.ts +8 -8
- package/dist/svg/networkDrawing.d.ts +5 -123
- package/dist/svg/nodeGenerators.d.ts +58 -0
- package/dist/svg/pieceDrawing.d.ts +1 -2
- package/dist/svg/pieceLayouts.d.ts +5 -23
- package/dist/svg/sankeyLinks.d.ts +3 -0
- package/dist/svg/summaryAxis.d.ts +6 -0
- package/dist/svg/summaryLayouts.d.ts +36 -57
- package/dist/svg/swarmLayout.d.ts +13 -0
- package/dist/types/annotationTypes.d.ts +13 -18
- package/dist/types/canvasTypes.d.ts +1 -1
- package/dist/types/generalTypes.d.ts +37 -35
- 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 +13 -16
- package/dist/useLegacyUnmountCallback.d.ts +2 -1
- package/dist/visualizationLayerBehavior/axis.d.ts +3 -5
- package/dist/visualizationLayerBehavior/general.d.ts +8 -12
- package/dist/xy.js +7944 -0
- package/dist/xy.js.map +1 -0
- package/dist/xy.min.js +1 -0
- package/dist/xy.module.js +7903 -0
- package/dist/xy.module.js.map +1 -0
- package/dist/xy.module.min.js +1 -0
- package/package.json +116 -66
- package/dist/AnnotationLayer/helpers.d.ts +0 -6
- package/dist/AnnotationLayer/index.d.ts +0 -2
- 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/SpanOrDiv.d.ts +0 -10
- 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/setupTests.d.ts +0 -1
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
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`
|
|
6
|
+
- `semiotic/ai` exports the 24 HOC chart components + TooltipProvider + MultiLineTooltip + `validateProps`
|
|
7
|
+
- `validateProps(componentName, props)` — validate props before rendering, returns `{ valid, errors }`
|
|
8
|
+
- CLI: `npx semiotic-ai [--schema|--compact|--examples]` — dump AI context to stdout
|
|
9
|
+
- MCP: `npx semiotic-mcp` — MCP server that renders charts to static SVG
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
- **HOC Charts** (recommended): Simple props, sensible defaults — use these
|
|
13
|
+
- **Frames** (advanced): Full control — only when HOCs aren't enough
|
|
14
|
+
- Every HOC accepts `frameProps` to pass through to the underlying Frame
|
|
15
|
+
|
|
16
|
+
## Component Reference
|
|
17
|
+
|
|
18
|
+
### XY Charts (import from "semiotic" or "semiotic/xy")
|
|
19
|
+
|
|
20
|
+
#### LineChart
|
|
21
|
+
Line traces with curve interpolation, area fill, and point markers. Use for time series, trends, and continuous data.
|
|
22
|
+
|
|
23
|
+
Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
|
|
24
|
+
`lineBy` (string|fn), `lineDataAccessor` (string, "coordinates"),
|
|
25
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
26
|
+
`curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom", "linear"),
|
|
27
|
+
`lineWidth` (number, 2), `showPoints` (boolean, false), `pointRadius` (number, 3),
|
|
28
|
+
`fillArea` (boolean, false), `areaOpacity` (number, 0.3),
|
|
29
|
+
`xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
|
|
30
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
31
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
32
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
33
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
34
|
+
|
|
35
|
+
```jsx
|
|
36
|
+
<LineChart data={sales} xAccessor="month" yAccessor="revenue" curve="monotoneX" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### AreaChart
|
|
40
|
+
Filled area under a line with optional stroke. Use for showing volume or magnitude over time.
|
|
41
|
+
|
|
42
|
+
Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
|
|
43
|
+
`areaBy` (string|fn), `lineDataAccessor` (string, "coordinates"),
|
|
44
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
45
|
+
`curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom", "monotoneX"),
|
|
46
|
+
`areaOpacity` (number, 0.7), `showLine` (boolean, true), `lineWidth` (number, 2),
|
|
47
|
+
`xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
|
|
48
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
49
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
50
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
51
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
<AreaChart data={temps} xAccessor="date" yAccessor="temp" areaBy="city" />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### StackedAreaChart
|
|
58
|
+
Stacked area chart with optional normalization to 100%. Use for part-to-whole trends over time.
|
|
59
|
+
|
|
60
|
+
Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
|
|
61
|
+
`areaBy` (string|fn), `lineDataAccessor` (string, "coordinates"),
|
|
62
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
63
|
+
`curve` ("linear"|"monotoneX"|"monotoneY"|"step"|"stepAfter"|"stepBefore"|"basis"|"cardinal"|"catmullRom", "monotoneX"),
|
|
64
|
+
`areaOpacity` (number, 0.7), `showLine` (boolean, true), `lineWidth` (number, 2),
|
|
65
|
+
`normalize` (boolean, false),
|
|
66
|
+
`xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
|
|
67
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
68
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
69
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
70
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
71
|
+
|
|
72
|
+
```jsx
|
|
73
|
+
<StackedAreaChart data={revenue} xAccessor="quarter" yAccessor="amount" areaBy="product" normalize />
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
#### Scatterplot
|
|
77
|
+
Individual data points plotted by x/y position with optional size and color encoding.
|
|
78
|
+
|
|
79
|
+
Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
|
|
80
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
81
|
+
`sizeBy` (string|fn), `sizeRange` ([number, number], [3, 15]),
|
|
82
|
+
`pointRadius` (number, 5), `pointOpacity` (number, 0.8),
|
|
83
|
+
`xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
|
|
84
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
85
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
86
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
87
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
88
|
+
|
|
89
|
+
```jsx
|
|
90
|
+
<Scatterplot data={iris} xAccessor="sepalLength" yAccessor="petalLength" colorBy="species" />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### BubbleChart
|
|
94
|
+
Like Scatterplot but with required size dimension. Use when a third numeric variable matters.
|
|
95
|
+
|
|
96
|
+
Props: `data` (TDatum[], required), `sizeBy` (string|fn, **required**),
|
|
97
|
+
`xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
|
|
98
|
+
`sizeRange` ([number, number], [5, 40]),
|
|
99
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
100
|
+
`bubbleOpacity` (number, 0.6), `bubbleStrokeWidth` (number, 1), `bubbleStrokeColor` (string, "white"),
|
|
101
|
+
`xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
|
|
102
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
103
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
104
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
105
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
<BubbleChart data={countries} xAccessor="gdp" yAccessor="life" sizeBy="population" colorBy="continent" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Heatmap
|
|
112
|
+
Grid/matrix visualization with color-encoded cell values.
|
|
113
|
+
|
|
114
|
+
Props: `data` (TDatum[], required), `xAccessor` (string|fn, "x"), `yAccessor` (string|fn, "y"),
|
|
115
|
+
`valueAccessor` (string|fn, "value"),
|
|
116
|
+
`colorScheme` ("blues"|"reds"|"greens"|"viridis"|"custom", "blues"),
|
|
117
|
+
`customColorScale` (any), `showValues` (boolean, false), `valueFormat` (fn),
|
|
118
|
+
`cellBorderColor` (string, "#fff"), `cellBorderWidth` (number, 1),
|
|
119
|
+
`xLabel` (string), `yLabel` (string), `xFormat` (fn), `yFormat` (fn),
|
|
120
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
121
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
122
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
123
|
+
|
|
124
|
+
```jsx
|
|
125
|
+
<Heatmap data={correlations} xAccessor="var1" yAccessor="var2" valueAccessor="r" colorScheme="viridis" />
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Ordinal/Categorical Charts (import from "semiotic" or "semiotic/ordinal")
|
|
129
|
+
|
|
130
|
+
#### BarChart
|
|
131
|
+
Vertical or horizontal bars for categorical comparisons.
|
|
132
|
+
|
|
133
|
+
Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
134
|
+
`orientation` ("vertical"|"horizontal", "vertical"),
|
|
135
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
136
|
+
`sort` (boolean|"asc"|"desc"|fn, false), `barPadding` (number, 5),
|
|
137
|
+
`categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
|
|
138
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
139
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
140
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
141
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
142
|
+
|
|
143
|
+
```jsx
|
|
144
|
+
<BarChart data={sales} categoryAccessor="region" valueAccessor="total" orientation="horizontal" />
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### StackedBarChart
|
|
148
|
+
Stacked bars for part-to-whole comparisons across categories.
|
|
149
|
+
|
|
150
|
+
Props: `data` (TDatum[], required), `stackBy` (string|fn, **required**),
|
|
151
|
+
`categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
152
|
+
`orientation` ("vertical"|"horizontal", "vertical"),
|
|
153
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
154
|
+
`normalize` (boolean, false), `barPadding` (number, 5),
|
|
155
|
+
`categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
|
|
156
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
157
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
158
|
+
`showLegend` (boolean, true), `showGrid` (boolean, false),
|
|
159
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
160
|
+
|
|
161
|
+
```jsx
|
|
162
|
+
<StackedBarChart data={survey} categoryAccessor="question" stackBy="response" valueAccessor="count" />
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### GroupedBarChart
|
|
166
|
+
Side-by-side bars for comparing sub-categories within categories.
|
|
167
|
+
|
|
168
|
+
Props: `data` (TDatum[], required), `groupBy` (string|fn, **required**),
|
|
169
|
+
`categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
170
|
+
`orientation` ("vertical"|"horizontal", "vertical"),
|
|
171
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
172
|
+
`barPadding` (number, 5),
|
|
173
|
+
`categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
|
|
174
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
175
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
176
|
+
`showLegend` (boolean, true), `showGrid` (boolean, false),
|
|
177
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
178
|
+
|
|
179
|
+
```jsx
|
|
180
|
+
<GroupedBarChart data={results} categoryAccessor="year" groupBy="product" valueAccessor="revenue" />
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### SwarmPlot
|
|
184
|
+
Beeswarm/jittered dot plot showing individual data points within categories.
|
|
185
|
+
|
|
186
|
+
Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
187
|
+
`orientation` ("vertical"|"horizontal", "vertical"),
|
|
188
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
189
|
+
`sizeBy` (string|fn), `sizeRange` ([number, number], [3, 8]),
|
|
190
|
+
`pointRadius` (number, 4), `pointOpacity` (number, 0.7), `categoryPadding` (number, 20),
|
|
191
|
+
`categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
|
|
192
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
193
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
194
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
195
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
196
|
+
|
|
197
|
+
```jsx
|
|
198
|
+
<SwarmPlot data={salaries} categoryAccessor="department" valueAccessor="salary" colorBy="level" />
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### BoxPlot
|
|
202
|
+
Box-and-whisker plots showing statistical distribution per category.
|
|
203
|
+
|
|
204
|
+
Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
205
|
+
`orientation` ("vertical"|"horizontal", "vertical"),
|
|
206
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
207
|
+
`showOutliers` (boolean, true), `outlierRadius` (number, 3), `categoryPadding` (number, 20),
|
|
208
|
+
`categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
|
|
209
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
210
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
211
|
+
`showLegend` (boolean), `showGrid` (boolean, false),
|
|
212
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
213
|
+
|
|
214
|
+
```jsx
|
|
215
|
+
<BoxPlot data={scores} categoryAccessor="subject" valueAccessor="score" showOutliers />
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### DotPlot
|
|
219
|
+
Cleveland-style dot plot for comparing values across categories.
|
|
220
|
+
|
|
221
|
+
Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
222
|
+
`orientation` ("vertical"|"horizontal", "horizontal"),
|
|
223
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
224
|
+
`sort` (boolean|"asc"|"desc"|fn, true), `dotRadius` (number, 5), `categoryPadding` (number, 10),
|
|
225
|
+
`categoryLabel` (string), `valueLabel` (string), `valueFormat` (fn),
|
|
226
|
+
`title` (string), `width` (number, 600), `height` (number, 400),
|
|
227
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
228
|
+
`showLegend` (boolean), `showGrid` (boolean, true),
|
|
229
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
230
|
+
|
|
231
|
+
```jsx
|
|
232
|
+
<DotPlot data={rankings} categoryAccessor="team" valueAccessor="wins" sort="desc" />
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### PieChart
|
|
236
|
+
Proportional slices in a circle.
|
|
237
|
+
|
|
238
|
+
Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
239
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
240
|
+
`startAngle` (number, 0), `slicePadding` (number, 2),
|
|
241
|
+
`title` (string), `width` (number, 400), `height` (number, 400),
|
|
242
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
243
|
+
`showLegend` (boolean, true),
|
|
244
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
245
|
+
|
|
246
|
+
```jsx
|
|
247
|
+
<PieChart data={market} categoryAccessor="brand" valueAccessor="share" />
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### DonutChart
|
|
251
|
+
Pie chart with a hole in the center. Supports center content.
|
|
252
|
+
|
|
253
|
+
Props: `data` (TDatum[], required), `categoryAccessor` (string|fn, "category"), `valueAccessor` (string|fn, "value"),
|
|
254
|
+
`innerRadius` (number, 60), `centerContent` (ReactNode),
|
|
255
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
256
|
+
`startAngle` (number, 0), `slicePadding` (number, 2),
|
|
257
|
+
`title` (string), `width` (number, 400), `height` (number, 400),
|
|
258
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
259
|
+
`showLegend` (boolean, true),
|
|
260
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
261
|
+
|
|
262
|
+
```jsx
|
|
263
|
+
<DonutChart data={budget} categoryAccessor="category" valueAccessor="amount" centerContent={<span>$42K</span>} />
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Network Charts (import from "semiotic" or "semiotic/network")
|
|
267
|
+
|
|
268
|
+
#### ForceDirectedGraph
|
|
269
|
+
Physics-based node-link diagram. Use for relationships, social networks, knowledge graphs.
|
|
270
|
+
|
|
271
|
+
Props: `nodes` (TNode[], required), `edges` (TEdge[], required),
|
|
272
|
+
`nodeIDAccessor` (string|fn, "id"), `sourceAccessor` (string|fn, "source"), `targetAccessor` (string|fn, "target"),
|
|
273
|
+
`nodeLabel` (string|fn), `colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
274
|
+
`nodeSize` (number|string|fn, 8), `nodeSizeRange` ([number, number], [5, 20]),
|
|
275
|
+
`edgeWidth` (number|string|fn, 1), `edgeColor` (string, "#999"), `edgeOpacity` (number, 0.6),
|
|
276
|
+
`iterations` (number, 300), `forceStrength` (number, 0.1),
|
|
277
|
+
`showLabels` (boolean, false),
|
|
278
|
+
`title` (string), `width` (number, 600), `height` (number, 600),
|
|
279
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
280
|
+
`showLegend` (boolean, true),
|
|
281
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
282
|
+
|
|
283
|
+
```jsx
|
|
284
|
+
<ForceDirectedGraph nodes={people} edges={friendships} colorBy="team" nodeSize={8} showLabels />
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
#### SankeyDiagram
|
|
288
|
+
Flow diagram showing weighted connections between nodes. Use for flows, budgets, process mapping.
|
|
289
|
+
|
|
290
|
+
Props: `edges` (TEdge[], required), `nodes` (TNode[]),
|
|
291
|
+
`sourceAccessor` (string|fn, "source"), `targetAccessor` (string|fn, "target"),
|
|
292
|
+
`valueAccessor` (string|fn, "value"), `nodeIdAccessor` (string|fn, "id"),
|
|
293
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
294
|
+
`edgeColorBy` ("source"|"target"|"gradient"|fn, "source"),
|
|
295
|
+
`orientation` ("horizontal"|"vertical", "horizontal"),
|
|
296
|
+
`nodeAlign` ("justify"|"left"|"right"|"center", "justify"),
|
|
297
|
+
`nodePaddingRatio` (number, 0.05), `nodeWidth` (number, 15),
|
|
298
|
+
`nodeLabel` (string|fn), `showLabels` (boolean, true),
|
|
299
|
+
`edgeOpacity` (number, 0.5), `edgeSort` (fn),
|
|
300
|
+
`title` (string), `width` (number, 800), `height` (number, 600),
|
|
301
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
302
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
303
|
+
|
|
304
|
+
```jsx
|
|
305
|
+
<SankeyDiagram edges={flows} sourceAccessor="from" targetAccessor="to" valueAccessor="amount" />
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
#### ChordDiagram
|
|
309
|
+
Circular diagram showing inter-relationships between groups.
|
|
310
|
+
|
|
311
|
+
Props: `edges` (TEdge[], required), `nodes` (TNode[]),
|
|
312
|
+
`sourceAccessor` (string|fn, "source"), `targetAccessor` (string|fn, "target"),
|
|
313
|
+
`valueAccessor` (string|fn, "value"), `nodeIdAccessor` (string|fn, "id"),
|
|
314
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
315
|
+
`edgeColorBy` ("source"|"target"|fn, "source"),
|
|
316
|
+
`padAngle` (number, 0.01), `groupWidth` (number, 20), `sortGroups` (fn),
|
|
317
|
+
`nodeLabel` (string|fn), `showLabels` (boolean, true),
|
|
318
|
+
`edgeOpacity` (number, 0.5),
|
|
319
|
+
`title` (string), `width` (number, 600), `height` (number, 600),
|
|
320
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
321
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
322
|
+
|
|
323
|
+
```jsx
|
|
324
|
+
<ChordDiagram edges={trades} sourceAccessor="exporter" targetAccessor="importer" valueAccessor="volume" />
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
#### TreeDiagram
|
|
328
|
+
Hierarchical tree layout. Supports tree, cluster, partition, and radial orientations.
|
|
329
|
+
|
|
330
|
+
Props: `data` (TNode, required — single root node with children),
|
|
331
|
+
`layout` ("tree"|"cluster"|"partition"|"treemap"|"circlepack", "tree"),
|
|
332
|
+
`orientation` ("vertical"|"horizontal"|"radial", "vertical"),
|
|
333
|
+
`childrenAccessor` (string|fn, "children"), `valueAccessor` (string|fn, "value"),
|
|
334
|
+
`nodeIdAccessor` (string|fn, "name"),
|
|
335
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
336
|
+
`colorByDepth` (boolean, false), `edgeStyle` ("line"|"curve", "curve"),
|
|
337
|
+
`nodeLabel` (string|fn), `showLabels` (boolean, true), `nodeSize` (number, 5),
|
|
338
|
+
`title` (string), `width` (number, 600), `height` (number, 600),
|
|
339
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
340
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
341
|
+
|
|
342
|
+
```jsx
|
|
343
|
+
<TreeDiagram data={orgChart} childrenAccessor="reports" nodeIdAccessor="name" orientation="horizontal" />
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### Treemap
|
|
347
|
+
Space-filling rectangular hierarchy visualization.
|
|
348
|
+
|
|
349
|
+
Props: `data` (TNode, required — single root node with children),
|
|
350
|
+
`childrenAccessor` (string|fn, "children"), `valueAccessor` (string|fn, "value"),
|
|
351
|
+
`nodeIdAccessor` (string|fn, "name"),
|
|
352
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
353
|
+
`colorByDepth` (boolean, false),
|
|
354
|
+
`showLabels` (boolean, true), `nodeLabel` (string|fn),
|
|
355
|
+
`title` (string), `width` (number, 600), `height` (number, 600),
|
|
356
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
357
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
358
|
+
|
|
359
|
+
```jsx
|
|
360
|
+
<Treemap data={fileSystem} childrenAccessor="children" valueAccessor="size" colorByDepth />
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
#### CirclePack
|
|
364
|
+
Nested circles representing hierarchical data.
|
|
365
|
+
|
|
366
|
+
Props: `data` (TNode, required — single root node with children),
|
|
367
|
+
`childrenAccessor` (string|fn, "children"), `valueAccessor` (string|fn, "value"),
|
|
368
|
+
`nodeIdAccessor` (string|fn, "name"),
|
|
369
|
+
`colorBy` (string|fn), `colorScheme` (string|string[], "category10"),
|
|
370
|
+
`colorByDepth` (boolean, false),
|
|
371
|
+
`showLabels` (boolean, true), `nodeLabel` (string|fn),
|
|
372
|
+
`circleOpacity` (number, 0.7),
|
|
373
|
+
`title` (string), `width` (number, 600), `height` (number, 600),
|
|
374
|
+
`enableHover` (boolean, true), `tooltip` (fn),
|
|
375
|
+
`margin` (object), `className` (string), `frameProps` (object)
|
|
376
|
+
|
|
377
|
+
```jsx
|
|
378
|
+
<CirclePack data={taxonomy} childrenAccessor="children" valueAccessor="count" colorByDepth />
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Realtime Charts (import from "semiotic" or "semiotic/realtime")
|
|
382
|
+
|
|
383
|
+
All realtime charts use a ref-based push API and render on canvas for high performance.
|
|
384
|
+
|
|
385
|
+
```jsx
|
|
386
|
+
const chartRef = useRef()
|
|
387
|
+
// Push data at any frequency
|
|
388
|
+
chartRef.current.push({ time: Date.now(), value: reading })
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
#### RealtimeLineChart
|
|
392
|
+
Streaming line chart rendered on canvas.
|
|
393
|
+
|
|
394
|
+
Props: `size` ([number, number], [500, 300]),
|
|
395
|
+
`timeAccessor` (string|fn), `valueAccessor` (string|fn),
|
|
396
|
+
`windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
|
|
397
|
+
`arrowOfTime` ("left"|"right", "right"),
|
|
398
|
+
`stroke` (string, "#007bff"), `strokeWidth` (number, 2), `strokeDasharray` (string),
|
|
399
|
+
`timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
|
|
400
|
+
`showAxes` (boolean, true), `background` (string),
|
|
401
|
+
`enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
|
|
402
|
+
`annotations` (object[]), `svgAnnotationRules` (fn),
|
|
403
|
+
`tickFormatTime` (fn), `tickFormatValue` (fn),
|
|
404
|
+
`margin` (object), `className` (string)
|
|
405
|
+
|
|
406
|
+
```jsx
|
|
407
|
+
<RealtimeLineChart ref={chartRef} timeAccessor="time" valueAccessor="value" windowSize={200} />
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
#### RealtimeBarChart
|
|
411
|
+
Streaming bar chart with binned aggregation.
|
|
412
|
+
|
|
413
|
+
Props: `binSize` (number, **required**),
|
|
414
|
+
`size` ([number, number], [500, 300]),
|
|
415
|
+
`timeAccessor` (string|fn), `valueAccessor` (string|fn),
|
|
416
|
+
`categoryAccessor` (string|fn), `colors` (Record<string, string>),
|
|
417
|
+
`windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
|
|
418
|
+
`arrowOfTime` ("left"|"right", "right"),
|
|
419
|
+
`fill` (string), `stroke` (string), `strokeWidth` (number), `gap` (number),
|
|
420
|
+
`timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
|
|
421
|
+
`showAxes` (boolean, true), `background` (string),
|
|
422
|
+
`enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
|
|
423
|
+
`annotations` (object[]), `svgAnnotationRules` (fn),
|
|
424
|
+
`tickFormatTime` (fn), `tickFormatValue` (fn),
|
|
425
|
+
`margin` (object), `className` (string)
|
|
426
|
+
|
|
427
|
+
```jsx
|
|
428
|
+
<RealtimeBarChart ref={chartRef} binSize={1000} timeAccessor="time" valueAccessor="count" />
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### RealtimeSwarmChart
|
|
432
|
+
Streaming swarm/scatter chart showing individual data points.
|
|
433
|
+
|
|
434
|
+
Props: `size` ([number, number], [500, 300]),
|
|
435
|
+
`timeAccessor` (string|fn), `valueAccessor` (string|fn),
|
|
436
|
+
`categoryAccessor` (string|fn), `colors` (Record<string, string>),
|
|
437
|
+
`windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
|
|
438
|
+
`arrowOfTime` ("left"|"right", "right"),
|
|
439
|
+
`radius` (number), `fill` (string), `opacity` (number), `stroke` (string), `strokeWidth` (number),
|
|
440
|
+
`timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
|
|
441
|
+
`showAxes` (boolean, true), `background` (string),
|
|
442
|
+
`enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
|
|
443
|
+
`annotations` (object[]), `svgAnnotationRules` (fn),
|
|
444
|
+
`tickFormatTime` (fn), `tickFormatValue` (fn),
|
|
445
|
+
`margin` (object), `className` (string)
|
|
446
|
+
|
|
447
|
+
```jsx
|
|
448
|
+
<RealtimeSwarmChart ref={chartRef} timeAccessor="time" valueAccessor="latency" categoryAccessor="service" />
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
#### RealtimeWaterfallChart
|
|
452
|
+
Streaming waterfall chart showing positive/negative changes over time.
|
|
453
|
+
|
|
454
|
+
Props: `size` ([number, number], [500, 300]),
|
|
455
|
+
`timeAccessor` (string|fn), `valueAccessor` (string|fn),
|
|
456
|
+
`windowSize` (number, 200), `windowMode` ("sliding"|"stepping", "sliding"),
|
|
457
|
+
`arrowOfTime` ("left"|"right", "right"),
|
|
458
|
+
`positiveColor` (string), `negativeColor` (string),
|
|
459
|
+
`connectorStroke` (string), `connectorWidth` (number),
|
|
460
|
+
`gap` (number), `stroke` (string), `strokeWidth` (number),
|
|
461
|
+
`timeExtent` ([number, number]), `valueExtent` ([number, number]), `extentPadding` (number),
|
|
462
|
+
`showAxes` (boolean, true), `background` (string),
|
|
463
|
+
`enableHover` (boolean|object), `tooltipContent` (fn), `onHover` (fn),
|
|
464
|
+
`annotations` (object[]), `svgAnnotationRules` (fn),
|
|
465
|
+
`tickFormatTime` (fn), `tickFormatValue` (fn),
|
|
466
|
+
`margin` (object), `className` (string)
|
|
467
|
+
|
|
468
|
+
```jsx
|
|
469
|
+
<RealtimeWaterfallChart ref={chartRef} timeAccessor="time" valueAccessor="delta" />
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
## Common Patterns
|
|
473
|
+
|
|
474
|
+
### Color encoding
|
|
475
|
+
```jsx
|
|
476
|
+
<BarChart data={d} categoryAccessor="name" valueAccessor="value" colorBy="region" />
|
|
477
|
+
// Custom colors:
|
|
478
|
+
<BarChart ... colorScheme={["#e41a1c", "#377eb8", "#4daf4a"]} />
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Tooltips
|
|
482
|
+
```jsx
|
|
483
|
+
import { MultiLineTooltip } from "semiotic"
|
|
484
|
+
|
|
485
|
+
<LineChart ... tooltip={MultiLineTooltip({ title: "name", fields: ["value"] })} />
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Legends
|
|
489
|
+
Automatic when `colorBy` is set. Control with `showLegend`.
|
|
490
|
+
|
|
491
|
+
### Grid lines
|
|
492
|
+
```jsx
|
|
493
|
+
<LineChart ... showGrid={true} />
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### Multi-line data
|
|
497
|
+
```jsx
|
|
498
|
+
// Array of line objects, each with a coordinates array:
|
|
499
|
+
const data = [
|
|
500
|
+
{ id: "A", coordinates: [{ x: 0, y: 1 }, { x: 1, y: 2 }] },
|
|
501
|
+
{ id: "B", coordinates: [{ x: 0, y: 3 }, { x: 1, y: 1 }] }
|
|
502
|
+
]
|
|
503
|
+
<LineChart data={data} lineBy="id" xAccessor="x" yAccessor="y" />
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### Hierarchical data (TreeDiagram, Treemap, CirclePack)
|
|
507
|
+
```jsx
|
|
508
|
+
// Single root object with nested children:
|
|
509
|
+
const data = {
|
|
510
|
+
name: "root",
|
|
511
|
+
children: [
|
|
512
|
+
{ name: "A", value: 10 },
|
|
513
|
+
{ name: "B", children: [{ name: "B1", value: 5 }] }
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
<Treemap data={data} childrenAccessor="children" valueAccessor="value" />
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
### Network data (ForceDirectedGraph, SankeyDiagram, ChordDiagram)
|
|
520
|
+
```jsx
|
|
521
|
+
const nodes = [{ id: "A" }, { id: "B" }, { id: "C" }]
|
|
522
|
+
const edges = [{ source: "A", target: "B", value: 10 }, { source: "B", target: "C", value: 5 }]
|
|
523
|
+
<SankeyDiagram nodes={nodes} edges={edges} valueAccessor="value" />
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
## What Semiotic Does That Others Don't
|
|
527
|
+
- Network visualization: ForceDirectedGraph, SankeyDiagram, ChordDiagram, TreeDiagram, Treemap, CirclePack
|
|
528
|
+
- Streaming data: RealtimeLineChart, RealtimeBarChart (canvas-based, high frequency)
|
|
529
|
+
- Annotation system: built-in hover, click, and custom annotations
|
|
530
|
+
- Server-side SVG: `renderToStaticSVG()` for email/OG images (import from "semiotic/server")
|