semiotic 2.0.3 → 3.0.0-beta.1
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 +530 -0
- package/README.md +190 -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 +373 -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/DividedLine.js +65 -0
- package/ai/dist/src/components/FacetController.js +259 -0
- package/ai/dist/src/components/Frame.js +139 -0
- package/ai/dist/src/components/InteractionLayer.js +328 -0
- package/ai/dist/src/components/Legend.js +140 -0
- package/ai/dist/src/components/MiniMap.js +75 -0
- package/ai/dist/src/components/MinimapXYFrame.js +99 -0
- package/ai/dist/src/components/NetworkFrame.js +335 -0
- package/ai/dist/src/components/OrdinalFrame.js +437 -0
- package/ai/dist/src/components/ResponsiveFrame.js +68 -0
- package/ai/dist/src/components/ResponsiveMinimapXYFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveNetworkFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveOrdinalFrame.js +11 -0
- package/ai/dist/src/components/ResponsiveXYFrame.js +10 -0
- package/ai/dist/src/components/SparkFrame.js +113 -0
- package/ai/dist/src/components/SparkNetworkFrame.js +11 -0
- package/ai/dist/src/components/SparkOrdinalFrame.js +11 -0
- package/ai/dist/src/components/SparkXYFrame.js +11 -0
- package/ai/dist/src/components/Tooltip/Tooltip.js +304 -0
- package/ai/dist/src/components/TooltipPositioner/index.js +132 -0
- package/ai/dist/src/components/VisualizationLayer.js +395 -0
- package/ai/dist/src/components/XYFrame.js +524 -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 +198 -0
- package/ai/dist/src/components/annotationRules/orframeRules.js +695 -0
- package/ai/dist/src/components/annotationRules/xyframeRules.js +299 -0
- package/ai/dist/src/components/batchWork.js +35 -0
- package/ai/dist/src/components/charts/index.js +96 -0
- package/ai/dist/src/components/charts/network/ChordDiagram.js +245 -0
- package/ai/dist/src/components/charts/network/CirclePack.js +177 -0
- package/ai/dist/src/components/charts/network/ForceDirectedGraph.js +248 -0
- package/ai/dist/src/components/charts/network/SankeyDiagram.js +305 -0
- package/ai/dist/src/components/charts/network/TreeDiagram.js +268 -0
- package/ai/dist/src/components/charts/network/Treemap.js +177 -0
- package/ai/dist/src/components/charts/ordinal/BarChart.js +191 -0
- package/ai/dist/src/components/charts/ordinal/BoxPlot.js +235 -0
- package/ai/dist/src/components/charts/ordinal/DonutChart.js +178 -0
- package/ai/dist/src/components/charts/ordinal/DotPlot.js +194 -0
- package/ai/dist/src/components/charts/ordinal/GroupedBarChart.js +194 -0
- package/ai/dist/src/components/charts/ordinal/PieChart.js +155 -0
- package/ai/dist/src/components/charts/ordinal/StackedBarChart.js +213 -0
- package/ai/dist/src/components/charts/ordinal/SwarmPlot.js +219 -0
- package/ai/dist/src/components/charts/realtime/RealtimeBarChart.js +91 -0
- package/ai/dist/src/components/charts/realtime/RealtimeLineChart.js +73 -0
- package/ai/dist/src/components/charts/realtime/RealtimeSwarmChart.js +85 -0
- package/ai/dist/src/components/charts/realtime/RealtimeWaterfallChart.js +86 -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 +176 -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/types.js +2 -0
- package/ai/dist/src/components/charts/shared/validateChartData.js +82 -0
- package/ai/dist/src/components/charts/shared/validateProps.js +640 -0
- package/ai/dist/src/components/charts/xy/AreaChart.js +220 -0
- package/ai/dist/src/components/charts/xy/BubbleChart.js +222 -0
- package/ai/dist/src/components/charts/xy/Heatmap.js +230 -0
- package/ai/dist/src/components/charts/xy/LineChart.js +302 -0
- package/ai/dist/src/components/charts/xy/Scatterplot.js +136 -0
- package/ai/dist/src/components/charts/xy/StackedAreaChart.js +220 -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/constants/jsx.js +71 -0
- package/ai/dist/src/components/data/dataFunctions.js +473 -0
- package/ai/dist/src/components/data/multiAccessorUtils.js +14 -0
- package/ai/dist/src/components/data/networkPipelineCache.js +43 -0
- package/ai/dist/src/components/data/ordinalPipelineCache.js +53 -0
- package/ai/dist/src/components/data/unflowedFunctions.js +5 -0
- package/ai/dist/src/components/data/xyPipelineCache.js +49 -0
- package/ai/dist/src/components/generic_utilities/functions.js +5 -0
- package/ai/dist/src/components/index.js +145 -0
- package/ai/dist/src/components/interactionLayerBehavior/InteractionCanvas.js +128 -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/network.js +771 -0
- package/ai/dist/src/components/processing/networkDefaults.js +39 -0
- package/ai/dist/src/components/processing/networkLayoutHelpers.js +98 -0
- package/ai/dist/src/components/processing/ordinal.js +889 -0
- package/ai/dist/src/components/processing/ordinalConstants.js +23 -0
- package/ai/dist/src/components/processing/ordinalOverlays.js +88 -0
- package/ai/dist/src/components/processing/ordinalRenderPipeline.js +196 -0
- package/ai/dist/src/components/processing/xyDrawing.js +484 -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/RealtimeFrame.js +710 -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 +66 -0
- package/ai/dist/src/components/semiotic-network.js +30 -0
- package/ai/dist/src/components/semiotic-ordinal.js +28 -0
- package/ai/dist/src/components/semiotic-realtime.js +37 -0
- package/ai/dist/src/components/semiotic-server.js +8 -0
- package/ai/dist/src/components/semiotic-xy.js +41 -0
- package/ai/dist/src/components/semiotic.js +101 -0
- package/ai/dist/src/components/server/renderToStaticSVG.js +392 -0
- package/ai/dist/src/components/store/TooltipStore.js +13 -0
- package/ai/dist/src/components/store/createStore.js +77 -0
- package/ai/dist/src/components/svg/SvgHelper.js +308 -0
- package/ai/dist/src/components/svg/areaDrawing.js +312 -0
- package/ai/dist/src/components/svg/boxplotRenderer.js +441 -0
- package/ai/dist/src/components/svg/bucketizedRenderer.js +677 -0
- package/ai/dist/src/components/svg/ckbinsRenderer.js +92 -0
- package/ai/dist/src/components/svg/ckmeans.js +238 -0
- package/ai/dist/src/components/svg/contourLayout.js +73 -0
- package/ai/dist/src/components/svg/contourRenderer.js +53 -0
- package/ai/dist/src/components/svg/edgeGenerators.js +181 -0
- package/ai/dist/src/components/svg/frameFunctions.js +579 -0
- package/ai/dist/src/components/svg/graphAlgorithms.js +138 -0
- package/ai/dist/src/components/svg/hexbinLayout.js +163 -0
- package/ai/dist/src/components/svg/lineDrawing.js +427 -0
- package/ai/dist/src/components/svg/networkDrawing.js +207 -0
- package/ai/dist/src/components/svg/nodeGenerators.js +131 -0
- package/ai/dist/src/components/svg/pieceDrawing.js +110 -0
- package/ai/dist/src/components/svg/pieceLayouts.js +588 -0
- package/ai/dist/src/components/svg/sankeyLinks.js +143 -0
- package/ai/dist/src/components/svg/summaryAxis.js +48 -0
- package/ai/dist/src/components/svg/summaryLayouts.js +202 -0
- package/ai/dist/src/components/svg/swarmLayout.js +128 -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/useDerivedStateFromProps.js +25 -0
- package/ai/dist/src/components/useLegacyUnmountCallback.js +21 -0
- package/ai/dist/src/components/visualizationLayerBehavior/axis.js +249 -0
- package/ai/dist/src/components/visualizationLayerBehavior/general.js +435 -0
- package/ai/dist/src/setupTests.js +4 -0
- package/ai/examples.md +394 -0
- package/ai/schema.json +1178 -0
- package/ai/system-prompt.md +38 -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/FacetController.d.ts +1 -1
- package/dist/MinimapXYFrame.d.ts +2 -2
- package/dist/NetworkFrame.d.ts +5 -1
- package/dist/OrdinalFrame.d.ts +5 -1
- package/dist/ResponsiveFrame.d.ts +2 -2
- package/dist/ResponsiveMinimapXYFrame.d.ts +3 -6
- package/dist/ResponsiveNetworkFrame.d.ts +3 -6
- package/dist/ResponsiveOrdinalFrame.d.ts +3 -6
- package/dist/ResponsiveXYFrame.d.ts +3 -6
- package/dist/SparkFrame.d.ts +1 -1
- package/dist/SparkNetworkFrame.d.ts +3 -3
- package/dist/SparkOrdinalFrame.d.ts +3 -3
- package/dist/SparkXYFrame.d.ts +3 -3
- package/dist/Tooltip/Tooltip.d.ts +141 -0
- package/dist/TooltipPositioner/index.d.ts +1 -1
- package/dist/VisualizationLayer.d.ts +3 -3
- package/dist/XYFrame.d.ts +5 -1
- package/dist/annotationLayerBehavior/annotationHandling.d.ts +2 -2
- package/dist/annotationRules/networkframeRules.d.ts +2 -2
- package/dist/annotationRules/orframeRules.d.ts +2 -4
- package/dist/annotationRules/xyframeRules.d.ts +2 -2
- package/dist/batchWork.d.ts +1 -1
- package/dist/charts/index.d.ts +62 -0
- package/dist/charts/network/ChordDiagram.d.ts +181 -0
- package/dist/charts/network/CirclePack.d.ts +103 -0
- package/dist/charts/network/ForceDirectedGraph.d.ts +192 -0
- package/dist/charts/network/SankeyDiagram.d.ts +195 -0
- package/dist/charts/network/TreeDiagram.d.ts +200 -0
- package/dist/charts/network/Treemap.d.ts +98 -0
- package/dist/charts/ordinal/BarChart.d.ts +119 -0
- package/dist/charts/ordinal/BoxPlot.d.ts +125 -0
- package/dist/charts/ordinal/DonutChart.d.ts +95 -0
- package/dist/charts/ordinal/DotPlot.d.ts +128 -0
- package/dist/charts/ordinal/GroupedBarChart.d.ts +113 -0
- package/dist/charts/ordinal/PieChart.d.ts +83 -0
- package/dist/charts/ordinal/StackedBarChart.d.ts +119 -0
- package/dist/charts/ordinal/SwarmPlot.d.ts +137 -0
- package/dist/charts/realtime/RealtimeBarChart.d.ts +102 -0
- package/dist/charts/realtime/RealtimeLineChart.d.ts +78 -0
- package/dist/charts/realtime/RealtimeSwarmChart.d.ts +88 -0
- package/dist/charts/realtime/RealtimeWaterfallChart.d.ts +85 -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 +82 -0
- package/dist/charts/shared/hooks.d.ts +20 -0
- package/dist/charts/shared/legendUtils.d.ts +32 -0
- package/dist/charts/shared/types.d.ts +58 -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 +127 -0
- package/dist/charts/xy/BubbleChart.d.ts +157 -0
- package/dist/charts/xy/Heatmap.d.ts +153 -0
- package/dist/charts/xy/LineChart.d.ts +193 -0
- package/dist/charts/xy/Scatterplot.d.ts +50 -0
- package/dist/charts/xy/StackedAreaChart.d.ts +131 -0
- package/dist/constants/frame_props.d.ts +9 -0
- package/dist/constants/jsx.d.ts +2 -2
- package/dist/data/dataFunctions.d.ts +11 -12
- package/dist/data/networkPipelineCache.d.ts +27 -0
- package/dist/data/ordinalPipelineCache.d.ts +33 -0
- package/dist/data/xyPipelineCache.d.ts +35 -0
- package/dist/index.d.ts +70 -62
- package/dist/interactionLayerBehavior/InteractionCanvas.d.ts +1 -1
- package/dist/network.js +8520 -0
- package/dist/network.js.map +1 -0
- package/dist/network.min.js +1 -0
- package/dist/network.module.js +8484 -0
- package/dist/network.module.js.map +1 -0
- package/dist/network.module.min.js +1 -0
- package/dist/ordinal.js +9276 -0
- package/dist/ordinal.js.map +1 -0
- package/dist/ordinal.min.js +1 -0
- package/dist/ordinal.module.js +9242 -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/network.d.ts +25 -28
- package/dist/processing/networkDefaults.d.ts +36 -0
- package/dist/processing/networkLayoutHelpers.d.ts +54 -0
- package/dist/processing/ordinal.d.ts +43 -43
- package/dist/processing/ordinalConstants.d.ts +33 -0
- package/dist/processing/ordinalOverlays.d.ts +33 -0
- package/dist/processing/ordinalRenderPipeline.d.ts +148 -0
- package/dist/processing/xyDrawing.d.ts +46 -41
- package/dist/realtime/BinAccumulator.d.ts +8 -0
- package/dist/realtime/IncrementalExtent.d.ts +13 -0
- package/dist/realtime/RealtimeFrame.d.ts +4 -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 +1598 -0
- package/dist/realtime.js.map +1 -0
- package/dist/realtime.min.js +1 -0
- package/dist/realtime.module.js +1566 -0
- package/dist/realtime.module.js.map +1 -0
- package/dist/realtime.module.min.js +1 -0
- package/dist/semiotic-ai.d.ts +28 -0
- package/dist/semiotic-ai.js +18722 -0
- package/dist/semiotic-ai.js.map +1 -0
- package/dist/semiotic-ai.min.js +1 -0
- package/dist/semiotic-ai.module.js +18668 -0
- package/dist/semiotic-ai.module.js.map +1 -0
- package/dist/semiotic-ai.module.min.js +1 -0
- package/dist/semiotic-network.d.ts +19 -0
- package/dist/semiotic-ordinal.d.ts +18 -0
- package/dist/semiotic-realtime.d.ts +23 -0
- package/dist/semiotic-server.d.ts +1 -0
- package/dist/semiotic-xy.d.ts +24 -0
- package/dist/semiotic.d.ts +19 -3
- package/dist/semiotic.js +18707 -12983
- package/dist/semiotic.js.map +1 -0
- package/dist/semiotic.min.js +1 -0
- package/dist/semiotic.module.js +18651 -12953
- 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 +8360 -0
- package/dist/server.js.map +1 -0
- package/dist/server.min.js +1 -0
- package/dist/server.module.js +8331 -0
- package/dist/server.module.js.map +1 -0
- package/dist/server.module.min.js +1 -0
- package/dist/svg/SvgHelper.d.ts +1 -5
- package/dist/svg/areaDrawing.d.ts +3 -13
- package/dist/svg/boxplotRenderer.d.ts +15 -0
- package/dist/svg/bucketizedRenderer.d.ts +16 -0
- package/dist/svg/ckbinsRenderer.d.ts +20 -0
- package/dist/svg/contourLayout.d.ts +6 -0
- package/dist/svg/contourRenderer.d.ts +12 -0
- package/dist/svg/edgeGenerators.d.ts +51 -0
- package/dist/svg/frameFunctions.d.ts +17 -28
- package/dist/svg/graphAlgorithms.d.ts +14 -0
- package/dist/svg/hexbinLayout.d.ts +7 -0
- package/dist/svg/lineDrawing.d.ts +8 -8
- package/dist/svg/networkDrawing.d.ts +5 -123
- package/dist/svg/nodeGenerators.d.ts +58 -0
- package/dist/svg/pieceDrawing.d.ts +1 -2
- package/dist/svg/pieceLayouts.d.ts +5 -23
- package/dist/svg/sankeyLinks.d.ts +3 -0
- package/dist/svg/summaryAxis.d.ts +6 -0
- package/dist/svg/summaryLayouts.d.ts +36 -57
- package/dist/svg/swarmLayout.d.ts +13 -0
- package/dist/types/annotationTypes.d.ts +13 -18
- package/dist/types/canvasTypes.d.ts +1 -1
- package/dist/types/generalTypes.d.ts +37 -35
- 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 +13 -16
- package/dist/useLegacyUnmountCallback.d.ts +2 -1
- package/dist/visualizationLayerBehavior/axis.d.ts +3 -5
- package/dist/visualizationLayerBehavior/general.d.ts +8 -12
- package/dist/xy.js +7944 -0
- package/dist/xy.js.map +1 -0
- package/dist/xy.min.js +1 -0
- package/dist/xy.module.js +7903 -0
- package/dist/xy.module.js.map +1 -0
- package/dist/xy.module.min.js +1 -0
- package/package.json +116 -66
- package/dist/AnnotationLayer/helpers.d.ts +0 -6
- package/dist/AnnotationLayer/index.d.ts +0 -2
- 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/SpanOrDiv.d.ts +0 -10
- 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/setupTests.d.ts +0 -1
|
@@ -0,0 +1,373 @@
|
|
|
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.boundingBoxMax = exports.marginalPointMapper = void 0;
|
|
40
|
+
exports.default = Axis;
|
|
41
|
+
exports.formatValue = formatValue;
|
|
42
|
+
const React = __importStar(require("react"));
|
|
43
|
+
const react_1 = require("react");
|
|
44
|
+
const axis_1 = require("./../visualizationLayerBehavior/axis");
|
|
45
|
+
const summaryGraphic_1 = __importDefault(require("./summaryGraphic"));
|
|
46
|
+
const axisTitle_1 = __importDefault(require("./axisTitle"));
|
|
47
|
+
const summaryLayouts_1 = require("./../svg/summaryLayouts");
|
|
48
|
+
// components
|
|
49
|
+
const marginalPointMapper = (orient, width, data) => {
|
|
50
|
+
const xMod = orient === "left" || orient === "right" ? width / 2 : 0;
|
|
51
|
+
const yMod = orient === "bottom" || orient === "top" ? width / 2 : 0;
|
|
52
|
+
return data.map((p) => [p.xy.x + xMod, p.xy.y + yMod]);
|
|
53
|
+
};
|
|
54
|
+
exports.marginalPointMapper = marginalPointMapper;
|
|
55
|
+
function formatValue(value, props) {
|
|
56
|
+
if (props.tickFormat) {
|
|
57
|
+
return props.tickFormat(value);
|
|
58
|
+
}
|
|
59
|
+
if (value.toString) {
|
|
60
|
+
return value.toString();
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
const boundingBoxMax = (axisNode, orient) => {
|
|
65
|
+
const axisRef = axisNode.current;
|
|
66
|
+
if (!axisRef)
|
|
67
|
+
return 30;
|
|
68
|
+
const positionType = orient === "left" || orient === "right" ? "width" : "height";
|
|
69
|
+
const axisLabelMax = Math.max(...[...axisRef.querySelectorAll(".axis-label")]
|
|
70
|
+
.map((l) => (l.getBBox && l.getBBox()) || { height: 30, width: 30 })
|
|
71
|
+
.map((d) => d[positionType])) + 25;
|
|
72
|
+
return axisLabelMax;
|
|
73
|
+
};
|
|
74
|
+
exports.boundingBoxMax = boundingBoxMax;
|
|
75
|
+
function Axis(props) {
|
|
76
|
+
const { rotate, label, dynamicLabelPosition, orient = "left", marginalSummaryType, tickFormat = marginalSummaryType ? () => "" : (d) => d, size, width = (size && size[0]) || 0, height = (size && size[1]) || 0, className, padding, tickValues, scale, ticks, footer, tickSize, tickLineGenerator, baseline = true, margin = { top: 0, bottom: 0, left: 0, right: 0 }, center = false, annotationFunction, glyphFunction, xyPoints } = props;
|
|
77
|
+
const [hoverPosition, changeHoverPosition] = (0, react_1.useState)(0);
|
|
78
|
+
const [calculatedLabelPosition, changeCalculatedLabelPosition] = (0, react_1.useState)(undefined);
|
|
79
|
+
const axisNode = (0, react_1.useRef)(null);
|
|
80
|
+
(0, react_1.useEffect)(() => {
|
|
81
|
+
if (!label?.position && dynamicLabelPosition) {
|
|
82
|
+
const newBBMax = boundingBoxMax(axisNode, orient);
|
|
83
|
+
if (newBBMax !== calculatedLabelPosition) {
|
|
84
|
+
changeCalculatedLabelPosition(newBBMax);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, [label, dynamicLabelPosition]);
|
|
88
|
+
let { axisParts, position = [0, 0] } = props;
|
|
89
|
+
let axisTickLines;
|
|
90
|
+
if (!axisParts) {
|
|
91
|
+
axisParts = (0, axis_1.axisPieces)({
|
|
92
|
+
padding: padding,
|
|
93
|
+
tickValues,
|
|
94
|
+
scale,
|
|
95
|
+
ticks,
|
|
96
|
+
orient,
|
|
97
|
+
size: [width, height],
|
|
98
|
+
footer,
|
|
99
|
+
tickSize
|
|
100
|
+
});
|
|
101
|
+
axisTickLines = (React.createElement("g", { className: `axis ${className}` }, (0, axis_1.axisLines)({
|
|
102
|
+
axisParts,
|
|
103
|
+
orient,
|
|
104
|
+
tickLineGenerator,
|
|
105
|
+
className,
|
|
106
|
+
scale
|
|
107
|
+
})));
|
|
108
|
+
}
|
|
109
|
+
if (axisParts.length === 0) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
let hoverWidth = 50;
|
|
113
|
+
let hoverHeight = height;
|
|
114
|
+
let hoverX = -50;
|
|
115
|
+
let hoverY = 0;
|
|
116
|
+
let baselineX = 0;
|
|
117
|
+
let baselineY = 0;
|
|
118
|
+
let baselineX2 = 0;
|
|
119
|
+
let baselineY2 = height;
|
|
120
|
+
// hoverFunction is set is switch(orient) below
|
|
121
|
+
let hoverFunction;
|
|
122
|
+
let circleX = 25;
|
|
123
|
+
let textX = -25;
|
|
124
|
+
let textY = 18;
|
|
125
|
+
let lineWidth = width + 25;
|
|
126
|
+
let lineHeight = 0;
|
|
127
|
+
let circleY = hoverPosition;
|
|
128
|
+
let annotationOffset = 0;
|
|
129
|
+
let annotationType = "y";
|
|
130
|
+
switch (orient) {
|
|
131
|
+
case "right":
|
|
132
|
+
position = [position[0], position[1]];
|
|
133
|
+
hoverX = width;
|
|
134
|
+
baselineX2 = baselineX = width;
|
|
135
|
+
annotationOffset = margin.top;
|
|
136
|
+
lineWidth = -width - 25;
|
|
137
|
+
textX = 5;
|
|
138
|
+
hoverFunction = (e) => {
|
|
139
|
+
changeHoverPosition(e.nativeEvent.offsetY - annotationOffset);
|
|
140
|
+
};
|
|
141
|
+
if (center === true) {
|
|
142
|
+
baselineX2 = baselineX = width / 2;
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
case "top":
|
|
146
|
+
position = [position[0], 0];
|
|
147
|
+
hoverWidth = width;
|
|
148
|
+
hoverHeight = 50;
|
|
149
|
+
hoverY = -50;
|
|
150
|
+
hoverX = 0;
|
|
151
|
+
annotationOffset = margin.left;
|
|
152
|
+
annotationType = "x";
|
|
153
|
+
baselineX2 = width;
|
|
154
|
+
baselineY2 = 0;
|
|
155
|
+
if (center === true) {
|
|
156
|
+
baselineY2 = baselineY = height / 2;
|
|
157
|
+
}
|
|
158
|
+
hoverFunction = (e) => {
|
|
159
|
+
changeHoverPosition(e.nativeEvent.offsetX - annotationOffset);
|
|
160
|
+
};
|
|
161
|
+
circleX = hoverPosition;
|
|
162
|
+
circleY = 25;
|
|
163
|
+
textX = 0;
|
|
164
|
+
textY = -10;
|
|
165
|
+
lineWidth = 0;
|
|
166
|
+
lineHeight = height + 25;
|
|
167
|
+
break;
|
|
168
|
+
case "bottom":
|
|
169
|
+
position = [position[0], 0];
|
|
170
|
+
hoverWidth = width;
|
|
171
|
+
hoverHeight = 50;
|
|
172
|
+
baselineY = baselineY2 = hoverY = height;
|
|
173
|
+
baselineX = hoverX = 0;
|
|
174
|
+
baselineX2 = width;
|
|
175
|
+
annotationOffset = margin.left;
|
|
176
|
+
hoverFunction = (e) => {
|
|
177
|
+
changeHoverPosition(e.nativeEvent.offsetX - annotationOffset);
|
|
178
|
+
};
|
|
179
|
+
circleX = hoverPosition;
|
|
180
|
+
circleY = 25;
|
|
181
|
+
textX = 0;
|
|
182
|
+
textY = 15;
|
|
183
|
+
lineWidth = 0;
|
|
184
|
+
lineHeight = -height - 25;
|
|
185
|
+
annotationType = "x";
|
|
186
|
+
if (center === true) {
|
|
187
|
+
baselineY2 = baselineY = height / 2;
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
default:
|
|
191
|
+
position = [position[0], position[1]];
|
|
192
|
+
annotationOffset = margin.top;
|
|
193
|
+
if (center === true) {
|
|
194
|
+
baselineX2 = baselineX = width / 2;
|
|
195
|
+
}
|
|
196
|
+
hoverFunction = (e) => {
|
|
197
|
+
changeHoverPosition(e.nativeEvent.offsetY - annotationOffset);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
let annotationBrush;
|
|
201
|
+
if (annotationFunction) {
|
|
202
|
+
const formattedValue = formatValue(scale.invert(hoverPosition), props);
|
|
203
|
+
const hoverGlyph = glyphFunction ? (glyphFunction({
|
|
204
|
+
lineHeight,
|
|
205
|
+
lineWidth,
|
|
206
|
+
value: scale.invert(hoverPosition)
|
|
207
|
+
})) : (React.createElement("g", null,
|
|
208
|
+
React.isValidElement(formattedValue) ? (React.createElement("g", { transform: `translate(${textX},${textY})` }, formattedValue)) : (React.createElement("text", { x: textX, y: textY }, formattedValue)),
|
|
209
|
+
React.createElement("circle", { r: 5 }),
|
|
210
|
+
React.createElement("line", { x1: lineWidth, y1: lineHeight, style: { stroke: "black" } })));
|
|
211
|
+
const annotationSymbol = hoverPosition ? (React.createElement("g", { style: { pointerEvents: "none" }, transform: `translate(${circleX},${circleY})` }, hoverGlyph)) : null;
|
|
212
|
+
annotationBrush = (React.createElement("g", { className: "annotation-brush", transform: `translate(${hoverX},${hoverY})` },
|
|
213
|
+
React.createElement("rect", { style: { fillOpacity: 0 }, height: hoverHeight, width: hoverWidth, onMouseMove: hoverFunction, onClick: (e) => annotationFunction({
|
|
214
|
+
className: "dynamic-axis-annotation",
|
|
215
|
+
type: annotationType,
|
|
216
|
+
value: scale.invert(hoverPosition),
|
|
217
|
+
e
|
|
218
|
+
}), onMouseOut: () => {
|
|
219
|
+
changeHoverPosition(undefined);
|
|
220
|
+
} }),
|
|
221
|
+
annotationSymbol));
|
|
222
|
+
}
|
|
223
|
+
let summaryGraphic;
|
|
224
|
+
if (marginalSummaryType && xyPoints) {
|
|
225
|
+
const summaryWidth = Math.max(margin[orient] - 6, 5);
|
|
226
|
+
const decoratedSummaryType = typeof marginalSummaryType === "string"
|
|
227
|
+
? { type: marginalSummaryType }
|
|
228
|
+
: marginalSummaryType;
|
|
229
|
+
if (decoratedSummaryType.flip === undefined &&
|
|
230
|
+
(orient === "bottom" || orient === "right")) {
|
|
231
|
+
decoratedSummaryType.flip = true;
|
|
232
|
+
}
|
|
233
|
+
const summaryStyle = decoratedSummaryType.summaryStyle
|
|
234
|
+
? () => decoratedSummaryType.summaryStyle
|
|
235
|
+
: () => ({
|
|
236
|
+
fill: "black",
|
|
237
|
+
fillOpacity: 0.5,
|
|
238
|
+
stroke: "black",
|
|
239
|
+
strokeDasharray: "0"
|
|
240
|
+
});
|
|
241
|
+
const summaryRenderMode = decoratedSummaryType.renderMode
|
|
242
|
+
? () => decoratedSummaryType.renderMode
|
|
243
|
+
: () => undefined;
|
|
244
|
+
const summaryClass = decoratedSummaryType.summaryClass
|
|
245
|
+
? () => decoratedSummaryType.summaryClass
|
|
246
|
+
: () => "";
|
|
247
|
+
const dataFilter = decoratedSummaryType.filter || (() => true);
|
|
248
|
+
const forSummaryData = xyPoints
|
|
249
|
+
.filter((p) => p.x !== undefined && p.y !== undefined && dataFilter(p.data))
|
|
250
|
+
.map((d) => ({
|
|
251
|
+
...d,
|
|
252
|
+
xy: {
|
|
253
|
+
x: orient === "top" || orient === "bottom" ? scale(d.x) : 0,
|
|
254
|
+
y: orient === "left" || orient === "right" ? scale(d.y) : 0
|
|
255
|
+
},
|
|
256
|
+
piece: {
|
|
257
|
+
scaledVerticalValue: scale(d.y),
|
|
258
|
+
scaledValue: scale(d.x)
|
|
259
|
+
},
|
|
260
|
+
value: orient === "top" || orient === "bottom" ? scale(d.y) : scale(d.x),
|
|
261
|
+
scaledValue: scale(d.x),
|
|
262
|
+
scaledVerticalValue: scale(d.y)
|
|
263
|
+
}));
|
|
264
|
+
const calculatedSummary = (0, summaryLayouts_1.drawSummaries)({
|
|
265
|
+
data: {
|
|
266
|
+
column: {
|
|
267
|
+
middle: summaryWidth / 2,
|
|
268
|
+
pieceData: forSummaryData,
|
|
269
|
+
width: summaryWidth,
|
|
270
|
+
xyData: forSummaryData
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
type: decoratedSummaryType,
|
|
274
|
+
renderMode: summaryRenderMode,
|
|
275
|
+
eventListenersGenerator: decoratedSummaryType.eventListenersGenerator || (() => ({})),
|
|
276
|
+
styleFn: summaryStyle,
|
|
277
|
+
classFn: summaryClass,
|
|
278
|
+
projection: orient === "top" || orient === "bottom" ? "horizontal" : "vertical",
|
|
279
|
+
adjustedSize: size,
|
|
280
|
+
margin: { top: 0, bottom: 0, left: 0, right: 0 }
|
|
281
|
+
});
|
|
282
|
+
const renderedSummary = (0, summaryLayouts_1.summaryInstructionsToMarks)(calculatedSummary.marks);
|
|
283
|
+
let points;
|
|
284
|
+
if (decoratedSummaryType.showPoints === true) {
|
|
285
|
+
const mappedPoints = marginalPointMapper(orient, summaryWidth, forSummaryData);
|
|
286
|
+
points = mappedPoints.map((d, i) => (React.createElement("circle", { key: `axis-summary-point-${i}`, cx: d[0], cy: d[1], r: decoratedSummaryType.r || 3, style: decoratedSummaryType.pointStyle || {
|
|
287
|
+
fill: "black",
|
|
288
|
+
fillOpacity: 0.1
|
|
289
|
+
} })));
|
|
290
|
+
}
|
|
291
|
+
const translation = {
|
|
292
|
+
left: [-margin.left + 2, 0],
|
|
293
|
+
right: [size[0] + 2, 0],
|
|
294
|
+
top: [0, -margin.top + 2],
|
|
295
|
+
bottom: [0, size[1] + 2]
|
|
296
|
+
};
|
|
297
|
+
summaryGraphic = (React.createElement(summaryGraphic_1.default, { translation: translation, orient: orient, decoratedSummaryType: decoratedSummaryType, summaryWidth: summaryWidth, renderedSummary: renderedSummary, points: points }));
|
|
298
|
+
}
|
|
299
|
+
let axisTitle;
|
|
300
|
+
const axisTickLabels = (0, axis_1.axisLabels)({
|
|
301
|
+
tickFormat,
|
|
302
|
+
axisParts,
|
|
303
|
+
orient,
|
|
304
|
+
rotate,
|
|
305
|
+
center
|
|
306
|
+
});
|
|
307
|
+
if (label) {
|
|
308
|
+
const labelName = label.name || label;
|
|
309
|
+
const labelPosition = label.position || {};
|
|
310
|
+
const locationMod = labelPosition.location || "outside";
|
|
311
|
+
let anchorMod = (labelPosition.anchor || "middle");
|
|
312
|
+
const distance = label.locationDistance || calculatedLabelPosition;
|
|
313
|
+
const rotateHash = {
|
|
314
|
+
left: -90,
|
|
315
|
+
right: 90,
|
|
316
|
+
top: 0,
|
|
317
|
+
bottom: 0
|
|
318
|
+
};
|
|
319
|
+
const rotation = labelPosition.rotation || rotateHash[orient];
|
|
320
|
+
const positionHash = {
|
|
321
|
+
left: {
|
|
322
|
+
start: [0, size[1]],
|
|
323
|
+
middle: [0, size[1] / 2],
|
|
324
|
+
end: [0, 0],
|
|
325
|
+
inside: [distance || 15, 0],
|
|
326
|
+
outside: [-(distance || 45), 0]
|
|
327
|
+
},
|
|
328
|
+
right: {
|
|
329
|
+
start: [size[0] + 0, size[1]],
|
|
330
|
+
middle: [size[0] + 0, size[1] / 2],
|
|
331
|
+
end: [size[0] + 0, 0],
|
|
332
|
+
inside: [-(distance || 15), 0],
|
|
333
|
+
outside: [distance || 45, 0]
|
|
334
|
+
},
|
|
335
|
+
top: {
|
|
336
|
+
start: [0, 0],
|
|
337
|
+
middle: [0 + size[0] / 2, 0],
|
|
338
|
+
end: [0 + size[0], 0],
|
|
339
|
+
inside: [0, distance || 15],
|
|
340
|
+
outside: [0, -(distance || 40)]
|
|
341
|
+
},
|
|
342
|
+
bottom: {
|
|
343
|
+
start: [0, size[1]],
|
|
344
|
+
middle: [0 + size[0] / 2, size[1]],
|
|
345
|
+
end: [0 + size[0], size[1]],
|
|
346
|
+
inside: [0, -(distance || 5)],
|
|
347
|
+
outside: [0, distance || 50]
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const translation = positionHash[orient][anchorMod];
|
|
351
|
+
const location = positionHash[orient][locationMod];
|
|
352
|
+
translation[0] = translation[0] + location[0];
|
|
353
|
+
translation[1] = translation[1] + location[1];
|
|
354
|
+
if (anchorMod === "start" && orient === "right") {
|
|
355
|
+
anchorMod = "end";
|
|
356
|
+
}
|
|
357
|
+
else if (anchorMod === "end" && orient === "right") {
|
|
358
|
+
anchorMod = "start";
|
|
359
|
+
}
|
|
360
|
+
axisTitle = (React.createElement(axisTitle_1.default, { className: className, translation: translation, position: position, rotation: rotation, labelName: labelName, anchorMod: anchorMod }));
|
|
361
|
+
}
|
|
362
|
+
const axisAriaLabel = `${orient} axis ${(axisParts &&
|
|
363
|
+
axisParts.length > 0 &&
|
|
364
|
+
`from ${tickFormat(axisParts[0].value, 0)} to ${tickFormat(axisParts[axisParts.length - 1].value, axisParts.length - 1)}`) ||
|
|
365
|
+
"without ticks"}`;
|
|
366
|
+
return (React.createElement("g", { className: className, "aria-label": axisAriaLabel, ref: axisNode },
|
|
367
|
+
annotationBrush,
|
|
368
|
+
axisTickLabels,
|
|
369
|
+
axisTickLines,
|
|
370
|
+
baseline === true ? (React.createElement("line", { key: "baseline", className: `axis-baseline ${className}`, stroke: "black", strokeLinecap: "square", x1: baselineX, x2: baselineX2, y1: baselineY, y2: baselineY2 })) : null,
|
|
371
|
+
axisTitle,
|
|
372
|
+
summaryGraphic));
|
|
373
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = AxisTitle;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function AxisTitle(props) {
|
|
9
|
+
const { className, translation, position, rotation, labelName, anchorMod } = props;
|
|
10
|
+
return (react_1.default.createElement("g", { className: `axis-title ${className}`, transform: `translate(${[
|
|
11
|
+
translation[0] + position[0],
|
|
12
|
+
translation[1] + position[1]
|
|
13
|
+
]}) rotate(${rotation})` }, react_1.default.isValidElement(labelName) ? (labelName) : (react_1.default.createElement("text", { textAnchor: anchorMod }, labelName))));
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Axis_1 = __importDefault(require("./Axis"));
|
|
7
|
+
exports.default = Axis_1.default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = SummaryGraphic;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function translateX({ t, o, w }) {
|
|
9
|
+
if ((t === "contour" || t === "boxplot") && (o === "left" || o === "right")) {
|
|
10
|
+
return w / 2;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
return 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function translateY({ t, o, w }) {
|
|
17
|
+
if ((t === "contour" || t === "boxplot") && (o === "top" || o === "bottom")) {
|
|
18
|
+
return w / 2;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function SummaryGraphic(props) {
|
|
25
|
+
const { translation, orient, decoratedSummaryType, summaryWidth, renderedSummary, points } = props;
|
|
26
|
+
return (react_1.default.createElement("g", { className: "marginal-graphics", transform: `translate(${translation[orient]})` },
|
|
27
|
+
react_1.default.createElement("g", { transform: `translate(${translateX({
|
|
28
|
+
t: decoratedSummaryType.type,
|
|
29
|
+
o: orient,
|
|
30
|
+
w: summaryWidth
|
|
31
|
+
})},${translateY({
|
|
32
|
+
t: decoratedSummaryType.type,
|
|
33
|
+
o: orient,
|
|
34
|
+
w: summaryWidth
|
|
35
|
+
})})` }, renderedSummary),
|
|
36
|
+
points));
|
|
37
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.default = Brush;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const react_1 = require("react");
|
|
40
|
+
const d3_selection_1 = require("d3-selection");
|
|
41
|
+
const flatten = (list) => list.reduce((a, b) => a.concat(Array.isArray(b) ? flatten(b.slice().sort((a, b) => a - b)) : b), []);
|
|
42
|
+
function flatShortArray(baseArray = []) {
|
|
43
|
+
if (!Array.isArray(baseArray))
|
|
44
|
+
return "not-array";
|
|
45
|
+
let array = baseArray.slice();
|
|
46
|
+
if (!Array.isArray(array[0])) {
|
|
47
|
+
array = array.slice().sort((a, b) => a - b);
|
|
48
|
+
}
|
|
49
|
+
const flat = flatten(array);
|
|
50
|
+
const stringifiedFlattened = flat
|
|
51
|
+
.map((d) => (d instanceof Date && d.toString()) ||
|
|
52
|
+
(d !== undefined && d.toFixed && d.toFixed(2)) ||
|
|
53
|
+
"empty")
|
|
54
|
+
.toString();
|
|
55
|
+
return stringifiedFlattened;
|
|
56
|
+
}
|
|
57
|
+
const createBrush = (node, props) => {
|
|
58
|
+
const { svgBrush: brush, selectedExtent: baseSelectedExtent } = props;
|
|
59
|
+
(0, d3_selection_1.select)(node).call(brush);
|
|
60
|
+
if (baseSelectedExtent) {
|
|
61
|
+
let selectedExtent = baseSelectedExtent;
|
|
62
|
+
if (Array.isArray(baseSelectedExtent[0])) {
|
|
63
|
+
const sortedY = [selectedExtent[0][1], selectedExtent[1][1]].sort((a, b) => a - b);
|
|
64
|
+
selectedExtent = [
|
|
65
|
+
[selectedExtent[0][0], sortedY[0]],
|
|
66
|
+
[selectedExtent[1][0], sortedY[1]]
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
(0, d3_selection_1.select)(node).call(brush.move, selectedExtent);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function Brush(props) {
|
|
73
|
+
const { extent, selectedExtent } = props;
|
|
74
|
+
const node = (0, react_1.useRef)(null);
|
|
75
|
+
const flatExtent = flatShortArray(extent);
|
|
76
|
+
const flatSelectedExtent = flatShortArray(selectedExtent);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
if (node?.current) {
|
|
79
|
+
createBrush(node.current, props);
|
|
80
|
+
}
|
|
81
|
+
}, [flatExtent, flatSelectedExtent, node]);
|
|
82
|
+
const { position = [0, 0] } = props;
|
|
83
|
+
return (React.createElement("g", { transform: `translate(${position})`, ref: node, className: "xybrush" }));
|
|
84
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.default = DividedLine;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const d3_shape_1 = require("d3-shape");
|
|
39
|
+
const lineDrawing_1 = require("./svg/lineDrawing");
|
|
40
|
+
const createLineSegments = (props) => {
|
|
41
|
+
const { parameters, className, interpolate = d3_shape_1.curveLinear, customAccessors, lineDataAccessor, data, searchIterations, ...rest } = props;
|
|
42
|
+
const { x, y } = customAccessors;
|
|
43
|
+
const lineData = (0, lineDrawing_1.projectLineData)({
|
|
44
|
+
data: data,
|
|
45
|
+
lineDataAccessor: [lineDataAccessor],
|
|
46
|
+
xProp: "x",
|
|
47
|
+
yProp: "y",
|
|
48
|
+
xAccessor: [x],
|
|
49
|
+
yAccessor: [y]
|
|
50
|
+
});
|
|
51
|
+
//Compatibility before Semiotic 2
|
|
52
|
+
for (const projectedD of lineData) {
|
|
53
|
+
projectedD.data = projectedD.data.map((d) => ({ ...d.data, ...d }));
|
|
54
|
+
}
|
|
55
|
+
const lines = (0, lineDrawing_1.dividedLine)(parameters, lineData[0].data, searchIterations);
|
|
56
|
+
const lineRender = (0, d3_shape_1.line)()
|
|
57
|
+
.curve(interpolate)
|
|
58
|
+
.x((d) => d.x)
|
|
59
|
+
.y((d) => d.y);
|
|
60
|
+
return lines.map((d, i) => (React.createElement("path", { ...rest, className: className, key: `DividedLine-${i}`, style: d.key, d: lineRender(d.points) })));
|
|
61
|
+
};
|
|
62
|
+
function DividedLine(props) {
|
|
63
|
+
const lines = createLineSegments(props);
|
|
64
|
+
return React.createElement("g", null, lines);
|
|
65
|
+
}
|