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 @@
|
|
|
1
|
+
import*as t from"react";import{line as e,curveLinearClosed as i,arc as s}from"d3-shape";import{scaleLinear as n,scaleBand as o}from"d3-scale";import{sankeyCircular as r,sankeyJustify as a,sankeyCenter as c,sankeyRight as l,sankeyLeft as h}from"d3-sankey-circular";import{schemeCategory10 as u}from"d3-scale-chromatic";import{interpolateNumber as d}from"d3-interpolate";import{forceLink as f,forceSimulation as y,forceManyBody as g,forceX as p,forceY as m}from"d3-force";import{min as x,max as v,quantile as b}from"d3-array";import{ribbon as w,chord as k}from"d3-chord";import{hierarchy as S,partition as A,pack as M,treemap as E,treemapBinary as _,cluster as N,tree as P}from"d3-hierarchy";class W{constructor(t){if(this._capacity=t,this.head=0,this._size=0,1>t)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(t)}push(t){let e;return this._size===this._capacity?e=this.buffer[this.head]:this._size++,this.buffer[this.head]=t,this.head=(this.head+1)%this._capacity,e}pushMany(t){const e=[];for(const i of t){const t=this.push(i);void 0!==t&&e.push(t)}return e}get(t){if(t>=0&&this._size>t)return this.buffer[(this.head-this._size+t+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let t=0;const e=this;return{next:()=>e._size>t?{done:!1,value:e.get(t++)}:{done:!0,value:void 0}}}toArray(){const t=[];for(const e of this)t.push(e);return t}resize(t){if(1>t)throw Error("RingBuffer capacity must be at least 1");const e=this.toArray(),i=[];for(;e.length>t;)i.push(e.shift());this._capacity=t,this.buffer=Array(t),this.head=0,this._size=0;for(const t of e)this.push(t);return i}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}}class ${constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(t){Number.isNaN(t)||(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}evict(t){t!==this._min&&t!==this._max||(this._dirty=!0)}recalculate(t,e){this._min=1/0,this._max=-1/0;for(const i of t){const t=e?e(i):i;Number.isNaN(t)||(this._min>t&&(this._min=t),t>this._max&&(this._max=t))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}}function z(t,e,i,s,n){const o=new Map;for(const r of t){const t=e(r),a=i(r);if(null==t||null==a||Number.isNaN(t)||Number.isNaN(a))continue;const c=Math.floor(t/s)*s;let l=o.get(c);if(l||(l={start:c,end:c+s,total:0,categories:new Map},o.set(c,l)),l.total+=a,n){const t=n(r);l.categories.set(t,(l.categories.get(t)||0)+a)}}return o}function O(t,e,i,s,n,o){const r=[],a=[];for(const n of t){const t=i(n),o=s(n);null==t||null==o||Number.isNaN(t)||Number.isNaN(o)||(r.push([e.x(t),e.y(o)]),a.push(o))}return{type:"line",path:r,rawValues:a,style:n,datum:t,group:o}}function D(t,e,i,s,n,o,r){const a=[],c=[];for(const o of t){const t=i(o),r=s(o);if(null==t||null==r||Number.isNaN(t)||Number.isNaN(r))continue;const l=e.x(t);a.push([l,e.y(r)]),c.push([l,e.y(n)])}return{type:"area",topPath:a,bottomPath:c,style:o,datum:t,group:r}}function j(t,e,i,s,n,o){const r=i(t),a=s(t);return null==r||null==a||Number.isNaN(r)||Number.isNaN(a)?null:{type:"point",x:e.x(r),y:e.y(a),r:n,style:o,datum:t}}function R(t,e,i,s,n,o,r){return{type:"rect",x:t,y:e,w:i,h:s,style:n,datum:o,group:r}}function B(t,e,i,s,n,o){return{type:"heatcell",x:t,y:e,w:i,h:s,fill:n,datum:o}}function L(t,e){if("function"==typeof t)return e=>+t(e);const i=t||e;return t=>+t[i]}function C(t,e){return"function"==typeof t?t:t?e=>e[t]+"":e?t=>t[e]+"":void 0}class T{constructor(t){this.xExtent=new $,this.yExtent=new $,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.lastIngestTime=0,this.scales=null,this.scene=[],this.version=0,this.config=t,this.buffer=new W(t.windowSize),this.growingCap=t.windowSize,["bar","swarm","waterfall"].includes(t.chartType)||"streaming"===t.runtimeMode?(this.getX=L(t.timeAccessor||t.xAccessor,"time"),this.getY=L(t.valueAccessor||t.yAccessor,"value")):(this.getX=L(t.xAccessor,"x"),this.getY=L(t.yAccessor,"y")),this.getGroup=C(t.groupAccessor),this.getCategory=C(t.categoryAccessor),this.getSize=t.sizeAccessor?L(t.sizeAccessor,"size"):void 0,this.getColor=C(t.colorAccessor),this.getBounds=t.boundsAccessor?L(t.boundsAccessor,"bounds"):void 0,"candlestick"===t.chartType&&(this.getOpen=L(t.openAccessor,"open"),this.getHigh=L(t.highAccessor,"high"),this.getLow=L(t.lowAccessor,"low"),this.getClose=L(t.closeAccessor,"close")),t.pulse&&(this.timestampBuffer=new W(t.windowSize))}ingest(t){const e="undefined"!=typeof performance?performance.now():Date.now();if(this.lastIngestTime=e,t.bounded){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();const i=t.totalSize||t.inserts.length;i>this.buffer.capacity&&(this.buffer.resize(i),this.timestampBuffer&&i>this.timestampBuffer.capacity&&this.timestampBuffer.resize(i));for(const i of t.inserts)this.buffer.push(i),this.timestampBuffer&&this.timestampBuffer.push(e),this.xExtent.push(this.getX(i)),"candlestick"===this.config.chartType&&this.getHigh&&this.getLow?(this.yExtent.push(this.getHigh(i)),this.yExtent.push(this.getLow(i))):this.yExtent.push(this.getY(i))}else for(const i of t.inserts){"growing"===this.config.windowMode&&this.buffer.full&&(this.growingCap*=2,this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap));const t=this.buffer.push(i);this.timestampBuffer&&this.timestampBuffer.push(e),this.xExtent.push(this.getX(i)),"candlestick"===this.config.chartType&&this.getHigh&&this.getLow?(this.yExtent.push(this.getHigh(i)),this.yExtent.push(this.getLow(i))):this.yExtent.push(this.getY(i)),null!=t&&(this.xExtent.evict(this.getX(t)),"candlestick"===this.config.chartType&&this.getHigh&&this.getLow?(this.yExtent.evict(this.getHigh(t)),this.yExtent.evict(this.getLow(t))):this.yExtent.evict(this.getY(t)))}return!0}computeScene(t){var e,i,s,o,r,a;const{config:c,buffer:l}=this;if(this.xExtent.dirty&&this.xExtent.recalculate(l,this.getX),this.yExtent.dirty)if("candlestick"===c.chartType&&this.getHigh&&this.getLow){this.yExtent.clear();for(const t of l)this.yExtent.push(this.getHigh(t)),this.yExtent.push(this.getLow(t))}else this.yExtent.recalculate(l,this.getY);const h=this.xExtent.extent,u=this.yExtent.extent;let d=c.xExtent?[null!==(e=c.xExtent[0])&&void 0!==e?e:h[0],null!==(i=c.xExtent[1])&&void 0!==i?i:h[1]]:h,f=c.yExtent?[null!==(s=c.yExtent[0])&&void 0!==s?s:u[0],null!==(o=c.yExtent[1])&&void 0!==o?o:u[1]]:u;const y=c.yExtent&&null!=c.yExtent[0]&&null!=c.yExtent[1];if("stackedarea"===c.chartType&&!y&&l.size>0)if(c.normalize)f=[0,1+c.extentPadding];else{const t=l.toArray(),e=this.groupData(t),i=new Map;for(const t of e)for(const e of t.data){const t=this.getX(e),s=this.getY(e);null==t||null==s||Number.isNaN(t)||Number.isNaN(s)||i.set(t,(i.get(t)||0)+s)}let s=0;for(const t of i.values())t>s&&(s=t);f=[0,s+(s>0?s*c.extentPadding:1)]}else if("bar"===c.chartType&&c.binSize&&!y&&l.size>0){const[,t]=function(t,e,i,s,n){const o=z(t,e,i,s,n);if(0===o.size)return[0,0];let r=0;for(const t of o.values())t.total>r&&(r=t.total);return[0,r]}(l,this.getX,this.getY,c.binSize,this.getCategory);f=[0,t+t*c.extentPadding]}else if("waterfall"===c.chartType&&!y&&l.size>0){const[t,e]=function(t,e){let i=0,s=0,n=0;for(const o of t){const t=e(o);null==t||Number.isNaN(t)||(n+=t,i>n&&(i=n),n>s&&(s=n))}return[i,s]}(l,this.getY),i=e-t,s=i>0?i*c.extentPadding:1;f=[Math.min(0,t-Math.abs(s)),Math.max(0,e+Math.abs(s))]}else if(!y&&f[0]!==1/0){if(this.getBounds){const t=l.toArray();for(const e of t){const t=this.getY(e),i=this.getBounds(e);null!=t&&!Number.isNaN(t)&&i&&(t+i>f[1]&&(f[1]=t+i),f[0]>t-i&&(f[0]=t-i))}}const t=f[1]-f[0],e=t>0?t*c.extentPadding:1,i=null===(r=c.yExtent)||void 0===r?void 0:r[0],s=null===(a=c.yExtent)||void 0===a?void 0:a[1];f=[null!=i?f[0]:f[0]-e,null!=s?f[1]:f[1]+e]}if(d[0]!==1/0&&d[1]!==-1/0||(d=[0,1]),f[0]!==1/0&&f[1]!==-1/0||(f=[0,1]),void 0!==c.arrowOfTime)if("x"==("up"===(g=c.arrowOfTime)||"down"===g?"y":"x")){const e="right"===c.arrowOfTime?[0,t.width]:[t.width,0];this.scales={x:n().domain(d).range(e),y:n().domain(f).range([t.height,0])}}else{const e="down"===c.arrowOfTime?[0,t.height]:[t.height,0];this.scales={x:n().domain(f).range([0,t.width]),y:n().domain(d).range(e)}}else this.scales={x:n().domain(d).range([0,t.width]),y:n().domain(f).range([t.height,0])};var g;this.config.transition&&this.scene.length>0&&this.snapshotPositions();const p=l.toArray();this.scene=this.buildSceneNodes(t),this.config.decay&&this.applyDecay(this.scene,p),this.config.pulse&&this.applyPulse(this.scene,p),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++}buildSceneNodes(t){const{config:e,buffer:i,scales:s}=this;if(!s||0===i.size)return[];const n=i.toArray();switch(e.chartType){case"line":return this.buildLineScene(n);case"area":return this.buildAreaScene(n);case"stackedarea":return this.buildStackedAreaScene(n);case"scatter":case"bubble":return this.buildPointScene(n);case"heatmap":return this.buildHeatmapScene(n,t);case"bar":return this.buildBarScene(n);case"swarm":return this.buildSwarmScene(n);case"waterfall":return this.buildWaterfallScene(n,t);case"candlestick":return this.buildCandlestickScene(n,t);default:return[]}}buildLineScene(t){var e;const i=this.groupData(t),s=[],n=null===(e=this.config.annotations)||void 0===e?void 0:e.filter(t=>"threshold"===t.type&&t.color).map(t=>({value:t.value,color:t.color,thresholdType:t.thresholdType||"greater"}));if(this.getBounds)for(const t of i){const e=this.buildBoundsForGroup(t.data,t.key);e&&s.push(e)}for(const t of i){const e=this.resolveLineStyle(t.key,t.data[0]),i=O(t.data,this.scales,this.getX,this.getY,e,t.key);n&&n.length>0&&(i.colorThresholds=n),s.push(i)}return s}buildAreaScene(t){const e=this.groupData(t),i=[],s=this.scales.y.domain()[0];for(const t of e){const e=this.resolveAreaStyle(t.key,t.data[0]);i.push(D(t.data,this.scales,this.getX,this.getY,s,e,t.key))}return i}buildStackedAreaScene(t){return function(t,e,i,s,n,o){var r;const a=new Set;for(const e of t)for(const t of e.data){const e=i(t);null==e||Number.isNaN(e)||a.add(e)}const c=Array.from(a).sort((t,e)=>t-e),l=new Map;for(const e of t){const t=new Map;for(const n of e.data){const e=i(n),o=s(n);null==e||null==o||Number.isNaN(e)||Number.isNaN(o)||t.set(e,(t.get(e)||0)+o)}l.set(e.key,t)}let h;if(o){h=new Map;for(const e of c){let i=0;for(const s of t)i+=(null===(r=l.get(s.key))||void 0===r?void 0:r.get(e))||0;h.set(e,i||1)}}const u=[],d=new Map;for(const t of c)d.set(t,0);for(const i of t){const t=l.get(i.key),s=[],r=[];for(const i of c){let n=t.get(i)||0;const a=d.get(i);o&&(n/=h.get(i));const c=e.x(i);r.push([c,e.y(a)]),s.push([c,e.y(a+n)]),d.set(i,a+n)}u.push({type:"area",topPath:s,bottomPath:r,style:n(i.key,i.data[0]),datum:i.data,group:i.key})}return u}(this.groupData(t),this.scales,this.getX,this.getY,(t,e)=>this.resolveAreaStyle(t,e),this.config.normalize)}buildPointScene(t){const e=[],i="bubble"===this.config.chartType?10:5,s=this.config.sizeRange||[3,15];let n=null;if(this.getSize&&!this.config.pointStyle){const e=t.map(t=>this.getSize(t)).filter(t=>null!=t&&!Number.isNaN(t));if(e.length>0){const t=Math.min(...e),i=Math.max(...e);n=e=>t===i?(s[0]+s[1])/2:s[0]+(e-t)/(i-t)*(s[1]-s[0])}}let o=null;if(this.getColor&&!this.config.pointStyle){const e=new Set;for(const i of t){const t=this.getColor(i);t&&e.add(t)}const i=Array.isArray(this.config.colorScheme)?this.config.colorScheme:["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"];o=new Map;let s=0;for(const t of e)o.set(t,i[s%i.length]),s++}for(const s of t){let t=this.config.pointStyle?this.config.pointStyle(s):{fill:"#4e79a7",opacity:.8},r=t.r||i;if(n&&this.getSize){const t=this.getSize(s);null==t||Number.isNaN(t)||(r=n(t))}if(o&&this.getColor){const e=this.getColor(s);e&&o.has(e)&&(t=Object.assign(Object.assign({},t),{fill:o.get(e)}))}const a=j(s,this.scales,this.getX,this.getY,r,t);a&&e.push(a)}return e}buildHeatmapScene(t,e){const i=[];if(this.config.heatmapAggregation)return this.buildStreamingHeatmapScene(t,e);const s=L(this.config.valueAccessor,"value"),n=new Set,o=new Set;for(const e of t)n.add(this.getX(e)),o.add(this.getY(e));const r=Array.from(n).sort((t,e)=>t-e),a=Array.from(o).sort((t,e)=>t-e);if(0===r.length||0===a.length)return i;const c=e.width/r.length,l=e.height/a.length,h=new Map;for(const e of t){const t=`${this.getX(e)}_${this.getY(e)}`;h.set(t,{val:s(e),datum:e})}let u=1/0,d=-1/0;for(const{val:t}of h.values())u>t&&(u=t),t>d&&(d=t);const f=d-u||1;for(let t=0;r.length>t;t++)for(let e=0;a.length>e;e++){const s=h.get(`${r[t]}_${a[e]}`);if(!s)continue;const n=(s.val-u)/f;i.push(B(t*c,(a.length-1-e)*l,c,l,`rgb(${Math.round(220-180*n)},${Math.round(220-100*n)},${Math.round(255-50*n)})`,s.datum))}return i}buildStreamingHeatmapScene(t,e){var i,s,n;const o=[],r=null!==(i=this.config.heatmapXBins)&&void 0!==i?i:20,a=null!==(s=this.config.heatmapYBins)&&void 0!==s?s:20,c=null!==(n=this.config.heatmapAggregation)&&void 0!==n?n:"count",l=L(this.config.valueAccessor,"value");if(!this.scales||0===t.length)return o;const[h,u]=this.scales.x.domain(),[d,f]=this.scales.y.domain(),y=(u-h||1)/r,g=(f-d||1)/a,p=new Map;for(const e of t){const t=this.getX(e),i=this.getY(e),s=Math.min(Math.floor((t-h)/y),r-1),n=Math.min(Math.floor((i-d)/g),a-1);if(0>s||0>n)continue;const o=`${s}_${n}`;let c=p.get(o);c||(c={sum:0,count:0,data:[]},p.set(o,c)),c.count++,c.sum+=l(e),c.data.push(e)}let m=1/0,x=-1/0;const v=new Map;for(const[t,e]of p){let i;switch(c){case"sum":i=e.sum;break;case"mean":i=e.count>0?e.sum/e.count:0;break;default:i=e.count}v.set(t,i),m>i&&(m=i),i>x&&(x=i)}const b=x-m||1,w=e.width/r,k=e.height/a;for(const[t,e]of v){const[i,s]=t.split("_"),n=+i,r=+s,c=(e-m)/b,l=`rgb(${Math.round(220-180*c)},${Math.round(220-100*c)},${Math.round(255-50*c)})`,h=p.get(t);o.push(B(n*w,(a-1-r)*k,w,k,l,{xi:n,yi:r,value:e,count:h.count,sum:h.sum,data:h.data}))}return o}buildBarScene(t){var e;if(!this.config.binSize)return[];const i=z(t,this.getX,this.getY,this.config.binSize,this.getCategory);if(0===i.size)return[];let s=null;if(this.getCategory){const t=new Set;for(const e of i.values())for(const i of e.categories.keys())t.add(i);const e=this.config.barColors?Object.keys(this.config.barColors):[],n=new Set(e),o=Array.from(t).filter(t=>!n.has(t)).sort();s=[...e.filter(e=>t.has(e)),...o]}const n=[],o=this.scales,[r,a]=o.x.domain();for(const t of i.values()){const i=Math.max(t.start,r),c=Math.min(t.end,a);if(i>=c)continue;const l=o.x(i),h=o.x(c),u=Math.min(l,h)+.5,d=Math.max(l,h)-.5-u;if(d>0)if(s&&t.categories.size>0){let i=0;for(const r of s){const s=t.categories.get(r)||0;if(0===s)continue;const a=o.y(i),c=o.y(i+s);n.push(R(u,Math.min(a,c),d,Math.abs(a-c),{fill:(null===(e=this.config.barColors)||void 0===e?void 0:e[r])||"#4e79a7"},{binStart:t.start,binEnd:t.end,total:t.total,category:r,categoryValue:s},r)),i+=s}}else{const e=o.y(0),i=o.y(t.total);n.push(R(u,Math.min(e,i),d,Math.abs(e-i),{fill:"#007bff"},{binStart:t.start,binEnd:t.end,total:t.total}))}}return n}buildSwarmScene(t){var e,i,s,n;const o=[],r=this.config.swarmStyle||{},a=null!==(e=r.radius)&&void 0!==e?e:3,c=null!==(i=r.fill)&&void 0!==i?i:"#007bff",l=null!==(s=r.opacity)&&void 0!==s?s:.7,h=r.stroke,u=r.strokeWidth;for(const e of t){const t=this.getX(e),i=this.getY(e);if(null==i||Number.isNaN(i))continue;const s=this.scales.x(t),r=this.scales.y(i);let d=c;if(this.getCategory){const t=this.getCategory(e);d=(null===(n=this.config.barColors)||void 0===n?void 0:n[t])||d}o.push({type:"point",x:s,y:r,r:a,style:{fill:d,opacity:l,stroke:h,strokeWidth:u},datum:e})}return o}buildWaterfallScene(t,e){const i=[],s=this.scales,n=t.filter(t=>{const e=this.getY(t);return null!=e&&!Number.isNaN(e)});if(0===n.length)return i;let o=0;for(let t=0;n.length>t;t++){const r=n[t],a=this.getX(r),c=this.getY(r),l=o+c;let h;h=n.length-1>t?this.getX(n[t+1])-a:t>0?a-this.getX(n[t-1]):0;const u=s.x(a),d=0!==h?s.x(a+h):u+e.width/10,f=Math.min(u,d)+.5,y=Math.max(u,d)-.5-f;if(0>=y){o=l;continue}const g=s.y(o),p=s.y(l);i.push(R(f,Math.min(g,p),y,Math.abs(g-p),{fill:0>c?"#dc3545":"#28a745"},Object.assign(Object.assign({},r),{baseline:o,cumEnd:l,delta:c}))),o=l}return i}buildCandlestickScene(t,e){if(!(this.getOpen&&this.getHigh&&this.getLow&&this.getClose&&this.scales))return[];const i=[],s=this.config.candlestickStyle||{},n=s.upColor||"#28a745",o=s.downColor||"#dc3545",r=s.wickColor||"#333",a=s.wickWidth||1,c=t.map(t=>this.getX(t)).filter(t=>null!=t&&!Number.isNaN(t)).sort((t,e)=>t-e);let l=s.bodyWidth||6;if(!s.bodyWidth&&c.length>1){let t=1/0;for(let e=1;c.length>e;e++){const i=Math.abs(this.scales.x(c[e])-this.scales.x(c[e-1]));i>0&&t>i&&(t=i)}t!==1/0&&(l=Math.max(2,Math.min(.6*t,20)))}for(const e of t){const t=this.getX(e);if(null==t||Number.isNaN(t))continue;const s=this.getOpen(e),c=this.getHigh(e),h=this.getLow(e),u=this.getClose(e);if([s,c,h,u].some(t=>null==t||Number.isNaN(t)))continue;const d=u>=s;i.push({type:"candlestick",x:this.scales.x(t),openY:this.scales.y(s),closeY:this.scales.y(u),highY:this.scales.y(c),lowY:this.scales.y(h),bodyWidth:l,upColor:n,downColor:o,wickColor:r,wickWidth:a,isUp:d,datum:e})}return i}buildBoundsForGroup(t,e){if(!this.getBounds||!this.scales)return null;const i=[],s=[];for(const e of t){const t=this.getX(e),n=this.getY(e);if(null==t||null==n||Number.isNaN(t)||Number.isNaN(n))continue;const o=this.getBounds(e),r=this.scales.x(t);if(o&&0!==o)i.push([r,this.scales.y(n+o)]),s.push([r,this.scales.y(n-o)]);else{const t=this.scales.y(n);i.push([r,t]),s.push([r,t])}}return 2>i.length?null:{type:"area",topPath:i,bottomPath:s,style:this.resolveBoundsStyle(e,t[0]),datum:t,group:e,interactive:!1}}resolveBoundsStyle(t,e){const i=this.config.boundsStyle;return"function"==typeof i?i(e||{},t):i&&"object"==typeof i?i:{fill:this.resolveLineStyle(t,e).stroke||"#4e79a7",fillOpacity:.2,stroke:"none"}}computeDecayOpacity(t,e){var i,s,n;const o=this.config.decay;if(!o||1>=e)return 1;const r=null!==(i=o.minOpacity)&&void 0!==i?i:.1,a=e-1-t;switch(o.type){case"linear":return r+(1-a/(e-1))*(1-r);case"exponential":{const t=null!==(s=o.halfLife)&&void 0!==s?s:e/2;return r+Math.pow(.5,a/t)*(1-r)}case"step":return(null!==(n=o.stepThreshold)&&void 0!==n?n:.5*e)>a?1:r;default:return 1}}applyDecay(t,e){var i,s;if(!this.config.decay)return;const n=e.length;if(1>=n)return;const o=new Map;for(let t=0;e.length>t;t++)o.set(e[t],t);for(const e of t){if("line"===e.type||"area"===e.type)continue;const t=o.get(e.datum);if(null==t)continue;const r=this.computeDecayOpacity(t,n);if("heatcell"===e.type)e.style={opacity:r};else if("candlestick"===e.type)e._decayOpacity=r;else{const t=null!==(s=null===(i=e.style)||void 0===i?void 0:i.opacity)&&void 0!==s?s:1;e.style=Object.assign(Object.assign({},e.style),{opacity:t*r})}}}computePulseIntensity(t,e){var i;const s=this.config.pulse;if(!s)return 0;const n=null!==(i=s.duration)&&void 0!==i?i:500,o=e-t;return n>o?1-o/n:0}applyPulse(t,e){var i;if(!this.config.pulse||!this.timestampBuffer)return;const s="undefined"!=typeof performance?performance.now():Date.now(),n=null!==(i=this.config.pulse.color)&&void 0!==i?i:"rgba(255,255,255,0.6)",o=new Map;for(let t=0;e.length>t;t++)o.set(e[t],t);for(const e of t){if("line"===e.type||"area"===e.type)continue;const t=o.get(e.datum);if(null==t)continue;const i=this.timestampBuffer.get(t);if(null==i)continue;const r=this.computePulseIntensity(i,s);r>0&&(e._pulseIntensity=r,e._pulseColor=n)}}get hasActivePulses(){var t;if(!this.config.pulse||!this.timestampBuffer||0===this.timestampBuffer.size)return!1;const e="undefined"!=typeof performance?performance.now():Date.now(),i=null!==(t=this.config.pulse.duration)&&void 0!==t?t:500,s=this.timestampBuffer.peek();return null!=s&&i>e-s}snapshotPositions(){this.prevPositionMap.clear();for(let t=0;this.scene.length>t;t++){const e=this.scene[t],i=this.getNodeIdentity(e,t);i&&("point"===e.type?this.prevPositionMap.set(i,{x:e.x,y:e.y,r:e.r}):"rect"===e.type||"heatcell"===e.type?this.prevPositionMap.set(i,{x:e.x,y:e.y,w:e.w,h:e.h}):"candlestick"===e.type&&this.prevPositionMap.set(i,{x:e.x,y:e.openY}))}}getNodeIdentity(t,e){var i,s,n,o;switch(t.type){case"point":return`p:${void 0===t.datum?e:this.getX(t.datum)}_${this.getY(t.datum)}`;case"rect":return`r:${t.group||""}:${null!==(o=null!==(s=null===(i=t.datum)||void 0===i?void 0:i.binStart)&&void 0!==s?s:null===(n=t.datum)||void 0===n?void 0:n.category)&&void 0!==o?o:e}`;case"heatcell":return`h:${t.x}_${t.y}`;case"candlestick":return"c:"+this.getX(t.datum);default:return null}}startTransition(){var t,e,i,s,n,o;if(!this.config.transition||0===this.prevPositionMap.size)return;const r=null!==(t=this.config.transition.duration)&&void 0!==t?t:300;let a=!1;for(let t=0;this.scene.length>t;t++){const r=this.scene[t],c=this.getNodeIdentity(r,t);if(!c)continue;const l=this.prevPositionMap.get(c);if(l)if("point"===r.type){const t={x:r.x,y:r.y,r:r.r};l.x===t.x&&l.y===t.y||(r._targetX=t.x,r._targetY=t.y,r._targetR=t.r,r.x=l.x,r.y=l.y,r.r=null!==(e=l.r)&&void 0!==e?e:r.r,a=!0)}else if("rect"===r.type){const t={x:r.x,y:r.y,w:r.w,h:r.h};l.x===t.x&&l.y===t.y&&l.w===t.w&&l.h===t.h||(r._targetX=t.x,r._targetY=t.y,r._targetW=t.w,r._targetH=t.h,r.x=l.x,r.y=l.y,r.w=null!==(i=l.w)&&void 0!==i?i:r.w,r.h=null!==(s=l.h)&&void 0!==s?s:r.h,a=!0)}else if("heatcell"===r.type){const t={x:r.x,y:r.y,w:r.w,h:r.h};l.x===t.x&&l.y===t.y||(r._targetX=t.x,r._targetY=t.y,r._targetW=t.w,r._targetH=t.h,r.x=l.x,r.y=l.y,r.w=null!==(n=l.w)&&void 0!==n?n:r.w,r.h=null!==(o=l.h)&&void 0!==o?o:r.h,a=!0)}}a&&(this.activeTransition={startTime:"undefined"!=typeof performance?performance.now():Date.now(),duration:r})}advanceTransition(t){var e;if(!this.activeTransition)return!1;const i=Math.min((t-this.activeTransition.startTime)/this.activeTransition.duration,1),s="linear"===(null===(e=this.config.transition)||void 0===e?void 0:e.easing)?i:1-Math.pow(1-i,3);for(const t of this.scene)if("point"===t.type){if(void 0===t._targetX)continue;const e=this.getNodeIdentity(t,0);if(!e)continue;const i=this.prevPositionMap.get(e);if(!i)continue;t.x=i.x+(t._targetX-i.x)*s,t.y=i.y+(t._targetY-i.y)*s,void 0!==t._targetR&&void 0!==i.r&&(t.r=i.r+(t._targetR-i.r)*s)}else if("rect"===t.type){if(void 0===t._targetX)continue;const e=this.getNodeIdentity(t,0);if(!e)continue;const i=this.prevPositionMap.get(e);if(!i)continue;t.x=i.x+(t._targetX-i.x)*s,t.y=i.y+(t._targetY-i.y)*s,void 0!==i.w&&(t.w=i.w+(t._targetW-i.w)*s),void 0!==i.h&&(t.h=i.h+(t._targetH-i.h)*s)}else if("heatcell"===t.type){if(void 0===t._targetX)continue;const e=this.getNodeIdentity(t,0);if(!e)continue;const i=this.prevPositionMap.get(e);if(!i)continue;t.x=i.x+(t._targetX-i.x)*s,t.y=i.y+(t._targetY-i.y)*s,void 0!==i.w&&(t.w=i.w+(t._targetW-i.w)*s),void 0!==i.h&&(t.h=i.h+(t._targetH-i.h)*s)}if(i>=1){for(const t of this.scene)if("point"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,void 0!==t._targetR&&(t.r=t._targetR),t._targetX=void 0,t._targetY=void 0,t._targetR=void 0}else if("rect"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}else if("heatcell"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}return this.activeTransition=null,!1}return!0}groupData(t){if(!this.getGroup)return[{key:"_default",data:t}];const e=new Map;for(const i of t){const t=this.getGroup(i);e.has(t)||e.set(t,[]),e.get(t).push(i)}return Array.from(e.entries()).map(([t,e])=>({key:t,data:e}))}resolveLineStyle(t,e){const i=this.config.lineStyle;return"function"==typeof i?i(e||{},t):i&&"object"==typeof i?{stroke:i.stroke||"#007bff",strokeWidth:i.strokeWidth||2,strokeDasharray:i.strokeDasharray,fill:i.fill,fillOpacity:i.fillOpacity,opacity:i.opacity}:{stroke:"#007bff",strokeWidth:2}}resolveAreaStyle(t,e){var i;if(this.config.areaStyle)return this.config.areaStyle(e||{});const s=this.config.lineStyle;return"function"==typeof s?s(e||{},t):s&&"object"==typeof s?{fill:s.fill||s.stroke||"#4e79a7",fillOpacity:null!==(i=s.fillOpacity)&&void 0!==i?i:.7,stroke:s.stroke||"#4e79a7",strokeWidth:s.strokeWidth||2}:{fill:"#4e79a7",fillOpacity:.7,stroke:"#4e79a7",strokeWidth:2}}getData(){return this.buffer.toArray()}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.version++}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}updateConfig(t){Object.assign(this.config,t)}}const Y=(t=1)=>(e,i)=>{const s=e[e.length-1];return s&&Math.round(s.x/t)===Math.round(i.x/t)&&Math.round(s.y/t)===Math.round(i.y/t)||e.push(i),e},X=t=>{let e,i,s,n,o,r,a,c,l;return"down"===t.direction?(e=t.y0-t.sankeyWidth/2,i=t.y1-t.sankeyWidth/2,s=t.y1+t.sankeyWidth/2,n=t.y0+t.sankeyWidth/2,o=t.source.y1,r=t.target.y0,a=d(o,r),c=a(.5),l=a(.5),`M${e},${o}C${e},${c} ${i},${l} ${i},${r}L${s},${r}C${s},${l} ${n},${c} ${n},${o}Z`):(e=t.source.x1,i=t.target.x0,a=d(e,i),s=a(.5),n=a(.5),o=t.y0-t.sankeyWidth/2,r=t.y1-t.sankeyWidth/2,c=t.y1+t.sankeyWidth/2,l=t.y0+t.sankeyWidth/2,`M${e},${o}C${s},${o} ${n},${r} ${i},${r}L${i},${c}C${n},${c} ${s},${l} ${e},${l}Z`)};function I(t){const s=function(){const t=e();let s=function(t){return t.x},n=function(t){return t.y},o=function(t){return t.r},r=i;function a(e){if(e.multiple){const i=o,a=e.multiple.reduce((t,e)=>t+e.weight,0);o=()=>a;let c=l(e.points).filter(t=>"forward"===t.direction).reduce(Y(),[]);const h=[];return e.multiple.forEach((t,i)=>{o=()=>t.weight;const s=l(c);h.push(s);const n=e.multiple[i+1];if(n){const t=s.reverse().filter(t=>"back"===t.direction).reduce(Y(),[]);o=()=>n.weight;const e=l(t);c=e.reverse().filter(t=>"back"===t.direction).reduce(Y(),[])}}),o=i,h.map(e=>t.x(s).y(n).curve(r)(e))}const i=l(e).reduce(Y(),[]);return t.x(s).y(n).curve(r)(i)}return a.x=function(t){return arguments.length?(s=t,a):s},a.y=function(t){return arguments.length?(n=t,a):n},a.r=function(t){return arguments.length?(o=t,a):o},a.interpolate=function(t){return arguments.length?(r=t,a):r},a;function c(t){const e=n(t.target)-n(t.source),i=s(t.target)-s(t.source),r=Math.atan2(i,e)+Math.PI/2,a=r+.5*Math.PI,c=r+.5*Math.PI;return{x1:s(t.source)+o(t.source)*Math.cos(a),y1:n(t.source)-o(t.source)*Math.sin(a),x2:s(t.target)+o(t.target)*Math.cos(c),y2:n(t.target)-o(t.target)*Math.sin(c)}}function l(t){const e=[];let i=0,s={x1:0,y1:0,x2:0,y2:0};for(;t.length>i;){if(i!==t.length-1&&(s=c({source:t[i],target:t[i+1]}),e.push({x:s.x1,y:s.y1,direction:"forward"},{x:s.x2,y:s.y2,direction:"forward"}),e.length>3)){const t=e.length-1,i={a:e[t-3],b:e[t-2]},s={a:e[t-1],b:e[t]},n=h(i.a.x,i.a.y,i.b.x,i.b.y,s.a.x,s.a.y,s.b.x,s.b.y);!0===n.found&&(i.b.x=n.x,i.b.y=n.y,s.a.x=n.x,s.a.y=n.y)}i++}for(i--;i>=0;){if(0!==i&&(s=c({source:t[i],target:t[i-1]}),e.push({x:s.x1,y:s.y1,direction:"back"},{x:s.x2,y:s.y2,direction:"back"}),e.length>3)){const t=e.length-1,i={a:e[t-3],b:e[t-2]},s={a:e[t-1],b:e[t]},n=h(i.a.x,i.a.y,i.b.x,i.b.y,s.a.x,s.a.y,s.b.x,s.b.y);!0===n.found&&(i.b.x=n.x,i.b.y=n.y,s.a.x=n.x,s.a.y=n.y)}i--}return e}function h(t,e,i,s,n,o,r,a){let c,l;const h={x:null,y:null,found:!1},u=(a-o)*(i-t)-(r-n)*(s-e);if(0===u)return h;c=e-o,l=t-n;const d=(i-t)*c-(s-e)*l;return c=((r-n)*c-(a-o)*l)/u,l=d/u,h.x=t+c*(i-t),h.y=e+c*(s-e),c>0&&1>c&&l>0&&1>l&&(h.found=!0),h}}();return s.x(t=>t.x),s.y(t=>t.y),s.r(()=>t.sankeyWidth/2),s("down"===t.direction?[{x:t.circularPathData.sourceY,y:t.circularPathData.sourceX},{x:t.circularPathData.sourceY,y:t.circularPathData.leftFullExtent},{x:t.circularPathData.verticalFullExtent,y:t.circularPathData.leftFullExtent},{x:t.circularPathData.verticalFullExtent,y:t.circularPathData.rightFullExtent},{x:t.circularPathData.targetY,y:t.circularPathData.rightFullExtent},{x:t.circularPathData.targetY,y:t.circularPathData.targetX}]:[{x:t.circularPathData.sourceX,y:t.circularPathData.sourceY},{x:t.circularPathData.leftFullExtent,y:t.circularPathData.sourceY},{x:t.circularPathData.leftFullExtent,y:t.circularPathData.verticalFullExtent},{x:t.circularPathData.rightFullExtent,y:t.circularPathData.verticalFullExtent},{x:t.circularPathData.rightFullExtent,y:t.circularPathData.targetY},{x:t.circularPathData.targetX,y:t.circularPathData.targetY}])}const q={left:h,right:l,center:c,justify:a},H={supportsStreaming:!0,hierarchical:!1,computeLayout(t,e,i,s){var n,o,c,l;if(0===t.length)return;const h="vertical"===i.orientation?"down":"right",u=i.nodeAlign||"justify",d=null!==(n=i.nodeWidth)&&void 0!==n?n:15,f=null!==(o=i.nodePaddingRatio)&&void 0!==o?o:.05,y=null!==(c=i.iterations)&&void 0!==c?c:100,g=t.map(t=>Object.assign({},t)),p=e.map(t=>Object.assign(Object.assign({},t),{source:"string"==typeof t.source?t.source:t.source.id,target:"string"==typeof t.target?t.target:t.target.id}));let m;m="down"===h?[[0,0],[s[1],s[0]]]:[[0,0],[s[0],s[1]]];const x=r().extent(m).links(p).nodes(g).nodeAlign(q[u]||a).nodeId(t=>t.id).nodeWidth(d).iterations(y);x.nodePaddingRatio&&x.nodePaddingRatio(f),x();for(const e of g){const i=t.find(t=>t.id===e.id);i&&(i.x0=e.x0,i.x1=e.x1,i.y0=e.y0,i.y1=e.y1,i.value=e.value,i.depth=e.depth,i.sourceLinks=e.sourceLinks,i.targetLinks=e.targetLinks,i.width=e.x1-e.x0,i.height=e.y1-e.y0,i.x=e.x0+(e.x1-e.x0)/2,i.y=e.y0+(e.y1-e.y0)/2)}for(const i of p){const s=i.source,n=i.target,o="object"==typeof s&&null!==s?s.id:s+"",r="object"==typeof n&&null!==n?n.id:n+"",a=e.find(t=>("string"==typeof t.source?t.source:t.source.id)===o&&("string"==typeof t.target?t.target:t.target.id)===r);if(a){a.y0=i.y0,a.y1=i.y1,a.sankeyWidth=null!==(l=i.width)&&void 0!==l?l:0,a.circular=!!i.circular,a.circularPathData=i.circularPathData,a.direction=h;const e=t.find(t=>t.id===o),s=t.find(t=>t.id===r);e&&(a.source=e),s&&(a.target=s)}}},buildScene(t,e,i,s){var n,o;const r="vertical"===i.orientation?"down":"right",a=i.nodeStyle,c=i.edgeStyle,l=null!==(n=i.edgeOpacity)&&void 0!==n?n:.5,h=i.edgeColorBy||"source",d=Array.isArray(i.colorScheme)?i.colorScheme:u,f=new Map;t.forEach((t,e)=>{f.set(t.id,d[e%d.length])});const y=[],g=[],p=[];for(const e of t){const t=e.x1-e.x0,i=e.y1-e.y0;if(0>=t||0>=i)continue;const s=a?a(e):{},n={fill:s.fill||f.get(e.id)||"#4d430c",stroke:s.stroke,strokeWidth:s.strokeWidth,opacity:s.opacity};y.push({type:"rect",x:e.x0,y:e.y0,w:t,h:i,style:n,datum:e,id:e.id,label:e.id})}const m=[...e].sort((t,e)=>(e.sankeyWidth||0)-(t.sankeyWidth||0));for(const t of m){if(!t.sankeyWidth||0>=t.sankeyWidth)continue;const e="object"==typeof t.source?t.source:null,i="object"==typeof t.target?t.target:null;if(!e||!i)continue;let s;s=t.circular&&t.circularPathData?I(t):X(t);let n="#999";c?n=c(t).fill||n:"target"===h&&i?n=f.get(i.id)||n:e&&(n=f.get(e.id)||n);const r=c?c(t):{},a={fill:n,fillOpacity:null!==(o=r.fillOpacity)&&void 0!==o?o:l,stroke:r.stroke||"none",strokeWidth:r.strokeWidth,opacity:r.opacity};g.push({type:"bezier",pathD:s,bezierCache:t.bezier,style:a,datum:t})}if(!1!==i.showLabels){const e=(x=i.nodeLabel)?"function"==typeof x?x:t=>t[x]||t.id:null;for(const i of t){const t=i.x1-i.x0,n=i.y1-i.y0;if(0>=t||0>=n)continue;const o=e?e(i):i.id;if(!o)continue;let a,c,l;"down"===r?(a=i.x0+t/2,c=i.y1+14,l="middle"):(s[0]/2>i.x0+t/2?(a=i.x0-6,l="end"):(a=i.x1+6,l="start"),c=i.y0+n/2),p.push({x:a,y:c,text:o+"",anchor:l,baseline:"middle",fontSize:11})}}var x;return{sceneNodes:y,sceneEdges:g,labels:p}}},F={supportsStreaming:!1,hierarchical:!1,computeLayout(t,e,i,s){var n,o;if(0===t.length)return;const r=null!==(n=i.iterations)&&void 0!==n?n:Math.max(50,Math.min(300,Math.floor(300-2*(t.length-30)))),a=null!==(o=i.forceStrength)&&void 0!==o?o:.1,c=s[0]/2,l=s[1]/2;for(let e=0;t.length>e;e++){const i=t[e];if(null==i.x||null==i.y||0===i.x&&0===i.y){const t=10*Math.sqrt(e+.5),s=2.399963229728653*e;i.x=c+t*Math.cos(s),i.y=l+t*Math.sin(s)}}const h=V(i.nodeSize,i.nodeSizeRange,t),u=f().strength(t=>Math.min(2.5,t.weight?t.weight*a:a)).id(t=>t.id),d=s[1]/s[0],x=y().force("charge",g().strength(t=>-25*(t=>h(t))(t))).force("x",p(s[0]/2).strength(.1*d)).force("y",m(s[1]/2).strength(.1));if(x.nodes(t),e.length>0){const t=e.map(t=>Object.assign(Object.assign({},t),{source:"string"==typeof t.source?t.source:t.source.id,target:"string"==typeof t.target?t.target:t.target.id}));x.force("link",u),x.force("link").links(t)}.1>x.alpha()&&x.alpha(1),x.stop();for(let t=0;r>t;++t)x.tick();for(const i of e){if("string"==typeof i.source){const e=t.find(t=>t.id===i.source);e&&(i.source=e)}if("string"==typeof i.target){const e=t.find(t=>t.id===i.target);e&&(i.target=e)}}},buildScene(t,e,i,s){var n,o,r;const a=i.nodeStyle,c=i.edgeStyle,l=V(i.nodeSize,i.nodeSizeRange,t),h=Array.isArray(i.colorScheme)?i.colorScheme:u,d=new Map;t.forEach((t,e)=>{d.set(t.id,h[e%h.length])});const f=[],y=[],g=[];for(const e of t){if(null==e.x||null==e.y)continue;const t=l(e),i=a?a(e):{},s={fill:i.fill||d.get(e.id)||"#007bff",stroke:i.stroke||"#fff",strokeWidth:null!==(n=i.strokeWidth)&&void 0!==n?n:2,opacity:i.opacity};f.push({type:"circle",cx:e.x,cy:e.y,r:t,style:s,datum:e,id:e.id,label:e.id})}for(const i of e){const e="object"==typeof i.source?i.source:G(t,i.source),s="object"==typeof i.target?i.target:G(t,i.target);if(!e||!s)continue;if(null==e.x||null==e.y)continue;if(null==s.x||null==s.y)continue;const n=c?c(i):{},a={stroke:n.stroke||"#999",strokeWidth:null!==(o=n.strokeWidth)&&void 0!==o?o:1,opacity:null!==(r=n.opacity)&&void 0!==r?r:.6};y.push({type:"line",x1:e.x,y1:e.y,x2:s.x,y2:s.y,style:a,datum:i})}if(!1!==i.showLabels){const e=(p=i.nodeLabel)?"function"==typeof p?p:t=>t[p]||t.id:null;for(const i of t){if(null==i.x||null==i.y)continue;const t=e?e(i):i.id;if(!t)continue;const s=l(i);g.push({x:i.x,y:i.y-s-4,text:t+"",anchor:"middle",baseline:"auto",fontSize:11})}}var p;return{sceneNodes:f,sceneEdges:y,labels:g}}};function G(t,e){return t.find(t=>t.id===e)}function V(t,e,i){var s,o;if(null==t)return()=>8;if("number"==typeof t)return()=>t;if("function"==typeof t)return e=>t(e)||8;const r=e||[5,20],a=i.map(e=>{var i;return null===(i=e.data)||void 0===i?void 0:i[t]}).filter(t=>null!=t&&"number"==typeof t);if(0===a.length)return()=>r[0];const c=null!==(s=x(a))&&void 0!==s?s:0,l=null!==(o=v(a))&&void 0!==o?o:1;if(c===l)return()=>(r[0]+r[1])/2;const h=n().domain([c,l]).range(r).clamp(!0);return e=>{var i;const s=null===(i=e.data)||void 0===i?void 0:i[t];return null==s||"number"!=typeof s?r[0]:h(s)}}const Z=u,Q={supportsStreaming:!1,hierarchical:!1,computeLayout(t,e,i,n){if(0===t.length)return;const{padAngle:o=.01,groupWidth:r=20,sortGroups:a}=i,c=Math.min(n[0],n[1])/2,l=c-r,h=n[0]/2,u=n[1]/2,d=(f=i.valueAccessor)?"function"==typeof f?f:t=>{var e;return null!==(e=t[f])&&void 0!==e?e:1}:t=>{var e;return null!==(e=t.value)&&void 0!==e?e:1};var f;const y=new Map;for(let e=0;t.length>e;e++)y.set(t[e].id,e);const g=t.length,p=Array.from({length:g},()=>Array.from({length:g},()=>0));for(const t of e){const e="string"==typeof t.target?t.target:t.target.id,i=y.get("string"==typeof t.source?t.source:t.source.id),s=y.get(e);if(void 0===i||void 0===s)continue;const n=d(t);p[i][s]=n}const m=k().padAngle(o);a&&m.sortGroups(a);const x=m(p),v=x.groups,b=s().innerRadius(l).outerRadius(c);for(const e of v){const i=t[e.index],s=b.centroid(e);i.x=s[0]+h,i.y=s[1]+u,i.arcData={startAngle:e.startAngle,endAngle:e.endAngle}}for(const i of e){const e="string"==typeof i.source?i.source:i.source.id,s="string"==typeof i.target?i.target:i.target.id,n=t.find(t=>t.id===e),o=t.find(t=>t.id===s);n&&(i.source=n),o&&(i.target=o)}for(const i of x){const s=t[i.source.index].id,n=t[i.target.index].id,o=e.find(t=>{const e="string"==typeof t.source?t.source:t.source.id,i="string"==typeof t.target?t.target:t.target.id;return e===s&&i===n||e===n&&i===s});o&&(o.chordData=i)}},buildScene(t,e,i,s){var n,o;const{groupWidth:r=20,edgeOpacity:a=.5}=i,c=Math.min(s[0],s[1])/2,l=c-r,h=s[0]/2,u=s[1]/2,d=i.nodeStyle,f=i.edgeStyle,y=i.edgeColorBy||"source",g=Array.isArray(i.colorScheme)?i.colorScheme:Z,p=new Map;t.forEach((t,e)=>{p.set(t.id,g[e%g.length])});const m=w().radius(l),x=[],v=[],b=[];for(let e=0;t.length>e;e++){const i=t[e],s=i.arcData;if(!s)continue;let o;o=d?d(i).fill||p.get(i.id)||g[e%g.length]:p.get(i.id)||g[e%g.length];const r=d?d(i):{},a={fill:o,stroke:r.stroke||"black",strokeWidth:null!==(n=r.strokeWidth)&&void 0!==n?n:1,opacity:r.opacity};x.push({type:"arc",cx:h,cy:u,innerR:l,outerR:c,startAngle:s.startAngle-Math.PI/2,endAngle:s.endAngle-Math.PI/2,style:a,datum:i,id:i.id,label:i.id})}for(const t of e){const e=t.chordData;if(!e)continue;const i=m({source:Object.assign(Object.assign({},e.source),{startAngle:e.source.startAngle-Math.PI/2,endAngle:e.source.endAngle-Math.PI/2}),target:Object.assign(Object.assign({},e.target),{startAngle:e.target.startAngle-Math.PI/2,endAngle:e.target.endAngle-Math.PI/2})});if(!i)continue;const s=U(i,h,u);let n="#999";if(f)n=f(t).fill||n;else{const e="object"==typeof t.source?t.source:null,i="object"==typeof t.target?t.target:null;"target"===y&&i?n=p.get(i.id)||n:e&&(n=p.get(e.id)||n)}const r=f?f(t):{},c={fill:n,fillOpacity:null!==(o=r.fillOpacity)&&void 0!==o?o:a,stroke:r.stroke||"none",strokeWidth:r.strokeWidth,opacity:r.opacity};v.push({type:"ribbon",pathD:s,style:c,datum:t})}if(!1!==i.showLabels){const e=(k=i.nodeLabel)?"function"==typeof k?k:t=>t[k]||t.id:null,s=c+12;for(const i of t){const t=i.arcData;if(!t)continue;const n=e?e(i):i.id;if(!n)continue;const o=(t.startAngle+t.endAngle)/2,r=o-Math.PI/2;b.push({x:h+Math.cos(r)*s,y:u+Math.sin(r)*s,text:n+"",anchor:o>Math.PI?"end":"start",baseline:"middle",fontSize:11})}}var k;return{sceneNodes:x,sceneEdges:v,labels:b}}};function U(t,e,i){const s=t.match(/[a-zA-Z]|[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?/g);if(!s)return t;const n=[];let o=0;for(;s.length>o;){const t=s[o];if("M"===t||"L"===t)for(n.push(t),o++;s.length>o&&!isNaN(Number(s[o]));)n.push(Number(s[o])+e+""),o++,s.length>o&&!isNaN(Number(s[o]))&&(n.push(Number(s[o])+i+""),o++);else if("C"===t)for(n.push(t),o++;s.length>o&&!isNaN(Number(s[o]));)for(let t=0;3>t&&s.length>o&&!isNaN(Number(s[o]));t++)n.push(Number(s[o])+e+""),o++,s.length>o&&!isNaN(Number(s[o]))&&(n.push(Number(s[o])+i+""),o++);else if("Q"===t)for(n.push(t),o++;s.length>o&&!isNaN(Number(s[o]));)for(let t=0;2>t&&s.length>o&&!isNaN(Number(s[o]));t++)n.push(Number(s[o])+e+""),o++,s.length>o&&!isNaN(Number(s[o]))&&(n.push(Number(s[o])+i+""),o++);else if("A"===t)for(n.push(t),o++;s.length>o&&!isNaN(Number(s[o]));)n.push(s[o++]),s.length>o&&n.push(s[o++]),s.length>o&&n.push(s[o++]),s.length>o&&n.push(s[o++]),s.length>o&&n.push(s[o++]),s.length>o&&(n.push(Number(s[o])+e+""),o++),s.length>o&&(n.push(Number(s[o])+i+""),o++);else"Z"===t||"z"===t?(n.push(t),o++):(n.push(s[o]),o++)}return n.join(" ")}const J={supportsStreaming:!1,hierarchical:!0,computeLayout(t,e,i,s){var n;const o=i.__hierarchyRoot;if(!o)return;const r=i.chartType,a=(c=i.childrenAccessor)?"function"==typeof c?c:t=>t[c]:void 0;var c;const l=i.hierarchySum||(t=>{var e;return null!==(e=t.value)&&void 0!==e?e:0}),h=S(o,a);h.sum(l),h.sort((t,e)=>{var i,s;return(null!==(i=e.value)&&void 0!==i?i:0)-(null!==(s=t.value)&&void 0!==s?s:0)});const[u,d]=s;switch(r){case"tree":!function(t,e,i,s){const n=e.treeOrientation||"vertical",o=P();o.size("horizontal"===n?[s,i]:"radial"===n?[2*Math.PI,Math.min(i,s)/2*.8]:[i,s]),o(t)}(h,i,u,d);break;case"cluster":!function(t,e,i,s){const n=e.treeOrientation||"vertical",o=N();o.size("horizontal"===n?[s,i]:"radial"===n?[2*Math.PI,Math.min(i,s)/2*.8]:[i,s]),o(t)}(h,i,u,d);break;case"treemap":!function(t,e,i,s){var n,o;const r=null!==(n=e.padding)&&void 0!==n?n:4,a=null!==(o=e.paddingTop)&&void 0!==o?o:0,c=E().size([i,s]).tile(_).padding(r);a>0&&c.paddingTop(a),c(t)}(h,i,u,d);break;case"circlepack":!function(t,e,i,s){var n;const o=null!==(n=e.padding)&&void 0!==n?n:4;M().size([i,s]).padding(o)(t)}(h,i,u,d);break;case"partition":!function(t,e,i,s){var n;A().size([i,s]).padding(null!==(n=e.padding)&&void 0!==n?n:1)(t)}(h,i,u,d)}const f=h.descendants();t.length=0,e.length=0;const y=new Map;for(let e=0;f.length>e;e++){const s=f[e],o={id:st(s,i,e),x:0,y:0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:null!==(n=s.value)&&void 0!==n?n:0,depth:s.depth,data:s.data,createdByFrame:!0};"tree"===r||"cluster"===r?K(o,s,i):"treemap"===r||"partition"===r?tt(o,s):"circlepack"===r&&et(o,s),o.__hierarchyNode=s,t.push(o),y.set(s,o)}if("tree"===r||"cluster"===r)for(const t of f)if(t.parent){const i=y.get(t.parent),s=y.get(t);i&&s&&e.push({source:i,target:s,value:1,y0:0,y1:0,sankeyWidth:0,data:{depth:t.depth}})}},buildScene(t,e,i,s){const n=i.nodeStyle||(()=>({})),o=i.edgeStyle||(()=>({}));switch(i.chartType){case"tree":case"cluster":return function(t,e,i,s,n,o){var r,a,c,l,h;const u=[],d=[],f=[],y=i.treeOrientation||"vertical",g="radial"===y,p=s[0]/2,m=s[1]/2,x="number"==typeof(v=i.nodeSize)?v:5;var v;for(const e of t){let t=e.x,i=e.y;g&&(t+=p,i+=m);const s=n(e),o={fill:s.fill||"#4d430c",stroke:s.stroke||"#fff",strokeWidth:null!==(r=s.strokeWidth)&&void 0!==r?r:1,opacity:s.opacity};u.push({type:"circle",cx:t,cy:i,r:x,style:o,datum:e,id:e.id,label:e.id,depth:e.depth})}const b=null!==(a=i.edgeOpacity)&&void 0!==a?a:.5;for(const t of e){const e="object"==typeof t.source?t.source:null,i="object"==typeof t.target?t.target:null;if(!e||!i)continue;let s=e.x,n=e.y,r=i.x,a=i.y;g&&(s+=p,n+=m,r+=p,a+=m);const h=it(s,n,r,a,y),u=o(t),f={fill:"none",stroke:u.stroke||"#999",strokeWidth:null!==(c=u.strokeWidth)&&void 0!==c?c:1.5,opacity:null!==(l=u.opacity)&&void 0!==l?l:b};d.push({type:"curved",pathD:h,style:f,datum:t})}if(!1!==i.showLabels){const e=nt(i.nodeLabel);for(const i of t){const t=e?e(i):i.id;if(!t)continue;let s,n,o,r=i.x,a=i.y;if(g&&(r+=p,a+=m),g){const t=r-p,e=a-m,i=Math.sqrt(t*t+e*e);i>0?(s=r+t/i*10,n=a+e/i*10,o=0>t?"end":"start"):(s=r,n=a-12,o="middle")}else"horizontal"===y?((null===(h=i.data)||void 0===h?void 0:h.children)&&0!==i.data.children.length?(s=r-x-6,o="end"):(s=r+x+6,o="start"),n=a):(s=r,n=a+x+14,o="middle");f.push({x:s,y:n,text:t+"",anchor:o,baseline:"middle",fontSize:11})}}return{sceneNodes:u,sceneEdges:d,labels:f}}(t,e,i,s,n,o);case"treemap":case"partition":return function(t,e,i,s){var n,o;const r=[],a=[],c=["#e8d5b7","#b8d4e3","#d4e3b8","#e3c4d4","#d4d4e3","#e3d4b8","#b8e3d4","#e3b8b8"];for(const i of t){const t=i.x1-i.x0,o=i.y1-i.y0;if(0>=t||0>=o)continue;const a=s(i);let l=a.fill||"#4d430c";e.colorByDepth&&void 0!==i.depth&&(l=c[i.depth%c.length]);const h={fill:l,stroke:a.stroke||"#fff",strokeWidth:null!==(n=a.strokeWidth)&&void 0!==n?n:1,opacity:a.opacity};r.push({type:"rect",x:i.x0,y:i.y0,w:t,h:o,style:h,datum:i,id:i.id,label:i.id,depth:i.depth})}if(!1!==e.showLabels){const i=nt(e.nodeLabel);for(const s of t){const t=s.x1-s.x0,n=s.y1-s.y0;if(0>=t||0>=n)continue;if((null===(o=s.data)||void 0===o?void 0:o.children)&&s.data.children.length>0&&"partition"!==e.chartType)continue;const r=i?i(s):s.id;r&&(30>t||16>n||a.push({x:s.x0+t/2,y:s.y0+n/2,text:r+"",anchor:"middle",baseline:"middle",fontSize:Math.min(11,Math.max(8,Math.min(t,n)/6))}))}}return{sceneNodes:r,sceneEdges:[],labels:a}}(t,i,0,n);case"circlepack":return function(t,e,i,s){var n,o,r,a,c;const l=[],h=[],u=["#e8d5b7","#b8d4e3","#d4e3b8","#e3c4d4","#d4d4e3","#e3d4b8","#b8e3d4","#e3b8b8"];for(const i of t){const t=null!==(n=i.__radius)&&void 0!==n?n:5;if(0>=t)continue;const a=s(i);let c=a.fill||"#4d430c";e.colorByDepth&&void 0!==i.depth&&(c=u[i.depth%u.length]);const h={fill:c,stroke:a.stroke||"#fff",strokeWidth:null!==(o=a.strokeWidth)&&void 0!==o?o:1,opacity:null!==(r=a.opacity)&&void 0!==r?r:.7};l.push({type:"circle",cx:i.x,cy:i.y,r:t,style:h,datum:i,id:i.id,label:i.id,depth:i.depth})}if(!1!==e.showLabels){const i=nt(e.nodeLabel);for(const e of t){const t=null!==(a=e.__radius)&&void 0!==a?a:5,s=i?i(e):e.id;if(!s)continue;if(15>t)continue;const n=!((null===(c=e.data)||void 0===c?void 0:c.children)&&e.data.children.length>0);h.push({x:e.x,y:n?e.y:e.y-t+14,text:s+"",anchor:"middle",baseline:n?"middle":"hanging",fontSize:Math.min(11,Math.max(8,t/3)),fill:n?void 0:"#000",stroke:n?void 0:"#fff",strokeWidth:n?void 0:3,paintOrder:n?void 0:"stroke"})}}return{sceneNodes:l,sceneEdges:[],labels:h}}(t,i,0,n);default:return{sceneNodes:[],sceneEdges:[],labels:[]}}}};function K(t,e,i){const s=i.treeOrientation||"vertical";if("radial"===s){const i=e.x,s=e.y;t.x=s*Math.cos(i-Math.PI/2),t.y=s*Math.sin(i-Math.PI/2)}else"horizontal"===s?(t.x=e.y,t.y=e.x):(t.x=e.x,t.y=e.y);t.x0=t.x-5,t.x1=t.x+5,t.y0=t.y-5,t.y1=t.y+5,t.width=10,t.height=10}function tt(t,e){t.x0=e.x0,t.x1=e.x1,t.y0=e.y0,t.y1=e.y1,t.x=(e.x0+e.x1)/2,t.y=(e.y0+e.y1)/2,t.width=e.x1-e.x0,t.height=e.y1-e.y0}function et(t,e){var i;const s=null!==(i=e.r)&&void 0!==i?i:0;t.x=e.x,t.y=e.y,t.x0=e.x-s,t.x1=e.x+s,t.y0=e.y-s,t.y1=e.y+s,t.width=2*s,t.height=2*s,t.__radius=s}function it(t,e,i,s,n){if("horizontal"===n){const n=(t+i)/2;return`M ${t},${e} C ${n},${e} ${n},${s} ${i},${s}`}if("radial"===n){const n=(t+i)/2;return`M ${t},${e} Q ${n},${e} ${n},${(e+s)/2} T ${i},${s}`}{const n=(e+s)/2;return`M ${t},${e} C ${t},${n} ${i},${n} ${i},${s}`}}function st(t,e,i){const s=e.nodeIDAccessor;return"function"==typeof s?s(t.data)+"":"string"==typeof s&&void 0!==t.data[s]?t.data[s]+"":void 0!==t.data.name?t.data.name+"":void 0!==t.data.id?t.data.id+"":"node-"+i}function nt(t){return t?"function"==typeof t?t:e=>{var i;return(null===(i=e.data)||void 0===i?void 0:i[t])||e[t]||e.id}:null}const ot={sankey:H,force:F,chord:Q,tree:J,cluster:J,treemap:J,circlepack:J,partition:J};function rt(t,e){const{columns:i,config:s,resolvePieceStyle:n}=t,o=[],r=Math.min(e.width,e.height)/2-4,a="donut"===s.chartType?s.innerRadius||60:0,c=-Math.PI/2+(s.startAngle||0)*Math.PI/180,l=2*Math.PI;for(const t of Object.values(i)){const e=c+t.pctStart*l,i=c+(t.pctStart+t.pct)*l,s=n(t.pieceData[0],t.name);o.push({type:"wedge",cx:0,cy:0,innerRadius:a,outerRadius:r,startAngle:e,endAngle:i,style:s,datum:t.pieceData,category:t.name})}return o}const at={bar:function(t,e){const{scales:i,columns:s,config:n,getR:o,getStack:r,resolvePieceStyle:a}=t,{r:c,projection:l}=i,h=[],u="vertical"===l,d="horizontal"===l,f=n.normalize;for(const t of Object.values(s)){const e=new Map;for(const i of t.pieceData){const t=r?r(i):"_default";e.has(t)||e.set(t,{total:0,pieces:[]});const s=e.get(t);s.total+=o(i),s.pieces.push(i)}let i=0;if(f)for(const t of e.values())i+=Math.abs(t.total);let s=0,n=0;for(const[o,l]of e){let e=l.total;f&&i>0&&(e/=i);const y=a(l.pieces[0],r?o:t.name),g=Object.assign(Object.assign({},l.pieces[0]),{__aggregateValue:l.total,__pieceCount:l.pieces.length,category:t.name});if(u){const i=c(0>e?n:s+e),r=0>e?c(n+e)-c(n):c(s)-c(s+e);h.push(R(t.x,i,t.width,Math.abs(r),y,g,o)),0>e?n+=e:s+=e}else if(d){const i=c(0>e?n+e:s),r=0>e?c(n)-c(n+e):c(s+e)-c(s);h.push(R(i,t.x,Math.abs(r),t.width,y,g,o)),0>e?n+=e:s+=e}}}return h},clusterbar:function(t,e){const{scales:i,columns:s,getR:n,getGroup:o,resolvePieceStyle:r}=t,{r:a,projection:c}=i,l=[],h="vertical"===c,u=[],d=new Set;for(const t of Object.values(s))for(const e of t.pieceData){const t=o?o(e):"_default";d.has(t)||(d.add(t),u.push(t))}const f=u.length||1;for(const t of Object.values(s)){const e=t.width/f,i=new Map;for(const e of t.pieceData){const t=o?o(e):"_default";i.has(t)||i.set(t,[]),i.get(t).push(e)}for(let s=0;u.length>s;s++){const o=i.get(u[s])||[];for(const i of o){const o=n(i),c=r(i,t.name);if(h){const n=t.x+s*e,r=a(0),h=a(o);l.push(R(n,Math.min(r,h),e,Math.abs(r-h),c,i,u[s]))}else{const n=t.x+s*e,r=a(0),h=a(o);l.push(R(Math.min(r,h),n,Math.abs(h-r),e,c,i,u[s]))}}}}return l},point:function(t,e){var i,s;const{scales:n,columns:o,getR:r,multiScales:a,resolvePieceStyle:c}=t,{r:l,projection:h}=n,u=[],d="vertical"===h,f="radial"===h,y=a.length>0,g=2*Math.PI,p=-Math.PI/2;for(const t of Object.values(o))for(const e of t.pieceData){const n=null!==(i=e.__rIndex)&&void 0!==i?i:0,o=null!==(s=e.__rValue)&&void 0!==s?s:r(e),h=y&&a[n]||l,m=c(e,t.name),x=m.r||5;let v,b;if(f){const e=p+(t.pctStart+t.pct/2)*g,i=h(o);v=Math.cos(e)*i,b=Math.sin(e)*i}else d?(v=t.middle,b=h(o)):(v=h(o),b=t.middle);u.push({type:"point",x:v,y:b,r:x,style:m,datum:e})}return u},swarm:function(t,e){const{scales:i,columns:s,getR:n,resolvePieceStyle:o}=t,{r:r,projection:a}=i,c=[],l="vertical"===a;for(const t of Object.values(s)){const e=t.width/2;for(let i=0;t.pieceData.length>i;i++){const s=t.pieceData[i],a=n(s),h=o(s,t.name),u=h.r||4,d=(7919*i%100/100-.5)*e*.8,f=l?t.middle+d:r(a),y=l?r(a):t.middle+d;c.push({type:"point",x:f,y:y,r:u,style:h,datum:s})}}return c},pie:rt,donut:rt,boxplot:function(t,e){var i,s,n,o,r;const{scales:a,columns:c,config:l,getR:h,resolveSummaryStyle:u}=t,{r:d,projection:f}=a,y=[],g="vertical"===f,p=!1!==l.showOutliers;for(const t of Object.values(c)){const e=t.pieceData.map(t=>h(t)).filter(t=>null!=t&&!isNaN(t)).sort((t,e)=>t-e);if(0===e.length)continue;const a=e[0],c=e[e.length-1],l=null!==(i=b(e,.25))&&void 0!==i?i:a,f=null!==(s=b(e,.5))&&void 0!==s?s:(a+c)/2,m=null!==(n=b(e,.75))&&void 0!==n?n:c,x=m-l,v=l-1.5*x,w=m+1.5*x,k=null!==(o=e.find(t=>t>=v))&&void 0!==o?o:a,S=null!==(r=[...e].reverse().find(t=>w>=t))&&void 0!==r?r:c,A=u(t.pieceData[0],t.name),M=[];if(p)for(const e of t.pieceData){const i=h(e);if(v>i||i>w){const s=g?t.middle:d(i),n=g?d(i):t.middle;M.push({px:s,py:n,value:i,datum:e})}}if(y.push({type:"boxplot",x:g?t.middle:0,y:g?0:t.middle,projection:g?"vertical":"horizontal",columnWidth:.6*t.width,minPos:d(k),q1Pos:d(l),medianPos:d(f),q3Pos:d(m),maxPos:d(S),stats:{min:k,q1:l,median:f,q3:m,max:S},style:A,datum:t.pieceData,category:t.name,outliers:M}),p)for(const t of M)y.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:A.fill||"#999",opacity:.6},datum:t.datum})}return y},violin:function(t,e){var i,s,n;const{scales:o,columns:r,config:a,getR:c,resolveSummaryStyle:l}=t,{r:h,projection:u}=o,d=[],f="vertical"===u,y=a.bins||20,g=!1!==a.showIQR;for(const t of Object.values(r)){const e=t.pieceData.map(t=>c(t)).filter(t=>null!=t&&!isNaN(t)).sort((t,e)=>t-e);if(2>e.length)continue;const o=e[0],r=e[e.length-1],a=(r-o)/y||1,u=Array(y).fill(0);for(const t of e)u[Math.min(Math.floor((t-o)/a),y-1)]++;const p=Math.max(...u,1),m=t.width/2*.9;let x="";if(f){for(let e=0;y>e;e++){const i=h(o+(e+.5)*a),s=u[e]/p*m;x+=0===e?`M ${t.middle+s} ${i}`:` L ${t.middle+s} ${i}`}for(let e=y-1;e>=0;e--){const i=h(o+(e+.5)*a);x+=` L ${t.middle-u[e]/p*m} ${i}`}x+=" Z"}else{for(let e=0;y>e;e++){const i=h(o+(e+.5)*a),s=u[e]/p*m;x+=0===e?`M ${i} ${t.middle-s}`:` L ${i} ${t.middle-s}`}for(let e=y-1;e>=0;e--)x+=` L ${h(o+(e+.5)*a)} ${t.middle+u[e]/p*m}`;x+=" Z"}const v=l(t.pieceData[0],t.name);let w;if(g&&e.length>=4){const t=null!==(i=b(e,.25))&&void 0!==i?i:o,a=null!==(s=b(e,.5))&&void 0!==s?s:(o+r)/2,c=null!==(n=b(e,.75))&&void 0!==n?n:r;w={q1Pos:h(t),medianPos:h(a),q3Pos:h(c)}}const k=f?{x:t.x,y:Math.min(h(r),h(o)),width:t.width,height:Math.abs(h(r)-h(o))}:{x:Math.min(h(o),h(r)),y:t.x,width:Math.abs(h(r)-h(o)),height:t.width};d.push({type:"violin",pathString:x,translateX:0,translateY:0,bounds:k,iqrLine:w,style:v,datum:t.pieceData,category:t.name})}return d},histogram:function(t,e){const{scales:i,columns:s,config:n,getR:o,resolveSummaryStyle:r}=t,{r:a}=i,c=[],l=n.bins||25,h=n.normalize;for(const t of Object.values(s)){const e=t.pieceData.map(t=>o(t)).filter(t=>null!=t&&!isNaN(t));if(0===e.length)continue;const i=Math.min(...e),s=(Math.max(...e)-i)/l||1,n=Array(l).fill(0);for(const t of e)n[Math.min(Math.floor((t-i)/s),l-1)]++;const u=e.length,d=Math.max(...n,1),f=r(t.pieceData[0],t.name);for(let e=0;l>e;e++){if(0===n[e])continue;const o=(h?n[e]/u:n[e]/d)*t.width*.9,r=a(i+e*s),l=a(i+(e+1)*s);c.push(R(Math.min(r,l),t.x+t.width-o,Math.abs(l-r),o,f,{bin:e,count:n[e],range:[i+e*s,i+(e+1)*s],category:t.name},t.name))}}return c},ridgeline:function(t,e){var i;const{scales:s,columns:n,config:o,getR:r,resolveSummaryStyle:a}=t,{r:c,projection:l}=s,h=[],u=o.bins||20,d="horizontal"===l,f=o.amplitude||1.5;for(const t of Object.values(n)){const e=t.pieceData.map(t=>r(t)).filter(t=>null!=t&&!isNaN(t)).sort((t,e)=>t-e);if(2>e.length)continue;const s=e[0],n=e[e.length-1],o=(n-s)/u||1,l=Array(u).fill(0);for(const t of e)l[Math.min(Math.floor((t-s)/o),u-1)]++;const y=Math.max(...l,1),g=a(t.pieceData[0],t.name),p=t.width*f;let m="";if(d){const e=t.x+t.width;m=`M ${c(s)} ${e}`;for(let t=0;u>t;t++)m+=` L ${c(s+(t+.5)*o)} ${e-l[t]/y*p}`;m+=` L ${c(n)} ${e} Z`}else{const e=t.x;m=`M ${e} ${c(s)}`;for(let t=0;u>t;t++){const i=c(s+(t+.5)*o);m+=` L ${e+l[t]/y*p} ${i}`}m+=` L ${e} ${c(n)} Z`}const x=d?{x:Math.min(c(s),c(n)),y:t.x,width:Math.abs(c(n)-c(s)),height:t.width}:{x:t.x,y:Math.min(c(n),c(s)),width:t.width,height:Math.abs(c(n)-c(s))};h.push({type:"violin",pathString:m,translateX:0,translateY:0,bounds:x,style:Object.assign(Object.assign({},g),{fillOpacity:null!==(i=g.fillOpacity)&&void 0!==i?i:.5}),datum:t.pieceData,category:t.name})}return h},timeline:function(t,e){const{scales:i,columns:s,getRawRange:n,resolvePieceStyle:o}=t,{r:r,projection:a}=i,c=[],l="horizontal"===a;for(const t of Object.values(s))for(const e of t.pieceData){const i=n(e);if(!i)continue;const[s,a]=i,h=o(e,t.name);if(l){const i=r(Math.min(s,a)),n=r(Math.max(s,a));c.push(R(i,t.x,n-i,t.width,h,e,t.name))}else{const i=r(Math.max(s,a)),n=r(Math.min(s,a));c.push(R(t.x,i,t.width,n-i,h,e,t.name))}}return c}};class ct{constructor(t){this.rExtent=new $,this.rExtents=[],this.rAccessors=[],this.categories=new Set,this._colorSchemeMap=null,this._colorSchemeIndex=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=new Map,this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.version=0,this.config=t,this.buffer=new W(t.windowSize),this.getO=C(t.oAccessor||t.categoryAccessor,"category");const e="streaming"===t.runtimeMode,i=t.rAccessor;Array.isArray(i)?(this.rAccessors=i.map(t=>L(t,"value")),this.getR=this.rAccessors[0],this.rExtents=i.map(()=>new $)):(this.getR=L(e&&(t.timeAccessor||t.valueAccessor)&&t.valueAccessor||i,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=C(t.stackBy),this.getGroup=C(t.groupBy),this.getColor=C(t.colorAccessor),this.getConnector=C(t.connectorAccessor),t.pulse&&(this.timestampBuffer=new W(t.windowSize))}ingest(t){const e="undefined"!=typeof performance?performance.now():Date.now();if(this.lastIngestTime=e,t.bounded){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear();const i=t.totalSize||t.inserts.length;i>this.buffer.capacity&&(this.buffer.resize(i),this.timestampBuffer&&i>this.timestampBuffer.capacity&&this.timestampBuffer.resize(i));for(const i of t.inserts)this.buffer.push(i),this.timestampBuffer&&this.timestampBuffer.push(e),this.categories.add(this.getO(i)),this.pushValueExtent(i)}else for(const i of t.inserts){const t=this.buffer.push(i);this.timestampBuffer&&this.timestampBuffer.push(e),this.categories.add(this.getO(i)),this.pushValueExtent(i),null!=t&&this.evictValueExtent(t)}return!0}pushValueExtent(t){if("timeline"===this.config.chartType){const e=this.getRawRange(t);e&&(this.rExtent.push(e[0]),this.rExtent.push(e[1]))}else if(this.rAccessors.length>1){for(let e=0;this.rAccessors.length>e;e++)this.rExtents[e].push(this.rAccessors[e](t));this.rExtent.push(this.getR(t))}else this.rExtent.push(this.getR(t))}evictValueExtent(t){if("timeline"===this.config.chartType){const e=this.getRawRange(t);e&&(this.rExtent.evict(e[0]),this.rExtent.evict(e[1]))}else if(this.rAccessors.length>1){for(let e=0;this.rAccessors.length>e;e++)this.rExtents[e].evict(this.rAccessors[e](t));this.rExtent.evict(this.getR(t))}else this.rExtent.evict(this.getR(t))}getRawRange(t){const e=this.config.rAccessor;if(!e)return null;const i="function"==typeof e?e(t):t[e];return Array.isArray(i)&&i.length>=2?[+i[0],+i[1]]:null}computeScene(t){const{config:e,buffer:i}=this;if(0===i.size)return this.scales=null,this.scene=[],this.columns={},void this.version++;this.rExtent.dirty&&this.rExtent.recalculate(i,this.getR);const s=i.toArray(),r=e.projection||"vertical",a=e.oExtent||this.resolveCategories(s),c=this.computeValueDomain(s,a),l="horizontal"===r,h=null!=e.barPadding?e.barPadding/("vertical"===r?t.width:t.height):.1;let u,d;if("radial"===r){u=o().domain(a).range([0,1]).padding(0);const i=Math.min(t.width,t.height)/2,s=e.innerRadius||0;d=n().domain(c).range([s,i])}else l?(u=o().domain(a).range([0,t.height]).padding(h),d=n().domain(c).range([0,t.width])):(u=o().domain(a).range([0,t.width]).padding(h),d=n().domain(c).range([t.height,0]));this.scales={o:u,r:d,projection:r},this.multiScales=this.rAccessors.length>1&&e.multiAxis?this.rAccessors.map((s,o)=>{const r=this.rExtents[o];r.dirty&&r.recalculate(i,s);let[a,c]=r.extent;a===1/0&&(a=0,c=1);const h=c-a,u=h>0?h*(e.extentPadding||.05):1;return a-=u,c+=u,a>0&&(a=0),l?n().domain([a,c]).range([0,t.width]):n().domain([a,c]).range([t.height,0])}):[];let f=s;this.rAccessors.length>1&&(f=s.flatMap(t=>this.rAccessors.map((e,i)=>Object.assign(Object.assign({},t),{__rIndex:i,__rValue:e(t),__rName:this.resolveRAccessorName(i)})))),this.columns=this.buildColumns(f,a,u,r,t),this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=this.buildSceneNodes(f,t),this.config.decay&&this.applyDecay(this.scene,s),this.config.pulse&&this.applyPulse(this.scene,s),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++}resolveRAccessorName(t){const e=Array.isArray(this.config.rAccessor)?this.config.rAccessor[t]:this.config.rAccessor;return"string"==typeof e?e:"value"+t}resolveCategories(t){const e=Array.from(this.categories),i=this.config.oSort;if("streaming"===this.config.runtimeMode&&void 0===i)return e;if(!1===i)return e;if("function"==typeof i)return e.sort(i);const s=new Map;for(const e of t){const t=this.getO(e);s.set(t,(s.get(t)||0)+Math.abs(this.getR(e)))}return e.sort("asc"===i?(t,e)=>(s.get(t)||0)-(s.get(e)||0):(t,e)=>(s.get(e)||0)-(s.get(t)||0))}computeValueDomain(t,e){var i,s;const n=this.config.chartType,o=this.config.extentPadding||.05;if("radial"===this.config.projection&&("pie"===n||"donut"===n))return[0,1];let r=0,a=0;if("bar"===n&&this.getStack){const e=new Map,i=new Map;for(const s of t){const t=this.getO(s),n=this.getR(s);0>n?i.set(t,(i.get(t)||0)+n):e.set(t,(e.get(t)||0)+n)}for(const t of e.values())t>a&&(a=t);for(const t of i.values())r>t&&(r=t)}else if("bar"===n){const e=new Map;for(const i of t){const t=this.getO(i),s=this.getR(i);e.set(t,(e.get(t)||0)+s)}for(const t of e.values())t>a&&(a=t),r>t&&(r=t)}else if("clusterbar"===n)for(const e of t){const t=this.getR(e);t>a&&(a=t),r>t&&(r=t)}else{const t=this.rExtent.extent[0],e=this.rExtent.extent[1];t!==1/0&&(r=t),e!==-1/0&&(a=e)}this.config.rExtent&&(null!=this.config.rExtent[0]&&(r=this.config.rExtent[0]),null!=this.config.rExtent[1]&&(a=this.config.rExtent[1]));const c=a-r,l=c>0?c*o:1;return(null===(i=this.config.rExtent)||void 0===i?void 0:i[0])||(r-=l),(null===(s=this.config.rExtent)||void 0===s?void 0:s[1])||(a+=l),"bar"!==n&&"clusterbar"!==n||(r>0&&(r=0),0>a&&(a=0)),[r,a]}buildColumns(t,e,i,s,n){var o;const r={},a=new Map;for(const e of t){const t=this.getO(e);a.has(t)||a.set(t,[]),a.get(t).push(e)}let c=0;if("radial"===s)for(const e of t)c+=Math.abs(this.getR(e));const l=this.config.dynamicColumnWidth;let h=null;if(l&&"radial"!==s){h=new Map;let t=0;for(const i of e){const e=a.get(i)||[];let s;s="string"==typeof l?e.reduce((t,e)=>t+(Number(e[l])||0),0):l(e),h.set(i,s),t+=s}const o=("horizontal"===s?n.height:n.width)-i.padding()*i.step()*e.length;if(t>0)for(const[e,i]of h)h.set(e,i/t*o)}let u=0,d=0;for(const t of e){const e=a.get(t)||[],s=e.reduce((t,e)=>t+Math.abs(this.getR(e)),0),n=c>0?s/c:0;let l,f;h?(l=d,f=h.get(t)||i.bandwidth(),d+=f+i.padding()*i.step()):(l=null!==(o=i(t))&&void 0!==o?o:0,f=i.bandwidth()),r[t]={name:t,x:l,y:0,width:f,middle:l+f/2,padding:i.padding()*i.step(),pieceData:e,pct:n,pctStart:u},u+=n}return r}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(t,e)=>this.resolvePieceStyle(t,e),resolveSummaryStyle:(t,e)=>this.resolveSummaryStyle(t,e),getRawRange:t=>this.getRawRange(t)}}buildSceneNodes(t,e){if(!this.scales)return[];const i=this.getSceneContext(),s=at[this.config.chartType];let n=s?s(i,e):[];if(this.getConnector&&this.scales){const t=function(t,e){const{scales:i,config:s,getConnector:n,getO:o}=t;if(!n||!i)return[];const r=[],{projection:a}=i,c=new Map;for(const t of e){if("point"!==t.type&&"rect"!==t.type)continue;const e=t.datum;if(!e)continue;const i=n(e);if(!i)continue;let s,r;"point"===t.type?(s=t.x,r=t.y):(s=t.x+t.w/2,r=t.y+("vertical"===a?0:t.h/2)),c.has(i)||c.set(i,[]),c.get(i).push({x:s,y:r,datum:e,category:o(e)})}const l=i.o.domain(),h=s.connectorStyle;for(const[t,e]of c)if(e.length>=2){e.sort((t,e)=>l.indexOf(t.category)-l.indexOf(e.category));for(let i=0;e.length-1>i;i++){const s=e[i],n=e[i+1],o="function"==typeof h?h(s.datum):h||{stroke:"#999",strokeWidth:1,opacity:.5};r.push({type:"connector",x1:s.x,y1:s.y,x2:n.x,y2:n.y,style:o,datum:s.datum,group:t})}}return r}(i,n);n=[...t,...n]}return n}resolvePieceStyle(t,e){return"function"==typeof this.config.pieceStyle?this.config.pieceStyle(t,e):this.config.pieceStyle&&"object"==typeof this.config.pieceStyle?this.config.pieceStyle:this.config.barColors&&e?{fill:this.config.barColors[e]||"#007bff"}:e?{fill:this.getColorFromScheme(e)}:{fill:"#007bff"}}getColorFromScheme(t){this._colorSchemeMap||(this._colorSchemeMap=new Map);const e=this._colorSchemeMap.get(t);if(e)return e;const i=Array.isArray(this.config.colorScheme)?this.config.colorScheme:["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],s=i[this._colorSchemeIndex%i.length];return this._colorSchemeIndex++,this._colorSchemeMap.set(t,s),s}resolveSummaryStyle(t,e){return"function"==typeof this.config.summaryStyle?this.config.summaryStyle(t,e):this.config.summaryStyle&&"object"==typeof this.config.summaryStyle?this.config.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}computeDecayOpacity(t,e){var i,s,n;const o=this.config.decay;if(!o||1>=e)return 1;const r=null!==(i=o.minOpacity)&&void 0!==i?i:.1,a=e-1-t;switch(o.type){case"linear":return r+(1-a/(e-1))*(1-r);case"exponential":{const t=null!==(s=o.halfLife)&&void 0!==s?s:e/2;return r+Math.pow(.5,a/t)*(1-r)}case"step":return(null!==(n=o.stepThreshold)&&void 0!==n?n:.5*e)>a?1:r;default:return 1}}applyDecay(t,e){var i,s;if(!this.config.decay)return;const n=e.length;if(1>=n)return;const o=new Map;for(let t=0;e.length>t;t++)o.set(e[t],t);for(const e of t){if("connector"===e.type||"violin"===e.type||"boxplot"===e.type||"wedge"===e.type)continue;const t=o.get(e.datum);if(null==t)continue;const r=this.computeDecayOpacity(t,n),a=null!==(s=null===(i=e.style)||void 0===i?void 0:i.opacity)&&void 0!==s?s:1;e.style=Object.assign(Object.assign({},e.style),{opacity:a*r})}}applyPulse(t,e){var i,s;if(!this.config.pulse||!this.timestampBuffer)return;const n="undefined"!=typeof performance?performance.now():Date.now(),o=null!==(i=this.config.pulse.duration)&&void 0!==i?i:500,r=null!==(s=this.config.pulse.color)&&void 0!==s?s:"rgba(255,255,255,0.6)",a=new Map;for(let t=0;e.length>t;t++)a.set(e[t],t);for(const e of t){if("connector"===e.type||"violin"===e.type||"boxplot"===e.type||"wedge"===e.type)continue;const t=a.get(e.datum);if(null==t)continue;const i=this.timestampBuffer.get(t);if(null==i)continue;const s=n-i;o>s&&(e._pulseIntensity=1-s/o,e._pulseColor=r)}}get hasActivePulses(){var t;if(!this.config.pulse||!this.timestampBuffer||0===this.timestampBuffer.size)return!1;const e="undefined"!=typeof performance?performance.now():Date.now(),i=null!==(t=this.config.pulse.duration)&&void 0!==t?t:500,s=this.timestampBuffer.peek();return null!=s&&i>e-s}snapshotPositions(){var t,e;this.prevPositionMap.clear();for(let i=0;this.scene.length>i;i++){const s=this.scene[i];if("point"===s.type)this.prevPositionMap.set("p:"+i,{x:s.x,y:s.y,r:s.r});else if("rect"===s.type){const n=`r:${s.group||""}:${null!==(e=null===(t=s.datum)||void 0===t?void 0:t.category)&&void 0!==e?e:i}`;this.prevPositionMap.set(n,{x:s.x,y:s.y,w:s.w,h:s.h})}}}startTransition(){var t,e,i,s,n;if(!this.config.transition||0===this.prevPositionMap.size)return;const o=null!==(t=this.config.transition.duration)&&void 0!==t?t:300;let r=!1;for(let t=0;this.scene.length>t;t++){const o=this.scene[t];let a=null;if("point"===o.type?a="p:"+t:"rect"===o.type&&(a=`r:${o.group||""}:${null!==(i=null===(e=o.datum)||void 0===e?void 0:e.category)&&void 0!==i?i:t}`),!a)continue;const c=this.prevPositionMap.get(a);c&&("point"===o.type?c.x===o.x&&c.y===o.y||(o._targetX=o.x,o._targetY=o.y,o.x=c.x,o.y=c.y,r=!0):"rect"===o.type&&(c.x===o.x&&c.y===o.y&&c.w===o.w&&c.h===o.h||(o._targetX=o.x,o._targetY=o.y,o._targetW=o.w,o._targetH=o.h,o.x=c.x,o.y=c.y,o.w=null!==(s=c.w)&&void 0!==s?s:o.w,o.h=null!==(n=c.h)&&void 0!==n?n:o.h,r=!0)))}r&&(this.activeTransition={startTime:"undefined"!=typeof performance?performance.now():Date.now(),duration:o})}advanceTransition(t){var e,i,s;if(!this.activeTransition)return!1;const n=Math.min((t-this.activeTransition.startTime)/this.activeTransition.duration,1),o="linear"===(null===(e=this.config.transition)||void 0===e?void 0:e.easing)?n:1-Math.pow(1-n,3);for(const t of this.scene)if("point"===t.type){if(void 0===t._targetX)continue;const e=this.prevPositionMap.get("p:0");if(!e)continue;t.x=e.x+(t._targetX-e.x)*o,t.y=e.y+(t._targetY-e.y)*o}else if("rect"===t.type){if(void 0===t._targetX)continue;const e=`r:${t.group||""}:${null!==(s=null===(i=t.datum)||void 0===i?void 0:i.category)&&void 0!==s?s:0}`,n=this.prevPositionMap.get(e);if(!n)continue;t.x=n.x+(t._targetX-n.x)*o,t.y=n.y+(t._targetY-n.y)*o,void 0!==n.w&&(t.w=n.w+(t._targetW-n.w)*o,t.h=n.h+(t._targetH-n.h)*o)}if(n>=1){for(const t of this.scene)if("point"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t._targetX=void 0,t._targetY=void 0}else if("rect"===t.type){if(void 0===t._targetX)continue;t.x=t._targetX,t.y=t._targetY,t.w=t._targetW,t.h=t._targetH,t._targetX=void 0,t._targetY=void 0,t._targetW=void 0,t._targetH=void 0}return this.activeTransition=null,!1}return!0}getData(){return this.buffer.toArray()}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.version++}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}updateConfig(t){t.colorScheme!==this.config.colorScheme&&(this._colorSchemeMap=null,this._colorSchemeIndex=0),Object.assign(this.config,t)}}function lt(t){return Math.round(100*t)/100+""}function ht(e){var i,s,n,o;const r=e.size||[500,300],a=Object.assign(Object.assign({},{top:20,right:20,bottom:30,left:40}),e.margin),c=r[0]-a.left-a.right,l=r[1]-a.top-a.bottom,h="streaming"===e.runtimeMode||["bar","swarm","waterfall"].includes(e.chartType),u={chartType:e.chartType,windowSize:null!==(i=e.windowSize)&&void 0!==i?i:200,windowMode:null!==(s=e.windowMode)&&void 0!==s?s:"sliding",arrowOfTime:h&&null!==(n=e.arrowOfTime)&&void 0!==n?n:"right",extentPadding:null!==(o=e.extentPadding)&&void 0!==o?o:.1,xAccessor:h?void 0:e.xAccessor,yAccessor:h?void 0:e.yAccessor,timeAccessor:h?e.timeAccessor:void 0,valueAccessor:e.valueAccessor,colorAccessor:e.colorAccessor,sizeAccessor:e.sizeAccessor,groupAccessor:e.groupAccessor,categoryAccessor:e.categoryAccessor,lineDataAccessor:e.lineDataAccessor,xExtent:e.xExtent,yExtent:e.yExtent,sizeRange:e.sizeRange,binSize:e.binSize,normalize:e.normalize,boundsAccessor:e.boundsAccessor,boundsStyle:e.boundsStyle,openAccessor:e.openAccessor,highAccessor:e.highAccessor,lowAccessor:e.lowAccessor,closeAccessor:e.closeAccessor,candlestickStyle:e.candlestickStyle,lineStyle:e.lineStyle,pointStyle:e.pointStyle,areaStyle:e.areaStyle,colorScheme:e.colorScheme,barColors:e.barColors},d=new T(u);if(e.data&&d.ingest({inserts:e.data,bounded:!0}),d.computeScene({width:c,height:l}),!d.scales||0===d.scene.length)return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-xy-frame",width:r[0],height:r[1]}));const f=d.scene.map((e,i)=>function(e,i){var s,n,o;switch(e.type){case"line":{const s=e;if(0===s.path.length)return null;const n="M"+s.path.map(([t,e])=>`${t},${e}`).join("L");return t.createElement("path",{key:"line-"+i,d:n,fill:"none",stroke:s.style.stroke||"#4e79a7",strokeWidth:s.style.strokeWidth||2,strokeDasharray:s.style.strokeDasharray,opacity:s.style.opacity})}case"area":{const o=e;if(0===o.topPath.length)return null;const r=o.topPath.map(([t,e])=>`${t},${e}`).join("L"),a=[...o.bottomPath].reverse().map(([t,e])=>`${t},${e}`).join("L");return t.createElement("path",{key:"area-"+i,d:`M${r}L${a}Z`,fill:o.style.fill||"#4e79a7",fillOpacity:null!==(n=null!==(s=o.style.fillOpacity)&&void 0!==s?s:o.style.opacity)&&void 0!==n?n:.7,stroke:o.style.stroke,strokeWidth:o.style.strokeWidth})}case"point":return t.createElement("circle",{key:"point-"+i,cx:e.x,cy:e.y,r:e.r,fill:e.style.fill||"#4e79a7",opacity:null!==(o=e.style.opacity)&&void 0!==o?o:.8,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth});case"rect":return t.createElement("rect",{key:"rect-"+i,x:e.x,y:e.y,width:e.w,height:e.h,fill:e.style.fill||"#4e79a7",opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth});case"heatcell":return t.createElement("rect",{key:"heatcell-"+i,x:e.x,y:e.y,width:e.w,height:e.h,fill:e.fill});case"candlestick":{const s=e,n=Math.min(s.openY,s.closeY),o=Math.max(Math.abs(s.openY-s.closeY),1),r=s.isUp?s.upColor:s.downColor;return t.createElement("g",{key:"candle-"+i},t.createElement("line",{x1:s.x,y1:s.highY,x2:s.x,y2:s.lowY,stroke:s.wickColor,strokeWidth:s.wickWidth}),t.createElement("rect",{x:s.x-s.bodyWidth/2,y:n,width:s.bodyWidth,height:o,fill:r,stroke:r,strokeWidth:1}))}default:return null}}(e,i)).filter(Boolean),y=!1!==e.showAxes?function(e,i,s){var n,o,r,a;const c=e.x.ticks(5).map(t=>({pixel:e.x(t),label:(s.xFormat||s.tickFormatTime||lt)(t)})),l=e.y.ticks(5).map(t=>({pixel:e.y(t),label:(s.yFormat||s.tickFormatValue||lt)(t)}));return t.createElement("g",{className:"stream-axes"},t.createElement("line",{x1:0,y1:i.height,x2:i.width,y2:i.height,stroke:"#ccc",strokeWidth:1}),c.map((e,s)=>t.createElement("g",{key:"xtick-"+s,transform:`translate(${e.pixel},${i.height})`},t.createElement("line",{y2:5,stroke:"#ccc",strokeWidth:1}),t.createElement("text",{y:18,textAnchor:"middle",fontSize:10,fill:"#666"},e.label))),s.xLabel&&t.createElement("text",{x:i.width/2,y:i.height+40,textAnchor:"middle",fontSize:12,fill:"#333"},s.xLabel),t.createElement("line",{x1:0,y1:0,x2:0,y2:i.height,stroke:"#ccc",strokeWidth:1}),l.map((e,i)=>t.createElement("g",{key:"ytick-"+i,transform:`translate(0,${e.pixel})`},t.createElement("line",{x2:-5,stroke:"#ccc",strokeWidth:1}),t.createElement("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"#666"},e.label))),s.yLabel&&t.createElement("text",{x:15-(null!==(o=null===(n=s.margin)||void 0===n?void 0:n.left)&&void 0!==o?o:40),y:i.height/2,textAnchor:"middle",fontSize:12,fill:"#333",transform:`rotate(-90, ${15-(null!==(a=null===(r=s.margin)||void 0===r?void 0:r.left)&&void 0!==a?a:40)}, ${i.height/2})`},s.yLabel))}(d.scales,{width:c,height:l},e):null,g=e.title&&"string"==typeof e.title?t.createElement("text",{x:r[0]/2,y:16,textAnchor:"middle",fontSize:14,fontWeight:"bold",fill:"#333"},e.title):null,p=e.background?t.createElement("rect",{x:0,y:0,width:c,height:l,fill:e.background}):null;return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-xy-frame"+(e.className?" "+e.className:""),width:r[0],height:r[1]},t.createElement("g",{transform:`translate(${a.left},${a.top})`},p,f,y),g))}function ut(t,e){return t?"function"==typeof t?t:e=>e[t]:t=>t[e]}const dt=new Set(["tree","cluster","treemap","circlepack","partition"]);function ft(e){const i=e.chartType||"force",n=e.size||[500,500],o=Object.assign(Object.assign({},{top:20,right:20,bottom:20,left:20}),e.margin),r=n[0]-o.left-o.right,a=n[1]-o.top-o.bottom,c=function(t){return ot[t]}(i);if(!c)throw Error(`No layout plugin found for chart type: "${i}". Supported types: force, sankey, chord, tree, cluster, treemap, circlepack, partition.`);const l={chartType:i,nodeIDAccessor:e.nodeIDAccessor,sourceAccessor:e.sourceAccessor,targetAccessor:e.targetAccessor,valueAccessor:e.valueAccessor,childrenAccessor:e.childrenAccessor,hierarchySum:e.hierarchySum,orientation:e.orientation,nodeAlign:e.nodeAlign,nodePaddingRatio:e.nodePaddingRatio,nodeWidth:e.nodeWidth,iterations:e.iterations,forceStrength:e.forceStrength,padAngle:e.padAngle,groupWidth:e.groupWidth,sortGroups:e.sortGroups,edgeSort:e.edgeSort,treeOrientation:e.treeOrientation,edgeType:e.edgeType,padding:e.padding,paddingTop:e.paddingTop,nodeStyle:e.nodeStyle,edgeStyle:e.edgeStyle,nodeLabel:e.nodeLabel,showLabels:e.showLabels,colorBy:e.colorBy,colorScheme:e.colorScheme,edgeColorBy:e.edgeColorBy,edgeOpacity:e.edgeOpacity,colorByDepth:e.colorByDepth,nodeSize:e.nodeSize,nodeSizeRange:e.nodeSizeRange};let h,u;if(dt.has(i)){const i=e.data||e.edges;if(!i||Array.isArray(i))return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-network-frame",width:n[0],height:n[1]}));l.__hierarchyRoot=i,h=[],u=[]}else{const i=e.nodes||[],s=Array.isArray(e.edges)?e.edges:[];if(0===i.length&&0===s.length)return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-network-frame",width:n[0],height:n[1]}));h=function(t,e){const i=ut(e.nodeIDAccessor,"id");return t.map(t=>({id:i(t)+"",x:0,y:0,x0:0,x1:0,y0:0,y1:0,width:0,height:0,value:0,data:t}))}(i,l),u=function(t,e){const i=ut(e.sourceAccessor,"source"),s=ut(e.targetAccessor,"target"),n=ut(e.valueAccessor,"value");return t.map(t=>({source:i(t)+"",target:s(t)+"",value:Number(n(t))||1,y0:0,y1:0,sankeyWidth:0,data:t}))}(s,l)}c.computeLayout(h,u,l,[r,a]);const{sceneNodes:d,sceneEdges:f,labels:y}=c.buildScene(h,u,l,[r,a]),g=f.map((e,i)=>function(e,i){switch(e.type){case"line":return t.createElement("line",{key:"net-edge-line-"+i,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth||1,opacity:e.style.opacity});case"bezier":return t.createElement("path",{key:"net-edge-bezier-"+i,d:e.pathD,fill:e.style.fill||"#999",fillOpacity:e.style.fillOpacity,stroke:e.style.stroke||"none",strokeWidth:e.style.strokeWidth,opacity:e.style.opacity});case"ribbon":return t.createElement("path",{key:"net-edge-ribbon-"+i,d:e.pathD,fill:e.style.fill||"#999",fillOpacity:e.style.fillOpacity,stroke:e.style.stroke||"none",strokeWidth:e.style.strokeWidth,opacity:e.style.opacity});case"curved":return t.createElement("path",{key:"net-edge-curved-"+i,d:e.pathD,fill:e.style.fill||"none",stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth||1,opacity:e.style.opacity});default:return null}}(e,i)).filter(Boolean),p=d.map((e,i)=>function(e,i){switch(e.type){case"circle":return t.createElement("circle",{key:"net-circle-"+i,cx:e.cx,cy:e.cy,r:e.r,fill:e.style.fill||"#4e79a7",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,opacity:e.style.opacity});case"rect":return t.createElement("rect",{key:"net-rect-"+i,x:e.x,y:e.y,width:e.w,height:e.h,fill:e.style.fill||"#4e79a7",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth,opacity:e.style.opacity});case"arc":{const n=e,o=s().innerRadius(n.innerR).outerRadius(n.outerR).startAngle(n.startAngle).endAngle(n.endAngle)({})||"";return t.createElement("path",{key:"net-arc-"+i,d:o,transform:`translate(${n.cx},${n.cy})`,fill:n.style.fill||"#4e79a7",stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n.style.opacity})}default:return null}}(e,i)).filter(Boolean),m=y.map((e,i)=>function(e,i){return t.createElement("text",{key:"net-label-"+i,x:e.x,y:e.y,textAnchor:e.anchor||"middle",dominantBaseline:e.baseline||"auto",fontSize:e.fontSize||11,fontWeight:e.fontWeight,fill:e.fill||"#333",stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:e.paintOrder},e.text)}(e,i)).filter(Boolean),x=e.title&&"string"==typeof e.title?t.createElement("text",{x:n[0]/2,y:16,textAnchor:"middle",fontSize:14,fontWeight:"bold",fill:"#333"},e.title):null,v=e.background?t.createElement("rect",{x:0,y:0,width:r,height:a,fill:e.background}):null;return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-network-frame"+(e.className?" "+e.className:""),width:n[0],height:n[1]},t.createElement("g",{transform:`translate(${o.left},${o.top})`},v,g,p,m),x))}function yt(e){var i,n,o;const r=e.size||[500,400],a=Object.assign(Object.assign({},{top:20,right:20,bottom:30,left:40}),e.margin),c=r[0]-a.left-a.right,l=r[1]-a.top-a.bottom,h=e.projection||"vertical",u="radial"===h,d={chartType:e.chartType,windowSize:null!==(i=e.windowSize)&&void 0!==i?i:1e4,windowMode:null!==(n=e.windowMode)&&void 0!==n?n:"sliding",extentPadding:null!==(o=e.extentPadding)&&void 0!==o?o:.05,projection:h,oAccessor:e.oAccessor,rAccessor:e.rAccessor,colorAccessor:e.colorAccessor,stackBy:e.stackBy,groupBy:e.groupBy,categoryAccessor:e.categoryAccessor,valueAccessor:e.valueAccessor,timeAccessor:e.timeAccessor,rExtent:e.rExtent,oExtent:e.oExtent,barPadding:e.barPadding,innerRadius:e.innerRadius,normalize:e.normalize,startAngle:e.startAngle,bins:e.bins,showOutliers:e.showOutliers,showIQR:e.showIQR,amplitude:e.amplitude,oSort:e.oSort,connectorAccessor:e.connectorAccessor,connectorStyle:e.connectorStyle,dynamicColumnWidth:e.dynamicColumnWidth,pieceStyle:e.pieceStyle,summaryStyle:e.summaryStyle,colorScheme:e.colorScheme,barColors:e.barColors},f=new ct(d);if(e.data&&f.ingest({inserts:e.data,bounded:!0}),f.computeScene({width:c,height:l}),!f.scales||0===f.scene.length)return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-ordinal-frame",width:r[0],height:r[1]}));const y=f.scene.map((e,i)=>function(e,i){var n,o,r,a,c;switch(e.type){case"rect":return t.createElement("rect",{key:"ord-rect-"+i,x:e.x,y:e.y,width:e.w,height:e.h,fill:e.style.fill||"#4e79a7",opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth});case"point":return t.createElement("circle",{key:"ord-point-"+i,cx:e.x,cy:e.y,r:e.r,fill:e.style.fill||"#4e79a7",opacity:null!==(n=e.style.opacity)&&void 0!==n?n:.8,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth});case"wedge":{const n=e,o=s().innerRadius(n.innerRadius).outerRadius(n.outerRadius).startAngle(n.startAngle).endAngle(n.endAngle)({})||"";return t.createElement("path",{key:"ord-wedge-"+i,d:o,transform:`translate(${n.cx},${n.cy})`,fill:n.style.fill||"#4e79a7",stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n.style.opacity})}case"boxplot":{const s=e,n=s.columnWidth/2;return"vertical"===s.projection?t.createElement("g",{key:"ord-boxplot-"+i},t.createElement("line",{x1:s.x,y1:s.minPos,x2:s.x,y2:s.maxPos,stroke:s.style.stroke||"#333",strokeWidth:1}),t.createElement("rect",{x:s.x-n,y:Math.min(s.q1Pos,s.q3Pos),width:s.columnWidth,height:Math.abs(s.q3Pos-s.q1Pos),fill:s.style.fill||"#4e79a7",fillOpacity:null!==(o=s.style.fillOpacity)&&void 0!==o?o:.6,stroke:s.style.stroke||"#333",strokeWidth:1}),t.createElement("line",{x1:s.x-n,y1:s.medianPos,x2:s.x+n,y2:s.medianPos,stroke:s.style.stroke||"#333",strokeWidth:2}),t.createElement("line",{x1:s.x-.5*n,y1:s.minPos,x2:s.x+.5*n,y2:s.minPos,stroke:s.style.stroke||"#333",strokeWidth:1}),t.createElement("line",{x1:s.x-.5*n,y1:s.maxPos,x2:s.x+.5*n,y2:s.maxPos,stroke:s.style.stroke||"#333",strokeWidth:1})):t.createElement("g",{key:"ord-boxplot-"+i},t.createElement("line",{x1:s.minPos,y1:s.y,x2:s.maxPos,y2:s.y,stroke:s.style.stroke||"#333",strokeWidth:1}),t.createElement("rect",{x:Math.min(s.q1Pos,s.q3Pos),y:s.y-n,width:Math.abs(s.q3Pos-s.q1Pos),height:s.columnWidth,fill:s.style.fill||"#4e79a7",fillOpacity:null!==(r=s.style.fillOpacity)&&void 0!==r?r:.6,stroke:s.style.stroke||"#333",strokeWidth:1}),t.createElement("line",{x1:s.medianPos,y1:s.y-n,x2:s.medianPos,y2:s.y+n,stroke:s.style.stroke||"#333",strokeWidth:2}),t.createElement("line",{x1:s.minPos,y1:s.y-.5*n,x2:s.minPos,y2:s.y+.5*n,stroke:s.style.stroke||"#333",strokeWidth:1}),t.createElement("line",{x1:s.maxPos,y1:s.y-.5*n,x2:s.maxPos,y2:s.y+.5*n,stroke:s.style.stroke||"#333",strokeWidth:1}))}case"violin":{const s=e,n=[t.createElement("path",{key:"ord-violin-path-"+i,d:s.pathString,transform:s.translateX||s.translateY?`translate(${s.translateX},${s.translateY})`:void 0,fill:s.style.fill||"#4e79a7",fillOpacity:null!==(a=s.style.fillOpacity)&&void 0!==a?a:.6,stroke:s.style.stroke||"#333",strokeWidth:s.style.strokeWidth||1})];if(s.iqrLine&&s.bounds){const e=s.bounds,o=e.x+e.width/2,r=e.y+e.height/2;e.height>e.width?n.push(t.createElement("line",{key:"ord-violin-iqr-"+i,x1:o,y1:s.iqrLine.q1Pos,x2:o,y2:s.iqrLine.q3Pos,stroke:s.style.stroke||"#333",strokeWidth:2}),t.createElement("circle",{key:"ord-violin-med-"+i,cx:o,cy:s.iqrLine.medianPos,r:3,fill:"white",stroke:s.style.stroke||"#333",strokeWidth:1})):n.push(t.createElement("line",{key:"ord-violin-iqr-"+i,x1:s.iqrLine.q1Pos,y1:r,x2:s.iqrLine.q3Pos,y2:r,stroke:s.style.stroke||"#333",strokeWidth:2}),t.createElement("circle",{key:"ord-violin-med-"+i,cx:s.iqrLine.medianPos,cy:r,r:3,fill:"white",stroke:s.style.stroke||"#333",strokeWidth:1}))}return t.createElement("g",{key:"ord-violin-"+i},n)}case"connector":return t.createElement("line",{key:"ord-conn-"+i,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.style.stroke||"#999",strokeWidth:e.style.strokeWidth||1,opacity:null!==(c=e.style.opacity)&&void 0!==c?c:.5});default:return null}}(e,i)).filter(Boolean),g=!1!==e.showAxes?function(e,i,s){var n,o,r,a,c,l,h,u;const d=e.scales;if(!d)return null;if("radial"===d.projection)return null;const f="vertical"===d.projection,y=Object.values(e.columns).map(t=>({pixel:t.middle,label:(s.oFormat||String)(t.name)})),g=d.r.ticks(5).map(t=>({pixel:d.r(t),label:(s.rFormat||lt)(t)}));return f?t.createElement("g",{className:"ordinal-axes"},t.createElement("line",{x1:0,y1:i.height,x2:i.width,y2:i.height,stroke:"#ccc",strokeWidth:1}),y.map((e,s)=>t.createElement("g",{key:"oxtick-"+s,transform:`translate(${e.pixel},${i.height})`},t.createElement("line",{y2:5,stroke:"#ccc",strokeWidth:1}),t.createElement("text",{y:18,textAnchor:"middle",fontSize:10,fill:"#666"},e.label))),s.oLabel&&t.createElement("text",{x:i.width/2,y:i.height+40,textAnchor:"middle",fontSize:12,fill:"#333"},s.oLabel),t.createElement("line",{x1:0,y1:0,x2:0,y2:i.height,stroke:"#ccc",strokeWidth:1}),g.map((e,i)=>t.createElement("g",{key:"oytick-"+i,transform:`translate(0,${e.pixel})`},t.createElement("line",{x2:-5,stroke:"#ccc",strokeWidth:1}),t.createElement("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"#666"},e.label))),s.rLabel&&t.createElement("text",{x:15-(null!==(o=null===(n=s.margin)||void 0===n?void 0:n.left)&&void 0!==o?o:40),y:i.height/2,textAnchor:"middle",fontSize:12,fill:"#333",transform:`rotate(-90, ${15-(null!==(a=null===(r=s.margin)||void 0===r?void 0:r.left)&&void 0!==a?a:40)}, ${i.height/2})`},s.rLabel)):t.createElement("g",{className:"ordinal-axes"},t.createElement("line",{x1:0,y1:i.height,x2:i.width,y2:i.height,stroke:"#ccc",strokeWidth:1}),g.map((e,s)=>t.createElement("g",{key:"oxtick-"+s,transform:`translate(${e.pixel},${i.height})`},t.createElement("line",{y2:5,stroke:"#ccc",strokeWidth:1}),t.createElement("text",{y:18,textAnchor:"middle",fontSize:10,fill:"#666"},e.label))),s.rLabel&&t.createElement("text",{x:i.width/2,y:i.height+40,textAnchor:"middle",fontSize:12,fill:"#333"},s.rLabel),t.createElement("line",{x1:0,y1:0,x2:0,y2:i.height,stroke:"#ccc",strokeWidth:1}),y.map((e,i)=>t.createElement("g",{key:"oytick-"+i,transform:`translate(0,${e.pixel})`},t.createElement("line",{x2:-5,stroke:"#ccc",strokeWidth:1}),t.createElement("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fontSize:10,fill:"#666"},e.label))),s.oLabel&&t.createElement("text",{x:15-(null!==(l=null===(c=s.margin)||void 0===c?void 0:c.left)&&void 0!==l?l:40),y:i.height/2,textAnchor:"middle",fontSize:12,fill:"#333",transform:`rotate(-90, ${15-(null!==(u=null===(h=s.margin)||void 0===h?void 0:h.left)&&void 0!==u?u:40)}, ${i.height/2})`},s.oLabel))}(f,{width:c,height:l},e):null,p=e.title&&"string"==typeof e.title?t.createElement("text",{x:r[0]/2,y:16,textAnchor:"middle",fontSize:14,fontWeight:"bold",fill:"#333"},e.title):null,m=e.background?t.createElement("rect",{x:0,y:0,width:c,height:l,fill:e.background}):null;return(void 0)(t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:"stream-ordinal-frame"+(e.className?" "+e.className:""),width:r[0],height:r[1]},t.createElement("g",{transform:`translate(${u?a.left+c/2:a.left},${u?a.top+l/2:a.top})`},m,y,g),p))}function gt(t,e){switch(t){case"xy":return ht(e);case"ordinal":return yt(e);case"network":return ft(e);default:throw Error(`Unknown frame type: ${t}. Must be "xy", "ordinal", or "network".`)}}function pt(t){return ht(t)}function mt(t){return yt(t)}function xt(t){return ft(t)}export{xt as renderNetworkToStaticSVG,mt as renderOrdinalToStaticSVG,gt as renderToStaticSVG,pt as renderXYToStaticSVG};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type ResolutionMode = "union" | "intersect" | "crossfilter";
|
|
2
|
+
export interface FieldConstraint {
|
|
3
|
+
type: "point";
|
|
4
|
+
values: Set<any>;
|
|
5
|
+
}
|
|
6
|
+
export interface IntervalConstraint {
|
|
7
|
+
type: "interval";
|
|
8
|
+
range: [number, number];
|
|
9
|
+
}
|
|
10
|
+
export type FieldSelection = FieldConstraint | IntervalConstraint;
|
|
11
|
+
export interface SelectionClause {
|
|
12
|
+
clientId: string;
|
|
13
|
+
type: "point" | "interval";
|
|
14
|
+
fields: Record<string, FieldSelection>;
|
|
15
|
+
}
|
|
16
|
+
export interface Selection {
|
|
17
|
+
name: string;
|
|
18
|
+
resolution: ResolutionMode;
|
|
19
|
+
clauses: Map<string, SelectionClause>;
|
|
20
|
+
}
|
|
21
|
+
export interface SelectionStoreState {
|
|
22
|
+
selections: Map<string, Selection>;
|
|
23
|
+
setClause: (selectionName: string, clause: SelectionClause) => void;
|
|
24
|
+
clearClause: (selectionName: string, clientId: string) => void;
|
|
25
|
+
setResolution: (selectionName: string, mode: ResolutionMode) => void;
|
|
26
|
+
clearSelection: (selectionName: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildPredicate(selection: Selection, requestingClientId?: string): (d: Record<string, any>) => boolean;
|
|
29
|
+
export declare const SelectionProvider: (selector: any) => any, useSelectionSelector: (selector: any) => any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface SemioticTheme {
|
|
2
|
+
mode: "light" | "dark" | "auto";
|
|
3
|
+
colors: {
|
|
4
|
+
primary: string;
|
|
5
|
+
categorical: string[];
|
|
6
|
+
sequential: string;
|
|
7
|
+
background: string;
|
|
8
|
+
text: string;
|
|
9
|
+
textSecondary: string;
|
|
10
|
+
grid: string;
|
|
11
|
+
border: string;
|
|
12
|
+
};
|
|
13
|
+
typography: {
|
|
14
|
+
fontFamily: string;
|
|
15
|
+
titleSize: number;
|
|
16
|
+
labelSize: number;
|
|
17
|
+
tickSize: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare const LIGHT_THEME: SemioticTheme;
|
|
21
|
+
export declare const DARK_THEME: SemioticTheme;
|
|
22
|
+
export interface ThemeStoreState {
|
|
23
|
+
theme: SemioticTheme;
|
|
24
|
+
setTheme: (theme: Partial<SemioticTheme> | "light" | "dark") => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const ThemeProvider: (selector: any) => any, useThemeSelector: (selector: any) => any;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface UseSelectionOptions {
|
|
2
|
+
/** Name of the selection to participate in */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Unique client ID. Defaults to React.useId() */
|
|
5
|
+
clientId?: string;
|
|
6
|
+
/** Fields this client cares about (for predicate context) */
|
|
7
|
+
fields?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface UseSelectionResult {
|
|
10
|
+
/** Returns true if the datum matches the current selection */
|
|
11
|
+
predicate: (datum: Record<string, any>) => boolean;
|
|
12
|
+
/** Whether any selection clause is currently active */
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
/** Set a point selection (categorical values) */
|
|
15
|
+
selectPoints: (fieldValues: Record<string, any[]>) => void;
|
|
16
|
+
/** Set an interval selection (numeric ranges) */
|
|
17
|
+
selectInterval: (fieldRanges: Record<string, [number, number]>) => void;
|
|
18
|
+
/** Clear this client's clause */
|
|
19
|
+
clear: () => void;
|
|
20
|
+
/** This client's ID */
|
|
21
|
+
clientId: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function useSelection(options: UseSelectionOptions): UseSelectionResult;
|
|
24
|
+
export interface UseLinkedHoverOptions {
|
|
25
|
+
/** Selection name. Defaults to "hover" */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** Fields to include in the hover selection */
|
|
28
|
+
fields: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface UseLinkedHoverResult {
|
|
31
|
+
/** Call with a datum to set hover, or null to clear */
|
|
32
|
+
onHover: (datum: Record<string, any> | null) => void;
|
|
33
|
+
/** Returns true if datum matches the hover selection */
|
|
34
|
+
predicate: (datum: Record<string, any>) => boolean;
|
|
35
|
+
/** Whether any hover is active */
|
|
36
|
+
isActive: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function useLinkedHover(options: UseLinkedHoverOptions): UseLinkedHoverResult;
|
|
39
|
+
export interface UseBrushSelectionOptions {
|
|
40
|
+
/** Selection name */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Field mapped to the x-axis brush extent */
|
|
43
|
+
xField?: string;
|
|
44
|
+
/** Field mapped to the y-axis brush extent */
|
|
45
|
+
yField?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface UseBrushSelectionResult {
|
|
48
|
+
/** Interaction config to pass to frameProps.interaction */
|
|
49
|
+
brushInteraction: {
|
|
50
|
+
brush: "xyBrush" | "xBrush" | "yBrush";
|
|
51
|
+
during: (extent: any) => void;
|
|
52
|
+
end: (extent: any) => void;
|
|
53
|
+
};
|
|
54
|
+
/** Returns true if datum matches the brush selection */
|
|
55
|
+
predicate: (datum: Record<string, any>) => boolean;
|
|
56
|
+
/** Whether any brush is active */
|
|
57
|
+
isActive: boolean;
|
|
58
|
+
/** Clear the brush */
|
|
59
|
+
clear: () => void;
|
|
60
|
+
}
|
|
61
|
+
export declare function useBrushSelection(options: UseBrushSelectionOptions): UseBrushSelectionResult;
|
|
62
|
+
/**
|
|
63
|
+
* Returns the subset of `data` that matches the given selection.
|
|
64
|
+
* In crossfilter mode, pass the consumer's clientId so its own clause is excluded.
|
|
65
|
+
*/
|
|
66
|
+
export declare function useFilteredData<T extends Record<string, any>>(data: T[], selectionName: string, clientId?: string): T[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SceneNode } from "./types";
|
|
2
|
+
import type { RingBuffer } from "../realtime/RingBuffer";
|
|
3
|
+
export interface HitResult {
|
|
4
|
+
node: SceneNode;
|
|
5
|
+
datum: any;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
distance: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Find the nearest scene node to the given pixel coordinates.
|
|
12
|
+
* Dispatches to type-specific hit testers for optimal performance.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findNearestNode(scene: SceneNode[], px: number, py: number, maxDistance?: number): HitResult | null;
|
|
15
|
+
/**
|
|
16
|
+
* Binary search for nearest point by time value in a RingBuffer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findNearestIndex(buf: RingBuffer<Record<string, any>>, targetTime: number, getTime: (d: Record<string, any>) => number): number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Changeset } from "./types";
|
|
2
|
+
export type ChangesetCallback<T> = (changeset: Changeset<T>) => void;
|
|
3
|
+
export declare class DataSourceAdapter<T = Record<string, any>> {
|
|
4
|
+
private callback;
|
|
5
|
+
private lastBoundedData;
|
|
6
|
+
private chunkTimer;
|
|
7
|
+
constructor(callback: ChangesetCallback<T>);
|
|
8
|
+
/**
|
|
9
|
+
* Ingest a bounded data array (from props).
|
|
10
|
+
*
|
|
11
|
+
* Small datasets emit a single changeset synchronously.
|
|
12
|
+
* Large datasets (> CHUNK_THRESHOLD) are split into chunks that render
|
|
13
|
+
* progressively: the first chunk fires immediately (bounded: true to
|
|
14
|
+
* reset + seed the buffer), subsequent chunks arrive on successive
|
|
15
|
+
* animation frames (bounded: false so they append without clearing).
|
|
16
|
+
*/
|
|
17
|
+
setBoundedData(data: T[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* Push a single datum (streaming mode).
|
|
20
|
+
* Emits a micro-changeset with `bounded: false`.
|
|
21
|
+
*/
|
|
22
|
+
push(datum: T): void;
|
|
23
|
+
/**
|
|
24
|
+
* Push multiple data (streaming batch).
|
|
25
|
+
* Emits a single changeset with `bounded: false`.
|
|
26
|
+
*/
|
|
27
|
+
pushMany(data: T[]): void;
|
|
28
|
+
/**
|
|
29
|
+
* Reset the adapter state.
|
|
30
|
+
*/
|
|
31
|
+
clear(): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ScaleLinear } from "d3-scale";
|
|
3
|
+
import type { MarginalConfig, MarginalType } from "./types";
|
|
4
|
+
export type MarginalOrient = "top" | "bottom" | "left" | "right";
|
|
5
|
+
export interface MarginalGraphicsProps {
|
|
6
|
+
orient: MarginalOrient;
|
|
7
|
+
config: MarginalConfig;
|
|
8
|
+
/** Raw numeric values along the relevant axis */
|
|
9
|
+
values: number[];
|
|
10
|
+
/** The chart's scale for the axis this marginal summarizes */
|
|
11
|
+
scale: ScaleLinear<number, number>;
|
|
12
|
+
/** Available pixel space in the margin (perpendicular to axis) */
|
|
13
|
+
size: number;
|
|
14
|
+
/** Chart width (top/bottom) or height (left/right) */
|
|
15
|
+
length: number;
|
|
16
|
+
}
|
|
17
|
+
/** Resolve a string shorthand or full config into a MarginalConfig */
|
|
18
|
+
export declare function normalizeMarginalConfig(input: MarginalConfig | MarginalType): MarginalConfig;
|
|
19
|
+
export declare function MarginalGraphics({ orient, config: rawConfig, values, scale, size, length }: MarginalGraphicsProps): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NetworkSceneNode, NetworkSceneEdge } from "./networkTypes";
|
|
2
|
+
export interface NetworkHitResult {
|
|
3
|
+
type: "node" | "edge";
|
|
4
|
+
datum: any;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
distance: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hit test against network scene nodes and edges.
|
|
11
|
+
*
|
|
12
|
+
* Checks nodes first (they're on top), then edges.
|
|
13
|
+
*/
|
|
14
|
+
export declare function findNearestNetworkNode(sceneNodes: NetworkSceneNode[], sceneEdges: NetworkSceneEdge[], px: number, py: number, maxDistance?: number): NetworkHitResult | null;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ParticlePool } from "./ParticlePool";
|
|
2
|
+
import type { NetworkPipelineConfig, NetworkSceneNode, NetworkSceneEdge, NetworkLabel, RealtimeNode, RealtimeEdge, EdgePush } from "./networkTypes";
|
|
3
|
+
/**
|
|
4
|
+
* NetworkPipelineStore — stateful store for the StreamNetworkFrame.
|
|
5
|
+
*
|
|
6
|
+
* Absorbs TopologyStore's functionality (mutable Maps, tension tracking,
|
|
7
|
+
* bezier caching) and adds layout plugin dispatch and scene graph generation.
|
|
8
|
+
*
|
|
9
|
+
* For bounded data: ingests nodes/edges arrays, runs layout once, builds scene.
|
|
10
|
+
* For streaming data: ingests edge pushes, tracks tension, relayouts on threshold.
|
|
11
|
+
*/
|
|
12
|
+
export declare class NetworkPipelineStore {
|
|
13
|
+
nodes: Map<string, RealtimeNode>;
|
|
14
|
+
edges: Map<string, RealtimeEdge>;
|
|
15
|
+
tension: number;
|
|
16
|
+
layoutVersion: number;
|
|
17
|
+
sceneNodes: NetworkSceneNode[];
|
|
18
|
+
sceneEdges: NetworkSceneEdge[];
|
|
19
|
+
labels: NetworkLabel[];
|
|
20
|
+
particlePool: ParticlePool | null;
|
|
21
|
+
private config;
|
|
22
|
+
private tensionConfig;
|
|
23
|
+
transition: {
|
|
24
|
+
startTime: number;
|
|
25
|
+
duration: number;
|
|
26
|
+
} | null;
|
|
27
|
+
constructor(config: NetworkPipelineConfig);
|
|
28
|
+
updateConfig(config: NetworkPipelineConfig): void;
|
|
29
|
+
/**
|
|
30
|
+
* Ingest hierarchy root data for tree/treemap/circlepack/partition layouts.
|
|
31
|
+
* The hierarchy root is passed to the layout plugin via config.__hierarchyRoot.
|
|
32
|
+
*/
|
|
33
|
+
ingestHierarchy(rootData: any, size: [number, number]): void;
|
|
34
|
+
/**
|
|
35
|
+
* Ingest bounded node/edge arrays (from props).
|
|
36
|
+
* Clears existing topology and rebuilds from scratch.
|
|
37
|
+
*/
|
|
38
|
+
ingestBounded(rawNodes: any[], rawEdges: any[], size: [number, number]): void;
|
|
39
|
+
/**
|
|
40
|
+
* Unique key for an edge (same as TopologyStore).
|
|
41
|
+
*/
|
|
42
|
+
private edgeKey;
|
|
43
|
+
/**
|
|
44
|
+
* Ingest a pushed edge. Creates nodes/edges as needed and accumulates tension.
|
|
45
|
+
* Returns true if a relayout is needed.
|
|
46
|
+
*/
|
|
47
|
+
ingestEdge(push: EdgePush): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Run the layout algorithm via the appropriate plugin.
|
|
50
|
+
*/
|
|
51
|
+
runLayout(size: [number, number]): void;
|
|
52
|
+
/**
|
|
53
|
+
* Build the scene graph from current layout positions.
|
|
54
|
+
*/
|
|
55
|
+
buildScene(size: [number, number]): void;
|
|
56
|
+
/**
|
|
57
|
+
* Advance the transition animation. Returns true if still animating.
|
|
58
|
+
*/
|
|
59
|
+
advanceTransition(now: number): boolean;
|
|
60
|
+
private prepareForRelayout;
|
|
61
|
+
private finalizeLayout;
|
|
62
|
+
private saveTargetPositions;
|
|
63
|
+
private restorePreviousPositions;
|
|
64
|
+
private snapToTargets;
|
|
65
|
+
private updateEdgeBezier;
|
|
66
|
+
private buildStandardBezier;
|
|
67
|
+
private buildCircularBezier;
|
|
68
|
+
rebuildAllBeziers(): void;
|
|
69
|
+
getLayoutData(): {
|
|
70
|
+
nodes: RealtimeNode[];
|
|
71
|
+
edges: RealtimeEdge[];
|
|
72
|
+
};
|
|
73
|
+
clear(): void;
|
|
74
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { NetworkLabel } from "./networkTypes";
|
|
4
|
+
import type { LegendGroup } from "../types/legendTypes";
|
|
5
|
+
export interface NetworkSVGOverlayProps {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
totalWidth: number;
|
|
9
|
+
totalHeight: number;
|
|
10
|
+
margin: {
|
|
11
|
+
top: number;
|
|
12
|
+
right: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
};
|
|
16
|
+
/** Labels from the layout plugin */
|
|
17
|
+
labels: NetworkLabel[];
|
|
18
|
+
/** Chart title */
|
|
19
|
+
title?: string | ReactNode;
|
|
20
|
+
/** Legend configuration */
|
|
21
|
+
legend?: ReactNode | {
|
|
22
|
+
legendGroups: LegendGroup[];
|
|
23
|
+
};
|
|
24
|
+
/** User-provided SVG elements on top */
|
|
25
|
+
foregroundGraphics?: ReactNode;
|
|
26
|
+
/** Annotations */
|
|
27
|
+
annotations?: Record<string, any>[];
|
|
28
|
+
svgAnnotationRules?: (annotation: Record<string, any>, index: number, context: any) => ReactNode;
|
|
29
|
+
annotationFrame?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* SVG overlay for network charts — renders labels, title, legend, annotations.
|
|
33
|
+
*
|
|
34
|
+
* Unlike XY/ordinal overlays, network charts don't have axes or grid lines.
|
|
35
|
+
* The overlay is positioned absolutely over the canvas.
|
|
36
|
+
*/
|
|
37
|
+
export declare function NetworkSVGOverlay(props: NetworkSVGOverlayProps): React.JSX.Element;
|
|
38
|
+
export declare namespace NetworkSVGOverlay {
|
|
39
|
+
var displayName: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NetworkCircleNode, NetworkRectNode, NetworkArcNode, NetworkLineEdge, NetworkBezierEdge, NetworkRibbonEdge, NetworkCurvedEdge, NetworkLabel } from "./networkTypes";
|
|
2
|
+
import type { Style } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Builder functions for network scene nodes.
|
|
5
|
+
* Used by layout plugins to construct the scene graph.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildCircleNode(cx: number, cy: number, r: number, style: Style, datum: any, id?: string, label?: string, depth?: number): NetworkCircleNode;
|
|
8
|
+
export declare function buildRectNode(x: number, y: number, w: number, h: number, style: Style, datum: any, id?: string, label?: string, depth?: number): NetworkRectNode;
|
|
9
|
+
export declare function buildArcNode(cx: number, cy: number, innerR: number, outerR: number, startAngle: number, endAngle: number, style: Style, datum: any, id?: string, label?: string): NetworkArcNode;
|
|
10
|
+
export declare function buildLineEdge(x1: number, y1: number, x2: number, y2: number, style: Style, datum: any): NetworkLineEdge;
|
|
11
|
+
export declare function buildBezierEdge(pathD: string, style: Style, datum: any, bezierCache?: any): NetworkBezierEdge;
|
|
12
|
+
export declare function buildRibbonEdge(pathD: string, style: Style, datum: any): NetworkRibbonEdge;
|
|
13
|
+
export declare function buildCurvedEdge(pathD: string, style: Style, datum: any): NetworkCurvedEdge;
|
|
14
|
+
export declare function buildLabel(x: number, y: number, text: string, options?: Partial<Omit<NetworkLabel, "x" | "y" | "text">>): NetworkLabel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OrdinalSceneNode } from "./ordinalTypes";
|
|
2
|
+
export interface OrdinalHitResult {
|
|
3
|
+
datum: any;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
distance: number;
|
|
7
|
+
category?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function findNearestOrdinalNode(scene: OrdinalSceneNode[], px: number, py: number, maxDistance?: number): OrdinalHitResult | null;
|