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,437 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.OrdinalFrameInner = OrdinalFrameInner;
|
|
41
|
+
const React = __importStar(require("react"));
|
|
42
|
+
const react_1 = require("react");
|
|
43
|
+
const d3_scale_1 = require("d3-scale");
|
|
44
|
+
const frame_props_1 = require("./constants/frame_props");
|
|
45
|
+
const orframeRules_1 = require("./annotationRules/orframeRules");
|
|
46
|
+
const baseRules_1 = require("./annotationRules/baseRules");
|
|
47
|
+
const multiAccessorUtils_1 = require("./data/multiAccessorUtils");
|
|
48
|
+
const Frame_1 = __importDefault(require("./Frame"));
|
|
49
|
+
const dataFunctions_1 = require("./data/dataFunctions");
|
|
50
|
+
const ordinal_1 = require("./processing/ordinal");
|
|
51
|
+
const ordinalPipelineCache_1 = require("./data/ordinalPipelineCache");
|
|
52
|
+
const useDerivedStateFromProps_1 = require("./useDerivedStateFromProps");
|
|
53
|
+
const useLegacyUnmountCallback_1 = require("./useLegacyUnmountCallback");
|
|
54
|
+
const xScale = (0, d3_scale_1.scaleLinear)();
|
|
55
|
+
const yScale = (0, d3_scale_1.scaleLinear)();
|
|
56
|
+
const projectedCoordinatesObject = { y: "y", x: "x" };
|
|
57
|
+
const defaultOverflow = { top: 0, bottom: 0, left: 0, right: 0 };
|
|
58
|
+
const defaultProps = {
|
|
59
|
+
annotations: [],
|
|
60
|
+
foregroundGraphics: [],
|
|
61
|
+
projection: "vertical",
|
|
62
|
+
size: [500, 500],
|
|
63
|
+
className: "",
|
|
64
|
+
data: [],
|
|
65
|
+
oScaleType: (0, d3_scale_1.scaleBand)(),
|
|
66
|
+
rScaleType: d3_scale_1.scaleLinear,
|
|
67
|
+
type: "none",
|
|
68
|
+
optimizeCustomTooltipPosition: false
|
|
69
|
+
};
|
|
70
|
+
function OrdinalFrameInner(allProps) {
|
|
71
|
+
const props = { ...defaultProps, ...allProps };
|
|
72
|
+
const pipelineCacheRef = (0, react_1.useRef)((0, ordinalPipelineCache_1.createOrdinalPipelineCache)());
|
|
73
|
+
const baseState = {
|
|
74
|
+
adjustedPosition: [],
|
|
75
|
+
adjustedSize: [],
|
|
76
|
+
backgroundGraphics: undefined,
|
|
77
|
+
foregroundGraphics: undefined,
|
|
78
|
+
axisData: undefined,
|
|
79
|
+
renderNumber: 0,
|
|
80
|
+
oLabels: { labels: [] },
|
|
81
|
+
oAccessor: (0, dataFunctions_1.stringToArrayFn)("renderKey"),
|
|
82
|
+
rAccessor: (0, dataFunctions_1.stringToArrayFn)("value"),
|
|
83
|
+
oScale: (0, d3_scale_1.scaleBand)(),
|
|
84
|
+
rScale: (0, d3_scale_1.scaleLinear)(),
|
|
85
|
+
axes: undefined,
|
|
86
|
+
calculatedOExtent: [],
|
|
87
|
+
calculatedRExtent: [0, 1],
|
|
88
|
+
columnOverlays: [],
|
|
89
|
+
dataVersion: undefined,
|
|
90
|
+
legendSettings: undefined,
|
|
91
|
+
margin: { top: 0, bottom: 0, left: 0, right: 0 },
|
|
92
|
+
oExtent: [],
|
|
93
|
+
oScaleType: (0, d3_scale_1.scaleBand)(),
|
|
94
|
+
orFrameRender: {},
|
|
95
|
+
pieceDataXY: [],
|
|
96
|
+
pieceIDAccessor: (0, dataFunctions_1.stringToFn)("semioticPieceID"),
|
|
97
|
+
projectedColumns: {},
|
|
98
|
+
rExtent: [],
|
|
99
|
+
rScaleType: (0, d3_scale_1.scaleLinear)(),
|
|
100
|
+
summaryType: { type: "none" },
|
|
101
|
+
title: {},
|
|
102
|
+
type: { type: "none" },
|
|
103
|
+
props: props
|
|
104
|
+
};
|
|
105
|
+
const initialState = (0, react_1.useMemo)(() => ({
|
|
106
|
+
...baseState,
|
|
107
|
+
...(0, ordinal_1.calculateOrdinalFrame)(props, baseState, pipelineCacheRef.current)
|
|
108
|
+
}), []);
|
|
109
|
+
const state = (0, useDerivedStateFromProps_1.useDerivedStateFromProps)((nextProps, prevState) => deriveOrdinalFrameState(nextProps, prevState, pipelineCacheRef.current), props, initialState);
|
|
110
|
+
(0, useLegacyUnmountCallback_1.useLegacyUnmountCallback)(props, state);
|
|
111
|
+
const propsRef = (0, react_1.useRef)(props);
|
|
112
|
+
propsRef.current = props;
|
|
113
|
+
const stateRef = (0, react_1.useRef)(state);
|
|
114
|
+
stateRef.current = state;
|
|
115
|
+
const defaultSVGRuleCb = (0, react_1.useCallback)((args) => defaultORSVGRule(propsRef.current, stateRef.current, args), []);
|
|
116
|
+
const defaultHTMLRuleCb = (0, react_1.useCallback)((args) => defaultORHTMLRule(propsRef.current, stateRef.current, args), []);
|
|
117
|
+
const { className, annotationSettings, annotations, matte, renderKey, interaction, customClickBehavior, customHoverBehavior, customDoubleClickBehavior, projection, backgroundGraphics, foregroundGraphics, afterElements, beforeElements, disableContext, summaryType, summaryHoverAnnotation, pieceHoverAnnotation, hoverAnnotation, canvasPostProcess, canvasPieces, canvasSummaries, canvasConnectors, renderOrder, additionalDefs, sketchyRenderingEngine, frameRenderOrder, disableCanvasInteraction, disableProgressiveRendering, transition } = props;
|
|
118
|
+
const { orFrameRender, projectedColumns, adjustedPosition, adjustedSize, legendSettings, columnOverlays, axesTickLines, axes, margin, pieceDataXY, oLabels, title } = state;
|
|
119
|
+
const size = [
|
|
120
|
+
adjustedSize[0] + margin.left + margin.right,
|
|
121
|
+
adjustedSize[1] + margin.top + margin.bottom
|
|
122
|
+
];
|
|
123
|
+
let interactionOverflow;
|
|
124
|
+
if (summaryType && summaryType.amplitude) {
|
|
125
|
+
if (projection === "horizontal") {
|
|
126
|
+
interactionOverflow = {
|
|
127
|
+
top: summaryType.amplitude,
|
|
128
|
+
bottom: 0,
|
|
129
|
+
left: 0,
|
|
130
|
+
right: 0
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
else if (projection === "radial") {
|
|
134
|
+
interactionOverflow = defaultOverflow;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
interactionOverflow = {
|
|
138
|
+
top: 0,
|
|
139
|
+
bottom: 0,
|
|
140
|
+
left: summaryType.amplitude,
|
|
141
|
+
right: 0
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Memoize foreground graphics calculation
|
|
146
|
+
const renderedForegroundGraphics = (0, react_1.useMemo)(() => typeof foregroundGraphics === "function"
|
|
147
|
+
? foregroundGraphics({ size, margin })
|
|
148
|
+
: foregroundGraphics, [foregroundGraphics, size, margin]);
|
|
149
|
+
// Memoize className concatenation
|
|
150
|
+
const frameClassName = (0, react_1.useMemo)(() => `${className} ${projection}`, [className, projection]);
|
|
151
|
+
// Memoize hoverAnnotation selection
|
|
152
|
+
const selectedHoverAnnotation = (0, react_1.useMemo)(() => summaryHoverAnnotation || hoverAnnotation || pieceHoverAnnotation, [summaryHoverAnnotation, pieceHoverAnnotation, hoverAnnotation]);
|
|
153
|
+
// Memoize interaction object
|
|
154
|
+
const memoizedInteraction = (0, react_1.useMemo)(() => interaction && {
|
|
155
|
+
...interaction,
|
|
156
|
+
brush: interaction.columnsBrush !== true && "oBrush",
|
|
157
|
+
projection,
|
|
158
|
+
projectedColumns
|
|
159
|
+
}, [interaction, projection, projectedColumns]);
|
|
160
|
+
// Memoize canvas rendering flag
|
|
161
|
+
const canvasRendering = (0, react_1.useMemo)(() => !!(canvasPieces || canvasSummaries || canvasConnectors), [canvasPieces, canvasSummaries, canvasConnectors]);
|
|
162
|
+
return (React.createElement(Frame_1.default, { name: "ordinalframe", renderPipeline: orFrameRender, adjustedPosition: adjustedPosition, adjustedSize: adjustedSize, size: size, xScale: xScale, yScale: yScale, axes: axes, axesTickLines: axesTickLines, title: title, matte: matte, additionalDefs: additionalDefs, className: frameClassName, frameKey: "none", renderFn: renderKey, projectedCoordinateNames: projectedCoordinatesObject, defaultSVGRule: defaultSVGRuleCb, defaultHTMLRule: defaultHTMLRuleCb, hoverAnnotation: selectedHoverAnnotation, annotations: annotations, annotationSettings: annotationSettings, legendSettings: legendSettings, interaction: memoizedInteraction, customClickBehavior: customClickBehavior, customHoverBehavior: customHoverBehavior, customDoubleClickBehavior: customDoubleClickBehavior, points: pieceDataXY, margin: margin, columns: projectedColumns, backgroundGraphics: backgroundGraphics, foregroundGraphics: renderedForegroundGraphics, beforeElements: beforeElements, afterElements: afterElements, overlay: columnOverlays, rScale: state.rScale, projection: projection, disableContext: disableContext, interactionOverflow: interactionOverflow, canvasPostProcess: canvasPostProcess, canvasRendering: canvasRendering, renderOrder: renderOrder, disableCanvasInteraction: disableCanvasInteraction, sketchyRenderingEngine: sketchyRenderingEngine, frameRenderOrder: frameRenderOrder, additionalVizElements: oLabels, disableProgressiveRendering: disableProgressiveRendering, transition: transition }));
|
|
163
|
+
}
|
|
164
|
+
function deriveOrdinalFrameState(nextProps, prevState, cache) {
|
|
165
|
+
const { props } = prevState;
|
|
166
|
+
// Check which category of props changed
|
|
167
|
+
const dataPropsChanged = !prevState.dataVersion && frame_props_1.orFrameDataAffectingProps.some((prop) => props[prop] !== nextProps[prop]);
|
|
168
|
+
const scalePropsChanged = !prevState.dataVersion && frame_props_1.orFrameScaleAffectingProps.some((prop) => props[prop] !== nextProps[prop]);
|
|
169
|
+
const sizeChanged = props.size[0] !== nextProps.size[0] || props.size[1] !== nextProps.size[1];
|
|
170
|
+
// Force full recalc if dataVersion changed or no projectedColumns exists
|
|
171
|
+
if ((prevState.dataVersion && prevState.dataVersion !== nextProps.dataVersion) ||
|
|
172
|
+
!prevState.projectedColumns) {
|
|
173
|
+
return {
|
|
174
|
+
...(0, ordinal_1.calculateOrdinalFrame)(nextProps, prevState, cache),
|
|
175
|
+
props: nextProps
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
// Full data recalculation needed if data-affecting props changed
|
|
179
|
+
if (dataPropsChanged) {
|
|
180
|
+
return {
|
|
181
|
+
...(0, ordinal_1.calculateOrdinalFrame)(nextProps, prevState, cache),
|
|
182
|
+
props: nextProps
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
// Scale/layout recalculation needed if size or scale-affecting props changed
|
|
186
|
+
// Note: calculateOrdinalFrame doesn't have an updateData flag like XYFrame,
|
|
187
|
+
// but size changes typically need full recalc due to column layout
|
|
188
|
+
if (sizeChanged || scalePropsChanged) {
|
|
189
|
+
return {
|
|
190
|
+
...(0, ordinal_1.calculateOrdinalFrame)(nextProps, prevState, cache),
|
|
191
|
+
props: nextProps
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
// Only styling changed - no recalc needed, React will re-render with existing state
|
|
195
|
+
return { props: nextProps };
|
|
196
|
+
}
|
|
197
|
+
const annotationTypeStrings = new Set([
|
|
198
|
+
"label", "callout", "callout-circle", "callout-rect",
|
|
199
|
+
"callout-custom", "xy-threshold", "bracket"
|
|
200
|
+
]);
|
|
201
|
+
function defaultORSVGRule(props, state, { d, i, annotationLayer }) {
|
|
202
|
+
const { projection, svgAnnotationRules } = props;
|
|
203
|
+
const { adjustedPosition, adjustedSize, oAccessor, rAccessor, oScale, rScale, projectedColumns, orFrameRender, pieceIDAccessor, rScaleType, summaryType, type } = state;
|
|
204
|
+
let screenCoordinates = [0, 0];
|
|
205
|
+
orframeRules_1.getColumnScreenCoordinates;
|
|
206
|
+
if (d.isColumnAnnotation) {
|
|
207
|
+
const { coordinates: [xPosition, yPosition] } = (0, orframeRules_1.getColumnScreenCoordinates)({
|
|
208
|
+
d,
|
|
209
|
+
projectedColumns,
|
|
210
|
+
oAccessor,
|
|
211
|
+
summaryType,
|
|
212
|
+
type,
|
|
213
|
+
projection,
|
|
214
|
+
adjustedPosition,
|
|
215
|
+
adjustedSize
|
|
216
|
+
});
|
|
217
|
+
screenCoordinates = [xPosition, yPosition];
|
|
218
|
+
}
|
|
219
|
+
else if (d.coordinates || (d.type === "enclose" && d.neighbors)) {
|
|
220
|
+
screenCoordinates = (d.coordinates || d.neighbors).map((p) => {
|
|
221
|
+
const pO = (0, multiAccessorUtils_1.findFirstAccessorValue)(oAccessor, p) || p.column;
|
|
222
|
+
const oColumn = projectedColumns[pO];
|
|
223
|
+
const idPiece = (0, orframeRules_1.findIDPiece)(pieceIDAccessor, oColumn, p);
|
|
224
|
+
return (0, orframeRules_1.screenProject)({
|
|
225
|
+
p,
|
|
226
|
+
adjustedSize,
|
|
227
|
+
rScale,
|
|
228
|
+
rAccessor,
|
|
229
|
+
idPiece,
|
|
230
|
+
projection,
|
|
231
|
+
oColumn,
|
|
232
|
+
rScaleType
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const pO = (0, multiAccessorUtils_1.findFirstAccessorValue)(oAccessor, d) || d.column;
|
|
238
|
+
const oColumn = projectedColumns[pO];
|
|
239
|
+
const idPiece = (0, orframeRules_1.findIDPiece)(pieceIDAccessor, oColumn, d);
|
|
240
|
+
screenCoordinates = (0, orframeRules_1.screenProject)({
|
|
241
|
+
p: d,
|
|
242
|
+
adjustedSize,
|
|
243
|
+
rScale,
|
|
244
|
+
rAccessor,
|
|
245
|
+
idPiece,
|
|
246
|
+
projection,
|
|
247
|
+
oColumn,
|
|
248
|
+
rScaleType
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const { voronoiHover } = annotationLayer;
|
|
252
|
+
//TODO: Process your rules first
|
|
253
|
+
const customAnnotation = svgAnnotationRules &&
|
|
254
|
+
svgAnnotationRules({
|
|
255
|
+
d,
|
|
256
|
+
i,
|
|
257
|
+
oScale,
|
|
258
|
+
rScale,
|
|
259
|
+
oAccessor,
|
|
260
|
+
rAccessor,
|
|
261
|
+
orFrameProps: props,
|
|
262
|
+
orFrameState: state,
|
|
263
|
+
screenCoordinates,
|
|
264
|
+
adjustedPosition,
|
|
265
|
+
adjustedSize,
|
|
266
|
+
annotationLayer,
|
|
267
|
+
categories: projectedColumns,
|
|
268
|
+
voronoiHover
|
|
269
|
+
});
|
|
270
|
+
if (svgAnnotationRules && customAnnotation !== null) {
|
|
271
|
+
return customAnnotation;
|
|
272
|
+
}
|
|
273
|
+
else if (d.type === "desaturation-layer") {
|
|
274
|
+
return (0, baseRules_1.desaturationLayer)({
|
|
275
|
+
style: d.style instanceof Function ? d.style(d, i) : d.style,
|
|
276
|
+
size: adjustedSize,
|
|
277
|
+
i,
|
|
278
|
+
key: d.key
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
else if (d.type === "ordinal-line") {
|
|
282
|
+
return (0, orframeRules_1.svgOrdinalLine)({ d, screenCoordinates, voronoiHover });
|
|
283
|
+
}
|
|
284
|
+
else if (d.type === "or") {
|
|
285
|
+
return (0, orframeRules_1.svgORRule)({ d, i, screenCoordinates, projection });
|
|
286
|
+
}
|
|
287
|
+
else if (d.type === "highlight") {
|
|
288
|
+
return (0, orframeRules_1.svgHighlightRule)({
|
|
289
|
+
d,
|
|
290
|
+
pieceIDAccessor,
|
|
291
|
+
orFrameRender,
|
|
292
|
+
oAccessor
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
else if (typeof d.type === "function" || annotationTypeStrings.has(d.type)) {
|
|
296
|
+
return (0, orframeRules_1.basicReactAnnotationRule)({ d, i, screenCoordinates });
|
|
297
|
+
}
|
|
298
|
+
else if (d.type === "enclose") {
|
|
299
|
+
return (0, orframeRules_1.svgEncloseRule)({ d, i, screenCoordinates });
|
|
300
|
+
}
|
|
301
|
+
else if (d.type === "enclose-rect") {
|
|
302
|
+
return (0, orframeRules_1.svgRectEncloseRule)({ d, screenCoordinates, i });
|
|
303
|
+
}
|
|
304
|
+
else if (d.type === "r") {
|
|
305
|
+
return (0, orframeRules_1.svgRRule)({
|
|
306
|
+
d,
|
|
307
|
+
i,
|
|
308
|
+
screenCoordinates,
|
|
309
|
+
rScale,
|
|
310
|
+
rAccessor,
|
|
311
|
+
projection,
|
|
312
|
+
adjustedSize,
|
|
313
|
+
adjustedPosition
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
else if (d.type === "category") {
|
|
317
|
+
return (0, orframeRules_1.svgCategoryRule)({
|
|
318
|
+
projection,
|
|
319
|
+
d,
|
|
320
|
+
i,
|
|
321
|
+
categories: state.projectedColumns,
|
|
322
|
+
adjustedSize
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
function defaultORHTMLRule(props, state, { d, i, annotationLayer }) {
|
|
328
|
+
const { adjustedPosition, adjustedSize, oAccessor, rAccessor, oScale, rScale, projectedColumns, summaryType, type, pieceIDAccessor, rScaleType } = state;
|
|
329
|
+
const { htmlAnnotationRules, tooltipContent, optimizeCustomTooltipPosition, projection, size } = props;
|
|
330
|
+
let screenCoordinates = [0, 0];
|
|
331
|
+
const { voronoiHover } = annotationLayer;
|
|
332
|
+
if (d.coordinates || (d.type === "enclose" && d.neighbors)) {
|
|
333
|
+
screenCoordinates = (d.coordinates || d.neighbors).map((p) => {
|
|
334
|
+
const pO = (0, multiAccessorUtils_1.findFirstAccessorValue)(oAccessor, p) || p.column;
|
|
335
|
+
const oColumn = projectedColumns[pO];
|
|
336
|
+
const idPiece = (0, orframeRules_1.findIDPiece)(pieceIDAccessor, oColumn, p);
|
|
337
|
+
return (0, orframeRules_1.screenProject)({
|
|
338
|
+
p,
|
|
339
|
+
adjustedSize,
|
|
340
|
+
rScale,
|
|
341
|
+
rAccessor,
|
|
342
|
+
idPiece,
|
|
343
|
+
projection,
|
|
344
|
+
oColumn,
|
|
345
|
+
rScaleType
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
else if (d.type === "column-hover") {
|
|
350
|
+
const { coordinates: [xPosition, yPosition] } = (0, orframeRules_1.getColumnScreenCoordinates)({
|
|
351
|
+
d,
|
|
352
|
+
projectedColumns,
|
|
353
|
+
oAccessor,
|
|
354
|
+
summaryType,
|
|
355
|
+
type,
|
|
356
|
+
projection,
|
|
357
|
+
adjustedPosition,
|
|
358
|
+
adjustedSize
|
|
359
|
+
});
|
|
360
|
+
screenCoordinates = [xPosition, yPosition];
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
const pO = (0, multiAccessorUtils_1.findFirstAccessorValue)(oAccessor, d) || d.column;
|
|
364
|
+
const oColumn = projectedColumns[pO];
|
|
365
|
+
const idPiece = (0, orframeRules_1.findIDPiece)(pieceIDAccessor, oColumn, d);
|
|
366
|
+
screenCoordinates = (0, orframeRules_1.screenProject)({
|
|
367
|
+
p: d,
|
|
368
|
+
adjustedSize,
|
|
369
|
+
rScale,
|
|
370
|
+
rAccessor,
|
|
371
|
+
idPiece,
|
|
372
|
+
projection,
|
|
373
|
+
oColumn,
|
|
374
|
+
rScaleType
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
const flippedRScale = projection === "vertical"
|
|
378
|
+
? rScaleType.domain(rScale.domain()).range(rScale.range().reverse())
|
|
379
|
+
: rScale;
|
|
380
|
+
//TODO: Process your rules first
|
|
381
|
+
const customAnnotation = htmlAnnotationRules &&
|
|
382
|
+
htmlAnnotationRules({
|
|
383
|
+
d,
|
|
384
|
+
i,
|
|
385
|
+
oScale,
|
|
386
|
+
rScale: flippedRScale,
|
|
387
|
+
oAccessor,
|
|
388
|
+
rAccessor,
|
|
389
|
+
orFrameProps: props,
|
|
390
|
+
screenCoordinates,
|
|
391
|
+
adjustedPosition,
|
|
392
|
+
adjustedSize,
|
|
393
|
+
annotationLayer,
|
|
394
|
+
orFrameState: state,
|
|
395
|
+
categories: state.projectedColumns,
|
|
396
|
+
voronoiHover
|
|
397
|
+
});
|
|
398
|
+
if (htmlAnnotationRules && customAnnotation !== null) {
|
|
399
|
+
return customAnnotation;
|
|
400
|
+
}
|
|
401
|
+
if (d.type === "frame-hover") {
|
|
402
|
+
return (0, orframeRules_1.htmlFrameHoverRule)({
|
|
403
|
+
d,
|
|
404
|
+
i,
|
|
405
|
+
rAccessor,
|
|
406
|
+
oAccessor,
|
|
407
|
+
projection,
|
|
408
|
+
tooltipContent,
|
|
409
|
+
optimizeCustomTooltipPosition,
|
|
410
|
+
projectedColumns,
|
|
411
|
+
pieceIDAccessor,
|
|
412
|
+
adjustedSize,
|
|
413
|
+
rScale,
|
|
414
|
+
type,
|
|
415
|
+
rScaleType
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
else if (d.type === "column-hover") {
|
|
419
|
+
return (0, orframeRules_1.htmlColumnHoverRule)({
|
|
420
|
+
d,
|
|
421
|
+
i,
|
|
422
|
+
summaryType,
|
|
423
|
+
oAccessor,
|
|
424
|
+
projectedColumns,
|
|
425
|
+
type,
|
|
426
|
+
adjustedPosition,
|
|
427
|
+
adjustedSize,
|
|
428
|
+
projection,
|
|
429
|
+
tooltipContent,
|
|
430
|
+
optimizeCustomTooltipPosition
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
return null;
|
|
434
|
+
}
|
|
435
|
+
OrdinalFrameInner.displayName = "OrdinalFrame";
|
|
436
|
+
const OrdinalFrame = React.memo(OrdinalFrameInner);
|
|
437
|
+
exports.default = OrdinalFrame;
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const react_1 = require("react");
|
|
39
|
+
const useBoundingRect_1 = require("./useBoundingRect");
|
|
40
|
+
const createResponsiveFrame = (ParticularFrame) => {
|
|
41
|
+
function ResponsiveFrame(props) {
|
|
42
|
+
const { responsiveWidth, responsiveHeight, size = [500, 500], dataVersion, debounce = 200, gridDisplay, ...rest } = props;
|
|
43
|
+
const actualSize = [...size];
|
|
44
|
+
let returnEmpty = false;
|
|
45
|
+
let sceneRef = (0, react_1.useRef)();
|
|
46
|
+
let rect = (0, useBoundingRect_1.useBoundingRect)(sceneRef);
|
|
47
|
+
if (responsiveWidth) {
|
|
48
|
+
if (rect == null)
|
|
49
|
+
returnEmpty = true;
|
|
50
|
+
else
|
|
51
|
+
actualSize[0] = rect.width;
|
|
52
|
+
}
|
|
53
|
+
if (responsiveHeight) {
|
|
54
|
+
if (rect == null)
|
|
55
|
+
returnEmpty = true;
|
|
56
|
+
else
|
|
57
|
+
actualSize[1] = rect.height;
|
|
58
|
+
}
|
|
59
|
+
const dataVersionWithSize = dataVersion + actualSize.toString() + debounce;
|
|
60
|
+
return (React.createElement("div", { "data-testid": "responsive-container", className: "responsive-container", style: gridDisplay
|
|
61
|
+
? { minWidth: "0px", minHeight: "0px" }
|
|
62
|
+
: { height: "100%", width: "100%" }, ref: sceneRef }, !returnEmpty && (React.createElement(ParticularFrame, { ...rest, size: actualSize, dataVersion: dataVersion ? dataVersionWithSize : undefined }))));
|
|
63
|
+
}
|
|
64
|
+
ResponsiveFrame.isResizing = setTimeout(() => { });
|
|
65
|
+
ResponsiveFrame.displayName = `Responsive${ParticularFrame.displayName}`;
|
|
66
|
+
return ResponsiveFrame;
|
|
67
|
+
};
|
|
68
|
+
exports.default = createResponsiveFrame;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ResponsiveMinimapXYFrame = void 0;
|
|
8
|
+
const MinimapXYFrame_1 = __importDefault(require("./MinimapXYFrame"));
|
|
9
|
+
const ResponsiveFrame_1 = __importDefault(require("./ResponsiveFrame"));
|
|
10
|
+
exports.ResponsiveMinimapXYFrame =
|
|
11
|
+
/*#__PURE__*/ (0, ResponsiveFrame_1.default)(MinimapXYFrame_1.default);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ResponsiveNetworkFrame = void 0;
|
|
8
|
+
const NetworkFrame_1 = __importDefault(require("./NetworkFrame"));
|
|
9
|
+
const ResponsiveFrame_1 = __importDefault(require("./ResponsiveFrame"));
|
|
10
|
+
exports.ResponsiveNetworkFrame =
|
|
11
|
+
/*#__PURE__*/ (0, ResponsiveFrame_1.default)(NetworkFrame_1.default);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ResponsiveOrdinalFrame = void 0;
|
|
8
|
+
const OrdinalFrame_1 = __importDefault(require("./OrdinalFrame"));
|
|
9
|
+
const ResponsiveFrame_1 = __importDefault(require("./ResponsiveFrame"));
|
|
10
|
+
exports.ResponsiveOrdinalFrame =
|
|
11
|
+
/*#__PURE__*/ (0, ResponsiveFrame_1.default)(OrdinalFrame_1.default);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ResponsiveXYFrame = void 0;
|
|
8
|
+
const XYFrame_1 = __importDefault(require("./XYFrame"));
|
|
9
|
+
const ResponsiveFrame_1 = __importDefault(require("./ResponsiveFrame"));
|
|
10
|
+
exports.ResponsiveXYFrame = (0, ResponsiveFrame_1.default)(XYFrame_1.default);
|
|
@@ -0,0 +1,113 @@
|
|
|
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.networkFrameDefaults = exports.ordinalFrameDefaults = exports.xyFrameDefaults = exports.axisDefaults = void 0;
|
|
38
|
+
exports.default = createSparkFrame;
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const react_1 = require("react");
|
|
41
|
+
const allFrameDefaults = {
|
|
42
|
+
margin: 0
|
|
43
|
+
};
|
|
44
|
+
function sparkNetworkSettings(originalSettings = "force") {
|
|
45
|
+
let finalSettings = {};
|
|
46
|
+
if (originalSettings) {
|
|
47
|
+
finalSettings = originalSettings;
|
|
48
|
+
if (originalSettings === "force")
|
|
49
|
+
finalSettings = { type: "force" };
|
|
50
|
+
return {
|
|
51
|
+
edgeStrength: 2,
|
|
52
|
+
edgeDistance: 5,
|
|
53
|
+
nodePadding: 1,
|
|
54
|
+
nodeWidth: 5,
|
|
55
|
+
groupWidth: 4,
|
|
56
|
+
...finalSettings
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return originalSettings;
|
|
60
|
+
}
|
|
61
|
+
exports.axisDefaults = {
|
|
62
|
+
tickFormat: () => "",
|
|
63
|
+
baseline: false
|
|
64
|
+
};
|
|
65
|
+
const xyFrameDefaults = (props) => ({
|
|
66
|
+
...allFrameDefaults,
|
|
67
|
+
...props,
|
|
68
|
+
hoverAnnotation: props.hoverAnnotation,
|
|
69
|
+
axes: props.axes
|
|
70
|
+
? props.axes.map((a) => ({ ...exports.axisDefaults, ...a }))
|
|
71
|
+
: props.axes
|
|
72
|
+
});
|
|
73
|
+
exports.xyFrameDefaults = xyFrameDefaults;
|
|
74
|
+
const ordinalFrameDefaults = (props) => ({
|
|
75
|
+
...allFrameDefaults,
|
|
76
|
+
...props,
|
|
77
|
+
hoverAnnotation: props.hoverAnnotation,
|
|
78
|
+
axes: props.axes
|
|
79
|
+
? props.axes.map((a) => ({ ...exports.axisDefaults, ...a }))
|
|
80
|
+
: props.axes
|
|
81
|
+
});
|
|
82
|
+
exports.ordinalFrameDefaults = ordinalFrameDefaults;
|
|
83
|
+
const networkFrameDefaults = (props) => ({
|
|
84
|
+
...allFrameDefaults,
|
|
85
|
+
nodeSizeAccessor: 2,
|
|
86
|
+
...props,
|
|
87
|
+
networkType: sparkNetworkSettings(props.networkType)
|
|
88
|
+
});
|
|
89
|
+
exports.networkFrameDefaults = networkFrameDefaults;
|
|
90
|
+
function createSparkFrame(Frame, defaults, frameName) {
|
|
91
|
+
return (props) => {
|
|
92
|
+
const { size = [], sparkStyle = {} } = props;
|
|
93
|
+
const [containerHeight, changeContainerHeight] = (0, react_1.useState)(30);
|
|
94
|
+
const actualSize = [];
|
|
95
|
+
actualSize[0] =
|
|
96
|
+
typeof size === "number" ? size : size[0] ? size[0] : containerHeight;
|
|
97
|
+
actualSize[1] = containerHeight;
|
|
98
|
+
const sparkNodeRef = (0, react_1.useCallback)((node) => {
|
|
99
|
+
if (node) {
|
|
100
|
+
const lineHeight = +window.getComputedStyle(node).lineHeight.split("px")[0] - 5;
|
|
101
|
+
changeContainerHeight(isNaN(lineHeight) ? node.offsetHeight : lineHeight);
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
104
|
+
return (React.createElement("div", { style: Object.assign({
|
|
105
|
+
width: `${actualSize[0]}px`,
|
|
106
|
+
height: `${actualSize[1]}px`,
|
|
107
|
+
display: "inline-block",
|
|
108
|
+
marginLeft: "5px",
|
|
109
|
+
marginRight: "5px"
|
|
110
|
+
}, sparkStyle), ref: sparkNodeRef },
|
|
111
|
+
React.createElement(Frame, { ...defaults(props), size: actualSize })));
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SparkNetworkFrame = void 0;
|
|
8
|
+
const NetworkFrame_1 = __importDefault(require("./NetworkFrame"));
|
|
9
|
+
const SparkFrame_1 = __importDefault(require("./SparkFrame"));
|
|
10
|
+
const SparkFrame_2 = require("./SparkFrame");
|
|
11
|
+
exports.SparkNetworkFrame = (0, SparkFrame_1.default)(NetworkFrame_1.default, SparkFrame_2.networkFrameDefaults, "SparkNetworkFrame");
|