@mui/x-charts 7.22.3 → 8.0.0-alpha.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/BarChart/AnimatedBarElement.d.ts +15 -0
- package/BarChart/AnimatedBarElement.js +21 -0
- package/BarChart/BarChart.d.ts +11 -16
- package/BarChart/BarChart.js +9 -59
- package/BarChart/BarElement.d.ts +6 -1343
- package/BarChart/BarElement.js +10 -20
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarPlot.js +24 -6
- package/BarChart/extremums.js +3 -3
- package/BarChart/useBarChartProps.d.ts +2 -4
- package/BarChart/useBarChartProps.js +4 -11
- package/CHANGELOG.md +348 -12
- package/ChartContainer/ChartContainer.d.ts +4 -38
- package/ChartContainer/ChartContainer.js +15 -44
- package/ChartContainer/ResizableContainer.d.ts +22 -0
- package/ChartContainer/ResizableContainer.js +60 -0
- package/ChartContainer/useChartContainerProps.d.ts +8 -92
- package/ChartContainer/useChartContainerProps.js +29 -59
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -17
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +10 -96
- package/ChartsAxisHighlight/ChartsAxisHighlight.types.d.ts +5 -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/ChartsLegend.js +0 -3
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
- package/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/ChartsLegend/LegendPerItem.d.ts +3 -3
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.d.ts +0 -15
- package/ChartsSurface/ChartsSurface.js +35 -34
- package/ChartsTooltip/ChartTooltip.types.d.ts +15 -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 +162 -107
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +33 -0
- package/ChartsTooltip/ChartsTooltipContainer.js +298 -0
- 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 +21 -21
- package/ChartsTooltip/useItemTooltip.d.ts +1 -1
- package/ChartsTooltip/useItemTooltip.js +8 -7
- package/ChartsTooltip/utils.d.ts +5 -16
- package/ChartsTooltip/utils.js +45 -50
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -39
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/Gauge.js +0 -6
- package/Gauge/GaugeContainer.d.ts +3 -3
- package/Gauge/GaugeContainer.js +60 -61
- 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/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.js +14 -8
- package/LineChart/CircleMarkElement.js +6 -5
- package/LineChart/LineChart.d.ts +11 -17
- package/LineChart/LineChart.js +9 -60
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LineHighlightPlot.js +8 -11
- package/LineChart/LinePlot.js +14 -8
- package/LineChart/MarkElement.js +6 -5
- package/LineChart/MarkPlot.js +2 -6
- package/LineChart/extremums.js +10 -6
- package/LineChart/useLineChartProps.d.ts +2 -4
- package/LineChart/useLineChartProps.js +4 -11
- package/PieChart/PieArc.d.ts +0 -5
- package/PieChart/PieArc.js +1 -10
- package/PieChart/PieArcPlot.js +0 -5
- package/PieChart/PieChart.d.ts +10 -39
- package/PieChart/PieChart.js +20 -137
- package/PieChart/PiePlot.js +2 -2
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/README.md +4 -4
- package/ScatterChart/Scatter.js +6 -5
- package/ScatterChart/ScatterChart.d.ts +11 -17
- package/ScatterChart/ScatterChart.js +11 -60
- package/ScatterChart/ScatterPlot.js +3 -6
- package/ScatterChart/extremums.js +6 -6
- package/ScatterChart/useScatterChartProps.d.ts +2 -4
- package/ScatterChart/useScatterChartProps.js +3 -12
- package/SparkLineChart/SparkLineChart.d.ts +7 -8
- package/SparkLineChart/SparkLineChart.js +6 -33
- package/context/CartesianProvider/defaultizeAxis.d.ts +1 -1
- package/context/ChartDataProvider/ChartDataProvider.d.ts +31 -0
- package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
- package/context/ChartDataProvider/index.d.ts +1 -0
- package/context/ChartDataProvider/index.js +1 -0
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +94 -0
- package/context/ChartDataProvider/useChartDataProviderProps.js +66 -0
- package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +12 -12
- package/{modern/ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/context/{DrawingProvider.d.ts → DrawingAreaProvider/DrawingArea.types.d.ts} +3 -14
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +8 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.js +16 -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/HighlightedProvider/HighlightedContext.d.ts +0 -8
- package/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/context/InteractionProvider.d.ts +5 -48
- package/context/InteractionProvider.js +8 -64
- package/context/InteractionSelectors.d.ts +359 -0
- package/context/InteractionSelectors.js +12 -0
- package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
- package/context/SizeProvider/Size.types.d.ts +30 -0
- package/context/SizeProvider/SizeContext.d.ts +4 -0
- package/context/SizeProvider/SizeContext.js +13 -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/ResponsiveChartContainer → context/SizeProvider}/useChartContainerDimensions.js +15 -7
- package/context/SizeProvider/useSize.d.ts +5 -0
- package/context/SizeProvider/useSize.js +13 -0
- package/context/SvgRefProvider/SvgRef.types.d.ts +8 -0
- package/context/SvgRefProvider/SvgRef.types.js +1 -0
- package/context/SvgRefProvider/SvgRefContext.d.ts +4 -0
- package/context/SvgRefProvider/SvgRefContext.js +17 -0
- package/context/SvgRefProvider/SvgRefProvider.d.ts +3 -0
- package/context/SvgRefProvider/SvgRefProvider.js +24 -0
- package/context/SvgRefProvider/index.d.ts +4 -0
- package/context/SvgRefProvider/index.js +4 -0
- package/context/SvgRefProvider/useSurfaceRef.d.ts +2 -0
- package/context/SvgRefProvider/useSurfaceRef.js +14 -0
- package/context/ZAxisContextProvider.d.ts +1 -1
- package/context/index.d.ts +2 -0
- package/context/index.js +2 -1
- package/hooks/useAxisEvents.js +32 -19
- package/hooks/useChartId.js +2 -2
- package/hooks/useDrawingArea.d.ts +2 -2
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +19 -12
- package/hooks/useSvgRef.js +3 -3
- package/index.d.ts +1 -2
- package/index.js +2 -3
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/internals/computeAxisValue.d.ts +2 -2
- package/internals/defaultizeColor.d.ts +1 -8
- package/internals/getSymbol.js +19 -3
- package/internals/index.d.ts +7 -6
- package/internals/index.js +7 -6
- package/internals/plugins/models/index.d.ts +35 -0
- package/internals/plugins/models/index.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +12 -0
- package/internals/plugins/utils/ChartStore.js +26 -0
- package/internals/plugins/utils/ChartsStore.d.ts +12 -0
- package/internals/plugins/utils/ChartsStore.js +26 -0
- package/internals/plugins/utils/selectors.d.ts +9 -0
- package/internals/plugins/utils/selectors.js +37 -0
- package/internals/useCharts.d.ts +6 -0
- package/internals/useCharts.js +29 -0
- package/internals/useSelector.d.ts +4 -0
- package/internals/useSelector.js +6 -0
- package/internals/useStore.d.ts +2 -0
- package/internals/useStore.js +17 -0
- package/internals/useStringInterpolator.js +1 -0
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.ts +0 -10
- package/models/seriesType/config.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +1 -6
- package/modern/BarChart/AnimatedBarElement.js +21 -0
- package/modern/BarChart/BarChart.js +9 -59
- package/modern/BarChart/BarElement.js +10 -20
- package/modern/BarChart/BarPlot.js +24 -6
- package/modern/BarChart/extremums.js +3 -3
- package/modern/BarChart/useBarChartProps.js +4 -11
- package/modern/ChartContainer/ChartContainer.js +15 -44
- package/modern/ChartContainer/ResizableContainer.js +60 -0
- package/modern/ChartContainer/useChartContainerProps.js +29 -59
- 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/ChartsLegend.js +0 -3
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
- package/modern/ChartsSurface/ChartsSurface.js +35 -34
- 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 +162 -107
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +298 -0
- package/modern/ChartsTooltip/chartsTooltipClasses.js +18 -2
- package/modern/ChartsTooltip/index.js +2 -3
- package/modern/ChartsTooltip/useAxisTooltip.js +21 -21
- package/modern/ChartsTooltip/useItemTooltip.js +8 -7
- package/modern/ChartsTooltip/utils.js +45 -50
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +50 -39
- package/modern/Gauge/Gauge.js +0 -6
- package/modern/Gauge/GaugeContainer.js +60 -61
- package/modern/LineChart/AnimatedArea.js +9 -18
- package/modern/LineChart/AnimatedLine.js +9 -20
- package/modern/LineChart/AreaPlot.js +14 -8
- package/modern/LineChart/CircleMarkElement.js +6 -5
- package/modern/LineChart/LineChart.js +9 -60
- package/modern/LineChart/LineHighlightPlot.js +8 -11
- package/modern/LineChart/LinePlot.js +14 -8
- package/modern/LineChart/MarkElement.js +6 -5
- package/modern/LineChart/MarkPlot.js +2 -6
- package/modern/LineChart/extremums.js +10 -6
- package/modern/LineChart/useLineChartProps.js +4 -11
- package/modern/PieChart/PieArc.js +1 -10
- package/modern/PieChart/PieArcPlot.js +0 -5
- package/modern/PieChart/PieChart.js +20 -137
- package/modern/PieChart/PiePlot.js +2 -2
- package/modern/ScatterChart/Scatter.js +6 -5
- package/modern/ScatterChart/ScatterChart.js +11 -60
- package/modern/ScatterChart/ScatterPlot.js +3 -6
- package/modern/ScatterChart/extremums.js +6 -6
- package/modern/ScatterChart/useScatterChartProps.js +3 -12
- package/modern/SparkLineChart/SparkLineChart.js +6 -33
- package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
- package/modern/context/ChartDataProvider/index.js +1 -0
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +66 -0
- package/{ChartContainer → modern/context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/modern/context/DrawingAreaProvider/DrawingArea.types.js +1 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +16 -0
- package/{context/DrawingProvider.js → modern/context/DrawingAreaProvider/DrawingAreaProvider.js} +11 -41
- package/modern/context/DrawingAreaProvider/index.js +3 -0
- package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/modern/context/InteractionProvider.js +8 -64
- package/modern/context/InteractionSelectors.js +12 -0
- package/modern/context/SizeProvider/Size.types.js +1 -0
- package/modern/context/SizeProvider/SizeContext.js +13 -0
- package/modern/context/SizeProvider/SizeProvider.js +26 -0
- package/modern/context/SizeProvider/index.js +4 -0
- package/{ResponsiveChartContainer → modern/context/SizeProvider}/useChartContainerDimensions.js +15 -7
- package/modern/context/SizeProvider/useSize.js +13 -0
- package/modern/context/SvgRefProvider/SvgRef.types.js +1 -0
- package/modern/context/SvgRefProvider/SvgRefContext.js +17 -0
- package/modern/context/SvgRefProvider/SvgRefProvider.js +24 -0
- package/modern/context/SvgRefProvider/index.js +4 -0
- package/modern/context/SvgRefProvider/useSurfaceRef.js +14 -0
- package/modern/context/index.js +2 -1
- package/modern/hooks/useAxisEvents.js +32 -19
- package/modern/hooks/useChartId.js +2 -2
- package/modern/hooks/useDrawingArea.js +2 -2
- package/modern/hooks/useInteractionItemProps.js +19 -12
- package/modern/hooks/useSvgRef.js +3 -3
- package/modern/index.js +2 -3
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/modern/internals/getSymbol.js +19 -3
- package/modern/internals/index.js +7 -6
- package/modern/internals/plugins/models/index.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +26 -0
- package/modern/internals/plugins/utils/ChartsStore.js +26 -0
- package/modern/internals/plugins/utils/selectors.js +37 -0
- package/modern/internals/useCharts.js +29 -0
- package/modern/internals/useSelector.js +6 -0
- package/modern/internals/useStore.js +17 -0
- package/modern/internals/useStringInterpolator.js +1 -0
- package/node/BarChart/AnimatedBarElement.js +28 -0
- package/node/BarChart/BarChart.js +9 -59
- package/node/BarChart/BarElement.js +11 -21
- package/node/BarChart/BarPlot.js +22 -4
- package/node/BarChart/extremums.js +3 -3
- package/node/BarChart/useBarChartProps.js +4 -11
- package/node/ChartContainer/ChartContainer.js +14 -43
- package/node/ChartContainer/ResizableContainer.js +68 -0
- package/node/ChartContainer/useChartContainerProps.js +29 -60
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +12 -100
- 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/ChartsLegend.js +0 -3
- package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +11 -9
- package/node/ChartsSurface/ChartsSurface.js +35 -34
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +83 -73
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +54 -45
- package/node/ChartsTooltip/ChartsTooltip.js +161 -106
- package/node/ChartsTooltip/ChartsTooltipContainer.js +304 -0
- package/node/ChartsTooltip/chartsTooltipClasses.js +22 -3
- package/node/ChartsTooltip/index.js +19 -28
- package/node/ChartsTooltip/useAxisTooltip.js +21 -21
- package/node/ChartsTooltip/useItemTooltip.js +8 -7
- package/node/ChartsTooltip/utils.js +46 -53
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +51 -40
- package/node/Gauge/Gauge.js +0 -6
- package/node/Gauge/GaugeContainer.js +60 -61
- package/node/LineChart/AnimatedArea.js +9 -19
- package/node/LineChart/AnimatedLine.js +9 -21
- package/node/LineChart/AreaPlot.js +13 -7
- package/node/LineChart/CircleMarkElement.js +6 -5
- package/node/LineChart/LineChart.js +9 -60
- package/node/LineChart/LineHighlightPlot.js +8 -11
- package/node/LineChart/LinePlot.js +13 -7
- package/node/LineChart/MarkElement.js +6 -5
- package/node/LineChart/MarkPlot.js +2 -6
- package/node/LineChart/extremums.js +10 -6
- package/node/LineChart/useLineChartProps.js +4 -11
- package/node/PieChart/PieArc.js +1 -10
- package/node/PieChart/PieArcPlot.js +0 -5
- package/node/PieChart/PieChart.js +20 -137
- package/node/PieChart/PiePlot.js +2 -2
- package/node/ScatterChart/Scatter.js +6 -5
- package/node/ScatterChart/ScatterChart.js +11 -60
- package/node/ScatterChart/ScatterPlot.js +3 -6
- package/node/ScatterChart/extremums.js +6 -6
- package/node/ScatterChart/useScatterChartProps.js +3 -12
- package/node/SparkLineChart/SparkLineChart.js +6 -33
- package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -39
- package/node/context/ChartDataProvider/index.js +16 -0
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +72 -0
- package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/node/context/DrawingAreaProvider/DrawingArea.types.js +5 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +22 -0
- package/node/context/{DrawingProvider.js → DrawingAreaProvider/DrawingAreaProvider.js} +12 -44
- package/node/context/DrawingAreaProvider/index.js +38 -0
- package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/node/context/InteractionProvider.js +9 -66
- package/node/context/InteractionSelectors.js +18 -0
- package/node/context/SizeProvider/Size.types.js +5 -0
- package/node/context/SizeProvider/SizeContext.js +20 -0
- package/node/context/SizeProvider/SizeProvider.js +29 -0
- package/node/context/SizeProvider/index.js +49 -0
- package/node/{ResponsiveChartContainer → context/SizeProvider}/useChartContainerDimensions.js +15 -7
- package/node/context/SizeProvider/useSize.js +20 -0
- package/node/context/SvgRefProvider/SvgRef.types.js +5 -0
- package/node/context/SvgRefProvider/SvgRefContext.js +23 -0
- package/node/context/SvgRefProvider/SvgRefProvider.js +31 -0
- package/node/context/SvgRefProvider/index.js +49 -0
- package/node/context/SvgRefProvider/useSurfaceRef.js +20 -0
- package/node/context/index.js +10 -2
- package/node/hooks/useAxisEvents.js +33 -19
- package/node/hooks/useChartId.js +2 -2
- package/node/hooks/useDrawingArea.js +2 -2
- package/node/hooks/useInteractionItemProps.js +20 -13
- package/node/hooks/useSvgRef.js +3 -3
- package/node/index.js +5 -16
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +9 -4
- package/node/internals/getSymbol.js +19 -3
- package/node/internals/index.js +64 -44
- package/node/internals/plugins/models/index.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +33 -0
- package/node/internals/plugins/utils/ChartsStore.js +33 -0
- package/node/internals/plugins/utils/selectors.js +44 -0
- package/node/internals/useCharts.js +36 -0
- package/node/internals/useSelector.js +13 -0
- package/node/internals/useStore.js +24 -0
- package/node/internals/useStringInterpolator.js +2 -0
- package/package.json +8 -6
- package/themeAugmentation/props.d.ts +1 -2
- 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/ResponsiveChartContainer/ResizableContainer.d.ts +0 -9
- package/ResponsiveChartContainer/ResizableContainer.js +0 -26
- package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
- package/ResponsiveChartContainer/index.d.ts +0 -1
- package/ResponsiveChartContainer/index.js +0 -1
- package/ResponsiveChartContainer/package.json +0 -6
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +0 -6
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/internals/SlotComponentPropsFromProps.d.ts +0 -1
- package/models/helpers.d.ts +0 -3
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -123
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -92
- package/modern/ResponsiveChartContainer/ResizableContainer.js +0 -26
- package/modern/ResponsiveChartContainer/index.js +0 -1
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -129
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -98
- package/node/ResponsiveChartContainer/ResizableContainer.js +0 -32
- package/node/ResponsiveChartContainer/index.js +0 -16
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
- /package/{internals/SlotComponentPropsFromProps.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
- /package/ChartsGrid/{styledCommonents.d.ts → styledComponents.d.ts} +0 -0
- /package/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/{models/helpers.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
- /package/{modern/internals/SlotComponentPropsFromProps.js → context/DrawingAreaProvider/DrawingArea.types.js} +0 -0
- /package/{modern/models/helpers.js → context/SizeProvider/Size.types.js} +0 -0
- /package/modern/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/{internals/SlotComponentPropsFromProps.js → ChartsAxisHighlight/ChartsAxisHighlight.types.js} +0 -0
- /package/node/ChartsGrid/{styledCommonents.js → styledComponents.js} +0 -0
- /package/node/{models/helpers.js → ChartsTooltip/ChartTooltip.types.js} +0 -0
|
@@ -11,14 +11,16 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _useStore = require("../internals/useStore");
|
|
15
|
+
var _useSelector = require("../internals/useSelector");
|
|
14
16
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
15
17
|
var _LineHighlightElement = require("./LineHighlightElement");
|
|
16
18
|
var _useScale = require("../hooks/useScale");
|
|
17
|
-
var _InteractionProvider = require("../context/InteractionProvider");
|
|
18
19
|
var _constants = require("../constants");
|
|
19
20
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
20
21
|
var _useSeries = require("../hooks/useSeries");
|
|
21
22
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
23
|
+
var _InteractionSelectors = require("../context/InteractionSelectors");
|
|
22
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
25
|
const _excluded = ["slots", "slotProps"];
|
|
24
26
|
/**
|
|
@@ -40,10 +42,9 @@ function LineHighlightPlot(props) {
|
|
|
40
42
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
41
43
|
const axisData = (0, _CartesianProvider.useCartesianContext)();
|
|
42
44
|
const drawingArea = (0, _useDrawingArea.useDrawingArea)();
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const highlightedIndex = axis.x?.index;
|
|
45
|
+
const store = (0, _useStore.useStore)();
|
|
46
|
+
const xAxisIdentifier = (0, _useSelector.useSelector)(store, _InteractionSelectors.selectorChartsInteractionXAxis);
|
|
47
|
+
const highlightedIndex = xAxisIdentifier?.index;
|
|
47
48
|
if (highlightedIndex === undefined) {
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
@@ -69,16 +70,12 @@ function LineHighlightPlot(props) {
|
|
|
69
70
|
}) => {
|
|
70
71
|
return groupIds.flatMap(seriesId => {
|
|
71
72
|
const {
|
|
72
|
-
xAxisId
|
|
73
|
-
yAxisId
|
|
74
|
-
xAxisKey = defaultXAxisId,
|
|
75
|
-
yAxisKey = defaultYAxisId,
|
|
73
|
+
xAxisId = defaultXAxisId,
|
|
74
|
+
yAxisId = defaultYAxisId,
|
|
76
75
|
stackedData,
|
|
77
76
|
data,
|
|
78
77
|
disableHighlight
|
|
79
78
|
} = series[seriesId];
|
|
80
|
-
const xAxisId = xAxisIdProp ?? xAxisKey;
|
|
81
|
-
const yAxisId = yAxisIdProp ?? yAxisKey;
|
|
82
79
|
if (disableHighlight || data[highlightedIndex] == null) {
|
|
83
80
|
return null;
|
|
84
81
|
}
|
|
@@ -11,6 +11,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _styles = require("@mui/material/styles");
|
|
14
15
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
15
16
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
16
17
|
var _LineElement = require("./LineElement");
|
|
@@ -22,6 +23,15 @@ var _useSeries = require("../hooks/useSeries");
|
|
|
22
23
|
var _AnimationProvider = require("../context/AnimationProvider");
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
26
|
+
const LinePlotRoot = (0, _styles.styled)('g', {
|
|
27
|
+
name: 'MuiAreaPlot',
|
|
28
|
+
slot: 'Root',
|
|
29
|
+
overridesResolver: (_, styles) => styles.root
|
|
30
|
+
})({
|
|
31
|
+
[`& .${_LineElement.lineElementClasses.root}`]: {
|
|
32
|
+
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
25
35
|
const useAggregatedData = () => {
|
|
26
36
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
27
37
|
const axisData = (0, _CartesianProvider.useCartesianContext)();
|
|
@@ -48,16 +58,12 @@ const useAggregatedData = () => {
|
|
|
48
58
|
}) => {
|
|
49
59
|
return groupIds.flatMap(seriesId => {
|
|
50
60
|
const {
|
|
51
|
-
xAxisId
|
|
52
|
-
yAxisId
|
|
53
|
-
xAxisKey = defaultXAxisId,
|
|
54
|
-
yAxisKey = defaultYAxisId,
|
|
61
|
+
xAxisId = defaultXAxisId,
|
|
62
|
+
yAxisId = defaultYAxisId,
|
|
55
63
|
stackedData,
|
|
56
64
|
data,
|
|
57
65
|
connectNulls
|
|
58
66
|
} = series[seriesId];
|
|
59
|
-
const xAxisId = xAxisIdProp ?? xAxisKey;
|
|
60
|
-
const yAxisId = yAxisIdProp ?? yAxisKey;
|
|
61
67
|
const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisId].scale);
|
|
62
68
|
const yScale = yAxis[yAxisId].scale;
|
|
63
69
|
const xData = xAxis[xAxisId].data;
|
|
@@ -109,7 +115,7 @@ function LinePlot(props) {
|
|
|
109
115
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(inSkipAnimation);
|
|
110
116
|
const getGradientId = (0, _ChartsAxesGradients.useChartGradient)();
|
|
111
117
|
const completedData = useAggregatedData();
|
|
112
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
118
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinePlotRoot, (0, _extends2.default)({}, other, {
|
|
113
119
|
children: completedData.map(({
|
|
114
120
|
d,
|
|
115
121
|
seriesId,
|
|
@@ -15,10 +15,12 @@ var _styles = require("@mui/material/styles");
|
|
|
15
15
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
16
16
|
var _web = require("@react-spring/web");
|
|
17
17
|
var _getSymbol = require("../internals/getSymbol");
|
|
18
|
-
var _InteractionProvider = require("../context/InteractionProvider");
|
|
19
18
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
20
19
|
var _context = require("../context");
|
|
21
20
|
var _markElementClasses = require("./markElementClasses");
|
|
21
|
+
var _InteractionSelectors = require("../context/InteractionSelectors");
|
|
22
|
+
var _useSelector = require("../internals/useSelector");
|
|
23
|
+
var _useStore = require("../internals/useStore");
|
|
22
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
25
|
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation"];
|
|
24
26
|
const MarkElementPath = (0, _styles.styled)(_web.animated.path, {
|
|
@@ -63,9 +65,8 @@ function MarkElement(props) {
|
|
|
63
65
|
} = (0, _context.useItemHighlighted)({
|
|
64
66
|
seriesId: id
|
|
65
67
|
});
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
} = React.useContext(_InteractionProvider.InteractionContext);
|
|
68
|
+
const store = (0, _useStore.useStore)();
|
|
69
|
+
const xAxisIdentifier = (0, _useSelector.useSelector)(store, _InteractionSelectors.selectorChartsInteractionXAxis);
|
|
69
70
|
const position = (0, _web.useSpring)({
|
|
70
71
|
to: {
|
|
71
72
|
x,
|
|
@@ -76,7 +77,7 @@ function MarkElement(props) {
|
|
|
76
77
|
const ownerState = {
|
|
77
78
|
id,
|
|
78
79
|
classes: innerClasses,
|
|
79
|
-
isHighlighted:
|
|
80
|
+
isHighlighted: xAxisIdentifier?.index === dataIndex || isHighlighted,
|
|
80
81
|
isFaded,
|
|
81
82
|
color
|
|
82
83
|
};
|
|
@@ -70,10 +70,8 @@ function MarkPlot(props) {
|
|
|
70
70
|
}) => {
|
|
71
71
|
return groupIds.map(seriesId => {
|
|
72
72
|
const {
|
|
73
|
-
xAxisId
|
|
74
|
-
yAxisId
|
|
75
|
-
xAxisKey = defaultXAxisId,
|
|
76
|
-
yAxisKey = defaultYAxisId,
|
|
73
|
+
xAxisId = defaultXAxisId,
|
|
74
|
+
yAxisId = defaultYAxisId,
|
|
77
75
|
stackedData,
|
|
78
76
|
data,
|
|
79
77
|
showMark = true
|
|
@@ -81,8 +79,6 @@ function MarkPlot(props) {
|
|
|
81
79
|
if (showMark === false) {
|
|
82
80
|
return null;
|
|
83
81
|
}
|
|
84
|
-
const xAxisId = xAxisIdProp ?? xAxisKey;
|
|
85
|
-
const yAxisId = yAxisIdProp ?? yAxisKey;
|
|
86
82
|
const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisId].scale);
|
|
87
83
|
const yScale = yAxis[yAxisId].scale;
|
|
88
84
|
const xData = xAxis[xAxisId].data;
|
|
@@ -13,8 +13,11 @@ const getExtremumX = params => {
|
|
|
13
13
|
return [minX, maxX];
|
|
14
14
|
};
|
|
15
15
|
exports.getExtremumX = getExtremumX;
|
|
16
|
-
function getSeriesExtremums(getValues, stackedData, filter) {
|
|
16
|
+
function getSeriesExtremums(getValues, data, stackedData, filter) {
|
|
17
17
|
return stackedData.reduce((seriesAcc, stackedValue, index) => {
|
|
18
|
+
if (data[index] === null) {
|
|
19
|
+
return seriesAcc;
|
|
20
|
+
}
|
|
18
21
|
const [base, value] = getValues(stackedValue);
|
|
19
22
|
if (filter && (!filter({
|
|
20
23
|
y: base,
|
|
@@ -36,24 +39,25 @@ const getExtremumY = params => {
|
|
|
36
39
|
getFilters
|
|
37
40
|
} = params;
|
|
38
41
|
return Object.keys(series).filter(seriesId => {
|
|
39
|
-
const yAxisId = series[seriesId].yAxisId
|
|
42
|
+
const yAxisId = series[seriesId].yAxisId;
|
|
40
43
|
return yAxisId === axis.id || isDefaultAxis && yAxisId === undefined;
|
|
41
44
|
}).reduce((acc, seriesId) => {
|
|
42
45
|
const {
|
|
43
46
|
area,
|
|
44
|
-
stackedData
|
|
47
|
+
stackedData,
|
|
48
|
+
data
|
|
45
49
|
} = series[seriesId];
|
|
46
50
|
const isArea = area !== undefined;
|
|
47
51
|
const filter = getFilters?.({
|
|
48
52
|
currentAxisId: axis.id,
|
|
49
53
|
isDefaultAxis,
|
|
50
|
-
seriesXAxisId: series[seriesId].xAxisId
|
|
51
|
-
seriesYAxisId: series[seriesId].yAxisId
|
|
54
|
+
seriesXAxisId: series[seriesId].xAxisId,
|
|
55
|
+
seriesYAxisId: series[seriesId].yAxisId
|
|
52
56
|
});
|
|
53
57
|
|
|
54
58
|
// Since this series is not used to display an area, we do not consider the base (the d[0]).
|
|
55
59
|
const getValues = isArea && axis.scaleType !== 'log' && typeof series[seriesId].baseline !== 'string' ? d => d : d => [d[1], d[1]];
|
|
56
|
-
const seriesExtremums = getSeriesExtremums(getValues, stackedData, filter);
|
|
60
|
+
const seriesExtremums = getSeriesExtremums(getValues, data, stackedData, filter);
|
|
57
61
|
const [seriesMin, seriesMax] = seriesExtremums;
|
|
58
62
|
return [Math.min(seriesMin, acc[0]), Math.max(seriesMax, acc[1])];
|
|
59
63
|
}, [Infinity, -Infinity]);
|
|
@@ -10,7 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
12
12
|
var _constants = require("../constants");
|
|
13
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "
|
|
13
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAxisClick", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className", "experimentalMarkRendering"];
|
|
14
14
|
/**
|
|
15
15
|
* A helper function that extracts LineChartProps from the input props
|
|
16
16
|
* and returns an object with props for the children components of LineChart.
|
|
@@ -29,14 +29,12 @@ const useLineChartProps = props => {
|
|
|
29
29
|
colors,
|
|
30
30
|
dataset,
|
|
31
31
|
sx,
|
|
32
|
-
tooltip,
|
|
33
32
|
onAxisClick,
|
|
34
33
|
onAreaClick,
|
|
35
34
|
onLineClick,
|
|
36
35
|
onMarkClick,
|
|
37
36
|
axisHighlight,
|
|
38
37
|
disableLineItemHighlight,
|
|
39
|
-
legend,
|
|
40
38
|
grid,
|
|
41
39
|
topAxis,
|
|
42
40
|
leftAxis,
|
|
@@ -76,7 +74,7 @@ const useLineChartProps = props => {
|
|
|
76
74
|
sx,
|
|
77
75
|
highlightedItem,
|
|
78
76
|
onHighlightChange,
|
|
79
|
-
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
77
|
+
disableAxisListener: slotProps?.tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
80
78
|
className,
|
|
81
79
|
skipAnimation
|
|
82
80
|
});
|
|
@@ -130,14 +128,10 @@ const useLineChartProps = props => {
|
|
|
130
128
|
slots,
|
|
131
129
|
slotProps
|
|
132
130
|
};
|
|
133
|
-
const legendProps =
|
|
131
|
+
const legendProps = {
|
|
134
132
|
slots,
|
|
135
133
|
slotProps
|
|
136
|
-
}
|
|
137
|
-
const tooltipProps = (0, _extends2.default)({}, tooltip, {
|
|
138
|
-
slots,
|
|
139
|
-
slotProps
|
|
140
|
-
});
|
|
134
|
+
};
|
|
141
135
|
return {
|
|
142
136
|
chartContainerProps,
|
|
143
137
|
axisClickHandlerProps,
|
|
@@ -152,7 +146,6 @@ const useLineChartProps = props => {
|
|
|
152
146
|
axisHighlightProps,
|
|
153
147
|
lineHighlightPlotProps,
|
|
154
148
|
legendProps,
|
|
155
|
-
tooltipProps,
|
|
156
149
|
children
|
|
157
150
|
};
|
|
158
151
|
};
|
package/node/PieChart/PieArc.js
CHANGED
|
@@ -21,7 +21,7 @@ var _styles = require("@mui/material/styles");
|
|
|
21
21
|
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
22
22
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle"
|
|
24
|
+
const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle"];
|
|
25
25
|
function getPieArcUtilityClass(slot) {
|
|
26
26
|
return (0, _generateUtilityClass.default)('MuiPieArc', slot);
|
|
27
27
|
}
|
|
@@ -102,15 +102,6 @@ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
|
102
102
|
// ----------------------------------------------------------------------
|
|
103
103
|
classes: _propTypes.default.object,
|
|
104
104
|
dataIndex: _propTypes.default.number.isRequired,
|
|
105
|
-
/**
|
|
106
|
-
* @deprecated Use the `isFaded` or `isHighlighted` props instead.
|
|
107
|
-
*/
|
|
108
|
-
highlightScope: _propTypes.default.shape({
|
|
109
|
-
fade: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
110
|
-
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
111
|
-
highlight: _propTypes.default.oneOf(['item', 'none', 'series']),
|
|
112
|
-
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
113
|
-
}),
|
|
114
105
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
115
106
|
isFaded: _propTypes.default.bool.isRequired,
|
|
116
107
|
isHighlighted: _propTypes.default.bool.isRequired
|
|
@@ -15,7 +15,6 @@ var _web = require("@react-spring/web");
|
|
|
15
15
|
var _PieArc = require("./PieArc");
|
|
16
16
|
var _transition = require("./dataTransform/transition");
|
|
17
17
|
var _useTransformData = require("./dataTransform/useTransformData");
|
|
18
|
-
var _context = require("../context");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
19
|
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"],
|
|
21
20
|
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "arcLabelRadius", "outerRadius", "cornerRadius"];
|
|
@@ -50,9 +49,6 @@ function PieArcPlot(props) {
|
|
|
50
49
|
const transition = (0, _web.useTransition)(transformedData, (0, _extends2.default)({}, _transition.defaultTransitionConfig, {
|
|
51
50
|
immediate: skipAnimation
|
|
52
51
|
}));
|
|
53
|
-
const {
|
|
54
|
-
highlightScope
|
|
55
|
-
} = (0, _context.useHighlighted)();
|
|
56
52
|
if (data.length === 0) {
|
|
57
53
|
return null;
|
|
58
54
|
}
|
|
@@ -79,7 +75,6 @@ function PieArcPlot(props) {
|
|
|
79
75
|
id: id,
|
|
80
76
|
color: item.color,
|
|
81
77
|
dataIndex: index,
|
|
82
|
-
highlightScope: highlightScope,
|
|
83
78
|
isFaded: item.isFaded,
|
|
84
79
|
isHighlighted: item.isHighlighted,
|
|
85
80
|
onClick: onItemClick && (event => {
|
|
@@ -13,16 +13,13 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
15
15
|
var _styles = require("@mui/material/styles");
|
|
16
|
-
var
|
|
17
|
-
var _ChartsAxis = require("../ChartsAxis/ChartsAxis");
|
|
18
|
-
var _constants = require("../constants");
|
|
16
|
+
var _ChartContainer = require("../ChartContainer");
|
|
19
17
|
var _ChartsTooltip = require("../ChartsTooltip");
|
|
20
18
|
var _ChartsLegend = require("../ChartsLegend");
|
|
21
|
-
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
22
19
|
var _PiePlot = require("./PiePlot");
|
|
23
20
|
var _ChartsOverlay = require("../ChartsOverlay");
|
|
24
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "
|
|
22
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
26
23
|
const defaultMargin = {
|
|
27
24
|
top: 5,
|
|
28
25
|
bottom: 5,
|
|
@@ -52,27 +49,14 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
52
49
|
name: 'MuiPieChart'
|
|
53
50
|
});
|
|
54
51
|
const {
|
|
55
|
-
xAxis,
|
|
56
|
-
yAxis,
|
|
57
52
|
series,
|
|
58
53
|
width,
|
|
59
54
|
height,
|
|
60
55
|
margin: marginProps,
|
|
61
56
|
colors,
|
|
62
57
|
sx,
|
|
63
|
-
tooltip = {
|
|
64
|
-
trigger: 'item'
|
|
65
|
-
},
|
|
66
|
-
axisHighlight = {
|
|
67
|
-
x: 'none',
|
|
68
|
-
y: 'none'
|
|
69
|
-
},
|
|
70
58
|
skipAnimation,
|
|
71
|
-
|
|
72
|
-
topAxis = null,
|
|
73
|
-
leftAxis = null,
|
|
74
|
-
rightAxis = null,
|
|
75
|
-
bottomAxis = null,
|
|
59
|
+
hideLegend,
|
|
76
60
|
children,
|
|
77
61
|
slots,
|
|
78
62
|
slotProps,
|
|
@@ -85,14 +69,8 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
85
69
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
86
70
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
87
71
|
const margin = (0, _extends2.default)({}, isRtl ? defaultRTLMargin : defaultMargin, marginProps);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
position: {
|
|
91
|
-
vertical: 'middle',
|
|
92
|
-
horizontal: isRtl ? 'left' : 'right'
|
|
93
|
-
}
|
|
94
|
-
}, legendProps);
|
|
95
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ResponsiveChartContainer.ResponsiveChartContainer, (0, _extends2.default)({}, other, {
|
|
72
|
+
const Tooltip = slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartContainer.ChartContainer, (0, _extends2.default)({}, other, {
|
|
96
74
|
ref: ref,
|
|
97
75
|
series: series.map(s => (0, _extends2.default)({
|
|
98
76
|
type: 'pie'
|
|
@@ -100,27 +78,14 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
100
78
|
width: width,
|
|
101
79
|
height: height,
|
|
102
80
|
margin: margin,
|
|
103
|
-
xAxis: xAxis ?? [{
|
|
104
|
-
id: _constants.DEFAULT_X_AXIS_KEY,
|
|
105
|
-
scaleType: 'point',
|
|
106
|
-
data: [...new Array(Math.max(...series.map(s => s.data.length)))].map((_, index) => index)
|
|
107
|
-
}],
|
|
108
|
-
yAxis: yAxis,
|
|
109
81
|
colors: colors,
|
|
110
82
|
sx: sx,
|
|
111
|
-
disableAxisListener:
|
|
83
|
+
disableAxisListener: true,
|
|
112
84
|
highlightedItem: highlightedItem,
|
|
113
85
|
onHighlightChange: onHighlightChange,
|
|
114
86
|
className: className,
|
|
115
87
|
skipAnimation: skipAnimation,
|
|
116
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
117
|
-
topAxis: topAxis,
|
|
118
|
-
leftAxis: leftAxis,
|
|
119
|
-
rightAxis: rightAxis,
|
|
120
|
-
bottomAxis: bottomAxis,
|
|
121
|
-
slots: slots,
|
|
122
|
-
slotProps: slotProps
|
|
123
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PiePlot.PiePlot, {
|
|
88
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PiePlot.PiePlot, {
|
|
124
89
|
slots: slots,
|
|
125
90
|
slotProps: slotProps,
|
|
126
91
|
onItemClick: onItemClick
|
|
@@ -128,13 +93,17 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
128
93
|
loading: loading,
|
|
129
94
|
slots: slots,
|
|
130
95
|
slotProps: slotProps
|
|
131
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
96
|
+
}), !hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
97
|
+
direction: "column",
|
|
98
|
+
position: {
|
|
99
|
+
vertical: 'middle',
|
|
100
|
+
horizontal: isRtl ? 'left' : 'right'
|
|
101
|
+
},
|
|
135
102
|
slots: slots,
|
|
136
103
|
slotProps: slotProps
|
|
137
|
-
})),
|
|
104
|
+
}), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({
|
|
105
|
+
trigger: "item"
|
|
106
|
+
}, slotProps?.tooltip)), children]
|
|
138
107
|
}));
|
|
139
108
|
});
|
|
140
109
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
@@ -142,21 +111,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
142
111
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
143
112
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
144
113
|
// ----------------------------------------------------------------------
|
|
145
|
-
/**
|
|
146
|
-
* The configuration of axes highlight.
|
|
147
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
148
|
-
* @default { x: 'none', y: 'none' }
|
|
149
|
-
*/
|
|
150
|
-
axisHighlight: _propTypes.default.shape({
|
|
151
|
-
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
152
|
-
y: _propTypes.default.oneOf(['band', 'line', 'none'])
|
|
153
|
-
}),
|
|
154
|
-
/**
|
|
155
|
-
* Indicate which axis to display the bottom of the charts.
|
|
156
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
157
|
-
* @default null
|
|
158
|
-
*/
|
|
159
|
-
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
160
114
|
children: _propTypes.default.node,
|
|
161
115
|
className: _propTypes.default.string,
|
|
162
116
|
/**
|
|
@@ -179,6 +133,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
179
133
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
180
134
|
*/
|
|
181
135
|
height: _propTypes.default.number,
|
|
136
|
+
/**
|
|
137
|
+
* If `true`, the legend is not rendered.
|
|
138
|
+
*/
|
|
139
|
+
hideLegend: _propTypes.default.bool,
|
|
182
140
|
/**
|
|
183
141
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
184
142
|
*/
|
|
@@ -186,40 +144,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
186
144
|
dataIndex: _propTypes.default.number,
|
|
187
145
|
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
188
146
|
}),
|
|
189
|
-
/**
|
|
190
|
-
* Indicate which axis to display the left of the charts.
|
|
191
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
192
|
-
* @default null
|
|
193
|
-
*/
|
|
194
|
-
leftAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
195
|
-
/**
|
|
196
|
-
* The props of the legend.
|
|
197
|
-
* @default { direction: 'column', position: { vertical: 'middle', horizontal: 'right' } }
|
|
198
|
-
* @deprecated Consider using `slotProps.legend` instead.
|
|
199
|
-
*/
|
|
200
|
-
legend: _propTypes.default.shape({
|
|
201
|
-
classes: _propTypes.default.object,
|
|
202
|
-
direction: _propTypes.default.oneOf(['column', 'row']),
|
|
203
|
-
hidden: _propTypes.default.bool,
|
|
204
|
-
itemGap: _propTypes.default.number,
|
|
205
|
-
itemMarkHeight: _propTypes.default.number,
|
|
206
|
-
itemMarkWidth: _propTypes.default.number,
|
|
207
|
-
labelStyle: _propTypes.default.object,
|
|
208
|
-
markGap: _propTypes.default.number,
|
|
209
|
-
onItemClick: _propTypes.default.func,
|
|
210
|
-
padding: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
211
|
-
bottom: _propTypes.default.number,
|
|
212
|
-
left: _propTypes.default.number,
|
|
213
|
-
right: _propTypes.default.number,
|
|
214
|
-
top: _propTypes.default.number
|
|
215
|
-
})]),
|
|
216
|
-
position: _propTypes.default.shape({
|
|
217
|
-
horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
|
|
218
|
-
vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
219
|
-
}),
|
|
220
|
-
slotProps: _propTypes.default.object,
|
|
221
|
-
slots: _propTypes.default.object
|
|
222
|
-
}),
|
|
223
147
|
/**
|
|
224
148
|
* If `true`, a loading overlay is displayed.
|
|
225
149
|
* @default false
|
|
@@ -247,22 +171,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
247
171
|
* Callback fired when a pie arc is clicked.
|
|
248
172
|
*/
|
|
249
173
|
onItemClick: _propTypes.default.func,
|
|
250
|
-
/**
|
|
251
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
252
|
-
* before it renders for the first time.
|
|
253
|
-
*
|
|
254
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
255
|
-
* the first render, like when used inside a grid.
|
|
256
|
-
*
|
|
257
|
-
* @default false
|
|
258
|
-
*/
|
|
259
|
-
resolveSizeBeforeRender: _propTypes.default.bool,
|
|
260
|
-
/**
|
|
261
|
-
* Indicate which axis to display the right of the charts.
|
|
262
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
263
|
-
* @default null
|
|
264
|
-
*/
|
|
265
|
-
rightAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
266
174
|
/**
|
|
267
175
|
* The series to display in the pie chart.
|
|
268
176
|
* An array of [[PieSeriesType]] objects.
|
|
@@ -285,31 +193,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
285
193
|
slots: _propTypes.default.object,
|
|
286
194
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
287
195
|
title: _propTypes.default.string,
|
|
288
|
-
/**
|
|
289
|
-
* The configuration of the tooltip.
|
|
290
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
291
|
-
* @default { trigger: 'item' }
|
|
292
|
-
*/
|
|
293
|
-
tooltip: _propTypes.default.shape({
|
|
294
|
-
axisContent: _propTypes.default.elementType,
|
|
295
|
-
classes: _propTypes.default.object,
|
|
296
|
-
itemContent: _propTypes.default.elementType,
|
|
297
|
-
slotProps: _propTypes.default.object,
|
|
298
|
-
slots: _propTypes.default.object,
|
|
299
|
-
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
300
|
-
}),
|
|
301
|
-
/**
|
|
302
|
-
* Indicate which axis to display the top of the charts.
|
|
303
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
304
|
-
* @default null
|
|
305
|
-
*/
|
|
306
|
-
topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
|
|
307
|
-
viewBox: _propTypes.default.shape({
|
|
308
|
-
height: _propTypes.default.number,
|
|
309
|
-
width: _propTypes.default.number,
|
|
310
|
-
x: _propTypes.default.number,
|
|
311
|
-
y: _propTypes.default.number
|
|
312
|
-
}),
|
|
313
196
|
/**
|
|
314
197
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
315
198
|
*/
|
package/node/PieChart/PiePlot.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.PiePlot = PiePlot;
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var
|
|
12
|
+
var _DrawingAreaProvider = require("../context/DrawingAreaProvider");
|
|
13
13
|
var _PieArcPlot = require("./PieArcPlot");
|
|
14
14
|
var _PieArcLabelPlot = require("./PieArcLabelPlot");
|
|
15
15
|
var _getPercentageValue = require("../internals/getPercentageValue");
|
|
@@ -40,7 +40,7 @@ function PiePlot(props) {
|
|
|
40
40
|
top,
|
|
41
41
|
width,
|
|
42
42
|
height
|
|
43
|
-
} = React.useContext(
|
|
43
|
+
} = React.useContext(_DrawingAreaProvider.DrawingAreaContext);
|
|
44
44
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(inSkipAnimation);
|
|
45
45
|
if (seriesData === undefined) {
|
|
46
46
|
return null;
|
|
@@ -12,9 +12,11 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _useScale = require("../hooks/useScale");
|
|
14
14
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
15
|
-
var
|
|
15
|
+
var _useStore = require("../internals/useStore");
|
|
16
|
+
var _useSelector = require("../internals/useSelector");
|
|
16
17
|
var _context = require("../context");
|
|
17
18
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
19
|
+
var _InteractionSelectors = require("../context/InteractionSelectors");
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
/**
|
|
20
22
|
* Demos:
|
|
@@ -37,10 +39,9 @@ function Scatter(props) {
|
|
|
37
39
|
onItemClick
|
|
38
40
|
} = props;
|
|
39
41
|
const drawingArea = (0, _useDrawingArea.useDrawingArea)();
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const skipInteractionHandlers = useVoronoiInteraction || series.disableHover;
|
|
42
|
+
const store = (0, _useStore.useStore)();
|
|
43
|
+
const isVoronoiEnabled = (0, _useSelector.useSelector)(store, _InteractionSelectors.selectorChartsInteractionIsVoronoiEnabled);
|
|
44
|
+
const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
|
|
44
45
|
const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)(skipInteractionHandlers);
|
|
45
46
|
const {
|
|
46
47
|
isFaded,
|