@mui/x-charts 8.0.0-alpha.0 → 8.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/AnimatedBarElement.d.ts +15 -0
- package/BarChart/AnimatedBarElement.js +21 -0
- package/BarChart/BarChart.d.ts +4 -9
- package/BarChart/BarChart.js +3 -35
- package/BarChart/BarElement.d.ts +5 -1342
- package/BarChart/BarElement.js +10 -20
- package/BarChart/BarLabel/BarLabel.d.ts +298 -298
- package/BarChart/BarPlot.js +12 -2
- package/BarChart/useBarChartProps.d.ts +0 -2
- package/BarChart/useBarChartProps.js +2 -8
- package/CHANGELOG.md +651 -6
- package/ChartContainer/ChartContainer.d.ts +26 -19
- package/ChartContainer/ChartContainer.js +31 -25
- package/ChartContainer/useChartContainerProps.d.ts +5 -7
- package/ChartContainer/useChartContainerProps.js +12 -27
- package/ChartsAxis/axisClasses.js +2 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
- package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
- package/ChartsAxisHighlight/ChartsAxisHighlightPath.d.ts +6 -0
- package/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +10 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +10 -0
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
- package/ChartsAxisHighlight/chartsAxisHighlightClasses.d.ts +7 -0
- package/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
- package/ChartsAxisHighlight/index.d.ts +3 -0
- package/ChartsAxisHighlight/index.js +4 -1
- package/ChartsGrid/ChartsGrid.js +1 -1
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/ChartsLegend/LegendPerItem.d.ts +2 -2
- package/ChartsLegend/chartsLegendClasses.js +2 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/ChartsSurface/ChartsSurface.d.ts +14 -15
- package/ChartsSurface/ChartsSurface.js +68 -35
- package/ChartsTooltip/ChartTooltip.types.d.ts +15 -0
- package/ChartsTooltip/ChartTooltip.types.js +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +7 -39
- package/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +5 -28
- package/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
- package/ChartsTooltip/ChartsTooltip.d.ts +3 -69
- package/ChartsTooltip/ChartsTooltip.js +143 -145
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
- package/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -0
- package/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/ChartsTooltip/index.d.ts +3 -3
- package/ChartsTooltip/index.js +2 -3
- package/ChartsTooltip/useAxisTooltip.d.ts +2 -2
- package/ChartsTooltip/useAxisTooltip.js +19 -19
- package/ChartsTooltip/useItemTooltip.d.ts +2 -3
- package/ChartsTooltip/useItemTooltip.js +5 -4
- package/ChartsTooltip/utils.d.ts +0 -3
- package/ChartsTooltip/utils.js +0 -8
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
- package/ChartsXAxis/ChartsXAxis.js +3 -17
- package/ChartsYAxis/ChartsYAxis.js +2 -17
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/Gauge.js +0 -6
- package/Gauge/GaugeContainer.d.ts +3 -3
- package/Gauge/GaugeContainer.js +42 -76
- package/LineChart/AnimatedArea.d.ts +0 -1333
- package/LineChart/AnimatedArea.js +9 -18
- package/LineChart/AnimatedLine.d.ts +0 -1333
- package/LineChart/AnimatedLine.js +9 -20
- package/LineChart/AreaPlot.js +12 -2
- package/LineChart/CircleMarkElement.js +6 -5
- package/LineChart/LineChart.d.ts +4 -10
- package/LineChart/LineChart.js +3 -36
- package/LineChart/LineHighlightPlot.js +6 -5
- package/LineChart/LinePlot.js +12 -2
- package/LineChart/MarkElement.js +6 -5
- package/LineChart/useLineChartProps.d.ts +0 -2
- package/LineChart/useLineChartProps.js +2 -8
- package/PieChart/PieChart.d.ts +3 -9
- package/PieChart/PieChart.js +5 -41
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/README.md +2 -2
- package/ScatterChart/Scatter.js +6 -5
- package/ScatterChart/ScatterChart.d.ts +4 -10
- package/ScatterChart/ScatterChart.js +5 -36
- package/ScatterChart/useScatterChartProps.d.ts +0 -2
- package/ScatterChart/useScatterChartProps.js +1 -9
- package/SparkLineChart/SparkLineChart.d.ts +3 -4
- package/SparkLineChart/SparkLineChart.js +4 -35
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -11
- package/context/ChartDataProvider/ChartDataProvider.d.ts +36 -19
- package/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +25 -32
- package/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -11
- package/context/ChartProvider/ChartContext.d.ts +6 -0
- package/context/ChartProvider/ChartContext.js +8 -0
- package/context/ChartProvider/ChartProvider.d.ts +4 -0
- package/context/ChartProvider/ChartProvider.js +19 -0
- package/context/ChartProvider/ChartProvider.types.d.ts +24 -0
- package/context/ChartProvider/ChartProvider.types.js +1 -0
- package/context/ChartProvider/index.d.ts +3 -0
- package/context/ChartProvider/index.js +3 -0
- package/context/ChartProvider/useChartContext.d.ts +3 -0
- package/context/ChartProvider/useChartContext.js +11 -0
- package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
- package/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +3 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
- package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +3 -0
- package/{modern/context/DrawingProvider.js → context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/context/DrawingAreaProvider/index.d.ts +3 -0
- package/context/DrawingAreaProvider/index.js +3 -0
- package/context/InteractionSelectors.d.ts +382 -0
- package/context/InteractionSelectors.js +12 -0
- package/context/SizeProvider/Size.types.d.ts +30 -0
- package/context/SizeProvider/Size.types.js +1 -0
- package/context/SizeProvider/SizeContext.d.ts +4 -0
- package/context/SizeProvider/SizeContext.js +15 -0
- package/context/SizeProvider/SizeProvider.d.ts +11 -0
- package/context/SizeProvider/SizeProvider.js +26 -0
- package/context/SizeProvider/index.d.ts +4 -0
- package/context/SizeProvider/index.js +4 -0
- package/context/SizeProvider/useChartContainerDimensions.d.ts +9 -0
- package/{modern/ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/context/SizeProvider/useSize.d.ts +5 -0
- package/context/SizeProvider/useSize.js +13 -0
- package/context/index.d.ts +2 -0
- package/context/index.js +2 -1
- package/hooks/useAxisEvents.js +32 -19
- package/hooks/useChartId.js +5 -6
- package/hooks/useDrawingArea.d.ts +2 -2
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +22 -13
- package/hooks/useSvgRef.d.ts +1 -1
- package/hooks/useSvgRef.js +4 -8
- package/index.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
- package/internals/computeAxisValue.d.ts +2 -2
- package/internals/defaultizeColor.d.ts +1 -1
- package/internals/index.d.ts +3 -4
- package/internals/index.js +3 -4
- package/internals/plugins/allPlugins.d.ts +1 -0
- package/internals/plugins/allPlugins.js +3 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +10 -0
- package/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/internals/plugins/corePlugins/index.d.ts +2 -0
- package/internals/plugins/corePlugins/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/index.d.ts +2 -0
- package/internals/plugins/corePlugins/useChartId/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +36 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +20 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +376 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +57 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/internals/plugins/models/chart.d.ts +14 -0
- package/internals/plugins/models/chart.js +1 -0
- package/internals/plugins/models/helpers.d.ts +7 -0
- package/internals/plugins/models/helpers.js +1 -0
- package/internals/plugins/models/index.d.ts +3 -0
- package/internals/plugins/models/index.js +3 -0
- package/internals/plugins/models/plugin.d.ts +75 -0
- package/internals/plugins/models/plugin.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +13 -0
- package/internals/plugins/utils/ChartStore.js +24 -0
- package/internals/plugins/utils/selectors.d.ts +9 -0
- package/internals/plugins/utils/selectors.js +37 -0
- package/internals/store/useCharts.d.ts +14 -0
- package/internals/store/useCharts.js +72 -0
- package/internals/store/useCharts.types.d.ts +5 -0
- package/internals/store/useCharts.types.js +1 -0
- package/internals/store/useSelector.d.ts +4 -0
- package/internals/store/useSelector.js +6 -0
- package/internals/store/useStore.d.ts +3 -0
- package/internals/store/useStore.js +17 -0
- package/models/axis.d.ts +1 -13
- package/modern/BarChart/AnimatedBarElement.js +21 -0
- package/modern/BarChart/BarChart.js +3 -35
- package/modern/BarChart/BarElement.js +10 -20
- package/modern/BarChart/BarPlot.js +12 -2
- package/modern/BarChart/useBarChartProps.js +2 -8
- package/modern/ChartContainer/ChartContainer.js +31 -25
- package/modern/ChartContainer/useChartContainerProps.js +12 -27
- package/modern/ChartsAxis/axisClasses.js +2 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.types.js +1 -0
- package/modern/ChartsAxisHighlight/ChartsAxisHighlightPath.js +34 -0
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +53 -0
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +53 -0
- package/modern/ChartsAxisHighlight/chartsAxisHighlightClasses.js +6 -0
- package/modern/ChartsAxisHighlight/index.js +4 -1
- package/modern/ChartsGrid/ChartsGrid.js +1 -1
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +3 -3
- package/modern/ChartsGrid/ChartsVerticalGrid.js +3 -3
- package/modern/ChartsLegend/chartsLegendClasses.js +2 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/modern/ChartsSurface/ChartsSurface.js +68 -35
- package/modern/ChartsTooltip/ChartTooltip.types.js +1 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +83 -72
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +54 -44
- package/modern/ChartsTooltip/ChartsTooltip.js +143 -145
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +280 -0
- package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/modern/ChartsTooltip/index.js +2 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +19 -19
- package/modern/ChartsTooltip/useItemTooltip.js +5 -4
- package/modern/ChartsTooltip/utils.js +0 -8
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +49 -36
- package/modern/ChartsXAxis/ChartsXAxis.js +3 -17
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -17
- package/modern/Gauge/Gauge.js +0 -6
- package/modern/Gauge/GaugeContainer.js +42 -76
- package/modern/LineChart/AnimatedArea.js +9 -18
- package/modern/LineChart/AnimatedLine.js +9 -20
- package/modern/LineChart/AreaPlot.js +12 -2
- package/modern/LineChart/CircleMarkElement.js +6 -5
- package/modern/LineChart/LineChart.js +3 -36
- package/modern/LineChart/LineHighlightPlot.js +6 -5
- package/modern/LineChart/LinePlot.js +12 -2
- package/modern/LineChart/MarkElement.js +6 -5
- package/modern/LineChart/useLineChartProps.js +2 -8
- package/modern/PieChart/PieChart.js +5 -41
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/ScatterChart/Scatter.js +6 -5
- package/modern/ScatterChart/ScatterChart.js +5 -36
- package/modern/ScatterChart/useScatterChartProps.js +1 -9
- package/modern/SparkLineChart/SparkLineChart.js +4 -35
- package/modern/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +22 -42
- package/modern/context/ChartProvider/ChartContext.js +8 -0
- package/modern/context/ChartProvider/ChartProvider.js +19 -0
- package/modern/context/ChartProvider/ChartProvider.types.js +1 -0
- package/modern/context/ChartProvider/index.js +3 -0
- package/modern/context/ChartProvider/useChartContext.js +11 -0
- package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +15 -0
- package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/modern/context/DrawingAreaProvider/index.js +3 -0
- package/modern/context/InteractionSelectors.js +12 -0
- package/modern/context/SizeProvider/Size.types.js +1 -0
- package/modern/context/SizeProvider/SizeContext.js +15 -0
- package/modern/context/SizeProvider/SizeProvider.js +26 -0
- package/modern/context/SizeProvider/index.js +4 -0
- package/{ChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/modern/context/SizeProvider/useSize.js +13 -0
- package/modern/context/index.js +2 -1
- package/modern/hooks/useAxisEvents.js +32 -19
- package/modern/hooks/useChartId.js +5 -6
- package/modern/hooks/useDrawingArea.js +2 -2
- package/modern/hooks/useInteractionItemProps.js +22 -13
- package/modern/hooks/useSvgRef.js +4 -8
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -7
- package/modern/internals/index.js +3 -4
- package/modern/internals/plugins/allPlugins.js +3 -0
- package/modern/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/modern/internals/plugins/corePlugins/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/modern/internals/plugins/models/chart.js +1 -0
- package/modern/internals/plugins/models/helpers.js +1 -0
- package/modern/internals/plugins/models/index.js +3 -0
- package/modern/internals/plugins/models/plugin.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +24 -0
- package/modern/internals/plugins/utils/selectors.js +37 -0
- package/modern/internals/store/useCharts.js +72 -0
- package/modern/internals/store/useCharts.types.js +1 -0
- package/modern/internals/store/useSelector.js +6 -0
- package/modern/internals/store/useStore.js +17 -0
- package/node/BarChart/AnimatedBarElement.js +28 -0
- package/node/BarChart/BarChart.js +3 -35
- package/node/BarChart/BarElement.js +11 -21
- package/node/BarChart/BarPlot.js +11 -1
- package/node/BarChart/useBarChartProps.js +2 -8
- package/node/ChartContainer/ChartContainer.js +31 -25
- package/node/ChartContainer/useChartContainerProps.js +12 -27
- package/node/ChartsAxis/axisClasses.js +5 -3
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.types.js +5 -0
- package/node/ChartsAxisHighlight/ChartsAxisHighlightPath.js +40 -0
- package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +57 -0
- package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +57 -0
- package/node/ChartsAxisHighlight/chartsAxisHighlightClasses.js +14 -0
- package/node/ChartsAxisHighlight/index.js +33 -0
- package/node/ChartsGrid/ChartsGrid.js +2 -2
- package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -4
- package/node/ChartsGrid/ChartsVerticalGrid.js +4 -4
- package/node/ChartsLegend/chartsLegendClasses.js +5 -3
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +9 -7
- package/node/ChartsSurface/ChartsSurface.js +68 -35
- package/node/ChartsTooltip/ChartTooltip.types.js +5 -0
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
- package/node/ChartsTooltip/ChartsTooltip.js +142 -144
- package/node/ChartsTooltip/ChartsTooltipContainer.js +286 -0
- package/node/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
- package/node/ChartsTooltip/index.js +19 -28
- package/node/ChartsTooltip/useAxisTooltip.js +19 -19
- package/node/ChartsTooltip/useItemTooltip.js +5 -4
- package/node/ChartsTooltip/utils.js +0 -9
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -37
- package/node/ChartsXAxis/ChartsXAxis.js +3 -17
- package/node/ChartsYAxis/ChartsYAxis.js +2 -17
- package/node/Gauge/Gauge.js +0 -6
- package/node/Gauge/GaugeContainer.js +42 -76
- package/node/LineChart/AnimatedArea.js +9 -19
- package/node/LineChart/AnimatedLine.js +9 -21
- package/node/LineChart/AreaPlot.js +11 -1
- package/node/LineChart/CircleMarkElement.js +6 -5
- package/node/LineChart/LineChart.js +3 -36
- package/node/LineChart/LineHighlightPlot.js +6 -5
- package/node/LineChart/LinePlot.js +11 -1
- package/node/LineChart/MarkElement.js +6 -5
- package/node/LineChart/useLineChartProps.js +2 -8
- package/node/PieChart/PieChart.js +5 -41
- package/node/PieChart/PiePlot.js +2 -2
- package/node/ScatterChart/Scatter.js +6 -5
- package/node/ScatterChart/ScatterChart.js +5 -36
- package/node/ScatterChart/useScatterChartProps.js +1 -9
- package/node/SparkLineChart/SparkLineChart.js +4 -35
- package/node/context/ChartDataProvider/ChartDataProvider.js +55 -48
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +22 -44
- package/node/context/ChartProvider/ChartContext.js +15 -0
- package/node/context/ChartProvider/ChartProvider.js +24 -0
- package/node/context/ChartProvider/ChartProvider.types.js +5 -0
- package/node/context/ChartProvider/index.js +38 -0
- package/node/context/ChartProvider/useChartContext.js +18 -0
- package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +21 -0
- package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
- package/node/context/DrawingAreaProvider/index.js +38 -0
- package/node/context/InteractionSelectors.js +18 -0
- package/node/context/SizeProvider/Size.types.js +5 -0
- package/node/context/SizeProvider/SizeContext.js +22 -0
- package/node/context/SizeProvider/SizeProvider.js +29 -0
- package/node/context/SizeProvider/index.js +49 -0
- package/node/{ChartContainer → context/SizeProvider}/useChartContainerDimensions.js +16 -6
- package/node/context/SizeProvider/useSize.js +20 -0
- package/node/context/index.js +10 -2
- package/node/hooks/useAxisEvents.js +33 -19
- package/node/hooks/useChartId.js +5 -7
- package/node/hooks/useDrawingArea.js +2 -2
- package/node/hooks/useInteractionItemProps.js +23 -14
- package/node/hooks/useSvgRef.js +4 -9
- package/node/index.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +8 -6
- package/node/internals/index.js +28 -40
- package/node/internals/plugins/allPlugins.js +10 -0
- package/node/internals/plugins/corePlugins/corePlugins.js +12 -0
- package/node/internals/plugins/corePlugins/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.js +41 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +15 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.types.js +5 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.utils.js +12 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +81 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +16 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +5 -0
- package/node/internals/plugins/models/chart.js +5 -0
- package/node/internals/plugins/models/helpers.js +5 -0
- package/node/internals/plugins/models/index.js +38 -0
- package/node/internals/plugins/models/plugin.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +31 -0
- package/node/internals/plugins/utils/selectors.js +44 -0
- package/node/internals/store/useCharts.js +80 -0
- package/node/internals/store/useCharts.types.js +5 -0
- package/node/internals/store/useSelector.js +13 -0
- package/node/internals/store/useStore.js +23 -0
- package/package.json +7 -5
- package/themeAugmentation/props.d.ts +1 -2
- package/ChartContainer/ResizableContainer.d.ts +0 -9
- package/ChartContainer/ResizableContainer.js +0 -26
- package/ChartContainer/useChartContainerDimensions.d.ts +0 -6
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.d.ts +0 -7
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/ChartsTooltip/DefaultChartsItemTooltipContent.d.ts +0 -8
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/context/InteractionProvider.d.ts +0 -50
- package/context/InteractionProvider.js +0 -78
- package/modern/ChartContainer/ResizableContainer.js +0 -26
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/modern/context/InteractionProvider.js +0 -78
- package/node/ChartContainer/ResizableContainer.js +0 -32
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- package/node/context/InteractionProvider.js +0 -85
- /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
- /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { UseChartInteractionSignature } from '../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types';
|
|
2
|
+
import { ChartState } from '../internals/plugins/models';
|
|
3
|
+
declare function selectInteraction(state: ChartState<[UseChartInteractionSignature]>): {
|
|
4
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
5
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
6
|
+
isVoronoiEnabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const selectorChartsInteractionItem: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
9
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
10
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
} & {
|
|
15
|
+
resultFunc: (resultFuncArgs_0: {
|
|
16
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
17
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
18
|
+
isVoronoiEnabled?: boolean;
|
|
19
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
20
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
21
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
22
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
23
|
+
isVoronoiEnabled?: boolean;
|
|
24
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
25
|
+
clearCache: () => void;
|
|
26
|
+
resultsCount: () => number;
|
|
27
|
+
resetResultsCount: () => void;
|
|
28
|
+
};
|
|
29
|
+
lastResult: () => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
30
|
+
dependencies: [typeof selectInteraction];
|
|
31
|
+
recomputations: () => number;
|
|
32
|
+
resetRecomputations: () => void;
|
|
33
|
+
dependencyRecomputations: () => number;
|
|
34
|
+
resetDependencyRecomputations: () => void;
|
|
35
|
+
} & {
|
|
36
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
37
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
38
|
+
};
|
|
39
|
+
export declare const selectorChartsInteractionAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
40
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
41
|
+
}) => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData) & {
|
|
42
|
+
clearCache: () => void;
|
|
43
|
+
resultsCount: () => number;
|
|
44
|
+
resetResultsCount: () => void;
|
|
45
|
+
} & {
|
|
46
|
+
resultFunc: (resultFuncArgs_0: {
|
|
47
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
48
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
49
|
+
isVoronoiEnabled?: boolean;
|
|
50
|
+
}) => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
51
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
52
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
53
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
54
|
+
isVoronoiEnabled?: boolean;
|
|
55
|
+
}) => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData) & {
|
|
56
|
+
clearCache: () => void;
|
|
57
|
+
resultsCount: () => number;
|
|
58
|
+
resetResultsCount: () => void;
|
|
59
|
+
};
|
|
60
|
+
lastResult: () => import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
61
|
+
dependencies: [typeof selectInteraction];
|
|
62
|
+
recomputations: () => number;
|
|
63
|
+
resetRecomputations: () => void;
|
|
64
|
+
dependencyRecomputations: () => number;
|
|
65
|
+
resetDependencyRecomputations: () => void;
|
|
66
|
+
} & {
|
|
67
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
68
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
69
|
+
};
|
|
70
|
+
export declare const selectorChartsInteractionXAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
71
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
72
|
+
}) => {
|
|
73
|
+
value: number | Date | string;
|
|
74
|
+
index: number;
|
|
75
|
+
} | null) & {
|
|
76
|
+
clearCache: () => void;
|
|
77
|
+
resultsCount: () => number;
|
|
78
|
+
resetResultsCount: () => void;
|
|
79
|
+
} & {
|
|
80
|
+
resultFunc: (resultFuncArgs_0: {
|
|
81
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
82
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
83
|
+
isVoronoiEnabled?: boolean;
|
|
84
|
+
}) => {
|
|
85
|
+
value: number | Date | string;
|
|
86
|
+
index: number;
|
|
87
|
+
} | null;
|
|
88
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
89
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
90
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
91
|
+
isVoronoiEnabled?: boolean;
|
|
92
|
+
}) => {
|
|
93
|
+
value: number | Date | string;
|
|
94
|
+
index: number;
|
|
95
|
+
} | null) & {
|
|
96
|
+
clearCache: () => void;
|
|
97
|
+
resultsCount: () => number;
|
|
98
|
+
resetResultsCount: () => void;
|
|
99
|
+
};
|
|
100
|
+
lastResult: () => {
|
|
101
|
+
value: number | Date | string;
|
|
102
|
+
index: number;
|
|
103
|
+
} | null;
|
|
104
|
+
dependencies: [typeof selectInteraction];
|
|
105
|
+
recomputations: () => number;
|
|
106
|
+
resetRecomputations: () => void;
|
|
107
|
+
dependencyRecomputations: () => number;
|
|
108
|
+
resetDependencyRecomputations: () => void;
|
|
109
|
+
} & {
|
|
110
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
111
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
112
|
+
};
|
|
113
|
+
export declare const selectorChartsInteractionYAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
114
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
115
|
+
}) => {
|
|
116
|
+
value: number | Date | string;
|
|
117
|
+
index: number;
|
|
118
|
+
} | null) & {
|
|
119
|
+
clearCache: () => void;
|
|
120
|
+
resultsCount: () => number;
|
|
121
|
+
resetResultsCount: () => void;
|
|
122
|
+
} & {
|
|
123
|
+
resultFunc: (resultFuncArgs_0: {
|
|
124
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
125
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
126
|
+
isVoronoiEnabled?: boolean;
|
|
127
|
+
}) => {
|
|
128
|
+
value: number | Date | string;
|
|
129
|
+
index: number;
|
|
130
|
+
} | null;
|
|
131
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
132
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
133
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
134
|
+
isVoronoiEnabled?: boolean;
|
|
135
|
+
}) => {
|
|
136
|
+
value: number | Date | string;
|
|
137
|
+
index: number;
|
|
138
|
+
} | null) & {
|
|
139
|
+
clearCache: () => void;
|
|
140
|
+
resultsCount: () => number;
|
|
141
|
+
resetResultsCount: () => void;
|
|
142
|
+
};
|
|
143
|
+
lastResult: () => {
|
|
144
|
+
value: number | Date | string;
|
|
145
|
+
index: number;
|
|
146
|
+
} | null;
|
|
147
|
+
dependencies: [typeof selectInteraction];
|
|
148
|
+
recomputations: () => number;
|
|
149
|
+
resetRecomputations: () => void;
|
|
150
|
+
dependencyRecomputations: () => number;
|
|
151
|
+
resetDependencyRecomputations: () => void;
|
|
152
|
+
} & {
|
|
153
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
154
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
155
|
+
};
|
|
156
|
+
export declare const selectorChartsInteractionItemIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
157
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
158
|
+
}) => boolean) & {
|
|
159
|
+
clearCache: () => void;
|
|
160
|
+
resultsCount: () => number;
|
|
161
|
+
resetResultsCount: () => void;
|
|
162
|
+
} & {
|
|
163
|
+
resultFunc: (resultFuncArgs_0: import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) => boolean;
|
|
164
|
+
memoizedResultFunc: ((resultFuncArgs_0: import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) => boolean) & {
|
|
165
|
+
clearCache: () => void;
|
|
166
|
+
resultsCount: () => number;
|
|
167
|
+
resetResultsCount: () => void;
|
|
168
|
+
};
|
|
169
|
+
lastResult: () => boolean;
|
|
170
|
+
dependencies: [((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
171
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
172
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
173
|
+
clearCache: () => void;
|
|
174
|
+
resultsCount: () => number;
|
|
175
|
+
resetResultsCount: () => void;
|
|
176
|
+
} & {
|
|
177
|
+
resultFunc: (resultFuncArgs_0: {
|
|
178
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
179
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
180
|
+
isVoronoiEnabled?: boolean;
|
|
181
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
182
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
183
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
184
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
185
|
+
isVoronoiEnabled?: boolean;
|
|
186
|
+
}) => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null) & {
|
|
187
|
+
clearCache: () => void;
|
|
188
|
+
resultsCount: () => number;
|
|
189
|
+
resetResultsCount: () => void;
|
|
190
|
+
};
|
|
191
|
+
lastResult: () => import("..").BarItemIdentifier | import("..").ScatterItemIdentifier | import("..").LineItemIdentifier | import("..").PieItemIdentifier | null;
|
|
192
|
+
dependencies: [typeof selectInteraction];
|
|
193
|
+
recomputations: () => number;
|
|
194
|
+
resetRecomputations: () => void;
|
|
195
|
+
dependencyRecomputations: () => number;
|
|
196
|
+
resetDependencyRecomputations: () => void;
|
|
197
|
+
} & {
|
|
198
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
199
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
200
|
+
}];
|
|
201
|
+
recomputations: () => number;
|
|
202
|
+
resetRecomputations: () => void;
|
|
203
|
+
dependencyRecomputations: () => number;
|
|
204
|
+
resetDependencyRecomputations: () => void;
|
|
205
|
+
} & {
|
|
206
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
207
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
208
|
+
};
|
|
209
|
+
export declare const selectorChartsInteractionXAxisIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
210
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
211
|
+
}) => boolean) & {
|
|
212
|
+
clearCache: () => void;
|
|
213
|
+
resultsCount: () => number;
|
|
214
|
+
resetResultsCount: () => void;
|
|
215
|
+
} & {
|
|
216
|
+
resultFunc: (resultFuncArgs_0: {
|
|
217
|
+
value: number | Date | string;
|
|
218
|
+
index: number;
|
|
219
|
+
} | null) => boolean;
|
|
220
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
221
|
+
value: number | Date | string;
|
|
222
|
+
index: number;
|
|
223
|
+
} | null) => boolean) & {
|
|
224
|
+
clearCache: () => void;
|
|
225
|
+
resultsCount: () => number;
|
|
226
|
+
resetResultsCount: () => void;
|
|
227
|
+
};
|
|
228
|
+
lastResult: () => boolean;
|
|
229
|
+
dependencies: [((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
230
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
231
|
+
}) => {
|
|
232
|
+
value: number | Date | string;
|
|
233
|
+
index: number;
|
|
234
|
+
} | null) & {
|
|
235
|
+
clearCache: () => void;
|
|
236
|
+
resultsCount: () => number;
|
|
237
|
+
resetResultsCount: () => void;
|
|
238
|
+
} & {
|
|
239
|
+
resultFunc: (resultFuncArgs_0: {
|
|
240
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
241
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
242
|
+
isVoronoiEnabled?: boolean;
|
|
243
|
+
}) => {
|
|
244
|
+
value: number | Date | string;
|
|
245
|
+
index: number;
|
|
246
|
+
} | null;
|
|
247
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
248
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
249
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
250
|
+
isVoronoiEnabled?: boolean;
|
|
251
|
+
}) => {
|
|
252
|
+
value: number | Date | string;
|
|
253
|
+
index: number;
|
|
254
|
+
} | null) & {
|
|
255
|
+
clearCache: () => void;
|
|
256
|
+
resultsCount: () => number;
|
|
257
|
+
resetResultsCount: () => void;
|
|
258
|
+
};
|
|
259
|
+
lastResult: () => {
|
|
260
|
+
value: number | Date | string;
|
|
261
|
+
index: number;
|
|
262
|
+
} | null;
|
|
263
|
+
dependencies: [typeof selectInteraction];
|
|
264
|
+
recomputations: () => number;
|
|
265
|
+
resetRecomputations: () => void;
|
|
266
|
+
dependencyRecomputations: () => number;
|
|
267
|
+
resetDependencyRecomputations: () => void;
|
|
268
|
+
} & {
|
|
269
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
270
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
271
|
+
}];
|
|
272
|
+
recomputations: () => number;
|
|
273
|
+
resetRecomputations: () => void;
|
|
274
|
+
dependencyRecomputations: () => number;
|
|
275
|
+
resetDependencyRecomputations: () => void;
|
|
276
|
+
} & {
|
|
277
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
278
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
279
|
+
};
|
|
280
|
+
export declare const selectorChartsInteractionYAxisIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
281
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
282
|
+
}) => boolean) & {
|
|
283
|
+
clearCache: () => void;
|
|
284
|
+
resultsCount: () => number;
|
|
285
|
+
resetResultsCount: () => void;
|
|
286
|
+
} & {
|
|
287
|
+
resultFunc: (resultFuncArgs_0: {
|
|
288
|
+
value: number | Date | string;
|
|
289
|
+
index: number;
|
|
290
|
+
} | null) => boolean;
|
|
291
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
292
|
+
value: number | Date | string;
|
|
293
|
+
index: number;
|
|
294
|
+
} | null) => boolean) & {
|
|
295
|
+
clearCache: () => void;
|
|
296
|
+
resultsCount: () => number;
|
|
297
|
+
resetResultsCount: () => void;
|
|
298
|
+
};
|
|
299
|
+
lastResult: () => boolean;
|
|
300
|
+
dependencies: [((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
301
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
302
|
+
}) => {
|
|
303
|
+
value: number | Date | string;
|
|
304
|
+
index: number;
|
|
305
|
+
} | null) & {
|
|
306
|
+
clearCache: () => void;
|
|
307
|
+
resultsCount: () => number;
|
|
308
|
+
resetResultsCount: () => void;
|
|
309
|
+
} & {
|
|
310
|
+
resultFunc: (resultFuncArgs_0: {
|
|
311
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
312
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
313
|
+
isVoronoiEnabled?: boolean;
|
|
314
|
+
}) => {
|
|
315
|
+
value: number | Date | string;
|
|
316
|
+
index: number;
|
|
317
|
+
} | null;
|
|
318
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
319
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
320
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
321
|
+
isVoronoiEnabled?: boolean;
|
|
322
|
+
}) => {
|
|
323
|
+
value: number | Date | string;
|
|
324
|
+
index: number;
|
|
325
|
+
} | null) & {
|
|
326
|
+
clearCache: () => void;
|
|
327
|
+
resultsCount: () => number;
|
|
328
|
+
resetResultsCount: () => void;
|
|
329
|
+
};
|
|
330
|
+
lastResult: () => {
|
|
331
|
+
value: number | Date | string;
|
|
332
|
+
index: number;
|
|
333
|
+
} | null;
|
|
334
|
+
dependencies: [typeof selectInteraction];
|
|
335
|
+
recomputations: () => number;
|
|
336
|
+
resetRecomputations: () => void;
|
|
337
|
+
dependencyRecomputations: () => number;
|
|
338
|
+
resetDependencyRecomputations: () => void;
|
|
339
|
+
} & {
|
|
340
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
341
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
342
|
+
}];
|
|
343
|
+
recomputations: () => number;
|
|
344
|
+
resetRecomputations: () => void;
|
|
345
|
+
dependencyRecomputations: () => number;
|
|
346
|
+
resetDependencyRecomputations: () => void;
|
|
347
|
+
} & {
|
|
348
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
349
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
350
|
+
};
|
|
351
|
+
export declare const selectorChartsInteractionIsVoronoiEnabled: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
352
|
+
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
353
|
+
}) => boolean | undefined) & {
|
|
354
|
+
clearCache: () => void;
|
|
355
|
+
resultsCount: () => number;
|
|
356
|
+
resetResultsCount: () => void;
|
|
357
|
+
} & {
|
|
358
|
+
resultFunc: (resultFuncArgs_0: {
|
|
359
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
360
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
361
|
+
isVoronoiEnabled?: boolean;
|
|
362
|
+
}) => boolean | undefined;
|
|
363
|
+
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
364
|
+
item: null | import("../internals").ChartItemIdentifier<import("../internals").ChartSeriesType>;
|
|
365
|
+
axis: import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").AxisInteractionData;
|
|
366
|
+
isVoronoiEnabled?: boolean;
|
|
367
|
+
}) => boolean | undefined) & {
|
|
368
|
+
clearCache: () => void;
|
|
369
|
+
resultsCount: () => number;
|
|
370
|
+
resetResultsCount: () => void;
|
|
371
|
+
};
|
|
372
|
+
lastResult: () => boolean | undefined;
|
|
373
|
+
dependencies: [typeof selectInteraction];
|
|
374
|
+
recomputations: () => number;
|
|
375
|
+
resetRecomputations: () => void;
|
|
376
|
+
dependencyRecomputations: () => number;
|
|
377
|
+
resetDependencyRecomputations: () => void;
|
|
378
|
+
} & {
|
|
379
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
380
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
381
|
+
};
|
|
382
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createSelector } from "../internals/plugins/utils/selectors.js";
|
|
2
|
+
function selectInteraction(state) {
|
|
3
|
+
return state.interaction;
|
|
4
|
+
}
|
|
5
|
+
export const selectorChartsInteractionItem = createSelector(selectInteraction, interaction => interaction.item);
|
|
6
|
+
export const selectorChartsInteractionAxis = createSelector(selectInteraction, interaction => interaction.axis);
|
|
7
|
+
export const selectorChartsInteractionXAxis = createSelector(selectInteraction, interaction => interaction.axis.x);
|
|
8
|
+
export const selectorChartsInteractionYAxis = createSelector(selectInteraction, interaction => interaction.axis.y);
|
|
9
|
+
export const selectorChartsInteractionItemIsDefined = createSelector(selectorChartsInteractionItem, item => item !== null);
|
|
10
|
+
export const selectorChartsInteractionXAxisIsDefined = createSelector(selectorChartsInteractionXAxis, x => x !== null);
|
|
11
|
+
export const selectorChartsInteractionYAxisIsDefined = createSelector(selectorChartsInteractionYAxis, y => y !== null);
|
|
12
|
+
export const selectorChartsInteractionIsVoronoiEnabled = createSelector(selectInteraction, interaction => interaction.isVoronoiEnabled);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SizeProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
5
|
+
*/
|
|
6
|
+
width?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
9
|
+
*/
|
|
10
|
+
height?: number;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface SizeContextState extends Required<Pick<SizeProviderProps, 'height' | 'width'>> {
|
|
14
|
+
/**
|
|
15
|
+
* The ref of the svg element that the chart is rendered in.
|
|
16
|
+
*/
|
|
17
|
+
svgRef: React.RefObject<SVGSVGElement>;
|
|
18
|
+
/**
|
|
19
|
+
* If the chart has a defined size.
|
|
20
|
+
*/
|
|
21
|
+
hasIntrinsicSize: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The input height of the chart in px.
|
|
24
|
+
*/
|
|
25
|
+
inHeight?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The input width of the chart in px.
|
|
28
|
+
*/
|
|
29
|
+
inWidth?: number;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const SizeContext = /*#__PURE__*/React.createContext({
|
|
3
|
+
isInitialized: false,
|
|
4
|
+
data: {
|
|
5
|
+
hasIntrinsicSize: false,
|
|
6
|
+
svgRef: {
|
|
7
|
+
current: null
|
|
8
|
+
},
|
|
9
|
+
height: 0,
|
|
10
|
+
width: 0
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
14
|
+
SizeContext.displayName = 'SizeContext';
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SizeProviderProps } from './Size.types';
|
|
3
|
+
/**
|
|
4
|
+
* The size provider.
|
|
5
|
+
*
|
|
6
|
+
* This differs from the DrawingProvider in that it provides the full size of the container.
|
|
7
|
+
*
|
|
8
|
+
* This provider is also responsible for resolving the size of the container before rendering and if the parent size changes.
|
|
9
|
+
*/
|
|
10
|
+
declare function SizeProvider(props: SizeProviderProps): React.JSX.Element;
|
|
11
|
+
export { SizeProvider };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { SizeContext } from "./SizeContext.js";
|
|
5
|
+
import { useChartContainerDimensions } from "./useChartContainerDimensions.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The size provider.
|
|
9
|
+
*
|
|
10
|
+
* This differs from the DrawingProvider in that it provides the full size of the container.
|
|
11
|
+
*
|
|
12
|
+
* This provider is also responsible for resolving the size of the container before rendering and if the parent size changes.
|
|
13
|
+
*/
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
function SizeProvider(props) {
|
|
16
|
+
const dimensions = useChartContainerDimensions(props.width, props.height);
|
|
17
|
+
const value = React.useMemo(() => ({
|
|
18
|
+
isInitialized: true,
|
|
19
|
+
data: dimensions
|
|
20
|
+
}), [dimensions]);
|
|
21
|
+
return /*#__PURE__*/_jsx(SizeContext.Provider, {
|
|
22
|
+
value: value,
|
|
23
|
+
children: props.children
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export { SizeProvider };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const useChartContainerDimensions: (inWidth?: number, inHeight?: number) => {
|
|
3
|
+
svgRef: React.RefObject<SVGSVGElement>;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
hasIntrinsicSize: boolean;
|
|
7
|
+
inWidth: number | undefined;
|
|
8
|
+
inHeight: number | undefined;
|
|
9
|
+
};
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
6
6
|
import ownerWindow from '@mui/utils/ownerWindow';
|
|
7
|
-
|
|
7
|
+
const MAX_COMPUTE_RUN = 10;
|
|
8
|
+
export const useChartContainerDimensions = (inWidth, inHeight) => {
|
|
8
9
|
const hasInSize = inWidth !== undefined && inHeight !== undefined;
|
|
9
10
|
const stateRef = React.useRef({
|
|
10
11
|
displayError: false,
|
|
@@ -19,6 +20,10 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
19
20
|
const computeSize = React.useCallback(() => {
|
|
20
21
|
const mainEl = rootRef?.current;
|
|
21
22
|
if (!mainEl) {
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
// This is mostly for internal use.
|
|
25
|
+
throw new Error([`MUI X: ChartContainer does not have a valid reference to the <svg /> element.`, 'This may be caused by a ref forwarding issue.', 'Make sure that the ref from SizedProvider is forwarded correctly.'].join('\n'));
|
|
26
|
+
}
|
|
22
27
|
return {};
|
|
23
28
|
}
|
|
24
29
|
const win = ownerWindow(mainEl);
|
|
@@ -42,7 +47,7 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
42
47
|
// https://github.com/mui/mui-x/issues/13477#issuecomment-2336634785
|
|
43
48
|
useEnhancedEffect(() => {
|
|
44
49
|
// computeRun is used to avoid infinite loops.
|
|
45
|
-
if (hasInSize || !
|
|
50
|
+
if (hasInSize || !stateRef.current.initialCompute || stateRef.current.computeRun > MAX_COMPUTE_RUN) {
|
|
46
51
|
return;
|
|
47
52
|
}
|
|
48
53
|
const computedSize = computeSize();
|
|
@@ -51,7 +56,7 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
51
56
|
} else if (stateRef.current.initialCompute) {
|
|
52
57
|
stateRef.current.initialCompute = false;
|
|
53
58
|
}
|
|
54
|
-
}, [width, height, computeSize,
|
|
59
|
+
}, [width, height, computeSize, hasInSize]);
|
|
55
60
|
useEnhancedEffect(() => {
|
|
56
61
|
if (hasInSize) {
|
|
57
62
|
return () => {};
|
|
@@ -90,9 +95,14 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
90
95
|
stateRef.current.displayError = false;
|
|
91
96
|
}
|
|
92
97
|
}
|
|
98
|
+
const finalWidth = inWidth ?? width;
|
|
99
|
+
const finalHeight = inHeight ?? height;
|
|
93
100
|
return {
|
|
94
|
-
|
|
95
|
-
width:
|
|
96
|
-
height:
|
|
101
|
+
svgRef: rootRef,
|
|
102
|
+
width: finalWidth,
|
|
103
|
+
height: finalHeight,
|
|
104
|
+
hasIntrinsicSize: finalWidth > 0 && finalHeight > 0,
|
|
105
|
+
inWidth,
|
|
106
|
+
inHeight
|
|
97
107
|
};
|
|
98
108
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { SizeContext } from "./SizeContext.js";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the size of the chart. And the ref of the container element that the chart is rendered in.
|
|
7
|
+
*/
|
|
8
|
+
export const useSize = () => {
|
|
9
|
+
const {
|
|
10
|
+
data
|
|
11
|
+
} = React.useContext(SizeContext);
|
|
12
|
+
return data;
|
|
13
|
+
};
|
package/context/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './HighlightedProvider';
|
|
2
2
|
export { ZAxisContextProvider } from './ZAxisContextProvider';
|
|
3
3
|
export type { ZAxisContextProviderProps } from './ZAxisContextProvider';
|
|
4
|
+
export { ChartDataProvider } from './ChartDataProvider';
|
|
5
|
+
export type { ChartDataProviderProps } from './ChartDataProvider';
|
package/context/index.js
CHANGED