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,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBoxplotScene = buildBoxplotScene;
|
|
4
|
+
exports.buildViolinScene = buildViolinScene;
|
|
5
|
+
exports.buildHistogramScene = buildHistogramScene;
|
|
6
|
+
exports.buildRidgelineScene = buildRidgelineScene;
|
|
7
|
+
const d3_array_1 = require("d3-array");
|
|
8
|
+
const SceneGraph_1 = require("../SceneGraph");
|
|
9
|
+
function buildBoxplotScene(ctx, layout) {
|
|
10
|
+
const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
|
|
11
|
+
const { r: rScale, projection } = scales;
|
|
12
|
+
const nodes = [];
|
|
13
|
+
const isVertical = projection === "vertical";
|
|
14
|
+
const showOutliers = config.showOutliers !== false;
|
|
15
|
+
for (const col of Object.values(columns)) {
|
|
16
|
+
const values = col.pieceData
|
|
17
|
+
.map(d => getR(d))
|
|
18
|
+
.filter(v => v != null && !isNaN(v))
|
|
19
|
+
.sort((a, b) => a - b);
|
|
20
|
+
if (values.length === 0)
|
|
21
|
+
continue;
|
|
22
|
+
const min = values[0];
|
|
23
|
+
const max = values[values.length - 1];
|
|
24
|
+
const q1 = (0, d3_array_1.quantile)(values, 0.25) ?? min;
|
|
25
|
+
const median = (0, d3_array_1.quantile)(values, 0.5) ?? (min + max) / 2;
|
|
26
|
+
const q3 = (0, d3_array_1.quantile)(values, 0.75) ?? max;
|
|
27
|
+
// IQR-based whiskers
|
|
28
|
+
const iqr = q3 - q1;
|
|
29
|
+
const lowerFence = q1 - 1.5 * iqr;
|
|
30
|
+
const upperFence = q3 + 1.5 * iqr;
|
|
31
|
+
const whiskerMin = values.find(v => v >= lowerFence) ?? min;
|
|
32
|
+
const whiskerMax = [...values].reverse().find(v => v <= upperFence) ?? max;
|
|
33
|
+
const style = resolveSummaryStyle(col.pieceData[0], col.name);
|
|
34
|
+
const outliers = [];
|
|
35
|
+
if (showOutliers) {
|
|
36
|
+
for (const d of col.pieceData) {
|
|
37
|
+
const v = getR(d);
|
|
38
|
+
if (v < lowerFence || v > upperFence) {
|
|
39
|
+
const px = isVertical ? col.middle : rScale(v);
|
|
40
|
+
const py = isVertical ? rScale(v) : col.middle;
|
|
41
|
+
outliers.push({ px, py, value: v, datum: d });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
nodes.push({
|
|
46
|
+
type: "boxplot",
|
|
47
|
+
x: isVertical ? col.middle : 0,
|
|
48
|
+
y: isVertical ? 0 : col.middle,
|
|
49
|
+
projection: isVertical ? "vertical" : "horizontal",
|
|
50
|
+
columnWidth: col.width * 0.6,
|
|
51
|
+
minPos: rScale(whiskerMin),
|
|
52
|
+
q1Pos: rScale(q1),
|
|
53
|
+
medianPos: rScale(median),
|
|
54
|
+
q3Pos: rScale(q3),
|
|
55
|
+
maxPos: rScale(whiskerMax),
|
|
56
|
+
stats: { min: whiskerMin, q1, median, q3, max: whiskerMax },
|
|
57
|
+
style,
|
|
58
|
+
datum: col.pieceData,
|
|
59
|
+
category: col.name,
|
|
60
|
+
outliers
|
|
61
|
+
});
|
|
62
|
+
// Add outlier points
|
|
63
|
+
if (showOutliers) {
|
|
64
|
+
for (const o of outliers) {
|
|
65
|
+
nodes.push({
|
|
66
|
+
type: "point",
|
|
67
|
+
x: o.px,
|
|
68
|
+
y: o.py,
|
|
69
|
+
r: 3,
|
|
70
|
+
style: { fill: style.fill || "#999", opacity: 0.6 },
|
|
71
|
+
datum: o.datum
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return nodes;
|
|
77
|
+
}
|
|
78
|
+
function buildViolinScene(ctx, layout) {
|
|
79
|
+
const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
|
|
80
|
+
const { r: rScale, projection } = scales;
|
|
81
|
+
const nodes = [];
|
|
82
|
+
const isVertical = projection === "vertical";
|
|
83
|
+
const bins = config.bins || 20;
|
|
84
|
+
const showIQR = config.showIQR !== false;
|
|
85
|
+
for (const col of Object.values(columns)) {
|
|
86
|
+
const values = col.pieceData
|
|
87
|
+
.map(d => getR(d))
|
|
88
|
+
.filter(v => v != null && !isNaN(v))
|
|
89
|
+
.sort((a, b) => a - b);
|
|
90
|
+
if (values.length < 2)
|
|
91
|
+
continue;
|
|
92
|
+
const vMin = values[0];
|
|
93
|
+
const vMax = values[values.length - 1];
|
|
94
|
+
const binWidth = (vMax - vMin) / bins || 1;
|
|
95
|
+
// Build histogram bins
|
|
96
|
+
const counts = new Array(bins).fill(0);
|
|
97
|
+
for (const v of values) {
|
|
98
|
+
const idx = Math.min(Math.floor((v - vMin) / binWidth), bins - 1);
|
|
99
|
+
counts[idx]++;
|
|
100
|
+
}
|
|
101
|
+
const maxCount = Math.max(...counts, 1);
|
|
102
|
+
// Build symmetric violin path
|
|
103
|
+
const halfWidth = col.width / 2 * 0.9;
|
|
104
|
+
let pathStr = "";
|
|
105
|
+
if (isVertical) {
|
|
106
|
+
// Right side (top to bottom)
|
|
107
|
+
for (let i = 0; i < bins; i++) {
|
|
108
|
+
const y = rScale(vMin + (i + 0.5) * binWidth);
|
|
109
|
+
const w = (counts[i] / maxCount) * halfWidth;
|
|
110
|
+
pathStr += i === 0 ? `M ${col.middle + w} ${y}` : ` L ${col.middle + w} ${y}`;
|
|
111
|
+
}
|
|
112
|
+
// Left side (bottom to top)
|
|
113
|
+
for (let i = bins - 1; i >= 0; i--) {
|
|
114
|
+
const y = rScale(vMin + (i + 0.5) * binWidth);
|
|
115
|
+
const w = (counts[i] / maxCount) * halfWidth;
|
|
116
|
+
pathStr += ` L ${col.middle - w} ${y}`;
|
|
117
|
+
}
|
|
118
|
+
pathStr += " Z";
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
// Top side (left to right)
|
|
122
|
+
for (let i = 0; i < bins; i++) {
|
|
123
|
+
const x = rScale(vMin + (i + 0.5) * binWidth);
|
|
124
|
+
const w = (counts[i] / maxCount) * halfWidth;
|
|
125
|
+
pathStr += i === 0 ? `M ${x} ${col.middle - w}` : ` L ${x} ${col.middle - w}`;
|
|
126
|
+
}
|
|
127
|
+
// Bottom side (right to left)
|
|
128
|
+
for (let i = bins - 1; i >= 0; i--) {
|
|
129
|
+
const x = rScale(vMin + (i + 0.5) * binWidth);
|
|
130
|
+
const w = (counts[i] / maxCount) * halfWidth;
|
|
131
|
+
pathStr += ` L ${x} ${col.middle + w}`;
|
|
132
|
+
}
|
|
133
|
+
pathStr += " Z";
|
|
134
|
+
}
|
|
135
|
+
const style = resolveSummaryStyle(col.pieceData[0], col.name);
|
|
136
|
+
// IQR overlay
|
|
137
|
+
let iqrLine;
|
|
138
|
+
if (showIQR && values.length >= 4) {
|
|
139
|
+
const q1 = (0, d3_array_1.quantile)(values, 0.25) ?? vMin;
|
|
140
|
+
const median = (0, d3_array_1.quantile)(values, 0.5) ?? (vMin + vMax) / 2;
|
|
141
|
+
const q3 = (0, d3_array_1.quantile)(values, 0.75) ?? vMax;
|
|
142
|
+
iqrLine = {
|
|
143
|
+
q1Pos: rScale(q1),
|
|
144
|
+
medianPos: rScale(median),
|
|
145
|
+
q3Pos: rScale(q3)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const violinBounds = isVertical
|
|
149
|
+
? { x: col.x, y: Math.min(rScale(vMax), rScale(vMin)), width: col.width, height: Math.abs(rScale(vMax) - rScale(vMin)) }
|
|
150
|
+
: { x: Math.min(rScale(vMin), rScale(vMax)), y: col.x, width: Math.abs(rScale(vMax) - rScale(vMin)), height: col.width };
|
|
151
|
+
nodes.push({
|
|
152
|
+
type: "violin",
|
|
153
|
+
pathString: pathStr,
|
|
154
|
+
translateX: 0,
|
|
155
|
+
translateY: 0,
|
|
156
|
+
bounds: violinBounds,
|
|
157
|
+
iqrLine,
|
|
158
|
+
style,
|
|
159
|
+
datum: col.pieceData,
|
|
160
|
+
category: col.name
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return nodes;
|
|
164
|
+
}
|
|
165
|
+
function buildHistogramScene(ctx, layout) {
|
|
166
|
+
const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
|
|
167
|
+
const { r: rScale } = scales;
|
|
168
|
+
const nodes = [];
|
|
169
|
+
const numBins = config.bins || 25;
|
|
170
|
+
const isRelative = config.normalize;
|
|
171
|
+
// Histograms always render horizontally: categories on y-axis, value bins on x-axis
|
|
172
|
+
for (const col of Object.values(columns)) {
|
|
173
|
+
const values = col.pieceData
|
|
174
|
+
.map(d => getR(d))
|
|
175
|
+
.filter(v => v != null && !isNaN(v));
|
|
176
|
+
if (values.length === 0)
|
|
177
|
+
continue;
|
|
178
|
+
const vMin = Math.min(...values);
|
|
179
|
+
const vMax = Math.max(...values);
|
|
180
|
+
const binWidth = (vMax - vMin) / numBins || 1;
|
|
181
|
+
const counts = new Array(numBins).fill(0);
|
|
182
|
+
for (const v of values) {
|
|
183
|
+
const idx = Math.min(Math.floor((v - vMin) / binWidth), numBins - 1);
|
|
184
|
+
counts[idx]++;
|
|
185
|
+
}
|
|
186
|
+
const total = values.length;
|
|
187
|
+
const maxCount = Math.max(...counts, 1);
|
|
188
|
+
const style = resolveSummaryStyle(col.pieceData[0], col.name);
|
|
189
|
+
for (let i = 0; i < numBins; i++) {
|
|
190
|
+
if (counts[i] === 0)
|
|
191
|
+
continue;
|
|
192
|
+
const normCount = isRelative ? counts[i] / total : counts[i] / maxCount;
|
|
193
|
+
// Bar height proportional to count, within the column band
|
|
194
|
+
const barH = normCount * col.width * 0.9;
|
|
195
|
+
// Bin position on the value (x) axis
|
|
196
|
+
const binStart = rScale(vMin + i * binWidth);
|
|
197
|
+
const binEnd = rScale(vMin + (i + 1) * binWidth);
|
|
198
|
+
const x = Math.min(binStart, binEnd);
|
|
199
|
+
const w = Math.abs(binEnd - binStart);
|
|
200
|
+
// Align bar to baseline (bottom of the column band)
|
|
201
|
+
const y = col.x + col.width - barH;
|
|
202
|
+
nodes.push((0, SceneGraph_1.buildRectNode)(x, y, w, barH, style, { bin: i, count: counts[i], range: [vMin + i * binWidth, vMin + (i + 1) * binWidth], category: col.name }, col.name));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return nodes;
|
|
206
|
+
}
|
|
207
|
+
function buildRidgelineScene(ctx, layout) {
|
|
208
|
+
const { scales, columns, config, getR, resolveSummaryStyle } = ctx;
|
|
209
|
+
const { r: rScale, projection } = scales;
|
|
210
|
+
const nodes = [];
|
|
211
|
+
const numBins = config.bins || 20;
|
|
212
|
+
const isHorizontal = projection === "horizontal";
|
|
213
|
+
// Amplitude controls how far the density extends (can overlap neighbors)
|
|
214
|
+
const amplitude = config.amplitude || 1.5;
|
|
215
|
+
for (const col of Object.values(columns)) {
|
|
216
|
+
const values = col.pieceData
|
|
217
|
+
.map(d => getR(d))
|
|
218
|
+
.filter(v => v != null && !isNaN(v))
|
|
219
|
+
.sort((a, b) => a - b);
|
|
220
|
+
if (values.length < 2)
|
|
221
|
+
continue;
|
|
222
|
+
const vMin = values[0];
|
|
223
|
+
const vMax = values[values.length - 1];
|
|
224
|
+
const binWidth = (vMax - vMin) / numBins || 1;
|
|
225
|
+
// Build histogram bins
|
|
226
|
+
const counts = new Array(numBins).fill(0);
|
|
227
|
+
for (const v of values) {
|
|
228
|
+
const idx = Math.min(Math.floor((v - vMin) / binWidth), numBins - 1);
|
|
229
|
+
counts[idx]++;
|
|
230
|
+
}
|
|
231
|
+
const maxCount = Math.max(...counts, 1);
|
|
232
|
+
const style = resolveSummaryStyle(col.pieceData[0], col.name);
|
|
233
|
+
const halfBand = col.width * amplitude;
|
|
234
|
+
// Build one-sided area path (density extends in one direction from baseline)
|
|
235
|
+
let pathStr = "";
|
|
236
|
+
if (isHorizontal) {
|
|
237
|
+
// Horizontal: categories on y, values on x
|
|
238
|
+
// Baseline is the bottom of the column band, density extends upward
|
|
239
|
+
const baseline = col.x + col.width;
|
|
240
|
+
// Start at baseline
|
|
241
|
+
pathStr = `M ${rScale(vMin)} ${baseline}`;
|
|
242
|
+
// Density curve going upward (negative y)
|
|
243
|
+
for (let i = 0; i < numBins; i++) {
|
|
244
|
+
const x = rScale(vMin + (i + 0.5) * binWidth);
|
|
245
|
+
const h = (counts[i] / maxCount) * halfBand;
|
|
246
|
+
pathStr += ` L ${x} ${baseline - h}`;
|
|
247
|
+
}
|
|
248
|
+
// Close back to baseline
|
|
249
|
+
pathStr += ` L ${rScale(vMax)} ${baseline} Z`;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
// Vertical: categories on x, values on y
|
|
253
|
+
// Baseline is the left of the column band, density extends rightward
|
|
254
|
+
const baseline = col.x;
|
|
255
|
+
pathStr = `M ${baseline} ${rScale(vMin)}`;
|
|
256
|
+
for (let i = 0; i < numBins; i++) {
|
|
257
|
+
const y = rScale(vMin + (i + 0.5) * binWidth);
|
|
258
|
+
const w = (counts[i] / maxCount) * halfBand;
|
|
259
|
+
pathStr += ` L ${baseline + w} ${y}`;
|
|
260
|
+
}
|
|
261
|
+
pathStr += ` L ${baseline} ${rScale(vMax)} Z`;
|
|
262
|
+
}
|
|
263
|
+
const ridgeBounds = isHorizontal
|
|
264
|
+
? { x: Math.min(rScale(vMin), rScale(vMax)), y: col.x, width: Math.abs(rScale(vMax) - rScale(vMin)), height: col.width }
|
|
265
|
+
: { x: col.x, y: Math.min(rScale(vMax), rScale(vMin)), width: col.width, height: Math.abs(rScale(vMax) - rScale(vMin)) };
|
|
266
|
+
nodes.push({
|
|
267
|
+
type: "violin",
|
|
268
|
+
pathString: pathStr,
|
|
269
|
+
translateX: 0,
|
|
270
|
+
translateY: 0,
|
|
271
|
+
bounds: ridgeBounds,
|
|
272
|
+
style: { ...style, fillOpacity: style.fillOpacity ?? 0.5 },
|
|
273
|
+
datum: col.pieceData,
|
|
274
|
+
category: col.name
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return nodes;
|
|
278
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildTimelineScene = buildTimelineScene;
|
|
4
|
+
const SceneGraph_1 = require("../SceneGraph");
|
|
5
|
+
function buildTimelineScene(ctx, layout) {
|
|
6
|
+
const { scales, columns, getRawRange, resolvePieceStyle } = ctx;
|
|
7
|
+
const { r: rScale, projection } = scales;
|
|
8
|
+
const nodes = [];
|
|
9
|
+
const isHorizontal = projection === "horizontal";
|
|
10
|
+
for (const col of Object.values(columns)) {
|
|
11
|
+
for (const d of col.pieceData) {
|
|
12
|
+
const range = getRawRange(d);
|
|
13
|
+
if (!range)
|
|
14
|
+
continue;
|
|
15
|
+
const [start, end] = range;
|
|
16
|
+
const style = resolvePieceStyle(d, col.name);
|
|
17
|
+
if (isHorizontal) {
|
|
18
|
+
const x0 = rScale(Math.min(start, end));
|
|
19
|
+
const x1 = rScale(Math.max(start, end));
|
|
20
|
+
nodes.push((0, SceneGraph_1.buildRectNode)(x0, col.x, x1 - x0, col.width, style, d, col.name));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const y0 = rScale(Math.max(start, end));
|
|
24
|
+
const y1 = rScale(Math.min(start, end));
|
|
25
|
+
nodes.push((0, SceneGraph_1.buildRectNode)(col.x, y0, col.width, y1 - y0, style, d, col.name));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return nodes;
|
|
30
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.areaCanvasRenderer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas area renderer.
|
|
6
|
+
* Renders AreaSceneNode as filled regions between topPath and bottomPath.
|
|
7
|
+
* Supports both overlapping areas and stacked areas.
|
|
8
|
+
*/
|
|
9
|
+
const areaCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
10
|
+
const areaNodes = nodes.filter((n) => n.type === "area");
|
|
11
|
+
for (const node of areaNodes) {
|
|
12
|
+
if (node.topPath.length < 2)
|
|
13
|
+
continue;
|
|
14
|
+
ctx.beginPath();
|
|
15
|
+
// Draw top path forward
|
|
16
|
+
const [startX, startY] = node.topPath[0];
|
|
17
|
+
ctx.moveTo(startX, startY);
|
|
18
|
+
for (let i = 1; i < node.topPath.length; i++) {
|
|
19
|
+
ctx.lineTo(node.topPath[i][0], node.topPath[i][1]);
|
|
20
|
+
}
|
|
21
|
+
// Draw bottom path backward to close the area
|
|
22
|
+
for (let i = node.bottomPath.length - 1; i >= 0; i--) {
|
|
23
|
+
ctx.lineTo(node.bottomPath[i][0], node.bottomPath[i][1]);
|
|
24
|
+
}
|
|
25
|
+
ctx.closePath();
|
|
26
|
+
// Fill
|
|
27
|
+
const fillOpacity = node.style.fillOpacity ?? 0.7;
|
|
28
|
+
ctx.globalAlpha = fillOpacity;
|
|
29
|
+
ctx.fillStyle = node.style.fill || "#4e79a7";
|
|
30
|
+
ctx.fill();
|
|
31
|
+
// Stroke on top
|
|
32
|
+
if (node.style.stroke && node.style.stroke !== "none") {
|
|
33
|
+
ctx.globalAlpha = 1;
|
|
34
|
+
ctx.strokeStyle = node.style.stroke;
|
|
35
|
+
ctx.lineWidth = node.style.strokeWidth || 2;
|
|
36
|
+
ctx.setLineDash([]);
|
|
37
|
+
// Only stroke the top path (not the baseline)
|
|
38
|
+
ctx.beginPath();
|
|
39
|
+
ctx.moveTo(node.topPath[0][0], node.topPath[0][1]);
|
|
40
|
+
for (let i = 1; i < node.topPath.length; i++) {
|
|
41
|
+
ctx.lineTo(node.topPath[i][0], node.topPath[i][1]);
|
|
42
|
+
}
|
|
43
|
+
ctx.stroke();
|
|
44
|
+
}
|
|
45
|
+
ctx.globalAlpha = 1;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.areaCanvasRenderer = areaCanvasRenderer;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.barCanvasRenderer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas bar renderer.
|
|
6
|
+
* Renders RectSceneNode as filled rectangles. Supports icon/isotype mode
|
|
7
|
+
* where an image is stamped repeatedly to fill the bar instead of a solid fill.
|
|
8
|
+
*/
|
|
9
|
+
const barCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
10
|
+
const rectNodes = nodes.filter((n) => n.type === "rect");
|
|
11
|
+
for (const node of rectNodes) {
|
|
12
|
+
if (node.style.opacity != null) {
|
|
13
|
+
ctx.globalAlpha = node.style.opacity;
|
|
14
|
+
}
|
|
15
|
+
if (node.style.icon) {
|
|
16
|
+
// Icon/isotype mode: stamp the image to fill the bar
|
|
17
|
+
drawIconBar(ctx, node);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
// Standard solid fill
|
|
21
|
+
ctx.fillStyle = node.style.fill || "#007bff";
|
|
22
|
+
ctx.fillRect(node.x, node.y, node.w, node.h);
|
|
23
|
+
if (node.style.stroke) {
|
|
24
|
+
ctx.strokeStyle = node.style.stroke;
|
|
25
|
+
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
26
|
+
ctx.strokeRect(node.x, node.y, node.w, node.h);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Pulse overlay
|
|
30
|
+
if (node._pulseIntensity && node._pulseIntensity > 0) {
|
|
31
|
+
ctx.globalAlpha = node._pulseIntensity * 0.3;
|
|
32
|
+
ctx.fillStyle = node._pulseColor || "rgba(255,255,255,0.6)";
|
|
33
|
+
ctx.fillRect(node.x, node.y, node.w, node.h);
|
|
34
|
+
}
|
|
35
|
+
ctx.globalAlpha = 1;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.barCanvasRenderer = barCanvasRenderer;
|
|
39
|
+
function drawIconBar(ctx, node) {
|
|
40
|
+
const icon = node.style.icon;
|
|
41
|
+
const padding = node.style.iconPadding || 2;
|
|
42
|
+
// Determine icon size: fit within the bar width
|
|
43
|
+
const iconSize = Math.min(node.w, node.w) - padding;
|
|
44
|
+
if (iconSize <= 0)
|
|
45
|
+
return;
|
|
46
|
+
// Determine if bar is primarily vertical or horizontal
|
|
47
|
+
const isVerticalBar = node.h > node.w;
|
|
48
|
+
ctx.save();
|
|
49
|
+
ctx.beginPath();
|
|
50
|
+
ctx.rect(node.x, node.y, node.w, node.h);
|
|
51
|
+
ctx.clip();
|
|
52
|
+
if (isVerticalBar) {
|
|
53
|
+
// Stamp icons from bottom to top
|
|
54
|
+
const step = iconSize + padding;
|
|
55
|
+
const startY = node.y + node.h - iconSize;
|
|
56
|
+
const centerX = node.x + (node.w - iconSize) / 2;
|
|
57
|
+
for (let y = startY; y >= node.y - iconSize; y -= step) {
|
|
58
|
+
ctx.drawImage(icon, centerX, y, iconSize, iconSize);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// Stamp icons from left to right
|
|
63
|
+
const step = iconSize + padding;
|
|
64
|
+
const centerY = node.y + (node.h - iconSize) / 2;
|
|
65
|
+
for (let x = node.x; x < node.x + node.w; x += step) {
|
|
66
|
+
ctx.drawImage(icon, x, centerY, iconSize, iconSize);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
ctx.restore();
|
|
70
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.boxplotCanvasRenderer = void 0;
|
|
4
|
+
const boxplotCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
+
const boxNodes = nodes.filter((n) => n.type === "boxplot");
|
|
6
|
+
for (const node of boxNodes) {
|
|
7
|
+
const halfWidth = node.columnWidth / 2;
|
|
8
|
+
const isVert = node.projection === "vertical";
|
|
9
|
+
const fillColor = node.style.fill || "#007bff";
|
|
10
|
+
const strokeColor = node.style.stroke || "#333";
|
|
11
|
+
const lineWidth = node.style.strokeWidth || 1;
|
|
12
|
+
const opacity = node.style.fillOpacity ?? node.style.opacity ?? 0.6;
|
|
13
|
+
ctx.save();
|
|
14
|
+
// Whisker line (min to max)
|
|
15
|
+
ctx.strokeStyle = strokeColor;
|
|
16
|
+
ctx.lineWidth = lineWidth;
|
|
17
|
+
ctx.beginPath();
|
|
18
|
+
if (isVert) {
|
|
19
|
+
ctx.moveTo(node.x, node.minPos);
|
|
20
|
+
ctx.lineTo(node.x, node.maxPos);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
ctx.moveTo(node.minPos, node.y);
|
|
24
|
+
ctx.lineTo(node.maxPos, node.y);
|
|
25
|
+
}
|
|
26
|
+
ctx.stroke();
|
|
27
|
+
// Whisker caps
|
|
28
|
+
ctx.beginPath();
|
|
29
|
+
if (isVert) {
|
|
30
|
+
ctx.moveTo(node.x - halfWidth * 0.4, node.minPos);
|
|
31
|
+
ctx.lineTo(node.x + halfWidth * 0.4, node.minPos);
|
|
32
|
+
ctx.moveTo(node.x - halfWidth * 0.4, node.maxPos);
|
|
33
|
+
ctx.lineTo(node.x + halfWidth * 0.4, node.maxPos);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
ctx.moveTo(node.minPos, node.y - halfWidth * 0.4);
|
|
37
|
+
ctx.lineTo(node.minPos, node.y + halfWidth * 0.4);
|
|
38
|
+
ctx.moveTo(node.maxPos, node.y - halfWidth * 0.4);
|
|
39
|
+
ctx.lineTo(node.maxPos, node.y + halfWidth * 0.4);
|
|
40
|
+
}
|
|
41
|
+
ctx.stroke();
|
|
42
|
+
// IQR box (q1 to q3)
|
|
43
|
+
ctx.globalAlpha = opacity;
|
|
44
|
+
ctx.fillStyle = fillColor;
|
|
45
|
+
if (isVert) {
|
|
46
|
+
const boxTop = Math.min(node.q1Pos, node.q3Pos);
|
|
47
|
+
const boxH = Math.abs(node.q3Pos - node.q1Pos);
|
|
48
|
+
ctx.fillRect(node.x - halfWidth, boxTop, node.columnWidth, boxH);
|
|
49
|
+
ctx.globalAlpha = 1;
|
|
50
|
+
ctx.strokeRect(node.x - halfWidth, boxTop, node.columnWidth, boxH);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const boxLeft = Math.min(node.q1Pos, node.q3Pos);
|
|
54
|
+
const boxW = Math.abs(node.q3Pos - node.q1Pos);
|
|
55
|
+
ctx.fillRect(boxLeft, node.y - halfWidth, boxW, node.columnWidth);
|
|
56
|
+
ctx.globalAlpha = 1;
|
|
57
|
+
ctx.strokeRect(boxLeft, node.y - halfWidth, boxW, node.columnWidth);
|
|
58
|
+
}
|
|
59
|
+
// Median line
|
|
60
|
+
ctx.strokeStyle = "#fff";
|
|
61
|
+
ctx.lineWidth = 2;
|
|
62
|
+
ctx.beginPath();
|
|
63
|
+
if (isVert) {
|
|
64
|
+
ctx.moveTo(node.x - halfWidth, node.medianPos);
|
|
65
|
+
ctx.lineTo(node.x + halfWidth, node.medianPos);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
ctx.moveTo(node.medianPos, node.y - halfWidth);
|
|
69
|
+
ctx.lineTo(node.medianPos, node.y + halfWidth);
|
|
70
|
+
}
|
|
71
|
+
ctx.stroke();
|
|
72
|
+
ctx.restore();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.boxplotCanvasRenderer = boxplotCanvasRenderer;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.candlestickCanvasRenderer = void 0;
|
|
4
|
+
const candlestickCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
+
for (const node of nodes) {
|
|
6
|
+
if (node.type !== "candlestick")
|
|
7
|
+
continue;
|
|
8
|
+
const n = node;
|
|
9
|
+
// Draw wick (high-low line)
|
|
10
|
+
ctx.beginPath();
|
|
11
|
+
ctx.moveTo(n.x, n.highY);
|
|
12
|
+
ctx.lineTo(n.x, n.lowY);
|
|
13
|
+
ctx.strokeStyle = n.wickColor;
|
|
14
|
+
ctx.lineWidth = n.wickWidth;
|
|
15
|
+
ctx.stroke();
|
|
16
|
+
// Draw body (open-close rect)
|
|
17
|
+
const bodyTop = Math.min(n.openY, n.closeY);
|
|
18
|
+
const bodyHeight = Math.abs(n.openY - n.closeY);
|
|
19
|
+
const bodyColor = n.isUp ? n.upColor : n.downColor;
|
|
20
|
+
ctx.fillStyle = bodyColor;
|
|
21
|
+
ctx.fillRect(n.x - n.bodyWidth / 2, bodyTop, n.bodyWidth, Math.max(bodyHeight, 1));
|
|
22
|
+
// Body border
|
|
23
|
+
ctx.strokeStyle = bodyColor;
|
|
24
|
+
ctx.lineWidth = 1;
|
|
25
|
+
ctx.strokeRect(n.x - n.bodyWidth / 2, bodyTop, n.bodyWidth, Math.max(bodyHeight, 1));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.candlestickCanvasRenderer = candlestickCanvasRenderer;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.connectorCanvasRenderer = void 0;
|
|
4
|
+
const connectorCanvasRenderer = (ctx, nodes, _scales, _layout) => {
|
|
5
|
+
const connectorNodes = nodes.filter((n) => n.type === "connector");
|
|
6
|
+
if (connectorNodes.length === 0)
|
|
7
|
+
return;
|
|
8
|
+
// Group connectors by their group key so we can draw filled polygons
|
|
9
|
+
const groups = new Map();
|
|
10
|
+
for (const node of connectorNodes) {
|
|
11
|
+
const key = node.group || "_default";
|
|
12
|
+
if (!groups.has(key))
|
|
13
|
+
groups.set(key, []);
|
|
14
|
+
groups.get(key).push(node);
|
|
15
|
+
}
|
|
16
|
+
for (const [, segments] of groups) {
|
|
17
|
+
if (segments.length === 0)
|
|
18
|
+
continue;
|
|
19
|
+
const firstStyle = segments[0].style;
|
|
20
|
+
const hasFill = firstStyle.fill && firstStyle.fill !== "none";
|
|
21
|
+
// Draw filled polygon if fill is specified (e.g. radar plot)
|
|
22
|
+
if (hasFill) {
|
|
23
|
+
ctx.beginPath();
|
|
24
|
+
ctx.moveTo(segments[0].x1, segments[0].y1);
|
|
25
|
+
for (const seg of segments) {
|
|
26
|
+
ctx.lineTo(seg.x2, seg.y2);
|
|
27
|
+
}
|
|
28
|
+
ctx.closePath();
|
|
29
|
+
ctx.globalAlpha = firstStyle.fillOpacity ?? firstStyle.opacity ?? 0.3;
|
|
30
|
+
ctx.fillStyle = firstStyle.fill;
|
|
31
|
+
ctx.fill();
|
|
32
|
+
ctx.globalAlpha = 1;
|
|
33
|
+
}
|
|
34
|
+
// Draw stroke lines
|
|
35
|
+
for (const node of segments) {
|
|
36
|
+
ctx.beginPath();
|
|
37
|
+
ctx.moveTo(node.x1, node.y1);
|
|
38
|
+
ctx.lineTo(node.x2, node.y2);
|
|
39
|
+
ctx.strokeStyle = node.style.stroke || node.style.fill || "#999";
|
|
40
|
+
ctx.lineWidth = node.style.strokeWidth || 1;
|
|
41
|
+
ctx.globalAlpha = node.style.opacity ?? 0.5;
|
|
42
|
+
ctx.stroke();
|
|
43
|
+
ctx.globalAlpha = 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.connectorCanvasRenderer = connectorCanvasRenderer;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.heatmapCanvasRenderer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Canvas heatmap renderer.
|
|
6
|
+
* Renders HeatcellSceneNode as filled rectangles with color encoding.
|
|
7
|
+
*/
|
|
8
|
+
const heatmapCanvasRenderer = (ctx, nodes, scales, layout) => {
|
|
9
|
+
const heatNodes = nodes.filter((n) => n.type === "heatcell");
|
|
10
|
+
for (const node of heatNodes) {
|
|
11
|
+
// Apply decay opacity if present (stored as style.opacity by applyDecay)
|
|
12
|
+
const nodeStyle = node.style;
|
|
13
|
+
if (nodeStyle?.opacity != null) {
|
|
14
|
+
ctx.globalAlpha = nodeStyle.opacity;
|
|
15
|
+
}
|
|
16
|
+
ctx.fillStyle = node.fill;
|
|
17
|
+
ctx.fillRect(node.x, node.y, node.w, node.h);
|
|
18
|
+
// Cell border
|
|
19
|
+
ctx.strokeStyle = "#fff";
|
|
20
|
+
ctx.lineWidth = 1;
|
|
21
|
+
ctx.strokeRect(node.x, node.y, node.w, node.h);
|
|
22
|
+
// Pulse overlay
|
|
23
|
+
if (node._pulseIntensity && node._pulseIntensity > 0) {
|
|
24
|
+
ctx.globalAlpha = node._pulseIntensity * 0.3;
|
|
25
|
+
ctx.fillStyle = node._pulseColor || "rgba(255,255,255,0.6)";
|
|
26
|
+
ctx.fillRect(node.x, node.y, node.w, node.h);
|
|
27
|
+
}
|
|
28
|
+
ctx.globalAlpha = 1;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.heatmapCanvasRenderer = heatmapCanvasRenderer;
|