semiotic 3.0.0-beta.2 → 3.0.0-beta.4
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 +93 -753
- package/README.md +92 -7
- package/ai/dist/componentRegistry.js +26 -0
- package/ai/dist/{ai/mcp-server.js → mcp-server.js} +1 -1
- package/ai/dist/{ai/renderHOCToSVG.js → renderHOCToSVG.js} +2 -2
- package/dist/ChartContainer.d.ts +60 -0
- package/dist/DetailsPanel.d.ts +37 -0
- package/dist/LinkedCharts.d.ts +2 -0
- package/dist/Tooltip/Tooltip.d.ts +2 -2
- package/dist/charts/index.d.ts +1 -1
- package/dist/charts/ordinal/BarChart.d.ts +1 -0
- package/dist/charts/ordinal/BoxPlot.d.ts +1 -0
- package/dist/charts/ordinal/DonutChart.d.ts +1 -0
- package/dist/charts/ordinal/DotPlot.d.ts +1 -0
- package/dist/charts/ordinal/GroupedBarChart.d.ts +1 -0
- package/dist/charts/ordinal/Histogram.d.ts +1 -0
- package/dist/charts/ordinal/PieChart.d.ts +1 -0
- package/dist/charts/ordinal/RidgelinePlot.d.ts +1 -0
- package/dist/charts/ordinal/StackedBarChart.d.ts +1 -0
- package/dist/charts/ordinal/SwarmPlot.d.ts +1 -0
- package/dist/charts/ordinal/ViolinPlot.d.ts +1 -0
- package/dist/charts/realtime/RealtimeHeatmap.d.ts +11 -0
- package/dist/charts/realtime/RealtimeHistogram.d.ts +15 -1
- package/dist/charts/realtime/RealtimeLineChart.d.ts +6 -0
- package/dist/charts/realtime/RealtimeSwarmChart.d.ts +6 -0
- package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +6 -0
- package/dist/charts/shared/annotationRules.d.ts +3 -0
- package/dist/charts/shared/colorUtils.d.ts +17 -11
- package/dist/charts/shared/hooks.d.ts +96 -1
- package/dist/charts/shared/loess.d.ts +13 -0
- package/dist/charts/shared/networkUtils.d.ts +31 -0
- package/dist/charts/shared/tooltipUtils.d.ts +16 -0
- package/dist/charts/shared/types.d.ts +17 -2
- package/dist/charts/shared/validateChartData.d.ts +2 -3
- package/dist/charts/shared/validateProps.d.ts +18 -0
- package/dist/charts/xy/AreaChart.d.ts +4 -0
- package/dist/charts/xy/BubbleChart.d.ts +6 -0
- package/dist/charts/xy/Heatmap.d.ts +4 -0
- package/dist/charts/xy/LineChart.d.ts +6 -0
- package/dist/charts/xy/Scatterplot.d.ts +4 -0
- package/dist/charts/xy/StackedAreaChart.d.ts +4 -0
- package/dist/data/fromVegaLite.d.ts +48 -0
- package/dist/export/chartConfig.d.ts +29 -0
- package/dist/export/selectionSerializer.d.ts +20 -0
- package/dist/geometry/sankeyLinks.d.ts +1 -1
- package/dist/network.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/realtime/types.d.ts +20 -6
- package/dist/realtime.min.js +1 -1
- package/dist/realtime.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +14 -0
- package/dist/semiotic-ai.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-data.d.ts +2 -0
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-network.d.ts +9 -19
- package/dist/semiotic-ordinal.d.ts +12 -14
- package/dist/semiotic-xy.d.ts +12 -18
- package/dist/semiotic.d.ts +16 -13
- package/dist/semiotic.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/store/ObservationStore.d.ts +61 -0
- package/dist/store/SelectionStore.d.ts +9 -1
- package/dist/store/ThemeStore.d.ts +6 -1
- package/dist/store/TooltipStore.d.ts +3 -1
- package/dist/store/createStore.d.ts +4 -1
- package/dist/store/useObservation.d.ts +18 -0
- package/dist/stream/MarginalGraphics.d.ts +1 -1
- package/dist/stream/NetworkPipelineStore.d.ts +44 -0
- package/dist/stream/OrdinalCanvasHitTester.d.ts +1 -0
- package/dist/stream/OrdinalSVGOverlay.d.ts +6 -2
- package/dist/stream/ParticlePool.d.ts +2 -1
- package/dist/stream/PipelineStore.d.ts +11 -0
- package/dist/stream/SVGOverlay.d.ts +21 -2
- package/dist/stream/SceneGraph.d.ts +1 -1
- package/dist/stream/networkTypes.d.ts +58 -1
- package/dist/stream/ordinalTypes.d.ts +13 -0
- package/dist/stream/types.d.ts +14 -0
- package/dist/types/annotationTypes.d.ts +10 -0
- package/dist/types/networkTypes.d.ts +1 -2
- package/dist/xy.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +30 -42
- package/ai/dist/ai/componentRegistry.js +0 -45
- package/ai/dist/src/components/Annotation.js +0 -358
- package/ai/dist/src/components/AnnotationLayer/AnnotationLayer.js +0 -369
- package/ai/dist/src/components/Axis/Axis.js +0 -374
- package/ai/dist/src/components/Axis/axisTitle.js +0 -14
- package/ai/dist/src/components/Axis/index.js +0 -7
- package/ai/dist/src/components/Axis/summaryGraphic.js +0 -37
- package/ai/dist/src/components/Brush.js +0 -84
- package/ai/dist/src/components/ChartErrorBoundary.js +0 -91
- package/ai/dist/src/components/DividedLine.js +0 -65
- package/ai/dist/src/components/Legend.js +0 -140
- package/ai/dist/src/components/LinkedCharts.js +0 -95
- package/ai/dist/src/components/ThemeProvider.js +0 -79
- package/ai/dist/src/components/Tooltip/Tooltip.js +0 -309
- package/ai/dist/src/components/TooltipPositioner/index.js +0 -132
- package/ai/dist/src/components/annotationLayerBehavior/annotationHandling.js +0 -73
- package/ai/dist/src/components/annotationLayerBehavior/d3labeler.js +0 -254
- package/ai/dist/src/components/annotationRules/baseRules.js +0 -150
- package/ai/dist/src/components/annotationRules/networkframeRules.js +0 -196
- package/ai/dist/src/components/annotationRules/xyframeRules.js +0 -297
- package/ai/dist/src/components/batchWork.js +0 -35
- package/ai/dist/src/components/charts/index.js +0 -109
- package/ai/dist/src/components/charts/network/ChordDiagram.js +0 -142
- package/ai/dist/src/components/charts/network/CirclePack.js +0 -108
- package/ai/dist/src/components/charts/network/ForceDirectedGraph.js +0 -121
- package/ai/dist/src/components/charts/network/SankeyDiagram.js +0 -155
- package/ai/dist/src/components/charts/network/TreeDiagram.js +0 -110
- package/ai/dist/src/components/charts/network/Treemap.js +0 -106
- package/ai/dist/src/components/charts/ordinal/BarChart.js +0 -156
- package/ai/dist/src/components/charts/ordinal/BoxPlot.js +0 -139
- package/ai/dist/src/components/charts/ordinal/DonutChart.js +0 -130
- package/ai/dist/src/components/charts/ordinal/DotPlot.js +0 -126
- package/ai/dist/src/components/charts/ordinal/GroupedBarChart.js +0 -129
- package/ai/dist/src/components/charts/ordinal/Histogram.js +0 -132
- package/ai/dist/src/components/charts/ordinal/PieChart.js +0 -128
- package/ai/dist/src/components/charts/ordinal/RidgelinePlot.js +0 -130
- package/ai/dist/src/components/charts/ordinal/StackedBarChart.js +0 -130
- package/ai/dist/src/components/charts/ordinal/SwarmPlot.js +0 -147
- package/ai/dist/src/components/charts/ordinal/ViolinPlot.js +0 -138
- package/ai/dist/src/components/charts/realtime/RealtimeHeatmap.js +0 -79
- package/ai/dist/src/components/charts/realtime/RealtimeHistogram.js +0 -114
- package/ai/dist/src/components/charts/realtime/RealtimeLineChart.js +0 -93
- package/ai/dist/src/components/charts/realtime/RealtimeSwarmChart.js +0 -105
- package/ai/dist/src/components/charts/realtime/RealtimeWaterfallChart.js +0 -106
- package/ai/dist/src/components/charts/shared/ChartError.js +0 -72
- package/ai/dist/src/components/charts/shared/colorUtils.js +0 -138
- package/ai/dist/src/components/charts/shared/formatUtils.js +0 -213
- package/ai/dist/src/components/charts/shared/hooks.js +0 -49
- package/ai/dist/src/components/charts/shared/legendUtils.js +0 -57
- package/ai/dist/src/components/charts/shared/selectionUtils.js +0 -67
- package/ai/dist/src/components/charts/shared/tooltipUtils.js +0 -79
- package/ai/dist/src/components/charts/shared/types.js +0 -2
- package/ai/dist/src/components/charts/shared/validateChartData.js +0 -82
- package/ai/dist/src/components/charts/shared/validateProps.js +0 -736
- package/ai/dist/src/components/charts/xy/AreaChart.js +0 -230
- package/ai/dist/src/components/charts/xy/BubbleChart.js +0 -251
- package/ai/dist/src/components/charts/xy/Heatmap.js +0 -235
- package/ai/dist/src/components/charts/xy/LineChart.js +0 -307
- package/ai/dist/src/components/charts/xy/MinimapChart.js +0 -298
- package/ai/dist/src/components/charts/xy/Scatterplot.js +0 -172
- package/ai/dist/src/components/charts/xy/ScatterplotMatrix.js +0 -426
- package/ai/dist/src/components/charts/xy/StackedAreaChart.js +0 -231
- package/ai/dist/src/components/constants/coordinateNames.js +0 -11
- package/ai/dist/src/components/constants/frame_props.js +0 -251
- package/ai/dist/src/components/data/dataFunctions.js +0 -487
- package/ai/dist/src/components/data/multiAccessorUtils.js +0 -14
- package/ai/dist/src/components/data/transforms.js +0 -143
- package/ai/dist/src/components/data/unflowedFunctions.js +0 -5
- package/ai/dist/src/components/export/exportChart.js +0 -121
- package/ai/dist/src/components/generic_utilities/functions.js +0 -5
- package/ai/dist/src/components/geometry/areaDrawing.js +0 -312
- package/ai/dist/src/components/geometry/contourLayout.js +0 -73
- package/ai/dist/src/components/geometry/hexbinLayout.js +0 -163
- package/ai/dist/src/components/geometry/lineDrawing.js +0 -356
- package/ai/dist/src/components/geometry/sankeyLinks.js +0 -331
- package/ai/dist/src/components/geometry/summaryLayouts.js +0 -136
- package/ai/dist/src/components/index.js +0 -18
- package/ai/dist/src/components/processing/InteractionItems.js +0 -223
- package/ai/dist/src/components/processing/hierarchyUtils.js +0 -104
- package/ai/dist/src/components/processing/layouts/chordLayout.js +0 -58
- package/ai/dist/src/components/processing/layouts/forceLayout.js +0 -142
- package/ai/dist/src/components/processing/layouts/hierarchyLayout.js +0 -31
- package/ai/dist/src/components/processing/layouts/index.js +0 -32
- package/ai/dist/src/components/processing/layouts/sankeyLayout.js +0 -96
- package/ai/dist/src/components/processing/layouts/simpleLayouts.js +0 -34
- package/ai/dist/src/components/processing/layouts/types.js +0 -2
- package/ai/dist/src/components/processing/networkDefaults.js +0 -39
- package/ai/dist/src/components/realtime/BinAccumulator.js +0 -36
- package/ai/dist/src/components/realtime/IncrementalExtent.js +0 -55
- package/ai/dist/src/components/realtime/RingBuffer.js +0 -104
- package/ai/dist/src/components/realtime/renderers/barRenderer.js +0 -133
- package/ai/dist/src/components/realtime/renderers/candlestickRenderer.js +0 -7
- package/ai/dist/src/components/realtime/renderers/lineRenderer.js +0 -164
- package/ai/dist/src/components/realtime/renderers/swarmRenderer.js +0 -91
- package/ai/dist/src/components/realtime/renderers/types.js +0 -2
- package/ai/dist/src/components/realtime/renderers/waterfallRenderer.js +0 -163
- package/ai/dist/src/components/realtime/types.js +0 -2
- package/ai/dist/src/components/semiotic-ai.js +0 -89
- package/ai/dist/src/components/semiotic-data.js +0 -12
- package/ai/dist/src/components/semiotic-network.js +0 -38
- package/ai/dist/src/components/semiotic-ordinal.js +0 -28
- package/ai/dist/src/components/semiotic-realtime.js +0 -30
- package/ai/dist/src/components/semiotic-server.js +0 -8
- package/ai/dist/src/components/semiotic-xy.js +0 -35
- package/ai/dist/src/components/semiotic.js +0 -109
- package/ai/dist/src/components/server/renderToStaticSVG.js +0 -594
- package/ai/dist/src/components/store/SelectionStore.js +0 -91
- package/ai/dist/src/components/store/ThemeStore.js +0 -78
- package/ai/dist/src/components/store/TooltipStore.js +0 -13
- package/ai/dist/src/components/store/createStore.js +0 -81
- package/ai/dist/src/components/store/useSelection.js +0 -133
- package/ai/dist/src/components/stream/CanvasHitTester.js +0 -164
- package/ai/dist/src/components/stream/DataSourceAdapter.js +0 -99
- package/ai/dist/src/components/stream/MarginalGraphics.js +0 -266
- package/ai/dist/src/components/stream/NetworkCanvasHitTester.js +0 -228
- package/ai/dist/src/components/stream/NetworkPipelineStore.js +0 -498
- package/ai/dist/src/components/stream/NetworkSVGOverlay.js +0 -70
- package/ai/dist/src/components/stream/NetworkSceneGraph.js +0 -38
- package/ai/dist/src/components/stream/OrdinalCanvasHitTester.js +0 -146
- package/ai/dist/src/components/stream/OrdinalPipelineStore.js +0 -786
- package/ai/dist/src/components/stream/OrdinalSVGOverlay.js +0 -130
- package/ai/dist/src/components/stream/ParticlePool.js +0 -174
- package/ai/dist/src/components/stream/PipelineStore.js +0 -1243
- package/ai/dist/src/components/stream/SVGOverlay.js +0 -129
- package/ai/dist/src/components/stream/SceneGraph.js +0 -132
- package/ai/dist/src/components/stream/StreamNetworkFrame.js +0 -561
- package/ai/dist/src/components/stream/StreamOrdinalFrame.js +0 -492
- package/ai/dist/src/components/stream/StreamXYFrame.js +0 -590
- package/ai/dist/src/components/stream/accessorUtils.js +0 -20
- package/ai/dist/src/components/stream/index.js +0 -32
- package/ai/dist/src/components/stream/layouts/chordLayoutPlugin.js +0 -352
- package/ai/dist/src/components/stream/layouts/forceLayoutPlugin.js +0 -230
- package/ai/dist/src/components/stream/layouts/hierarchyLayoutPlugin.js +0 -568
- package/ai/dist/src/components/stream/layouts/index.js +0 -28
- package/ai/dist/src/components/stream/layouts/sankeyLayoutPlugin.js +0 -245
- package/ai/dist/src/components/stream/networkTypes.js +0 -17
- package/ai/dist/src/components/stream/ordinalSceneBuilders/barScene.js +0 -126
- package/ai/dist/src/components/stream/ordinalSceneBuilders/connectorScene.js +0 -62
- package/ai/dist/src/components/stream/ordinalSceneBuilders/pieScene.js +0 -33
- package/ai/dist/src/components/stream/ordinalSceneBuilders/pointScene.js +0 -63
- package/ai/dist/src/components/stream/ordinalSceneBuilders/statisticalScene.js +0 -278
- package/ai/dist/src/components/stream/ordinalSceneBuilders/timelineScene.js +0 -30
- package/ai/dist/src/components/stream/ordinalSceneBuilders/types.js +0 -2
- package/ai/dist/src/components/stream/ordinalTypes.js +0 -2
- package/ai/dist/src/components/stream/renderers/areaCanvasRenderer.js +0 -48
- package/ai/dist/src/components/stream/renderers/barCanvasRenderer.js +0 -70
- package/ai/dist/src/components/stream/renderers/boxplotCanvasRenderer.js +0 -75
- package/ai/dist/src/components/stream/renderers/candlestickCanvasRenderer.js +0 -28
- package/ai/dist/src/components/stream/renderers/connectorCanvasRenderer.js +0 -47
- package/ai/dist/src/components/stream/renderers/heatmapCanvasRenderer.js +0 -31
- package/ai/dist/src/components/stream/renderers/lineCanvasRenderer.js +0 -140
- package/ai/dist/src/components/stream/renderers/networkArcRenderer.js +0 -38
- package/ai/dist/src/components/stream/renderers/networkCircleRenderer.js +0 -37
- package/ai/dist/src/components/stream/renderers/networkEdgeRenderer.js +0 -102
- package/ai/dist/src/components/stream/renderers/networkParticleRenderer.js +0 -63
- package/ai/dist/src/components/stream/renderers/networkRectRenderer.js +0 -35
- package/ai/dist/src/components/stream/renderers/pointCanvasRenderer.js +0 -38
- package/ai/dist/src/components/stream/renderers/swarmCanvasRenderer.js +0 -10
- package/ai/dist/src/components/stream/renderers/types.js +0 -2
- package/ai/dist/src/components/stream/renderers/violinCanvasRenderer.js +0 -47
- package/ai/dist/src/components/stream/renderers/waterfallCanvasRenderer.js +0 -38
- package/ai/dist/src/components/stream/renderers/wedgeCanvasRenderer.js +0 -33
- package/ai/dist/src/components/stream/types.js +0 -2
- package/ai/dist/src/components/types/annotationTypes.js +0 -2
- package/ai/dist/src/components/types/canvasTypes.js +0 -2
- package/ai/dist/src/components/types/generalTypes.js +0 -2
- package/ai/dist/src/components/types/interactionTypes.js +0 -2
- package/ai/dist/src/components/types/legendTypes.js +0 -2
- package/ai/dist/src/components/types/networkTypes.js +0 -2
- package/ai/dist/src/components/types/ordinalTypes.js +0 -2
- package/ai/dist/src/components/types/xyTypes.js +0 -2
- package/ai/dist/src/components/useBoundingRect.js +0 -24
- package/ai/dist/src/components/visualizationLayerBehavior/axis.js +0 -301
- package/ai/dist/src/components/visualizationLayerBehavior/general.js +0 -435
- package/ai/dist/src/setupTests.js +0 -4
- package/dist/AnnotationLayer/AnnotationLayer.d.ts +0 -25
- package/dist/Axis/Axis.d.ts +0 -7
- package/dist/Axis/axisTitle.d.ts +0 -10
- package/dist/Axis/index.d.ts +0 -2
- package/dist/Axis/summaryGraphic.d.ts +0 -17
- package/dist/Brush.d.ts +0 -12
- package/dist/DividedLine.d.ts +0 -16
- package/dist/TooltipPositioner/index.d.ts +0 -7
- package/dist/annotationLayerBehavior/annotationHandling.d.ts +0 -19
- package/dist/annotationLayerBehavior/d3labeler.d.ts +0 -9
- package/dist/annotationRules/baseRules.d.ts +0 -25
- package/dist/annotationRules/networkframeRules.d.ts +0 -48
- package/dist/annotationRules/xyframeRules.d.ts +0 -117
- package/dist/batchWork.d.ts +0 -6
- package/dist/constants/coordinateNames.d.ts +0 -8
- package/dist/constants/frame_props.d.ts +0 -13
- package/dist/data/dataFunctions.d.ts +0 -45
- package/dist/data/multiAccessorUtils.d.ts +0 -1
- package/dist/data/unflowedFunctions.d.ts +0 -1
- package/dist/generic_utilities/functions.d.ts +0 -1
- package/dist/geometry/areaDrawing.d.ts +0 -21
- package/dist/geometry/contourLayout.d.ts +0 -6
- package/dist/geometry/hexbinLayout.d.ts +0 -7
- package/dist/geometry/lineDrawing.d.ts +0 -71
- package/dist/geometry/summaryLayouts.d.ts +0 -45
- package/dist/index.d.ts +0 -1
- package/dist/network.js +0 -7495
- package/dist/network.js.map +0 -1
- package/dist/network.module.js +0 -7458
- package/dist/network.module.js.map +0 -1
- package/dist/ordinal.js +0 -6497
- package/dist/ordinal.js.map +0 -1
- package/dist/ordinal.module.js +0 -6465
- package/dist/ordinal.module.js.map +0 -1
- package/dist/processing/InteractionItems.d.ts +0 -13
- package/dist/processing/hierarchyUtils.d.ts +0 -16
- package/dist/processing/layouts/chordLayout.d.ts +0 -2
- package/dist/processing/layouts/forceLayout.d.ts +0 -3
- package/dist/processing/layouts/hierarchyLayout.d.ts +0 -10
- package/dist/processing/layouts/index.d.ts +0 -8
- package/dist/processing/layouts/sankeyLayout.d.ts +0 -8
- package/dist/processing/layouts/simpleLayouts.d.ts +0 -7
- package/dist/processing/layouts/types.d.ts +0 -17
- package/dist/processing/networkDefaults.d.ts +0 -36
- package/dist/realtime/renderers/barRenderer.d.ts +0 -2
- package/dist/realtime/renderers/candlestickRenderer.d.ts +0 -2
- package/dist/realtime/renderers/lineRenderer.d.ts +0 -2
- package/dist/realtime/renderers/swarmRenderer.d.ts +0 -2
- package/dist/realtime.js +0 -7072
- package/dist/realtime.js.map +0 -1
- package/dist/realtime.module.js +0 -7043
- package/dist/realtime.module.js.map +0 -1
- package/dist/semiotic-ai.js +0 -13323
- package/dist/semiotic-ai.js.map +0 -1
- package/dist/semiotic-ai.module.js +0 -13264
- package/dist/semiotic-ai.module.js.map +0 -1
- package/dist/semiotic-data.js +0 -141
- package/dist/semiotic-data.js.map +0 -1
- package/dist/semiotic-data.module.js +0 -136
- package/dist/semiotic-data.module.js.map +0 -1
- package/dist/semiotic.js +0 -16351
- package/dist/semiotic.js.map +0 -1
- package/dist/semiotic.module.js +0 -16265
- package/dist/semiotic.module.js.map +0 -1
- package/dist/server.js +0 -5191
- package/dist/server.js.map +0 -1
- package/dist/server.module.js +0 -5166
- package/dist/server.module.js.map +0 -1
- package/dist/stream/NetworkSceneGraph.d.ts +0 -14
- package/dist/stream/index.d.ts +0 -16
- package/dist/types/canvasTypes.d.ts +0 -9
- package/dist/types/xyTypes.d.ts +0 -24
- package/dist/useBoundingRect.d.ts +0 -2
- package/dist/visualizationLayerBehavior/axis.d.ts +0 -36
- package/dist/visualizationLayerBehavior/general.d.ts +0 -80
- package/dist/xy.js +0 -6993
- package/dist/xy.js.map +0 -1
- package/dist/xy.module.js +0 -6957
- package/dist/xy.module.js.map +0 -1
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lineCanvasRenderer = void 0;
|
|
4
|
-
function resolveColor(value, thresholds, baseColor) {
|
|
5
|
-
let color = baseColor;
|
|
6
|
-
for (const t of thresholds) {
|
|
7
|
-
if (t.thresholdType === "lesser") {
|
|
8
|
-
if (value < t.value)
|
|
9
|
-
color = t.color;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
if (value > t.value)
|
|
13
|
-
color = t.color;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return color;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Canvas line renderer.
|
|
20
|
-
* Renders LineSceneNode paths using moveTo/lineTo.
|
|
21
|
-
* Supports threshold-based segment coloring when colorThresholds + rawValues
|
|
22
|
-
* are present on the node.
|
|
23
|
-
*/
|
|
24
|
-
const lineCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
25
|
-
const lineNodes = nodes.filter((n) => n.type === "line");
|
|
26
|
-
for (const node of lineNodes) {
|
|
27
|
-
if (node.path.length < 2)
|
|
28
|
-
continue;
|
|
29
|
-
const baseColor = node.style.stroke || "#007bff";
|
|
30
|
-
const lineWidth = node.style.strokeWidth || 2;
|
|
31
|
-
const thresholds = node.colorThresholds;
|
|
32
|
-
const rawValues = node.rawValues;
|
|
33
|
-
if (node.style.strokeDasharray) {
|
|
34
|
-
ctx.setLineDash(node.style.strokeDasharray.split(/[\s,]+/).map(Number));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
ctx.setLineDash([]);
|
|
38
|
-
}
|
|
39
|
-
if (node.style.opacity != null) {
|
|
40
|
-
ctx.globalAlpha = node.style.opacity;
|
|
41
|
-
}
|
|
42
|
-
ctx.lineWidth = lineWidth;
|
|
43
|
-
// Fast path: no color thresholds — single-path draw
|
|
44
|
-
if (!thresholds || thresholds.length === 0 || !rawValues || rawValues.length !== node.path.length) {
|
|
45
|
-
ctx.beginPath();
|
|
46
|
-
ctx.strokeStyle = baseColor;
|
|
47
|
-
const [startX, startY] = node.path[0];
|
|
48
|
-
ctx.moveTo(startX, startY);
|
|
49
|
-
for (let i = 1; i < node.path.length; i++) {
|
|
50
|
-
ctx.lineTo(node.path[i][0], node.path[i][1]);
|
|
51
|
-
}
|
|
52
|
-
ctx.stroke();
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// Threshold mode: segment-based drawing with interpolated crossings
|
|
56
|
-
let prevX = null;
|
|
57
|
-
let prevY = null;
|
|
58
|
-
let prevValue = null;
|
|
59
|
-
let prevColor = null;
|
|
60
|
-
let pathStarted = false;
|
|
61
|
-
function startSegment(color, x, y) {
|
|
62
|
-
ctx.beginPath();
|
|
63
|
-
ctx.strokeStyle = color;
|
|
64
|
-
ctx.moveTo(x, y);
|
|
65
|
-
pathStarted = true;
|
|
66
|
-
}
|
|
67
|
-
function endSegment() {
|
|
68
|
-
if (pathStarted) {
|
|
69
|
-
ctx.stroke();
|
|
70
|
-
pathStarted = false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
for (let i = 0; i < node.path.length; i++) {
|
|
74
|
-
const [x, y] = node.path[i];
|
|
75
|
-
const v = rawValues[i];
|
|
76
|
-
const currColor = resolveColor(v, thresholds, baseColor);
|
|
77
|
-
if (prevX === null || prevColor === null || prevValue === null) {
|
|
78
|
-
startSegment(currColor, x, y);
|
|
79
|
-
prevX = x;
|
|
80
|
-
prevY = y;
|
|
81
|
-
prevValue = v;
|
|
82
|
-
prevColor = currColor;
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (currColor === prevColor) {
|
|
86
|
-
ctx.lineTo(x, y);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
// Find threshold crossings between prevValue and v
|
|
90
|
-
const crossings = [];
|
|
91
|
-
for (const threshold of thresholds) {
|
|
92
|
-
const tv = threshold.value;
|
|
93
|
-
if ((prevValue <= tv && v >= tv) || (prevValue >= tv && v <= tv)) {
|
|
94
|
-
if (prevValue !== tv && v !== tv) {
|
|
95
|
-
const interpT = (tv - prevValue) / (v - prevValue);
|
|
96
|
-
crossings.push({ t: interpT });
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
crossings.sort((a, b) => a.t - b.t);
|
|
101
|
-
for (const crossing of crossings) {
|
|
102
|
-
const midX = prevX + (x - prevX) * crossing.t;
|
|
103
|
-
const midY = prevY + (y - prevY) * crossing.t;
|
|
104
|
-
const nudgedValue = prevValue + (v - prevValue) * Math.min(crossing.t + 0.0001, 1);
|
|
105
|
-
const nextColor = resolveColor(nudgedValue, thresholds, baseColor);
|
|
106
|
-
ctx.lineTo(midX, midY);
|
|
107
|
-
endSegment();
|
|
108
|
-
startSegment(nextColor, midX, midY);
|
|
109
|
-
}
|
|
110
|
-
ctx.lineTo(x, y);
|
|
111
|
-
}
|
|
112
|
-
prevX = x;
|
|
113
|
-
prevY = y;
|
|
114
|
-
prevValue = v;
|
|
115
|
-
prevColor = currColor;
|
|
116
|
-
}
|
|
117
|
-
endSegment();
|
|
118
|
-
}
|
|
119
|
-
// Fill area under line if fillOpacity is set
|
|
120
|
-
if (node.style.fill && node.style.fillOpacity && node.style.fillOpacity > 0) {
|
|
121
|
-
ctx.beginPath();
|
|
122
|
-
ctx.globalAlpha = node.style.fillOpacity;
|
|
123
|
-
ctx.fillStyle = node.style.fill;
|
|
124
|
-
const [startX, startY] = node.path[0];
|
|
125
|
-
ctx.moveTo(startX, startY);
|
|
126
|
-
for (let i = 1; i < node.path.length; i++) {
|
|
127
|
-
ctx.lineTo(node.path[i][0], node.path[i][1]);
|
|
128
|
-
}
|
|
129
|
-
const lastX = node.path[node.path.length - 1][0];
|
|
130
|
-
const firstX = node.path[0][0];
|
|
131
|
-
ctx.lineTo(lastX, layout.height);
|
|
132
|
-
ctx.lineTo(firstX, layout.height);
|
|
133
|
-
ctx.closePath();
|
|
134
|
-
ctx.fill();
|
|
135
|
-
}
|
|
136
|
-
ctx.globalAlpha = 1;
|
|
137
|
-
ctx.setLineDash([]);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
exports.lineCanvasRenderer = lineCanvasRenderer;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.networkArcRenderer = networkArcRenderer;
|
|
4
|
-
/**
|
|
5
|
-
* Canvas painter for NetworkArcNode (chord diagram arc segments).
|
|
6
|
-
*/
|
|
7
|
-
function networkArcRenderer(ctx, nodes) {
|
|
8
|
-
for (const node of nodes) {
|
|
9
|
-
if (node.type !== "arc")
|
|
10
|
-
continue;
|
|
11
|
-
const a = node;
|
|
12
|
-
ctx.save();
|
|
13
|
-
if (a.style.opacity !== undefined) {
|
|
14
|
-
ctx.globalAlpha = a.style.opacity;
|
|
15
|
-
}
|
|
16
|
-
// Draw arc segment (annular sector)
|
|
17
|
-
ctx.beginPath();
|
|
18
|
-
ctx.arc(a.cx, a.cy, a.outerR, a.startAngle, a.endAngle);
|
|
19
|
-
ctx.arc(a.cx, a.cy, a.innerR, a.endAngle, a.startAngle, true);
|
|
20
|
-
ctx.closePath();
|
|
21
|
-
// Fill
|
|
22
|
-
if (a.style.fill) {
|
|
23
|
-
ctx.fillStyle = a.style.fill;
|
|
24
|
-
if (a.style.fillOpacity !== undefined) {
|
|
25
|
-
ctx.globalAlpha = (a.style.opacity ?? 1) * a.style.fillOpacity;
|
|
26
|
-
}
|
|
27
|
-
ctx.fill();
|
|
28
|
-
}
|
|
29
|
-
// Stroke
|
|
30
|
-
if (a.style.stroke && a.style.stroke !== "none") {
|
|
31
|
-
ctx.strokeStyle = a.style.stroke;
|
|
32
|
-
ctx.lineWidth = a.style.strokeWidth ?? 1;
|
|
33
|
-
ctx.globalAlpha = a.style.opacity ?? 1;
|
|
34
|
-
ctx.stroke();
|
|
35
|
-
}
|
|
36
|
-
ctx.restore();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.networkCircleRenderer = networkCircleRenderer;
|
|
4
|
-
/**
|
|
5
|
-
* Canvas painter for NetworkCircleNode (force nodes, tree nodes, circlepack).
|
|
6
|
-
*/
|
|
7
|
-
function networkCircleRenderer(ctx, nodes) {
|
|
8
|
-
for (const node of nodes) {
|
|
9
|
-
if (node.type !== "circle")
|
|
10
|
-
continue;
|
|
11
|
-
const c = node;
|
|
12
|
-
if (c.r <= 0)
|
|
13
|
-
continue;
|
|
14
|
-
ctx.save();
|
|
15
|
-
if (c.style.opacity !== undefined) {
|
|
16
|
-
ctx.globalAlpha = c.style.opacity;
|
|
17
|
-
}
|
|
18
|
-
ctx.beginPath();
|
|
19
|
-
ctx.arc(c.cx, c.cy, c.r, 0, Math.PI * 2);
|
|
20
|
-
// Fill
|
|
21
|
-
if (c.style.fill) {
|
|
22
|
-
ctx.fillStyle = c.style.fill;
|
|
23
|
-
if (c.style.fillOpacity !== undefined) {
|
|
24
|
-
ctx.globalAlpha = (c.style.opacity ?? 1) * c.style.fillOpacity;
|
|
25
|
-
}
|
|
26
|
-
ctx.fill();
|
|
27
|
-
}
|
|
28
|
-
// Stroke
|
|
29
|
-
if (c.style.stroke && c.style.stroke !== "none") {
|
|
30
|
-
ctx.strokeStyle = c.style.stroke;
|
|
31
|
-
ctx.lineWidth = c.style.strokeWidth ?? 1;
|
|
32
|
-
ctx.globalAlpha = c.style.opacity ?? 1;
|
|
33
|
-
ctx.stroke();
|
|
34
|
-
}
|
|
35
|
-
ctx.restore();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.networkEdgeRenderer = networkEdgeRenderer;
|
|
4
|
-
/**
|
|
5
|
-
* Canvas painter for all network edge types.
|
|
6
|
-
*
|
|
7
|
-
* - bezier: Sankey flow bands (Path2D from SVG path string)
|
|
8
|
-
* - line: Force-directed straight edges
|
|
9
|
-
* - ribbon: Chord diagram ribbons
|
|
10
|
-
* - curved: Tree/cluster curved edges
|
|
11
|
-
*/
|
|
12
|
-
function networkEdgeRenderer(ctx, edges) {
|
|
13
|
-
for (const edge of edges) {
|
|
14
|
-
switch (edge.type) {
|
|
15
|
-
case "bezier":
|
|
16
|
-
renderBezierEdge(ctx, edge);
|
|
17
|
-
break;
|
|
18
|
-
case "line":
|
|
19
|
-
renderLineEdge(ctx, edge);
|
|
20
|
-
break;
|
|
21
|
-
case "ribbon":
|
|
22
|
-
renderRibbonEdge(ctx, edge);
|
|
23
|
-
break;
|
|
24
|
-
case "curved":
|
|
25
|
-
renderCurvedEdge(ctx, edge);
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function renderBezierEdge(ctx, edge) {
|
|
31
|
-
if (!edge.pathD)
|
|
32
|
-
return;
|
|
33
|
-
ctx.save();
|
|
34
|
-
const path = new Path2D(edge.pathD);
|
|
35
|
-
// Fill the band
|
|
36
|
-
if (edge.style.fill && edge.style.fill !== "none") {
|
|
37
|
-
ctx.fillStyle = edge.style.fill;
|
|
38
|
-
ctx.globalAlpha = edge.style.fillOpacity ?? edge.style.opacity ?? 0.5;
|
|
39
|
-
ctx.fill(path);
|
|
40
|
-
}
|
|
41
|
-
// Stroke the band outline
|
|
42
|
-
if (edge.style.stroke && edge.style.stroke !== "none") {
|
|
43
|
-
ctx.strokeStyle = edge.style.stroke;
|
|
44
|
-
ctx.lineWidth = edge.style.strokeWidth ?? 0.5;
|
|
45
|
-
ctx.globalAlpha = (edge.style.opacity ?? 1) * 0.5;
|
|
46
|
-
ctx.stroke(path);
|
|
47
|
-
}
|
|
48
|
-
ctx.restore();
|
|
49
|
-
}
|
|
50
|
-
function renderLineEdge(ctx, edge) {
|
|
51
|
-
ctx.save();
|
|
52
|
-
ctx.strokeStyle = edge.style.stroke || "#999";
|
|
53
|
-
ctx.lineWidth = edge.style.strokeWidth ?? 1;
|
|
54
|
-
if (edge.style.opacity !== undefined) {
|
|
55
|
-
ctx.globalAlpha = edge.style.opacity;
|
|
56
|
-
}
|
|
57
|
-
if (edge.style.strokeDasharray) {
|
|
58
|
-
ctx.setLineDash(edge.style.strokeDasharray.split(/[\s,]+/).map(Number));
|
|
59
|
-
}
|
|
60
|
-
ctx.beginPath();
|
|
61
|
-
ctx.moveTo(edge.x1, edge.y1);
|
|
62
|
-
ctx.lineTo(edge.x2, edge.y2);
|
|
63
|
-
ctx.stroke();
|
|
64
|
-
ctx.restore();
|
|
65
|
-
}
|
|
66
|
-
function renderRibbonEdge(ctx, edge) {
|
|
67
|
-
if (!edge.pathD)
|
|
68
|
-
return;
|
|
69
|
-
ctx.save();
|
|
70
|
-
const path = new Path2D(edge.pathD);
|
|
71
|
-
if (edge.style.fill && edge.style.fill !== "none") {
|
|
72
|
-
ctx.fillStyle = edge.style.fill;
|
|
73
|
-
ctx.globalAlpha = edge.style.fillOpacity ?? edge.style.opacity ?? 0.5;
|
|
74
|
-
ctx.fill(path);
|
|
75
|
-
}
|
|
76
|
-
if (edge.style.stroke && edge.style.stroke !== "none") {
|
|
77
|
-
ctx.strokeStyle = edge.style.stroke;
|
|
78
|
-
ctx.lineWidth = edge.style.strokeWidth ?? 0.5;
|
|
79
|
-
ctx.globalAlpha = (edge.style.opacity ?? 1) * 0.3;
|
|
80
|
-
ctx.stroke(path);
|
|
81
|
-
}
|
|
82
|
-
ctx.restore();
|
|
83
|
-
}
|
|
84
|
-
function renderCurvedEdge(ctx, edge) {
|
|
85
|
-
if (!edge.pathD)
|
|
86
|
-
return;
|
|
87
|
-
ctx.save();
|
|
88
|
-
const path = new Path2D(edge.pathD);
|
|
89
|
-
ctx.strokeStyle = edge.style.stroke || "#999";
|
|
90
|
-
ctx.lineWidth = edge.style.strokeWidth ?? 1;
|
|
91
|
-
if (edge.style.opacity !== undefined) {
|
|
92
|
-
ctx.globalAlpha = edge.style.opacity;
|
|
93
|
-
}
|
|
94
|
-
ctx.stroke(path);
|
|
95
|
-
// Fill if specified (usually not for tree edges)
|
|
96
|
-
if (edge.style.fill && edge.style.fill !== "none") {
|
|
97
|
-
ctx.fillStyle = edge.style.fill;
|
|
98
|
-
ctx.globalAlpha = edge.style.fillOpacity ?? 0.1;
|
|
99
|
-
ctx.fill(path);
|
|
100
|
-
}
|
|
101
|
-
ctx.restore();
|
|
102
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderNetworkParticles = renderNetworkParticles;
|
|
4
|
-
exports.spawnNetworkParticles = spawnNetworkParticles;
|
|
5
|
-
const networkTypes_1 = require("../networkTypes");
|
|
6
|
-
/**
|
|
7
|
-
* Canvas particle renderer for sankey — ported directly from realtime-network.
|
|
8
|
-
* Called each rAF frame.
|
|
9
|
-
*/
|
|
10
|
-
function renderNetworkParticles(ctx, pool, edges, style, edgeColorFn) {
|
|
11
|
-
const radius = style.radius ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.radius;
|
|
12
|
-
const opacity = style.opacity ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.opacity;
|
|
13
|
-
ctx.globalAlpha = opacity;
|
|
14
|
-
for (let i = 0; i < pool.particles.length; i++) {
|
|
15
|
-
const p = pool.particles[i];
|
|
16
|
-
if (!p.active)
|
|
17
|
-
continue;
|
|
18
|
-
const edge = edges[p.edgeIndex];
|
|
19
|
-
if (!edge)
|
|
20
|
-
continue;
|
|
21
|
-
// Resolve color
|
|
22
|
-
if (typeof style.color === "function") {
|
|
23
|
-
const sourceNode = typeof edge.source === "object" ? edge.source : null;
|
|
24
|
-
ctx.fillStyle = sourceNode ? style.color(edge, sourceNode) : "#666";
|
|
25
|
-
}
|
|
26
|
-
else if (style.color && style.color !== "inherit") {
|
|
27
|
-
ctx.fillStyle = style.color;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
ctx.fillStyle = edgeColorFn(edge);
|
|
31
|
-
}
|
|
32
|
-
ctx.beginPath();
|
|
33
|
-
ctx.arc(p.x, p.y, radius, 0, Math.PI * 2);
|
|
34
|
-
ctx.fill();
|
|
35
|
-
}
|
|
36
|
-
ctx.globalAlpha = 1;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Spawn particles for all edges proportional to their value.
|
|
40
|
-
*/
|
|
41
|
-
function spawnNetworkParticles(pool, edges, deltaTime, style) {
|
|
42
|
-
const spawnRate = style.spawnRate ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.spawnRate;
|
|
43
|
-
const maxPerEdge = style.maxPerEdge ?? networkTypes_1.DEFAULT_PARTICLE_STYLE.maxPerEdge;
|
|
44
|
-
for (let i = 0; i < edges.length; i++) {
|
|
45
|
-
const edge = edges[i];
|
|
46
|
-
if (!edge.bezier)
|
|
47
|
-
continue;
|
|
48
|
-
const currentCount = pool.countForEdge(i);
|
|
49
|
-
if (currentCount >= maxPerEdge)
|
|
50
|
-
continue;
|
|
51
|
-
const rate = edge.value * spawnRate * deltaTime;
|
|
52
|
-
const whole = Math.floor(rate);
|
|
53
|
-
const frac = rate - whole;
|
|
54
|
-
let toSpawn = whole;
|
|
55
|
-
if (Math.random() < frac)
|
|
56
|
-
toSpawn++;
|
|
57
|
-
for (let j = 0; j < toSpawn; j++) {
|
|
58
|
-
if (pool.countForEdge(i) >= maxPerEdge)
|
|
59
|
-
break;
|
|
60
|
-
pool.spawn(i);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.networkRectRenderer = networkRectRenderer;
|
|
4
|
-
/**
|
|
5
|
-
* Canvas painter for NetworkRectNode (sankey nodes, treemap cells, partition blocks).
|
|
6
|
-
*/
|
|
7
|
-
function networkRectRenderer(ctx, nodes) {
|
|
8
|
-
for (const node of nodes) {
|
|
9
|
-
if (node.type !== "rect")
|
|
10
|
-
continue;
|
|
11
|
-
const r = node;
|
|
12
|
-
if (r.w <= 0 || r.h <= 0)
|
|
13
|
-
continue;
|
|
14
|
-
ctx.save();
|
|
15
|
-
if (r.style.opacity !== undefined) {
|
|
16
|
-
ctx.globalAlpha = r.style.opacity;
|
|
17
|
-
}
|
|
18
|
-
// Fill
|
|
19
|
-
if (r.style.fill) {
|
|
20
|
-
ctx.fillStyle = r.style.fill;
|
|
21
|
-
if (r.style.fillOpacity !== undefined) {
|
|
22
|
-
ctx.globalAlpha = (r.style.opacity ?? 1) * r.style.fillOpacity;
|
|
23
|
-
}
|
|
24
|
-
ctx.fillRect(r.x, r.y, r.w, r.h);
|
|
25
|
-
}
|
|
26
|
-
// Stroke
|
|
27
|
-
if (r.style.stroke && r.style.stroke !== "none") {
|
|
28
|
-
ctx.strokeStyle = r.style.stroke;
|
|
29
|
-
ctx.lineWidth = r.style.strokeWidth ?? 1;
|
|
30
|
-
ctx.globalAlpha = r.style.opacity ?? 1;
|
|
31
|
-
ctx.strokeRect(r.x, r.y, r.w, r.h);
|
|
32
|
-
}
|
|
33
|
-
ctx.restore();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pointCanvasRenderer = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Canvas point renderer.
|
|
6
|
-
* Renders PointSceneNode as circles. Used for Scatterplot, BubbleChart, and SwarmChart.
|
|
7
|
-
* Supports pulse glow effect via _pulseIntensity/_pulseColor fields.
|
|
8
|
-
*/
|
|
9
|
-
const pointCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
10
|
-
const pointNodes = nodes.filter((n) => n.type === "point");
|
|
11
|
-
for (const node of pointNodes) {
|
|
12
|
-
ctx.beginPath();
|
|
13
|
-
ctx.arc(node.x, node.y, node.r, 0, Math.PI * 2);
|
|
14
|
-
const alpha = node.style.opacity ?? node.style.fillOpacity;
|
|
15
|
-
if (alpha != null) {
|
|
16
|
-
ctx.globalAlpha = alpha;
|
|
17
|
-
}
|
|
18
|
-
ctx.fillStyle = node.style.fill || "#4e79a7";
|
|
19
|
-
ctx.fill();
|
|
20
|
-
if (node.style.stroke) {
|
|
21
|
-
ctx.strokeStyle = node.style.stroke;
|
|
22
|
-
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
23
|
-
ctx.stroke();
|
|
24
|
-
}
|
|
25
|
-
// Pulse glow ring
|
|
26
|
-
if (node._pulseIntensity && node._pulseIntensity > 0) {
|
|
27
|
-
const glowRadius = 4;
|
|
28
|
-
ctx.beginPath();
|
|
29
|
-
ctx.arc(node.x, node.y, node.r + glowRadius * node._pulseIntensity, 0, Math.PI * 2);
|
|
30
|
-
ctx.strokeStyle = node._pulseColor || "rgba(255,255,255,0.6)";
|
|
31
|
-
ctx.lineWidth = 2 * node._pulseIntensity;
|
|
32
|
-
ctx.globalAlpha = node._pulseIntensity * 0.5;
|
|
33
|
-
ctx.stroke();
|
|
34
|
-
}
|
|
35
|
-
ctx.globalAlpha = 1;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.pointCanvasRenderer = pointCanvasRenderer;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.swarmCanvasRenderer = void 0;
|
|
4
|
-
const pointCanvasRenderer_1 = require("./pointCanvasRenderer");
|
|
5
|
-
/**
|
|
6
|
-
* Canvas swarm renderer.
|
|
7
|
-
* Identical to point renderer — swarm data points are pre-computed as PointSceneNodes.
|
|
8
|
-
* Separated for semantic clarity and potential future swarm-specific logic.
|
|
9
|
-
*/
|
|
10
|
-
exports.swarmCanvasRenderer = pointCanvasRenderer_1.pointCanvasRenderer;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.violinCanvasRenderer = void 0;
|
|
4
|
-
const violinCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
-
const violinNodes = nodes.filter((n) => n.type === "violin");
|
|
6
|
-
for (const node of violinNodes) {
|
|
7
|
-
ctx.save();
|
|
8
|
-
if (node.translateX || node.translateY) {
|
|
9
|
-
ctx.translate(node.translateX, node.translateY);
|
|
10
|
-
}
|
|
11
|
-
// Draw the violin shape
|
|
12
|
-
const path = new Path2D(node.pathString);
|
|
13
|
-
ctx.globalAlpha = node.style.fillOpacity ?? node.style.opacity ?? 0.6;
|
|
14
|
-
ctx.fillStyle = node.style.fill || "#007bff";
|
|
15
|
-
ctx.fill(path);
|
|
16
|
-
ctx.globalAlpha = 1;
|
|
17
|
-
if (node.style.stroke && node.style.stroke !== "none") {
|
|
18
|
-
ctx.strokeStyle = node.style.stroke;
|
|
19
|
-
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
20
|
-
ctx.stroke(path);
|
|
21
|
-
}
|
|
22
|
-
// IQR overlay lines
|
|
23
|
-
if (node.iqrLine) {
|
|
24
|
-
ctx.strokeStyle = "#333";
|
|
25
|
-
ctx.lineWidth = 2;
|
|
26
|
-
ctx.globalAlpha = 0.8;
|
|
27
|
-
// Q1 to Q3 line
|
|
28
|
-
ctx.beginPath();
|
|
29
|
-
// Determine if this is a vertical violin by checking path characteristics
|
|
30
|
-
// IQR positions are already in pixel space from rScale
|
|
31
|
-
ctx.moveTo(0, node.iqrLine.q1Pos);
|
|
32
|
-
ctx.lineTo(0, node.iqrLine.q3Pos);
|
|
33
|
-
ctx.stroke();
|
|
34
|
-
// Median dot
|
|
35
|
-
ctx.beginPath();
|
|
36
|
-
ctx.arc(0, node.iqrLine.medianPos, 3, 0, Math.PI * 2);
|
|
37
|
-
ctx.fillStyle = "#fff";
|
|
38
|
-
ctx.fill();
|
|
39
|
-
ctx.strokeStyle = "#333";
|
|
40
|
-
ctx.lineWidth = 1;
|
|
41
|
-
ctx.stroke();
|
|
42
|
-
ctx.globalAlpha = 1;
|
|
43
|
-
}
|
|
44
|
-
ctx.restore();
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.violinCanvasRenderer = violinCanvasRenderer;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waterfallCanvasRenderer = void 0;
|
|
4
|
-
const barCanvasRenderer_1 = require("./barCanvasRenderer");
|
|
5
|
-
/**
|
|
6
|
-
* Canvas waterfall renderer.
|
|
7
|
-
* Waterfall bars are pre-computed as RectSceneNodes by PipelineStore,
|
|
8
|
-
* so the rendering is identical to the bar renderer.
|
|
9
|
-
* Connector lines between bars are handled separately if needed.
|
|
10
|
-
*/
|
|
11
|
-
const waterfallCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
12
|
-
// Render the bar segments
|
|
13
|
-
(0, barCanvasRenderer_1.barCanvasRenderer)(ctx, nodes, scales, layout);
|
|
14
|
-
// Draw connector lines between consecutive waterfall bars
|
|
15
|
-
const rects = nodes.filter(n => n.type === "rect");
|
|
16
|
-
if (rects.length < 2)
|
|
17
|
-
return;
|
|
18
|
-
ctx.save();
|
|
19
|
-
ctx.strokeStyle = "#999";
|
|
20
|
-
ctx.lineWidth = 1;
|
|
21
|
-
ctx.setLineDash([]);
|
|
22
|
-
for (let i = 0; i < rects.length - 1; i++) {
|
|
23
|
-
const curr = rects[i];
|
|
24
|
-
const next = rects[i + 1];
|
|
25
|
-
if (!curr.datum?.cumEnd || !next.datum?.baseline)
|
|
26
|
-
continue;
|
|
27
|
-
// Connect from end of current bar to start of next bar at cumEnd level
|
|
28
|
-
const yConn = scales.y(curr.datum.cumEnd);
|
|
29
|
-
const x1 = curr.x + curr.w;
|
|
30
|
-
const x2 = next.x;
|
|
31
|
-
ctx.beginPath();
|
|
32
|
-
ctx.moveTo(x1, yConn);
|
|
33
|
-
ctx.lineTo(x2, yConn);
|
|
34
|
-
ctx.stroke();
|
|
35
|
-
}
|
|
36
|
-
ctx.restore();
|
|
37
|
-
};
|
|
38
|
-
exports.waterfallCanvasRenderer = waterfallCanvasRenderer;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wedgeCanvasRenderer = void 0;
|
|
4
|
-
const wedgeCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
-
const wedgeNodes = nodes.filter((n) => n.type === "wedge");
|
|
6
|
-
for (const node of wedgeNodes) {
|
|
7
|
-
ctx.beginPath();
|
|
8
|
-
if (node.innerRadius > 0) {
|
|
9
|
-
// Donut: outer arc forward, inner arc backward
|
|
10
|
-
ctx.arc(node.cx, node.cy, node.outerRadius, node.startAngle, node.endAngle);
|
|
11
|
-
ctx.arc(node.cx, node.cy, node.innerRadius, node.endAngle, node.startAngle, true);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
// Pie: move to center, arc, close
|
|
15
|
-
ctx.moveTo(node.cx, node.cy);
|
|
16
|
-
ctx.arc(node.cx, node.cy, node.outerRadius, node.startAngle, node.endAngle);
|
|
17
|
-
}
|
|
18
|
-
ctx.closePath();
|
|
19
|
-
if (node.style.opacity != null)
|
|
20
|
-
ctx.globalAlpha = node.style.opacity;
|
|
21
|
-
if (node.style.fillOpacity != null)
|
|
22
|
-
ctx.globalAlpha = node.style.fillOpacity;
|
|
23
|
-
ctx.fillStyle = node.style.fill || "#007bff";
|
|
24
|
-
ctx.fill();
|
|
25
|
-
if (node.style.stroke && node.style.stroke !== "none") {
|
|
26
|
-
ctx.strokeStyle = node.style.stroke;
|
|
27
|
-
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
28
|
-
ctx.stroke();
|
|
29
|
-
}
|
|
30
|
-
ctx.globalAlpha = 1;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.wedgeCanvasRenderer = wedgeCanvasRenderer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useBoundingRect = useBoundingRect;
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
function useBoundingRect(ref) {
|
|
7
|
-
const [rect, setRect] = (0, react_1.useState)(null);
|
|
8
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
9
|
-
const element = ref.current;
|
|
10
|
-
if (element != null) {
|
|
11
|
-
setRect(element.getBoundingClientRect());
|
|
12
|
-
// TypeScript 3.9 does not know about resize observer
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
const observer = new ResizeObserver((entries) => {
|
|
15
|
-
if (entries.length > 0) {
|
|
16
|
-
setRect(entries[0].contentRect);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
observer.observe(element);
|
|
20
|
-
return () => observer.disconnect();
|
|
21
|
-
}
|
|
22
|
-
}, []);
|
|
23
|
-
return rect;
|
|
24
|
-
}
|