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/ai/examples.md
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
# Semiotic Examples
|
|
2
|
+
|
|
3
|
+
Copy-paste-ready examples for every data shape.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Flat Array — XY Charts
|
|
8
|
+
|
|
9
|
+
### LineChart (single line)
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
import { LineChart } from "semiotic/ai"
|
|
13
|
+
|
|
14
|
+
const data = [
|
|
15
|
+
{ month: "Jan", revenue: 4200 },
|
|
16
|
+
{ month: "Feb", revenue: 5800 },
|
|
17
|
+
{ month: "Mar", revenue: 5200 },
|
|
18
|
+
{ month: "Apr", revenue: 7100 },
|
|
19
|
+
{ month: "May", revenue: 6800 }
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
<LineChart
|
|
23
|
+
data={data}
|
|
24
|
+
xAccessor="month"
|
|
25
|
+
yAccessor="revenue"
|
|
26
|
+
curve="monotoneX"
|
|
27
|
+
xLabel="Month"
|
|
28
|
+
yLabel="Revenue ($)"
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Key props: `xAccessor`, `yAccessor`, `curve`, `showPoints`, `fillArea`
|
|
33
|
+
|
|
34
|
+
### LineChart (multi-line)
|
|
35
|
+
|
|
36
|
+
```jsx
|
|
37
|
+
import { LineChart } from "semiotic/ai"
|
|
38
|
+
|
|
39
|
+
const data = [
|
|
40
|
+
{ quarter: 1, sales: 120, region: "East" },
|
|
41
|
+
{ quarter: 2, sales: 180, region: "East" },
|
|
42
|
+
{ quarter: 3, sales: 150, region: "East" },
|
|
43
|
+
{ quarter: 1, sales: 90, region: "West" },
|
|
44
|
+
{ quarter: 2, sales: 140, region: "West" },
|
|
45
|
+
{ quarter: 3, sales: 200, region: "West" }
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
<LineChart
|
|
49
|
+
data={data}
|
|
50
|
+
xAccessor="quarter"
|
|
51
|
+
yAccessor="sales"
|
|
52
|
+
lineBy="region"
|
|
53
|
+
colorBy="region"
|
|
54
|
+
showLegend
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Key props: `lineBy` groups flat array into separate lines, `colorBy` colors them
|
|
59
|
+
|
|
60
|
+
### Scatterplot
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
import { Scatterplot } from "semiotic/ai"
|
|
64
|
+
|
|
65
|
+
const data = [
|
|
66
|
+
{ sepalLength: 5.1, petalLength: 1.4, species: "setosa" },
|
|
67
|
+
{ sepalLength: 7.0, petalLength: 4.7, species: "versicolor" },
|
|
68
|
+
{ sepalLength: 6.3, petalLength: 6.0, species: "virginica" },
|
|
69
|
+
{ sepalLength: 4.9, petalLength: 1.5, species: "setosa" },
|
|
70
|
+
{ sepalLength: 6.4, petalLength: 4.5, species: "versicolor" }
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
<Scatterplot
|
|
74
|
+
data={data}
|
|
75
|
+
xAccessor="sepalLength"
|
|
76
|
+
yAccessor="petalLength"
|
|
77
|
+
colorBy="species"
|
|
78
|
+
xLabel="Sepal Length"
|
|
79
|
+
yLabel="Petal Length"
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Key props: `colorBy`, `sizeBy`, `pointRadius`, `pointOpacity`
|
|
84
|
+
|
|
85
|
+
### Heatmap
|
|
86
|
+
|
|
87
|
+
```jsx
|
|
88
|
+
import { Heatmap } from "semiotic/ai"
|
|
89
|
+
|
|
90
|
+
const data = [
|
|
91
|
+
{ day: "Mon", hour: "9am", count: 12 },
|
|
92
|
+
{ day: "Mon", hour: "12pm", count: 45 },
|
|
93
|
+
{ day: "Mon", hour: "3pm", count: 32 },
|
|
94
|
+
{ day: "Tue", hour: "9am", count: 18 },
|
|
95
|
+
{ day: "Tue", hour: "12pm", count: 52 },
|
|
96
|
+
{ day: "Tue", hour: "3pm", count: 28 },
|
|
97
|
+
{ day: "Wed", hour: "9am", count: 15 },
|
|
98
|
+
{ day: "Wed", hour: "12pm", count: 48 },
|
|
99
|
+
{ day: "Wed", hour: "3pm", count: 35 }
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
<Heatmap
|
|
103
|
+
data={data}
|
|
104
|
+
xAccessor="hour"
|
|
105
|
+
yAccessor="day"
|
|
106
|
+
valueAccessor="count"
|
|
107
|
+
colorScheme="viridis"
|
|
108
|
+
showValues
|
|
109
|
+
/>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Key props: `valueAccessor`, `colorScheme` ("blues"|"reds"|"greens"|"viridis"), `showValues`
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Flat Array — Ordinal Charts
|
|
117
|
+
|
|
118
|
+
### BarChart
|
|
119
|
+
|
|
120
|
+
```jsx
|
|
121
|
+
import { BarChart } from "semiotic/ai"
|
|
122
|
+
|
|
123
|
+
const data = [
|
|
124
|
+
{ region: "North", total: 4200 },
|
|
125
|
+
{ region: "South", total: 3800 },
|
|
126
|
+
{ region: "East", total: 5100 },
|
|
127
|
+
{ region: "West", total: 4600 }
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
<BarChart
|
|
131
|
+
data={data}
|
|
132
|
+
categoryAccessor="region"
|
|
133
|
+
valueAccessor="total"
|
|
134
|
+
sort="desc"
|
|
135
|
+
colorBy="region"
|
|
136
|
+
categoryLabel="Region"
|
|
137
|
+
valueLabel="Sales ($)"
|
|
138
|
+
/>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Key props: `categoryAccessor`, `valueAccessor`, `orientation`, `sort`
|
|
142
|
+
|
|
143
|
+
### StackedBarChart
|
|
144
|
+
|
|
145
|
+
```jsx
|
|
146
|
+
import { StackedBarChart } from "semiotic/ai"
|
|
147
|
+
|
|
148
|
+
const data = [
|
|
149
|
+
{ question: "Q1", response: "Agree", count: 45 },
|
|
150
|
+
{ question: "Q1", response: "Neutral", count: 30 },
|
|
151
|
+
{ question: "Q1", response: "Disagree", count: 25 },
|
|
152
|
+
{ question: "Q2", response: "Agree", count: 60 },
|
|
153
|
+
{ question: "Q2", response: "Neutral", count: 20 },
|
|
154
|
+
{ question: "Q2", response: "Disagree", count: 20 },
|
|
155
|
+
{ question: "Q3", response: "Agree", count: 35 },
|
|
156
|
+
{ question: "Q3", response: "Neutral", count: 40 },
|
|
157
|
+
{ question: "Q3", response: "Disagree", count: 25 }
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
<StackedBarChart
|
|
161
|
+
data={data}
|
|
162
|
+
categoryAccessor="question"
|
|
163
|
+
stackBy="response"
|
|
164
|
+
valueAccessor="count"
|
|
165
|
+
normalize
|
|
166
|
+
/>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Key props: **`stackBy`** (required), `normalize` for 100% stacked bars
|
|
170
|
+
|
|
171
|
+
### GroupedBarChart
|
|
172
|
+
|
|
173
|
+
```jsx
|
|
174
|
+
import { GroupedBarChart } from "semiotic/ai"
|
|
175
|
+
|
|
176
|
+
const data = [
|
|
177
|
+
{ year: "2022", product: "Widget", revenue: 120 },
|
|
178
|
+
{ year: "2022", product: "Gadget", revenue: 95 },
|
|
179
|
+
{ year: "2023", product: "Widget", revenue: 150 },
|
|
180
|
+
{ year: "2023", product: "Gadget", revenue: 130 },
|
|
181
|
+
{ year: "2024", product: "Widget", revenue: 180 },
|
|
182
|
+
{ year: "2024", product: "Gadget", revenue: 165 }
|
|
183
|
+
]
|
|
184
|
+
|
|
185
|
+
<GroupedBarChart
|
|
186
|
+
data={data}
|
|
187
|
+
categoryAccessor="year"
|
|
188
|
+
groupBy="product"
|
|
189
|
+
valueAccessor="revenue"
|
|
190
|
+
valueLabel="Revenue ($K)"
|
|
191
|
+
/>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Key props: **`groupBy`** (required), side-by-side bars within each category
|
|
195
|
+
|
|
196
|
+
### Histogram
|
|
197
|
+
|
|
198
|
+
```jsx
|
|
199
|
+
import { Histogram } from "semiotic/ai"
|
|
200
|
+
|
|
201
|
+
const data = [
|
|
202
|
+
{ category: "Group A", value: 12 },
|
|
203
|
+
{ category: "Group A", value: 15 },
|
|
204
|
+
{ category: "Group A", value: 18 },
|
|
205
|
+
{ category: "Group A", value: 22 },
|
|
206
|
+
{ category: "Group A", value: 25 },
|
|
207
|
+
{ category: "Group B", value: 30 },
|
|
208
|
+
{ category: "Group B", value: 35 },
|
|
209
|
+
{ category: "Group B", value: 28 },
|
|
210
|
+
{ category: "Group B", value: 42 },
|
|
211
|
+
{ category: "Group B", value: 38 }
|
|
212
|
+
]
|
|
213
|
+
|
|
214
|
+
<Histogram
|
|
215
|
+
data={data}
|
|
216
|
+
categoryAccessor="category"
|
|
217
|
+
valueAccessor="value"
|
|
218
|
+
bins={10}
|
|
219
|
+
colorBy="category"
|
|
220
|
+
valueLabel="Frequency"
|
|
221
|
+
/>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Key props: `bins` (default 25), `relative` (normalize per-category)
|
|
225
|
+
|
|
226
|
+
### ViolinPlot
|
|
227
|
+
|
|
228
|
+
```jsx
|
|
229
|
+
import { ViolinPlot } from "semiotic/ai"
|
|
230
|
+
|
|
231
|
+
const data = [
|
|
232
|
+
{ department: "Engineering", salary: 95000 },
|
|
233
|
+
{ department: "Engineering", salary: 110000 },
|
|
234
|
+
{ department: "Engineering", salary: 125000 },
|
|
235
|
+
{ department: "Engineering", salary: 140000 },
|
|
236
|
+
{ department: "Marketing", salary: 65000 },
|
|
237
|
+
{ department: "Marketing", salary: 75000 },
|
|
238
|
+
{ department: "Marketing", salary: 85000 },
|
|
239
|
+
{ department: "Marketing", salary: 95000 }
|
|
240
|
+
]
|
|
241
|
+
|
|
242
|
+
<ViolinPlot
|
|
243
|
+
data={data}
|
|
244
|
+
categoryAccessor="department"
|
|
245
|
+
valueAccessor="salary"
|
|
246
|
+
colorBy="department"
|
|
247
|
+
showIQR
|
|
248
|
+
categoryLabel="Department"
|
|
249
|
+
valueLabel="Salary ($)"
|
|
250
|
+
/>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Key props: `bins`, `curve` (default "catmullRom"), `showIQR` (default true)
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Hierarchical Data — Single Root Object
|
|
258
|
+
|
|
259
|
+
### TreeDiagram
|
|
260
|
+
|
|
261
|
+
```jsx
|
|
262
|
+
import { TreeDiagram } from "semiotic/ai"
|
|
263
|
+
|
|
264
|
+
const orgChart = {
|
|
265
|
+
name: "CEO",
|
|
266
|
+
children: [
|
|
267
|
+
{
|
|
268
|
+
name: "CTO",
|
|
269
|
+
children: [
|
|
270
|
+
{ name: "Engineering Lead" },
|
|
271
|
+
{ name: "Data Lead" }
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "CFO",
|
|
276
|
+
children: [
|
|
277
|
+
{ name: "Accounting" },
|
|
278
|
+
{ name: "Finance" }
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
<TreeDiagram
|
|
285
|
+
data={orgChart}
|
|
286
|
+
childrenAccessor="children"
|
|
287
|
+
nodeIdAccessor="name"
|
|
288
|
+
orientation="horizontal"
|
|
289
|
+
colorByDepth
|
|
290
|
+
/>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Key props: `data` is a single root object, `childrenAccessor`, `layout`, `orientation`
|
|
294
|
+
|
|
295
|
+
### Treemap
|
|
296
|
+
|
|
297
|
+
```jsx
|
|
298
|
+
import { Treemap } from "semiotic/ai"
|
|
299
|
+
|
|
300
|
+
const diskUsage = {
|
|
301
|
+
name: "root",
|
|
302
|
+
children: [
|
|
303
|
+
{
|
|
304
|
+
name: "src",
|
|
305
|
+
children: [
|
|
306
|
+
{ name: "components", value: 450 },
|
|
307
|
+
{ name: "utils", value: 120 },
|
|
308
|
+
{ name: "styles", value: 80 }
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "assets",
|
|
313
|
+
children: [
|
|
314
|
+
{ name: "images", value: 800 },
|
|
315
|
+
{ name: "fonts", value: 200 }
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{ name: "config", value: 50 }
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
<Treemap
|
|
323
|
+
data={diskUsage}
|
|
324
|
+
childrenAccessor="children"
|
|
325
|
+
valueAccessor="value"
|
|
326
|
+
nodeIdAccessor="name"
|
|
327
|
+
colorByDepth
|
|
328
|
+
/>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Key props: `valueAccessor` controls rectangle size, `colorByDepth`
|
|
332
|
+
|
|
333
|
+
### CirclePack
|
|
334
|
+
|
|
335
|
+
```jsx
|
|
336
|
+
import { CirclePack } from "semiotic/ai"
|
|
337
|
+
|
|
338
|
+
const taxonomy = {
|
|
339
|
+
name: "Life",
|
|
340
|
+
children: [
|
|
341
|
+
{
|
|
342
|
+
name: "Animals",
|
|
343
|
+
children: [
|
|
344
|
+
{ name: "Mammals", count: 5500 },
|
|
345
|
+
{ name: "Birds", count: 10000 },
|
|
346
|
+
{ name: "Reptiles", count: 10700 }
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
name: "Plants",
|
|
351
|
+
children: [
|
|
352
|
+
{ name: "Flowering", count: 300000 },
|
|
353
|
+
{ name: "Ferns", count: 10500 }
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
<CirclePack
|
|
360
|
+
data={taxonomy}
|
|
361
|
+
childrenAccessor="children"
|
|
362
|
+
valueAccessor="count"
|
|
363
|
+
nodeIdAccessor="name"
|
|
364
|
+
colorByDepth
|
|
365
|
+
/>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Key props: `valueAccessor` controls circle size, nested circles for hierarchy
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## Network Data — Nodes + Edges Arrays
|
|
373
|
+
|
|
374
|
+
### ForceDirectedGraph
|
|
375
|
+
|
|
376
|
+
```jsx
|
|
377
|
+
import { ForceDirectedGraph } from "semiotic/ai"
|
|
378
|
+
|
|
379
|
+
const nodes = [
|
|
380
|
+
{ id: "Alice", team: "Engineering" },
|
|
381
|
+
{ id: "Bob", team: "Engineering" },
|
|
382
|
+
{ id: "Carol", team: "Design" },
|
|
383
|
+
{ id: "Dave", team: "Design" },
|
|
384
|
+
{ id: "Eve", team: "Product" }
|
|
385
|
+
]
|
|
386
|
+
|
|
387
|
+
const edges = [
|
|
388
|
+
{ source: "Alice", target: "Bob" },
|
|
389
|
+
{ source: "Alice", target: "Carol" },
|
|
390
|
+
{ source: "Bob", target: "Dave" },
|
|
391
|
+
{ source: "Carol", target: "Dave" },
|
|
392
|
+
{ source: "Eve", target: "Alice" },
|
|
393
|
+
{ source: "Eve", target: "Carol" }
|
|
394
|
+
]
|
|
395
|
+
|
|
396
|
+
<ForceDirectedGraph
|
|
397
|
+
nodes={nodes}
|
|
398
|
+
edges={edges}
|
|
399
|
+
colorBy="team"
|
|
400
|
+
nodeSize={10}
|
|
401
|
+
showLabels
|
|
402
|
+
/>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
Key props: **`nodes`** and **`edges`** (both required), `nodeIDAccessor`, `sourceAccessor`, `targetAccessor`
|
|
406
|
+
|
|
407
|
+
### SankeyDiagram
|
|
408
|
+
|
|
409
|
+
```jsx
|
|
410
|
+
import { SankeyDiagram } from "semiotic/ai"
|
|
411
|
+
|
|
412
|
+
const edges = [
|
|
413
|
+
{ source: "Salary", target: "Budget", value: 5000 },
|
|
414
|
+
{ source: "Freelance", target: "Budget", value: 2000 },
|
|
415
|
+
{ source: "Budget", target: "Rent", value: 2500 },
|
|
416
|
+
{ source: "Budget", target: "Food", value: 1200 },
|
|
417
|
+
{ source: "Budget", target: "Transport", value: 800 },
|
|
418
|
+
{ source: "Budget", target: "Savings", value: 2500 }
|
|
419
|
+
]
|
|
420
|
+
|
|
421
|
+
<SankeyDiagram
|
|
422
|
+
edges={edges}
|
|
423
|
+
sourceAccessor="source"
|
|
424
|
+
targetAccessor="target"
|
|
425
|
+
valueAccessor="value"
|
|
426
|
+
/>
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Key props: **`edges`** (required, nodes inferred), `valueAccessor` controls band width
|
|
430
|
+
|
|
431
|
+
### ChordDiagram
|
|
432
|
+
|
|
433
|
+
```jsx
|
|
434
|
+
import { ChordDiagram } from "semiotic/ai"
|
|
435
|
+
|
|
436
|
+
const edges = [
|
|
437
|
+
{ source: "US", target: "EU", value: 500 },
|
|
438
|
+
{ source: "US", target: "Asia", value: 300 },
|
|
439
|
+
{ source: "EU", target: "US", value: 400 },
|
|
440
|
+
{ source: "EU", target: "Asia", value: 200 },
|
|
441
|
+
{ source: "Asia", target: "US", value: 350 },
|
|
442
|
+
{ source: "Asia", target: "EU", value: 250 }
|
|
443
|
+
]
|
|
444
|
+
|
|
445
|
+
<ChordDiagram
|
|
446
|
+
edges={edges}
|
|
447
|
+
sourceAccessor="source"
|
|
448
|
+
targetAccessor="target"
|
|
449
|
+
valueAccessor="value"
|
|
450
|
+
/>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Key props: **`edges`** (required), shows bidirectional relationships in a circle
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Realtime — Push API via Ref
|
|
458
|
+
|
|
459
|
+
### Streaming Sankey (StreamNetworkFrame)
|
|
460
|
+
|
|
461
|
+
```jsx
|
|
462
|
+
import { useRef, useEffect } from "react"
|
|
463
|
+
import { StreamNetworkFrame } from "semiotic"
|
|
464
|
+
|
|
465
|
+
const chartRef = useRef()
|
|
466
|
+
|
|
467
|
+
// Push edges at any frequency
|
|
468
|
+
useEffect(() => {
|
|
469
|
+
const edges = [
|
|
470
|
+
{ source: "Salary", target: "Budget", value: 5000 },
|
|
471
|
+
{ source: "Freelance", target: "Budget", value: 1500 },
|
|
472
|
+
{ source: "Budget", target: "Rent", value: 2000 },
|
|
473
|
+
{ source: "Budget", target: "Food", value: 800 },
|
|
474
|
+
{ source: "Budget", target: "Savings", value: 1500 }
|
|
475
|
+
]
|
|
476
|
+
for (const edge of edges) {
|
|
477
|
+
chartRef.current.push(edge)
|
|
478
|
+
}
|
|
479
|
+
}, [])
|
|
480
|
+
|
|
481
|
+
<StreamNetworkFrame
|
|
482
|
+
ref={chartRef}
|
|
483
|
+
chartType="sankey"
|
|
484
|
+
size={[800, 400]}
|
|
485
|
+
edgeOpacity={0.4}
|
|
486
|
+
/>
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
Key props: push via ref (`push`, `pushMany`, `clear`), `chartType="sankey"`, uses `StreamNetworkFrame` from `semiotic`
|