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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lineCanvasRenderer = void 0;
|
|
4
|
+
function resolveColor(value, thresholds, baseColor) {
|
|
5
|
+
let color = baseColor;
|
|
6
|
+
for (const t of thresholds) {
|
|
7
|
+
if (t.thresholdType === "lesser") {
|
|
8
|
+
if (value < t.value)
|
|
9
|
+
color = t.color;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
if (value > t.value)
|
|
13
|
+
color = t.color;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return color;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Canvas line renderer.
|
|
20
|
+
* Renders LineSceneNode paths using moveTo/lineTo.
|
|
21
|
+
* Supports threshold-based segment coloring when colorThresholds + rawValues
|
|
22
|
+
* are present on the node.
|
|
23
|
+
*/
|
|
24
|
+
const lineCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
25
|
+
const lineNodes = nodes.filter((n) => n.type === "line");
|
|
26
|
+
for (const node of lineNodes) {
|
|
27
|
+
if (node.path.length < 2)
|
|
28
|
+
continue;
|
|
29
|
+
const baseColor = node.style.stroke || "#007bff";
|
|
30
|
+
const lineWidth = node.style.strokeWidth || 2;
|
|
31
|
+
const thresholds = node.colorThresholds;
|
|
32
|
+
const rawValues = node.rawValues;
|
|
33
|
+
if (node.style.strokeDasharray) {
|
|
34
|
+
ctx.setLineDash(node.style.strokeDasharray.split(/[\s,]+/).map(Number));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
ctx.setLineDash([]);
|
|
38
|
+
}
|
|
39
|
+
if (node.style.opacity != null) {
|
|
40
|
+
ctx.globalAlpha = node.style.opacity;
|
|
41
|
+
}
|
|
42
|
+
ctx.lineWidth = lineWidth;
|
|
43
|
+
// Fast path: no color thresholds — single-path draw
|
|
44
|
+
if (!thresholds || thresholds.length === 0 || !rawValues || rawValues.length !== node.path.length) {
|
|
45
|
+
ctx.beginPath();
|
|
46
|
+
ctx.strokeStyle = baseColor;
|
|
47
|
+
const [startX, startY] = node.path[0];
|
|
48
|
+
ctx.moveTo(startX, startY);
|
|
49
|
+
for (let i = 1; i < node.path.length; i++) {
|
|
50
|
+
ctx.lineTo(node.path[i][0], node.path[i][1]);
|
|
51
|
+
}
|
|
52
|
+
ctx.stroke();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Threshold mode: segment-based drawing with interpolated crossings
|
|
56
|
+
let prevX = null;
|
|
57
|
+
let prevY = null;
|
|
58
|
+
let prevValue = null;
|
|
59
|
+
let prevColor = null;
|
|
60
|
+
let pathStarted = false;
|
|
61
|
+
function startSegment(color, x, y) {
|
|
62
|
+
ctx.beginPath();
|
|
63
|
+
ctx.strokeStyle = color;
|
|
64
|
+
ctx.moveTo(x, y);
|
|
65
|
+
pathStarted = true;
|
|
66
|
+
}
|
|
67
|
+
function endSegment() {
|
|
68
|
+
if (pathStarted) {
|
|
69
|
+
ctx.stroke();
|
|
70
|
+
pathStarted = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (let i = 0; i < node.path.length; i++) {
|
|
74
|
+
const [x, y] = node.path[i];
|
|
75
|
+
const v = rawValues[i];
|
|
76
|
+
const currColor = resolveColor(v, thresholds, baseColor);
|
|
77
|
+
if (prevX === null || prevColor === null || prevValue === null) {
|
|
78
|
+
startSegment(currColor, x, y);
|
|
79
|
+
prevX = x;
|
|
80
|
+
prevY = y;
|
|
81
|
+
prevValue = v;
|
|
82
|
+
prevColor = currColor;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (currColor === prevColor) {
|
|
86
|
+
ctx.lineTo(x, y);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// Find threshold crossings between prevValue and v
|
|
90
|
+
const crossings = [];
|
|
91
|
+
for (const threshold of thresholds) {
|
|
92
|
+
const tv = threshold.value;
|
|
93
|
+
if ((prevValue <= tv && v >= tv) || (prevValue >= tv && v <= tv)) {
|
|
94
|
+
if (prevValue !== tv && v !== tv) {
|
|
95
|
+
const interpT = (tv - prevValue) / (v - prevValue);
|
|
96
|
+
crossings.push({ t: interpT });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
crossings.sort((a, b) => a.t - b.t);
|
|
101
|
+
for (const crossing of crossings) {
|
|
102
|
+
const midX = prevX + (x - prevX) * crossing.t;
|
|
103
|
+
const midY = prevY + (y - prevY) * crossing.t;
|
|
104
|
+
const nudgedValue = prevValue + (v - prevValue) * Math.min(crossing.t + 0.0001, 1);
|
|
105
|
+
const nextColor = resolveColor(nudgedValue, thresholds, baseColor);
|
|
106
|
+
ctx.lineTo(midX, midY);
|
|
107
|
+
endSegment();
|
|
108
|
+
startSegment(nextColor, midX, midY);
|
|
109
|
+
}
|
|
110
|
+
ctx.lineTo(x, y);
|
|
111
|
+
}
|
|
112
|
+
prevX = x;
|
|
113
|
+
prevY = y;
|
|
114
|
+
prevValue = v;
|
|
115
|
+
prevColor = currColor;
|
|
116
|
+
}
|
|
117
|
+
endSegment();
|
|
118
|
+
}
|
|
119
|
+
// Fill area under line if fillOpacity is set
|
|
120
|
+
if (node.style.fill && node.style.fillOpacity && node.style.fillOpacity > 0) {
|
|
121
|
+
ctx.beginPath();
|
|
122
|
+
ctx.globalAlpha = node.style.fillOpacity;
|
|
123
|
+
ctx.fillStyle = node.style.fill;
|
|
124
|
+
const [startX, startY] = node.path[0];
|
|
125
|
+
ctx.moveTo(startX, startY);
|
|
126
|
+
for (let i = 1; i < node.path.length; i++) {
|
|
127
|
+
ctx.lineTo(node.path[i][0], node.path[i][1]);
|
|
128
|
+
}
|
|
129
|
+
const lastX = node.path[node.path.length - 1][0];
|
|
130
|
+
const firstX = node.path[0][0];
|
|
131
|
+
ctx.lineTo(lastX, layout.height);
|
|
132
|
+
ctx.lineTo(firstX, layout.height);
|
|
133
|
+
ctx.closePath();
|
|
134
|
+
ctx.fill();
|
|
135
|
+
}
|
|
136
|
+
ctx.globalAlpha = 1;
|
|
137
|
+
ctx.setLineDash([]);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
exports.lineCanvasRenderer = lineCanvasRenderer;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkArcRenderer = networkArcRenderer;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas painter for NetworkArcNode (chord diagram arc segments).
|
|
6
|
+
*/
|
|
7
|
+
function networkArcRenderer(ctx, nodes) {
|
|
8
|
+
for (const node of nodes) {
|
|
9
|
+
if (node.type !== "arc")
|
|
10
|
+
continue;
|
|
11
|
+
const a = node;
|
|
12
|
+
ctx.save();
|
|
13
|
+
if (a.style.opacity !== undefined) {
|
|
14
|
+
ctx.globalAlpha = a.style.opacity;
|
|
15
|
+
}
|
|
16
|
+
// Draw arc segment (annular sector)
|
|
17
|
+
ctx.beginPath();
|
|
18
|
+
ctx.arc(a.cx, a.cy, a.outerR, a.startAngle, a.endAngle);
|
|
19
|
+
ctx.arc(a.cx, a.cy, a.innerR, a.endAngle, a.startAngle, true);
|
|
20
|
+
ctx.closePath();
|
|
21
|
+
// Fill
|
|
22
|
+
if (a.style.fill) {
|
|
23
|
+
ctx.fillStyle = a.style.fill;
|
|
24
|
+
if (a.style.fillOpacity !== undefined) {
|
|
25
|
+
ctx.globalAlpha = (a.style.opacity ?? 1) * a.style.fillOpacity;
|
|
26
|
+
}
|
|
27
|
+
ctx.fill();
|
|
28
|
+
}
|
|
29
|
+
// Stroke
|
|
30
|
+
if (a.style.stroke && a.style.stroke !== "none") {
|
|
31
|
+
ctx.strokeStyle = a.style.stroke;
|
|
32
|
+
ctx.lineWidth = a.style.strokeWidth ?? 1;
|
|
33
|
+
ctx.globalAlpha = a.style.opacity ?? 1;
|
|
34
|
+
ctx.stroke();
|
|
35
|
+
}
|
|
36
|
+
ctx.restore();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkCircleRenderer = networkCircleRenderer;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas painter for NetworkCircleNode (force nodes, tree nodes, circlepack).
|
|
6
|
+
*/
|
|
7
|
+
function networkCircleRenderer(ctx, nodes) {
|
|
8
|
+
for (const node of nodes) {
|
|
9
|
+
if (node.type !== "circle")
|
|
10
|
+
continue;
|
|
11
|
+
const c = node;
|
|
12
|
+
if (c.r <= 0)
|
|
13
|
+
continue;
|
|
14
|
+
ctx.save();
|
|
15
|
+
if (c.style.opacity !== undefined) {
|
|
16
|
+
ctx.globalAlpha = c.style.opacity;
|
|
17
|
+
}
|
|
18
|
+
ctx.beginPath();
|
|
19
|
+
ctx.arc(c.cx, c.cy, c.r, 0, Math.PI * 2);
|
|
20
|
+
// Fill
|
|
21
|
+
if (c.style.fill) {
|
|
22
|
+
ctx.fillStyle = c.style.fill;
|
|
23
|
+
if (c.style.fillOpacity !== undefined) {
|
|
24
|
+
ctx.globalAlpha = (c.style.opacity ?? 1) * c.style.fillOpacity;
|
|
25
|
+
}
|
|
26
|
+
ctx.fill();
|
|
27
|
+
}
|
|
28
|
+
// Stroke
|
|
29
|
+
if (c.style.stroke && c.style.stroke !== "none") {
|
|
30
|
+
ctx.strokeStyle = c.style.stroke;
|
|
31
|
+
ctx.lineWidth = c.style.strokeWidth ?? 1;
|
|
32
|
+
ctx.globalAlpha = c.style.opacity ?? 1;
|
|
33
|
+
ctx.stroke();
|
|
34
|
+
}
|
|
35
|
+
ctx.restore();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkEdgeRenderer = networkEdgeRenderer;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas painter for all network edge types.
|
|
6
|
+
*
|
|
7
|
+
* - bezier: Sankey flow bands (Path2D from SVG path string)
|
|
8
|
+
* - line: Force-directed straight edges
|
|
9
|
+
* - ribbon: Chord diagram ribbons
|
|
10
|
+
* - curved: Tree/cluster curved edges
|
|
11
|
+
*/
|
|
12
|
+
function networkEdgeRenderer(ctx, edges) {
|
|
13
|
+
for (const edge of edges) {
|
|
14
|
+
switch (edge.type) {
|
|
15
|
+
case "bezier":
|
|
16
|
+
renderBezierEdge(ctx, edge);
|
|
17
|
+
break;
|
|
18
|
+
case "line":
|
|
19
|
+
renderLineEdge(ctx, edge);
|
|
20
|
+
break;
|
|
21
|
+
case "ribbon":
|
|
22
|
+
renderRibbonEdge(ctx, edge);
|
|
23
|
+
break;
|
|
24
|
+
case "curved":
|
|
25
|
+
renderCurvedEdge(ctx, edge);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function renderBezierEdge(ctx, edge) {
|
|
31
|
+
if (!edge.pathD)
|
|
32
|
+
return;
|
|
33
|
+
ctx.save();
|
|
34
|
+
const path = new Path2D(edge.pathD);
|
|
35
|
+
// Fill the band
|
|
36
|
+
if (edge.style.fill && edge.style.fill !== "none") {
|
|
37
|
+
ctx.fillStyle = edge.style.fill;
|
|
38
|
+
ctx.globalAlpha = edge.style.fillOpacity ?? edge.style.opacity ?? 0.5;
|
|
39
|
+
ctx.fill(path);
|
|
40
|
+
}
|
|
41
|
+
// Stroke the band outline
|
|
42
|
+
if (edge.style.stroke && edge.style.stroke !== "none") {
|
|
43
|
+
ctx.strokeStyle = edge.style.stroke;
|
|
44
|
+
ctx.lineWidth = edge.style.strokeWidth ?? 0.5;
|
|
45
|
+
ctx.globalAlpha = (edge.style.opacity ?? 1) * 0.5;
|
|
46
|
+
ctx.stroke(path);
|
|
47
|
+
}
|
|
48
|
+
ctx.restore();
|
|
49
|
+
}
|
|
50
|
+
function renderLineEdge(ctx, edge) {
|
|
51
|
+
ctx.save();
|
|
52
|
+
ctx.strokeStyle = edge.style.stroke || "#999";
|
|
53
|
+
ctx.lineWidth = edge.style.strokeWidth ?? 1;
|
|
54
|
+
if (edge.style.opacity !== undefined) {
|
|
55
|
+
ctx.globalAlpha = edge.style.opacity;
|
|
56
|
+
}
|
|
57
|
+
if (edge.style.strokeDasharray) {
|
|
58
|
+
ctx.setLineDash(edge.style.strokeDasharray.split(/[\s,]+/).map(Number));
|
|
59
|
+
}
|
|
60
|
+
ctx.beginPath();
|
|
61
|
+
ctx.moveTo(edge.x1, edge.y1);
|
|
62
|
+
ctx.lineTo(edge.x2, edge.y2);
|
|
63
|
+
ctx.stroke();
|
|
64
|
+
ctx.restore();
|
|
65
|
+
}
|
|
66
|
+
function renderRibbonEdge(ctx, edge) {
|
|
67
|
+
if (!edge.pathD)
|
|
68
|
+
return;
|
|
69
|
+
ctx.save();
|
|
70
|
+
const path = new Path2D(edge.pathD);
|
|
71
|
+
if (edge.style.fill && edge.style.fill !== "none") {
|
|
72
|
+
ctx.fillStyle = edge.style.fill;
|
|
73
|
+
ctx.globalAlpha = edge.style.fillOpacity ?? edge.style.opacity ?? 0.5;
|
|
74
|
+
ctx.fill(path);
|
|
75
|
+
}
|
|
76
|
+
if (edge.style.stroke && edge.style.stroke !== "none") {
|
|
77
|
+
ctx.strokeStyle = edge.style.stroke;
|
|
78
|
+
ctx.lineWidth = edge.style.strokeWidth ?? 0.5;
|
|
79
|
+
ctx.globalAlpha = (edge.style.opacity ?? 1) * 0.3;
|
|
80
|
+
ctx.stroke(path);
|
|
81
|
+
}
|
|
82
|
+
ctx.restore();
|
|
83
|
+
}
|
|
84
|
+
function renderCurvedEdge(ctx, edge) {
|
|
85
|
+
if (!edge.pathD)
|
|
86
|
+
return;
|
|
87
|
+
ctx.save();
|
|
88
|
+
const path = new Path2D(edge.pathD);
|
|
89
|
+
ctx.strokeStyle = edge.style.stroke || "#999";
|
|
90
|
+
ctx.lineWidth = edge.style.strokeWidth ?? 1;
|
|
91
|
+
if (edge.style.opacity !== undefined) {
|
|
92
|
+
ctx.globalAlpha = edge.style.opacity;
|
|
93
|
+
}
|
|
94
|
+
ctx.stroke(path);
|
|
95
|
+
// Fill if specified (usually not for tree edges)
|
|
96
|
+
if (edge.style.fill && edge.style.fill !== "none") {
|
|
97
|
+
ctx.fillStyle = edge.style.fill;
|
|
98
|
+
ctx.globalAlpha = edge.style.fillOpacity ?? 0.1;
|
|
99
|
+
ctx.fill(path);
|
|
100
|
+
}
|
|
101
|
+
ctx.restore();
|
|
102
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderNetworkParticles = renderNetworkParticles;
|
|
4
|
+
exports.spawnNetworkParticles = spawnNetworkParticles;
|
|
5
|
+
const networkTypes_1 = require("../networkTypes");
|
|
6
|
+
/**
|
|
7
|
+
* Canvas particle renderer for sankey — ported directly from realtime-network.
|
|
8
|
+
* Called each rAF frame.
|
|
9
|
+
*/
|
|
10
|
+
function renderNetworkParticles(ctx, pool, edges, style, edgeColorFn) {
|
|
11
|
+
const radius = style.radius ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.radius;
|
|
12
|
+
const opacity = style.opacity ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.opacity;
|
|
13
|
+
ctx.globalAlpha = opacity;
|
|
14
|
+
for (let i = 0; i < pool.particles.length; i++) {
|
|
15
|
+
const p = pool.particles[i];
|
|
16
|
+
if (!p.active)
|
|
17
|
+
continue;
|
|
18
|
+
const edge = edges[p.edgeIndex];
|
|
19
|
+
if (!edge)
|
|
20
|
+
continue;
|
|
21
|
+
// Resolve color
|
|
22
|
+
if (typeof style.color === "function") {
|
|
23
|
+
const sourceNode = typeof edge.source === "object" ? edge.source : null;
|
|
24
|
+
ctx.fillStyle = sourceNode ? style.color(edge, sourceNode) : "#666";
|
|
25
|
+
}
|
|
26
|
+
else if (style.color && style.color !== "inherit") {
|
|
27
|
+
ctx.fillStyle = style.color;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
ctx.fillStyle = edgeColorFn(edge);
|
|
31
|
+
}
|
|
32
|
+
ctx.beginPath();
|
|
33
|
+
ctx.arc(p.x, p.y, radius, 0, Math.PI * 2);
|
|
34
|
+
ctx.fill();
|
|
35
|
+
}
|
|
36
|
+
ctx.globalAlpha = 1;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Spawn particles for all edges proportional to their value.
|
|
40
|
+
*/
|
|
41
|
+
function spawnNetworkParticles(pool, edges, deltaTime, style) {
|
|
42
|
+
const spawnRate = style.spawnRate ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.spawnRate;
|
|
43
|
+
const maxPerEdge = style.maxPerEdge ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.maxPerEdge;
|
|
44
|
+
for (let i = 0; i < edges.length; i++) {
|
|
45
|
+
const edge = edges[i];
|
|
46
|
+
if (!edge.bezier)
|
|
47
|
+
continue;
|
|
48
|
+
const currentCount = pool.countForEdge(i);
|
|
49
|
+
if (currentCount >= maxPerEdge)
|
|
50
|
+
continue;
|
|
51
|
+
const rate = edge.value * spawnRate * deltaTime;
|
|
52
|
+
const whole = Math.floor(rate);
|
|
53
|
+
const frac = rate - whole;
|
|
54
|
+
let toSpawn = whole;
|
|
55
|
+
if (Math.random() < frac)
|
|
56
|
+
toSpawn++;
|
|
57
|
+
for (let j = 0; j < toSpawn; j++) {
|
|
58
|
+
if (pool.countForEdge(i) >= maxPerEdge)
|
|
59
|
+
break;
|
|
60
|
+
pool.spawn(i);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkRectRenderer = networkRectRenderer;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas painter for NetworkRectNode (sankey nodes, treemap cells, partition blocks).
|
|
6
|
+
*/
|
|
7
|
+
function networkRectRenderer(ctx, nodes) {
|
|
8
|
+
for (const node of nodes) {
|
|
9
|
+
if (node.type !== "rect")
|
|
10
|
+
continue;
|
|
11
|
+
const r = node;
|
|
12
|
+
if (r.w <= 0 || r.h <= 0)
|
|
13
|
+
continue;
|
|
14
|
+
ctx.save();
|
|
15
|
+
if (r.style.opacity !== undefined) {
|
|
16
|
+
ctx.globalAlpha = r.style.opacity;
|
|
17
|
+
}
|
|
18
|
+
// Fill
|
|
19
|
+
if (r.style.fill) {
|
|
20
|
+
ctx.fillStyle = r.style.fill;
|
|
21
|
+
if (r.style.fillOpacity !== undefined) {
|
|
22
|
+
ctx.globalAlpha = (r.style.opacity ?? 1) * r.style.fillOpacity;
|
|
23
|
+
}
|
|
24
|
+
ctx.fillRect(r.x, r.y, r.w, r.h);
|
|
25
|
+
}
|
|
26
|
+
// Stroke
|
|
27
|
+
if (r.style.stroke && r.style.stroke !== "none") {
|
|
28
|
+
ctx.strokeStyle = r.style.stroke;
|
|
29
|
+
ctx.lineWidth = r.style.strokeWidth ?? 1;
|
|
30
|
+
ctx.globalAlpha = r.style.opacity ?? 1;
|
|
31
|
+
ctx.strokeRect(r.x, r.y, r.w, r.h);
|
|
32
|
+
}
|
|
33
|
+
ctx.restore();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pointCanvasRenderer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas point renderer.
|
|
6
|
+
* Renders PointSceneNode as circles. Used for Scatterplot, BubbleChart, and SwarmChart.
|
|
7
|
+
* Supports pulse glow effect via _pulseIntensity/_pulseColor fields.
|
|
8
|
+
*/
|
|
9
|
+
const pointCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
10
|
+
const pointNodes = nodes.filter((n) => n.type === "point");
|
|
11
|
+
for (const node of pointNodes) {
|
|
12
|
+
ctx.beginPath();
|
|
13
|
+
ctx.arc(node.x, node.y, node.r, 0, Math.PI * 2);
|
|
14
|
+
const alpha = node.style.opacity ?? node.style.fillOpacity;
|
|
15
|
+
if (alpha != null) {
|
|
16
|
+
ctx.globalAlpha = alpha;
|
|
17
|
+
}
|
|
18
|
+
ctx.fillStyle = node.style.fill || "#4e79a7";
|
|
19
|
+
ctx.fill();
|
|
20
|
+
if (node.style.stroke) {
|
|
21
|
+
ctx.strokeStyle = node.style.stroke;
|
|
22
|
+
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
23
|
+
ctx.stroke();
|
|
24
|
+
}
|
|
25
|
+
// Pulse glow ring
|
|
26
|
+
if (node._pulseIntensity && node._pulseIntensity > 0) {
|
|
27
|
+
const glowRadius = 4;
|
|
28
|
+
ctx.beginPath();
|
|
29
|
+
ctx.arc(node.x, node.y, node.r + glowRadius * node._pulseIntensity, 0, Math.PI * 2);
|
|
30
|
+
ctx.strokeStyle = node._pulseColor || "rgba(255,255,255,0.6)";
|
|
31
|
+
ctx.lineWidth = 2 * node._pulseIntensity;
|
|
32
|
+
ctx.globalAlpha = node._pulseIntensity * 0.5;
|
|
33
|
+
ctx.stroke();
|
|
34
|
+
}
|
|
35
|
+
ctx.globalAlpha = 1;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.pointCanvasRenderer = pointCanvasRenderer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.swarmCanvasRenderer = void 0;
|
|
4
|
+
const pointCanvasRenderer_1 = require("./pointCanvasRenderer");
|
|
5
|
+
/**
|
|
6
|
+
* Canvas swarm renderer.
|
|
7
|
+
* Identical to point renderer — swarm data points are pre-computed as PointSceneNodes.
|
|
8
|
+
* Separated for semantic clarity and potential future swarm-specific logic.
|
|
9
|
+
*/
|
|
10
|
+
exports.swarmCanvasRenderer = pointCanvasRenderer_1.pointCanvasRenderer;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.violinCanvasRenderer = void 0;
|
|
4
|
+
const violinCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
+
const violinNodes = nodes.filter((n) => n.type === "violin");
|
|
6
|
+
for (const node of violinNodes) {
|
|
7
|
+
ctx.save();
|
|
8
|
+
if (node.translateX || node.translateY) {
|
|
9
|
+
ctx.translate(node.translateX, node.translateY);
|
|
10
|
+
}
|
|
11
|
+
// Draw the violin shape
|
|
12
|
+
const path = new Path2D(node.pathString);
|
|
13
|
+
ctx.globalAlpha = node.style.fillOpacity ?? node.style.opacity ?? 0.6;
|
|
14
|
+
ctx.fillStyle = node.style.fill || "#007bff";
|
|
15
|
+
ctx.fill(path);
|
|
16
|
+
ctx.globalAlpha = 1;
|
|
17
|
+
if (node.style.stroke && node.style.stroke !== "none") {
|
|
18
|
+
ctx.strokeStyle = node.style.stroke;
|
|
19
|
+
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
20
|
+
ctx.stroke(path);
|
|
21
|
+
}
|
|
22
|
+
// IQR overlay lines
|
|
23
|
+
if (node.iqrLine) {
|
|
24
|
+
ctx.strokeStyle = "#333";
|
|
25
|
+
ctx.lineWidth = 2;
|
|
26
|
+
ctx.globalAlpha = 0.8;
|
|
27
|
+
// Q1 to Q3 line
|
|
28
|
+
ctx.beginPath();
|
|
29
|
+
// Determine if this is a vertical violin by checking path characteristics
|
|
30
|
+
// IQR positions are already in pixel space from rScale
|
|
31
|
+
ctx.moveTo(0, node.iqrLine.q1Pos);
|
|
32
|
+
ctx.lineTo(0, node.iqrLine.q3Pos);
|
|
33
|
+
ctx.stroke();
|
|
34
|
+
// Median dot
|
|
35
|
+
ctx.beginPath();
|
|
36
|
+
ctx.arc(0, node.iqrLine.medianPos, 3, 0, Math.PI * 2);
|
|
37
|
+
ctx.fillStyle = "#fff";
|
|
38
|
+
ctx.fill();
|
|
39
|
+
ctx.strokeStyle = "#333";
|
|
40
|
+
ctx.lineWidth = 1;
|
|
41
|
+
ctx.stroke();
|
|
42
|
+
ctx.globalAlpha = 1;
|
|
43
|
+
}
|
|
44
|
+
ctx.restore();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.violinCanvasRenderer = violinCanvasRenderer;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waterfallCanvasRenderer = void 0;
|
|
4
|
+
const barCanvasRenderer_1 = require("./barCanvasRenderer");
|
|
5
|
+
/**
|
|
6
|
+
* Canvas waterfall renderer.
|
|
7
|
+
* Waterfall bars are pre-computed as RectSceneNodes by PipelineStore,
|
|
8
|
+
* so the rendering is identical to the bar renderer.
|
|
9
|
+
* Connector lines between bars are handled separately if needed.
|
|
10
|
+
*/
|
|
11
|
+
const waterfallCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
12
|
+
// Render the bar segments
|
|
13
|
+
(0, barCanvasRenderer_1.barCanvasRenderer)(ctx, nodes, scales, layout);
|
|
14
|
+
// Draw connector lines between consecutive waterfall bars
|
|
15
|
+
const rects = nodes.filter(n => n.type === "rect");
|
|
16
|
+
if (rects.length < 2)
|
|
17
|
+
return;
|
|
18
|
+
ctx.save();
|
|
19
|
+
ctx.strokeStyle = "#999";
|
|
20
|
+
ctx.lineWidth = 1;
|
|
21
|
+
ctx.setLineDash([]);
|
|
22
|
+
for (let i = 0; i < rects.length - 1; i++) {
|
|
23
|
+
const curr = rects[i];
|
|
24
|
+
const next = rects[i + 1];
|
|
25
|
+
if (!curr.datum?.cumEnd || !next.datum?.baseline)
|
|
26
|
+
continue;
|
|
27
|
+
// Connect from end of current bar to start of next bar at cumEnd level
|
|
28
|
+
const yConn = scales.y(curr.datum.cumEnd);
|
|
29
|
+
const x1 = curr.x + curr.w;
|
|
30
|
+
const x2 = next.x;
|
|
31
|
+
ctx.beginPath();
|
|
32
|
+
ctx.moveTo(x1, yConn);
|
|
33
|
+
ctx.lineTo(x2, yConn);
|
|
34
|
+
ctx.stroke();
|
|
35
|
+
}
|
|
36
|
+
ctx.restore();
|
|
37
|
+
};
|
|
38
|
+
exports.waterfallCanvasRenderer = waterfallCanvasRenderer;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wedgeCanvasRenderer = void 0;
|
|
4
|
+
const wedgeCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
+
const wedgeNodes = nodes.filter((n) => n.type === "wedge");
|
|
6
|
+
for (const node of wedgeNodes) {
|
|
7
|
+
ctx.beginPath();
|
|
8
|
+
if (node.innerRadius > 0) {
|
|
9
|
+
// Donut: outer arc forward, inner arc backward
|
|
10
|
+
ctx.arc(node.cx, node.cy, node.outerRadius, node.startAngle, node.endAngle);
|
|
11
|
+
ctx.arc(node.cx, node.cy, node.innerRadius, node.endAngle, node.startAngle, true);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
// Pie: move to center, arc, close
|
|
15
|
+
ctx.moveTo(node.cx, node.cy);
|
|
16
|
+
ctx.arc(node.cx, node.cy, node.outerRadius, node.startAngle, node.endAngle);
|
|
17
|
+
}
|
|
18
|
+
ctx.closePath();
|
|
19
|
+
if (node.style.opacity != null)
|
|
20
|
+
ctx.globalAlpha = node.style.opacity;
|
|
21
|
+
if (node.style.fillOpacity != null)
|
|
22
|
+
ctx.globalAlpha = node.style.fillOpacity;
|
|
23
|
+
ctx.fillStyle = node.style.fill || "#007bff";
|
|
24
|
+
ctx.fill();
|
|
25
|
+
if (node.style.stroke && node.style.stroke !== "none") {
|
|
26
|
+
ctx.strokeStyle = node.style.stroke;
|
|
27
|
+
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
28
|
+
ctx.stroke();
|
|
29
|
+
}
|
|
30
|
+
ctx.globalAlpha = 1;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.wedgeCanvasRenderer = wedgeCanvasRenderer;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useBoundingRect = useBoundingRect;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
function useBoundingRect(ref) {
|
|
7
|
+
const [rect, setRect] = (0, react_1.useState)(null);
|
|
8
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
if (element != null) {
|
|
11
|
+
setRect(element.getBoundingClientRect());
|
|
12
|
+
// TypeScript 3.9 does not know about resize observer
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
const observer = new ResizeObserver((entries) => {
|
|
15
|
+
if (entries.length > 0) {
|
|
16
|
+
setRect(entries[0].contentRect);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
observer.observe(element);
|
|
20
|
+
return () => observer.disconnect();
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
return rect;
|
|
24
|
+
}
|