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,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportChart = exportChart;
|
|
4
|
+
/**
|
|
5
|
+
* Export a semiotic chart to SVG or PNG from the browser.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const ref = useRef<HTMLDivElement>(null)
|
|
10
|
+
* // ... render chart inside ref ...
|
|
11
|
+
* <button onClick={() => exportChart(ref.current!)}>Download</button>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
async function exportChart(container, options) {
|
|
15
|
+
const { format = "svg", filename = "chart", scale = 2, background = "white" } = options || {};
|
|
16
|
+
// Find the SVG element inside the container
|
|
17
|
+
const svgElement = container.querySelector("svg");
|
|
18
|
+
if (!svgElement) {
|
|
19
|
+
throw new Error("No SVG element found in the container");
|
|
20
|
+
}
|
|
21
|
+
// Clone the SVG to avoid modifying the original
|
|
22
|
+
const clone = svgElement.cloneNode(true);
|
|
23
|
+
// Ensure the clone has explicit width/height attributes
|
|
24
|
+
const bbox = svgElement.getBoundingClientRect();
|
|
25
|
+
if (!clone.getAttribute("width")) {
|
|
26
|
+
clone.setAttribute("width", String(bbox.width));
|
|
27
|
+
}
|
|
28
|
+
if (!clone.getAttribute("height")) {
|
|
29
|
+
clone.setAttribute("height", String(bbox.height));
|
|
30
|
+
}
|
|
31
|
+
// Add xmlns if missing
|
|
32
|
+
if (!clone.getAttribute("xmlns")) {
|
|
33
|
+
clone.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
34
|
+
}
|
|
35
|
+
// Inline computed styles for standalone rendering
|
|
36
|
+
inlineStyles(svgElement, clone);
|
|
37
|
+
if (format === "svg") {
|
|
38
|
+
const serializer = new XMLSerializer();
|
|
39
|
+
const svgString = serializer.serializeToString(clone);
|
|
40
|
+
const blob = new Blob([svgString], { type: "image/svg+xml;charset=utf-8" });
|
|
41
|
+
downloadBlob(blob, `${filename}.svg`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// PNG: render SVG to canvas
|
|
45
|
+
const width = bbox.width * scale;
|
|
46
|
+
const height = bbox.height * scale;
|
|
47
|
+
const serializer = new XMLSerializer();
|
|
48
|
+
const svgString = serializer.serializeToString(clone);
|
|
49
|
+
const svgBlob = new Blob([svgString], { type: "image/svg+xml;charset=utf-8" });
|
|
50
|
+
const url = URL.createObjectURL(svgBlob);
|
|
51
|
+
const img = new Image();
|
|
52
|
+
img.width = bbox.width;
|
|
53
|
+
img.height = bbox.height;
|
|
54
|
+
await new Promise((resolve, reject) => {
|
|
55
|
+
img.onload = () => {
|
|
56
|
+
const canvas = document.createElement("canvas");
|
|
57
|
+
canvas.width = width;
|
|
58
|
+
canvas.height = height;
|
|
59
|
+
const ctx = canvas.getContext("2d");
|
|
60
|
+
// Fill background
|
|
61
|
+
ctx.fillStyle = background;
|
|
62
|
+
ctx.fillRect(0, 0, width, height);
|
|
63
|
+
// Scale and draw
|
|
64
|
+
ctx.scale(scale, scale);
|
|
65
|
+
ctx.drawImage(img, 0, 0);
|
|
66
|
+
canvas.toBlob((blob) => {
|
|
67
|
+
if (blob) {
|
|
68
|
+
downloadBlob(blob, `${filename}.png`);
|
|
69
|
+
resolve();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
reject(new Error("Failed to create PNG blob"));
|
|
73
|
+
}
|
|
74
|
+
}, "image/png");
|
|
75
|
+
URL.revokeObjectURL(url);
|
|
76
|
+
};
|
|
77
|
+
img.onerror = () => {
|
|
78
|
+
URL.revokeObjectURL(url);
|
|
79
|
+
reject(new Error("Failed to load SVG image"));
|
|
80
|
+
};
|
|
81
|
+
img.src = url;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Inline computed styles from source SVG elements into clone elements.
|
|
87
|
+
* This ensures the exported SVG/PNG looks the same as on screen.
|
|
88
|
+
*/
|
|
89
|
+
function inlineStyles(source, target) {
|
|
90
|
+
const sourceChildren = source.children;
|
|
91
|
+
const targetChildren = target.children;
|
|
92
|
+
// Copy computed styles for the element itself
|
|
93
|
+
const computed = window.getComputedStyle(source);
|
|
94
|
+
const important = ["fill", "stroke", "stroke-width", "stroke-dasharray",
|
|
95
|
+
"opacity", "fill-opacity", "stroke-opacity", "font-family",
|
|
96
|
+
"font-size", "font-weight", "text-anchor", "dominant-baseline"];
|
|
97
|
+
for (const prop of important) {
|
|
98
|
+
const value = computed.getPropertyValue(prop);
|
|
99
|
+
if (value && value !== "none" && value !== "") {
|
|
100
|
+
;
|
|
101
|
+
target.style?.setProperty(prop, value);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Recurse into children
|
|
105
|
+
for (let i = 0; i < Math.min(sourceChildren.length, targetChildren.length); i++) {
|
|
106
|
+
inlineStyles(sourceChildren[i], targetChildren[i]);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Trigger a file download from a blob.
|
|
111
|
+
*/
|
|
112
|
+
function downloadBlob(blob, filename) {
|
|
113
|
+
const url = URL.createObjectURL(blob);
|
|
114
|
+
const a = document.createElement("a");
|
|
115
|
+
a.href = url;
|
|
116
|
+
a.download = filename;
|
|
117
|
+
document.body.appendChild(a);
|
|
118
|
+
a.click();
|
|
119
|
+
document.body.removeChild(a);
|
|
120
|
+
URL.revokeObjectURL(url);
|
|
121
|
+
}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.hexbinning = exports.contouring = void 0;
|
|
40
|
+
exports.lineBounding = lineBounding;
|
|
41
|
+
exports.heatmapping = heatmapping;
|
|
42
|
+
exports.trendlining = trendlining;
|
|
43
|
+
exports.shapeBounds = shapeBounds;
|
|
44
|
+
const React = __importStar(require("react"));
|
|
45
|
+
const d3_scale_1 = require("d3-scale");
|
|
46
|
+
const regression_1 = __importDefault(require("regression"));
|
|
47
|
+
const d3_shape_1 = require("d3-shape");
|
|
48
|
+
// Re-export from new locations for backwards compatibility
|
|
49
|
+
var contourLayout_1 = require("./contourLayout");
|
|
50
|
+
Object.defineProperty(exports, "contouring", { enumerable: true, get: function () { return contourLayout_1.contouring; } });
|
|
51
|
+
var hexbinLayout_1 = require("./hexbinLayout");
|
|
52
|
+
Object.defineProperty(exports, "hexbinning", { enumerable: true, get: function () { return hexbinLayout_1.hexbinning; } });
|
|
53
|
+
const generateLineBounds = (xydata, basedata, topBoundingAccessor, bottomBoundingAccessor) => {
|
|
54
|
+
const tops = xydata.map((d, i) => [
|
|
55
|
+
d[0],
|
|
56
|
+
d[1] + topBoundingAccessor(basedata[i])
|
|
57
|
+
]);
|
|
58
|
+
const bottoms = xydata.map((d, i) => [
|
|
59
|
+
d[0],
|
|
60
|
+
d[1] - bottomBoundingAccessor(basedata[i])
|
|
61
|
+
]);
|
|
62
|
+
return [...tops, ...bottoms.reverse()];
|
|
63
|
+
};
|
|
64
|
+
function lineBounding({ summaryType, data, defined }) {
|
|
65
|
+
let projectedSummaries = [];
|
|
66
|
+
if (!summaryType.type) {
|
|
67
|
+
summaryType = { type: summaryType };
|
|
68
|
+
}
|
|
69
|
+
const { boundingAccessor, topBoundingAccessor = boundingAccessor, bottomBoundingAccessor = boundingAccessor } = summaryType;
|
|
70
|
+
data.forEach((lineData) => {
|
|
71
|
+
const definedData = lineData._baseData.map(defined);
|
|
72
|
+
let currentBaseData = [];
|
|
73
|
+
let currentXYFC = [];
|
|
74
|
+
const boundingPieces = [
|
|
75
|
+
{
|
|
76
|
+
xyf: currentXYFC,
|
|
77
|
+
base: currentBaseData
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
definedData.forEach((d, i) => {
|
|
81
|
+
if (d === true) {
|
|
82
|
+
currentBaseData.push(lineData._baseData[i]);
|
|
83
|
+
currentXYFC.push(lineData._xyfCoordinates[i]);
|
|
84
|
+
}
|
|
85
|
+
else if (definedData[i + 1]) {
|
|
86
|
+
currentBaseData = [];
|
|
87
|
+
currentXYFC = [];
|
|
88
|
+
boundingPieces.push({
|
|
89
|
+
xyf: currentXYFC,
|
|
90
|
+
base: currentBaseData
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
boundingPieces.forEach(({ xyf, base }) => {
|
|
95
|
+
const boundingProjectedSummary = {
|
|
96
|
+
data: lineData,
|
|
97
|
+
parentSummary: lineData,
|
|
98
|
+
_xyfCoordinates: generateLineBounds(xyf, base, topBoundingAccessor, bottomBoundingAccessor)
|
|
99
|
+
};
|
|
100
|
+
projectedSummaries = [...projectedSummaries, boundingProjectedSummary];
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
return projectedSummaries;
|
|
104
|
+
}
|
|
105
|
+
function heatmapping({ preprocess = true, processedData = false, summaryType: baseSummaryType, data: baseData, finalXExtent = [
|
|
106
|
+
Math.min(...baseData.coordinates.map((d) => d.x)),
|
|
107
|
+
Math.max(...baseData.coordinates.map((d) => d.x))
|
|
108
|
+
], finalYExtent = [
|
|
109
|
+
Math.min(...baseData.coordinates.map((d) => d.y)),
|
|
110
|
+
Math.max(...baseData.coordinates.map((d) => d.y))
|
|
111
|
+
], size, xScaleType = (0, d3_scale_1.scaleLinear)(), yScaleType = (0, d3_scale_1.scaleLinear)(), margin, styleFn, classFn, renderFn, chartSize }) {
|
|
112
|
+
if (processedData && baseData) {
|
|
113
|
+
return baseData.coordinates;
|
|
114
|
+
}
|
|
115
|
+
if (baseData.coordinates && !baseData._xyfCoordinates) {
|
|
116
|
+
baseData._xyfCoordinates = baseData.coordinates.map((d) => [d.x, d.y]);
|
|
117
|
+
}
|
|
118
|
+
const data = Array.isArray(baseData) ? baseData : [baseData];
|
|
119
|
+
let projectedSummaries = [];
|
|
120
|
+
let summaryType;
|
|
121
|
+
if (!baseSummaryType.type) {
|
|
122
|
+
summaryType = { type: summaryType };
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
summaryType = baseSummaryType;
|
|
126
|
+
}
|
|
127
|
+
const {
|
|
128
|
+
// binGraphic = "square",
|
|
129
|
+
binValue = (d) => d.length, xBins = summaryType.yBins || 0.05, yBins = xBins, xCellPx = !summaryType.xBins && summaryType.xCellPx, yCellPx = !summaryType.yBins && summaryType.yCellPx, customMark, binMax } = summaryType;
|
|
130
|
+
const xBinPercent = xBins < 1 ? xBins : 1 / xBins;
|
|
131
|
+
const yBinPercent = yBins < 1 ? yBins : 1 / yBins;
|
|
132
|
+
const heatmapBinXScale = xScaleType.domain(finalXExtent).range([0, size[0]]);
|
|
133
|
+
const heatmapBinYScale = yScaleType.domain(finalYExtent).range([size[1], 0]);
|
|
134
|
+
const actualResolution = [
|
|
135
|
+
Math.ceil(((xCellPx && xCellPx / size[0]) || xBinPercent) * size[0] * 10) /
|
|
136
|
+
10,
|
|
137
|
+
Math.ceil(((yCellPx && yCellPx / size[1]) || yBinPercent) * size[1] * 10) /
|
|
138
|
+
10
|
|
139
|
+
];
|
|
140
|
+
let maxValue = -Infinity;
|
|
141
|
+
data.forEach((heatmapData) => {
|
|
142
|
+
const grid = [];
|
|
143
|
+
const flatGrid = [];
|
|
144
|
+
let cell;
|
|
145
|
+
let gridColumn;
|
|
146
|
+
for (let i = 0; Math.ceil(i) < size[0]; i += actualResolution[0]) {
|
|
147
|
+
const x = heatmapBinXScale.invert(i);
|
|
148
|
+
const x1 = heatmapBinXScale.invert(i + actualResolution[0]);
|
|
149
|
+
gridColumn = [];
|
|
150
|
+
grid.push(gridColumn);
|
|
151
|
+
for (let j = 0; Math.ceil(j) < size[1]; j += actualResolution[1]) {
|
|
152
|
+
const y = heatmapBinYScale.invert(j);
|
|
153
|
+
const y1 = heatmapBinYScale.invert(j + actualResolution[1]);
|
|
154
|
+
cell = {
|
|
155
|
+
gx: i,
|
|
156
|
+
gy: j,
|
|
157
|
+
gw: actualResolution[0],
|
|
158
|
+
gh: actualResolution[1],
|
|
159
|
+
x: (x + x1) / 2,
|
|
160
|
+
y: (y + y1) / 2,
|
|
161
|
+
binItems: [],
|
|
162
|
+
value: 0,
|
|
163
|
+
_xyfCoordinates: [
|
|
164
|
+
[x, y],
|
|
165
|
+
[x1, y],
|
|
166
|
+
[x1, y1],
|
|
167
|
+
[x, y1]
|
|
168
|
+
],
|
|
169
|
+
parentSummary: heatmapData
|
|
170
|
+
};
|
|
171
|
+
gridColumn.push(cell);
|
|
172
|
+
flatGrid.push(cell);
|
|
173
|
+
}
|
|
174
|
+
gridColumn.push(cell);
|
|
175
|
+
}
|
|
176
|
+
grid.push(gridColumn);
|
|
177
|
+
heatmapData._xyfCoordinates.forEach((d, di) => {
|
|
178
|
+
const baseX = heatmapBinXScale(d[0]);
|
|
179
|
+
const baseY = heatmapBinYScale(d[1]);
|
|
180
|
+
const xCoordinate = Math.floor(baseX / actualResolution[0]);
|
|
181
|
+
const yCoordinate = Math.floor(baseY / actualResolution[1]);
|
|
182
|
+
if (grid[xCoordinate][yCoordinate]) {
|
|
183
|
+
grid[xCoordinate][yCoordinate].binItems.push(heatmapData.coordinates[di]);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
flatGrid.forEach((d) => {
|
|
187
|
+
d.value = binValue(d.binItems);
|
|
188
|
+
maxValue = Math.max(maxValue, d.value);
|
|
189
|
+
});
|
|
190
|
+
flatGrid.forEach((d) => {
|
|
191
|
+
d.percent = d.value / maxValue;
|
|
192
|
+
d.customMark = customMark && (React.createElement("g", { transform: `translate(${d.gx},${d.gy})` }, customMark({
|
|
193
|
+
d,
|
|
194
|
+
margin,
|
|
195
|
+
styleFn,
|
|
196
|
+
classFn,
|
|
197
|
+
renderFn,
|
|
198
|
+
chartSize,
|
|
199
|
+
adjustedSize: size
|
|
200
|
+
})));
|
|
201
|
+
});
|
|
202
|
+
projectedSummaries = [...projectedSummaries, ...flatGrid];
|
|
203
|
+
});
|
|
204
|
+
if (binMax) {
|
|
205
|
+
binMax(maxValue);
|
|
206
|
+
}
|
|
207
|
+
if (preprocess) {
|
|
208
|
+
const preprocessedSummary = {
|
|
209
|
+
type: "heatmap",
|
|
210
|
+
processedData: true,
|
|
211
|
+
_baseData: [],
|
|
212
|
+
_xyfCoordinates: [],
|
|
213
|
+
data: [],
|
|
214
|
+
bounds: [],
|
|
215
|
+
x: 0,
|
|
216
|
+
y: 0,
|
|
217
|
+
coordinates: projectedSummaries,
|
|
218
|
+
binMax: maxValue
|
|
219
|
+
};
|
|
220
|
+
return preprocessedSummary;
|
|
221
|
+
}
|
|
222
|
+
return projectedSummaries;
|
|
223
|
+
}
|
|
224
|
+
function trendlining({ preprocess = false, summaryType: baseSummaryType, data: baseData, finalXExtent = [
|
|
225
|
+
Math.min(...baseData.coordinates.map((d) => d.x)),
|
|
226
|
+
Math.max(...baseData.coordinates.map((d) => d.x))
|
|
227
|
+
], xScaleType = (0, d3_scale_1.scaleLinear)() }) {
|
|
228
|
+
if (preprocess) {
|
|
229
|
+
return baseData[0].coordinates;
|
|
230
|
+
}
|
|
231
|
+
let projectedSummaries = [];
|
|
232
|
+
let summaryType;
|
|
233
|
+
if (!baseSummaryType.type) {
|
|
234
|
+
summaryType = { type: summaryType };
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
summaryType = baseSummaryType;
|
|
238
|
+
}
|
|
239
|
+
const { regressionType: baseRegressionType = "linear", order = 2, precision = 4, controlPoints = 20, curve = d3_shape_1.curveCardinal } = summaryType;
|
|
240
|
+
let regressionType = baseRegressionType;
|
|
241
|
+
if (finalXExtent[0] < 0 &&
|
|
242
|
+
(baseRegressionType === "logarithmic" ||
|
|
243
|
+
baseRegressionType === "power" ||
|
|
244
|
+
baseRegressionType === "exponential")) {
|
|
245
|
+
console.error(`Cannot use this ${baseRegressionType} regressionType type with value range that goes below 0, defaulting to linear`);
|
|
246
|
+
regressionType = "linear";
|
|
247
|
+
}
|
|
248
|
+
if (baseData.coordinates && !baseData._xyfCoordinates) {
|
|
249
|
+
baseData._xyfCoordinates = baseData.coordinates.map((d) => [d.x, d.y]);
|
|
250
|
+
}
|
|
251
|
+
const data = Array.isArray(baseData) ? baseData : [baseData];
|
|
252
|
+
const xScale = xScaleType.domain([0, 1]).range(finalXExtent);
|
|
253
|
+
projectedSummaries = [];
|
|
254
|
+
data.forEach((bdata) => {
|
|
255
|
+
const regressionLine = regression_1.default[regressionType](bdata._xyfCoordinates.map((d) => {
|
|
256
|
+
let x = d[0];
|
|
257
|
+
let y = d[1];
|
|
258
|
+
if (typeof x !== "number") {
|
|
259
|
+
x = x.getTime();
|
|
260
|
+
}
|
|
261
|
+
if (typeof y !== "number") {
|
|
262
|
+
y = y.getTime();
|
|
263
|
+
}
|
|
264
|
+
return [x, y];
|
|
265
|
+
}), {
|
|
266
|
+
order,
|
|
267
|
+
precision
|
|
268
|
+
});
|
|
269
|
+
const controlStep = 1 / controlPoints;
|
|
270
|
+
let steps = [0, 1];
|
|
271
|
+
if (regressionType !== "linear") {
|
|
272
|
+
steps = [];
|
|
273
|
+
for (let step = 0; step < 1 + controlStep; step += controlStep) {
|
|
274
|
+
steps.push(step);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const controlPointArray = [];
|
|
278
|
+
steps.forEach((controlPoint) => {
|
|
279
|
+
controlPointArray.push(regressionLine.predict(xScale(controlPoint)));
|
|
280
|
+
});
|
|
281
|
+
projectedSummaries.push({
|
|
282
|
+
centroid: false,
|
|
283
|
+
customMark: undefined,
|
|
284
|
+
data: bdata,
|
|
285
|
+
parentSummary: bdata,
|
|
286
|
+
value: regressionLine.string,
|
|
287
|
+
r2: regressionLine.r2,
|
|
288
|
+
curve,
|
|
289
|
+
_xyfCoordinates: controlPointArray
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
return projectedSummaries;
|
|
293
|
+
}
|
|
294
|
+
function shapeBounds(coordinates) {
|
|
295
|
+
let left = [Infinity, 0];
|
|
296
|
+
let right = [-Infinity, 0];
|
|
297
|
+
let top = [0, Infinity];
|
|
298
|
+
let bottom = [0, -Infinity];
|
|
299
|
+
coordinates.forEach((d) => {
|
|
300
|
+
left = d[0] < left[0] ? d : left;
|
|
301
|
+
right = d[0] > right[0] ? d : right;
|
|
302
|
+
bottom = d[1] > bottom[1] ? d : bottom;
|
|
303
|
+
top = d[1] < top[1] ? d : top;
|
|
304
|
+
});
|
|
305
|
+
return {
|
|
306
|
+
center: [(left[0] + right[0]) / 2, (top[1] + bottom[1]) / 2],
|
|
307
|
+
top,
|
|
308
|
+
left,
|
|
309
|
+
right,
|
|
310
|
+
bottom
|
|
311
|
+
};
|
|
312
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contouring = contouring;
|
|
4
|
+
const d3_contour_1 = require("d3-contour");
|
|
5
|
+
const d3_scale_1 = require("d3-scale");
|
|
6
|
+
function shapeBounds(coordinates) {
|
|
7
|
+
let left = [Infinity, 0];
|
|
8
|
+
let right = [-Infinity, 0];
|
|
9
|
+
let top = [0, Infinity];
|
|
10
|
+
let bottom = [0, -Infinity];
|
|
11
|
+
coordinates.forEach((d) => {
|
|
12
|
+
left = d[0] < left[0] ? d : left;
|
|
13
|
+
right = d[0] > right[0] ? d : right;
|
|
14
|
+
bottom = d[1] > bottom[1] ? d : bottom;
|
|
15
|
+
top = d[1] < top[1] ? d : top;
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
center: [(left[0] + right[0]) / 2, (top[1] + bottom[1]) / 2],
|
|
19
|
+
top,
|
|
20
|
+
left,
|
|
21
|
+
right,
|
|
22
|
+
bottom
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function contouring({ summaryType, data, finalXExtent, finalYExtent }) {
|
|
26
|
+
let projectedSummaries = [];
|
|
27
|
+
if (!summaryType.type) {
|
|
28
|
+
summaryType = { type: summaryType };
|
|
29
|
+
}
|
|
30
|
+
const { resolution = 500, thresholds = 10, bandwidth = 20, neighborhood } = summaryType;
|
|
31
|
+
const xScale = (0, d3_scale_1.scaleLinear)()
|
|
32
|
+
.domain(finalXExtent)
|
|
33
|
+
.rangeRound([0, resolution])
|
|
34
|
+
.nice();
|
|
35
|
+
const yScale = (0, d3_scale_1.scaleLinear)()
|
|
36
|
+
.domain(finalYExtent)
|
|
37
|
+
.rangeRound([resolution, 0])
|
|
38
|
+
.nice();
|
|
39
|
+
data.forEach((contourData) => {
|
|
40
|
+
let contourProjectedSummaries = (0, d3_contour_1.contourDensity)()
|
|
41
|
+
.size([resolution, resolution])
|
|
42
|
+
.x((d) => xScale(d[0]))
|
|
43
|
+
.y((d) => yScale(d[1]))
|
|
44
|
+
.thresholds(thresholds)
|
|
45
|
+
.bandwidth(bandwidth)(contourData._xyfCoordinates);
|
|
46
|
+
if (neighborhood) {
|
|
47
|
+
contourProjectedSummaries = [contourProjectedSummaries[0]];
|
|
48
|
+
}
|
|
49
|
+
const max = Math.max(...contourProjectedSummaries.map((d) => d.value));
|
|
50
|
+
contourProjectedSummaries.forEach((summary) => {
|
|
51
|
+
summary.parentSummary = contourData;
|
|
52
|
+
summary.bounds = [];
|
|
53
|
+
summary.percent = summary.value / max;
|
|
54
|
+
summary.coordinates.forEach((poly) => {
|
|
55
|
+
poly.forEach((subpoly, i) => {
|
|
56
|
+
poly[i] = subpoly.map((coordpair) => {
|
|
57
|
+
coordpair = [
|
|
58
|
+
xScale.invert(coordpair[0]),
|
|
59
|
+
yScale.invert(coordpair[1])
|
|
60
|
+
];
|
|
61
|
+
return coordpair;
|
|
62
|
+
});
|
|
63
|
+
//Only push bounds for the main poly, not its interior rings, otherwise you end up labeling interior cutouts
|
|
64
|
+
if (i === 0) {
|
|
65
|
+
summary.bounds.push(shapeBounds(poly[i]));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
projectedSummaries = [...projectedSummaries, ...contourProjectedSummaries];
|
|
71
|
+
});
|
|
72
|
+
return projectedSummaries;
|
|
73
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.hexbinning = hexbinning;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const d3_hexbin_1 = require("d3-hexbin");
|
|
39
|
+
const d3_scale_1 = require("d3-scale");
|
|
40
|
+
function hexbinning({ preprocess = true, processedData = false, summaryType: baseSummaryType, data: baseData, finalXExtent: baseXExtent, finalYExtent: baseYExtent, size, xScaleType = (0, d3_scale_1.scaleLinear)(), yScaleType = (0, d3_scale_1.scaleLinear)(), margin, styleFn, classFn, renderFn, chartSize }) {
|
|
41
|
+
let finalXExtent = baseXExtent;
|
|
42
|
+
let finalYExtent = baseYExtent;
|
|
43
|
+
if (!finalXExtent) {
|
|
44
|
+
const xData = baseData.coordinates.map((p) => p.x);
|
|
45
|
+
finalXExtent = [Math.min(...xData), Math.max(...xData)];
|
|
46
|
+
}
|
|
47
|
+
if (!finalYExtent) {
|
|
48
|
+
const yData = baseData.coordinates.map((p) => p.y);
|
|
49
|
+
finalYExtent = [Math.min(...yData), Math.max(...yData)];
|
|
50
|
+
}
|
|
51
|
+
if (processedData && baseData) {
|
|
52
|
+
return baseData.coordinates;
|
|
53
|
+
}
|
|
54
|
+
let projectedSummaries = [];
|
|
55
|
+
let summaryType;
|
|
56
|
+
if (!baseSummaryType.type) {
|
|
57
|
+
summaryType = { type: summaryType };
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
summaryType = baseSummaryType;
|
|
61
|
+
}
|
|
62
|
+
const { bins = 0.05, cellPx, binValue = (d) => d.length, binMax, customMark } = summaryType;
|
|
63
|
+
if (baseData.coordinates && !baseData._xyfCoordinates) {
|
|
64
|
+
baseData._xyfCoordinates = baseData.coordinates.map((d) => [d.x, d.y]);
|
|
65
|
+
}
|
|
66
|
+
const data = Array.isArray(baseData) ? baseData : [baseData];
|
|
67
|
+
const hexBinXScale = xScaleType.domain(finalXExtent).range([0, size[0]]);
|
|
68
|
+
const hexBinYScale = yScaleType.domain(finalYExtent).range([0, size[1]]);
|
|
69
|
+
const actualResolution = (cellPx && cellPx / 2) || ((bins > 1 ? 1 / bins : bins) * size[0]) / 2;
|
|
70
|
+
const hexbinner = (0, d3_hexbin_1.hexbin)()
|
|
71
|
+
.x((d) => hexBinXScale(d._xyfPoint[0]))
|
|
72
|
+
.y((d) => hexBinYScale(d._xyfPoint[1]))
|
|
73
|
+
.radius(actualResolution)
|
|
74
|
+
.size(size);
|
|
75
|
+
let hexMax;
|
|
76
|
+
const allHexes = hexbinner.centers();
|
|
77
|
+
data.forEach((hexbinData) => {
|
|
78
|
+
hexMax = 0;
|
|
79
|
+
const hexes = hexbinner(hexbinData._xyfCoordinates.map((d, i) => ({
|
|
80
|
+
_xyfPoint: d,
|
|
81
|
+
...hexbinData.coordinates[i]
|
|
82
|
+
})));
|
|
83
|
+
const centerHash = {};
|
|
84
|
+
hexes.forEach((d) => {
|
|
85
|
+
centerHash[`${parseInt(d.x)}-${parseInt(d.y)}`] = true;
|
|
86
|
+
});
|
|
87
|
+
allHexes.forEach((hexCenter) => {
|
|
88
|
+
if (!centerHash[`${parseInt(hexCenter[0])}-${parseInt(hexCenter[1])}`]) {
|
|
89
|
+
const newHex = [];
|
|
90
|
+
newHex.x = hexCenter[0];
|
|
91
|
+
newHex.y = hexCenter[1];
|
|
92
|
+
hexes.push(newHex);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
hexMax = Math.max(...hexes.map((d) => binValue(d)));
|
|
96
|
+
if (binMax) {
|
|
97
|
+
binMax(hexMax);
|
|
98
|
+
}
|
|
99
|
+
const hexBase = [
|
|
100
|
+
[0, -1],
|
|
101
|
+
[0.866, -0.5],
|
|
102
|
+
[0.866, 0.5],
|
|
103
|
+
[0, 1],
|
|
104
|
+
[-0.866, 0.5],
|
|
105
|
+
[-0.866, -0.5]
|
|
106
|
+
];
|
|
107
|
+
const hexWidth = hexBinXScale.invert(actualResolution) - finalXExtent[0];
|
|
108
|
+
const hexHeight = hexBinYScale.invert(actualResolution) - finalYExtent[0];
|
|
109
|
+
const hexacoordinates = hexBase.map((d) => [
|
|
110
|
+
d[0] * hexWidth,
|
|
111
|
+
d[1] * hexHeight
|
|
112
|
+
]);
|
|
113
|
+
const hexbinProjectedSummaries = hexes.map((d) => {
|
|
114
|
+
const hexValue = binValue(d);
|
|
115
|
+
const gx = d.x;
|
|
116
|
+
const gy = d.y;
|
|
117
|
+
d.x = hexBinXScale.invert(d.x);
|
|
118
|
+
d.y = hexBinYScale.invert(d.y);
|
|
119
|
+
const percent = hexValue / hexMax;
|
|
120
|
+
return {
|
|
121
|
+
customMark: customMark && (React.createElement("g", { transform: `translate(${gx},${size[1] - gy})` }, customMark({
|
|
122
|
+
d: {
|
|
123
|
+
...d,
|
|
124
|
+
binItems: d,
|
|
125
|
+
percent,
|
|
126
|
+
value: hexValue,
|
|
127
|
+
radius: actualResolution,
|
|
128
|
+
hexCoordinates: hexBase.map((d) => [
|
|
129
|
+
d[0] * actualResolution,
|
|
130
|
+
d[1] * actualResolution
|
|
131
|
+
])
|
|
132
|
+
},
|
|
133
|
+
margin,
|
|
134
|
+
styleFn,
|
|
135
|
+
classFn,
|
|
136
|
+
renderFn,
|
|
137
|
+
chartSize,
|
|
138
|
+
adjustedSize: size
|
|
139
|
+
}))),
|
|
140
|
+
_xyfCoordinates: hexacoordinates.map((p) => [p[0] + d.x, p[1] + d.y]),
|
|
141
|
+
value: hexValue,
|
|
142
|
+
percent,
|
|
143
|
+
data: d,
|
|
144
|
+
parentSummary: hexbinData,
|
|
145
|
+
centroid: true
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
projectedSummaries = [...projectedSummaries, ...hexbinProjectedSummaries];
|
|
149
|
+
});
|
|
150
|
+
if (preprocess) {
|
|
151
|
+
projectedSummaries.forEach((d) => {
|
|
152
|
+
d.x = d.data.x;
|
|
153
|
+
d.y = d.data.y;
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
type: "hexbin",
|
|
157
|
+
processedData: true,
|
|
158
|
+
coordinates: projectedSummaries,
|
|
159
|
+
binMax: hexMax
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
return projectedSummaries;
|
|
163
|
+
}
|