@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
|
@@ -2,17 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "
|
|
5
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
9
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
|
-
import {
|
|
11
|
-
import { ChartsAxis } from "../ChartsAxis/ChartsAxis.js";
|
|
12
|
-
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
10
|
+
import { ChartContainer } from "../ChartContainer/index.js";
|
|
13
11
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
14
12
|
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
15
|
-
import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
|
|
16
13
|
import { PiePlot } from "./PiePlot.js";
|
|
17
14
|
import { ChartsOverlay } from "../ChartsOverlay/index.js";
|
|
18
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -45,27 +42,14 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
45
42
|
name: 'MuiPieChart'
|
|
46
43
|
});
|
|
47
44
|
const {
|
|
48
|
-
xAxis,
|
|
49
|
-
yAxis,
|
|
50
45
|
series,
|
|
51
46
|
width,
|
|
52
47
|
height,
|
|
53
48
|
margin: marginProps,
|
|
54
49
|
colors,
|
|
55
50
|
sx,
|
|
56
|
-
tooltip = {
|
|
57
|
-
trigger: 'item'
|
|
58
|
-
},
|
|
59
|
-
axisHighlight = {
|
|
60
|
-
x: 'none',
|
|
61
|
-
y: 'none'
|
|
62
|
-
},
|
|
63
51
|
skipAnimation,
|
|
64
|
-
|
|
65
|
-
topAxis = null,
|
|
66
|
-
leftAxis = null,
|
|
67
|
-
rightAxis = null,
|
|
68
|
-
bottomAxis = null,
|
|
52
|
+
hideLegend,
|
|
69
53
|
children,
|
|
70
54
|
slots,
|
|
71
55
|
slotProps,
|
|
@@ -78,14 +62,8 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
78
62
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
79
63
|
const isRtl = useRtl();
|
|
80
64
|
const margin = _extends({}, isRtl ? defaultRTLMargin : defaultMargin, marginProps);
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
position: {
|
|
84
|
-
vertical: 'middle',
|
|
85
|
-
horizontal: isRtl ? 'left' : 'right'
|
|
86
|
-
}
|
|
87
|
-
}, legendProps);
|
|
88
|
-
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({}, other, {
|
|
65
|
+
const Tooltip = slots?.tooltip ?? ChartsTooltip;
|
|
66
|
+
return /*#__PURE__*/_jsxs(ChartContainer, _extends({}, other, {
|
|
89
67
|
ref: ref,
|
|
90
68
|
series: series.map(s => _extends({
|
|
91
69
|
type: 'pie'
|
|
@@ -93,27 +71,14 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
93
71
|
width: width,
|
|
94
72
|
height: height,
|
|
95
73
|
margin: margin,
|
|
96
|
-
xAxis: xAxis ?? [{
|
|
97
|
-
id: DEFAULT_X_AXIS_KEY,
|
|
98
|
-
scaleType: 'point',
|
|
99
|
-
data: [...new Array(Math.max(...series.map(s => s.data.length)))].map((_, index) => index)
|
|
100
|
-
}],
|
|
101
|
-
yAxis: yAxis,
|
|
102
74
|
colors: colors,
|
|
103
75
|
sx: sx,
|
|
104
|
-
disableAxisListener:
|
|
76
|
+
disableAxisListener: true,
|
|
105
77
|
highlightedItem: highlightedItem,
|
|
106
78
|
onHighlightChange: onHighlightChange,
|
|
107
79
|
className: className,
|
|
108
80
|
skipAnimation: skipAnimation,
|
|
109
|
-
children: [/*#__PURE__*/_jsx(
|
|
110
|
-
topAxis: topAxis,
|
|
111
|
-
leftAxis: leftAxis,
|
|
112
|
-
rightAxis: rightAxis,
|
|
113
|
-
bottomAxis: bottomAxis,
|
|
114
|
-
slots: slots,
|
|
115
|
-
slotProps: slotProps
|
|
116
|
-
}), /*#__PURE__*/_jsx(PiePlot, {
|
|
81
|
+
children: [/*#__PURE__*/_jsx(PiePlot, {
|
|
117
82
|
slots: slots,
|
|
118
83
|
slotProps: slotProps,
|
|
119
84
|
onItemClick: onItemClick
|
|
@@ -121,13 +86,17 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
121
86
|
loading: loading,
|
|
122
87
|
slots: slots,
|
|
123
88
|
slotProps: slotProps
|
|
124
|
-
}), /*#__PURE__*/_jsx(ChartsLegend,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
89
|
+
}), !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
90
|
+
direction: "column",
|
|
91
|
+
position: {
|
|
92
|
+
vertical: 'middle',
|
|
93
|
+
horizontal: isRtl ? 'left' : 'right'
|
|
94
|
+
},
|
|
128
95
|
slots: slots,
|
|
129
96
|
slotProps: slotProps
|
|
130
|
-
})
|
|
97
|
+
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
98
|
+
trigger: "item"
|
|
99
|
+
}, slotProps?.tooltip)), children]
|
|
131
100
|
}));
|
|
132
101
|
});
|
|
133
102
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
@@ -135,21 +104,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
135
104
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
136
105
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
137
106
|
// ----------------------------------------------------------------------
|
|
138
|
-
/**
|
|
139
|
-
* The configuration of axes highlight.
|
|
140
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
141
|
-
* @default { x: 'none', y: 'none' }
|
|
142
|
-
*/
|
|
143
|
-
axisHighlight: PropTypes.shape({
|
|
144
|
-
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
145
|
-
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
146
|
-
}),
|
|
147
|
-
/**
|
|
148
|
-
* Indicate which axis to display the bottom of the charts.
|
|
149
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
150
|
-
* @default null
|
|
151
|
-
*/
|
|
152
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
153
107
|
children: PropTypes.node,
|
|
154
108
|
className: PropTypes.string,
|
|
155
109
|
/**
|
|
@@ -172,6 +126,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
172
126
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
173
127
|
*/
|
|
174
128
|
height: PropTypes.number,
|
|
129
|
+
/**
|
|
130
|
+
* If `true`, the legend is not rendered.
|
|
131
|
+
*/
|
|
132
|
+
hideLegend: PropTypes.bool,
|
|
175
133
|
/**
|
|
176
134
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
177
135
|
*/
|
|
@@ -179,40 +137,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
179
137
|
dataIndex: PropTypes.number,
|
|
180
138
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
181
139
|
}),
|
|
182
|
-
/**
|
|
183
|
-
* Indicate which axis to display the left of the charts.
|
|
184
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
185
|
-
* @default null
|
|
186
|
-
*/
|
|
187
|
-
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
188
|
-
/**
|
|
189
|
-
* The props of the legend.
|
|
190
|
-
* @default { direction: 'column', position: { vertical: 'middle', horizontal: 'right' } }
|
|
191
|
-
* @deprecated Consider using `slotProps.legend` instead.
|
|
192
|
-
*/
|
|
193
|
-
legend: PropTypes.shape({
|
|
194
|
-
classes: PropTypes.object,
|
|
195
|
-
direction: PropTypes.oneOf(['column', 'row']),
|
|
196
|
-
hidden: PropTypes.bool,
|
|
197
|
-
itemGap: PropTypes.number,
|
|
198
|
-
itemMarkHeight: PropTypes.number,
|
|
199
|
-
itemMarkWidth: PropTypes.number,
|
|
200
|
-
labelStyle: PropTypes.object,
|
|
201
|
-
markGap: PropTypes.number,
|
|
202
|
-
onItemClick: PropTypes.func,
|
|
203
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
204
|
-
bottom: PropTypes.number,
|
|
205
|
-
left: PropTypes.number,
|
|
206
|
-
right: PropTypes.number,
|
|
207
|
-
top: PropTypes.number
|
|
208
|
-
})]),
|
|
209
|
-
position: PropTypes.shape({
|
|
210
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
211
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
212
|
-
}),
|
|
213
|
-
slotProps: PropTypes.object,
|
|
214
|
-
slots: PropTypes.object
|
|
215
|
-
}),
|
|
216
140
|
/**
|
|
217
141
|
* If `true`, a loading overlay is displayed.
|
|
218
142
|
* @default false
|
|
@@ -240,22 +164,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
240
164
|
* Callback fired when a pie arc is clicked.
|
|
241
165
|
*/
|
|
242
166
|
onItemClick: PropTypes.func,
|
|
243
|
-
/**
|
|
244
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
245
|
-
* before it renders for the first time.
|
|
246
|
-
*
|
|
247
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
248
|
-
* the first render, like when used inside a grid.
|
|
249
|
-
*
|
|
250
|
-
* @default false
|
|
251
|
-
*/
|
|
252
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
253
|
-
/**
|
|
254
|
-
* Indicate which axis to display the right of the charts.
|
|
255
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
256
|
-
* @default null
|
|
257
|
-
*/
|
|
258
|
-
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
259
167
|
/**
|
|
260
168
|
* The series to display in the pie chart.
|
|
261
169
|
* An array of [[PieSeriesType]] objects.
|
|
@@ -278,31 +186,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
278
186
|
slots: PropTypes.object,
|
|
279
187
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
280
188
|
title: PropTypes.string,
|
|
281
|
-
/**
|
|
282
|
-
* The configuration of the tooltip.
|
|
283
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
284
|
-
* @default { trigger: 'item' }
|
|
285
|
-
*/
|
|
286
|
-
tooltip: PropTypes.shape({
|
|
287
|
-
axisContent: PropTypes.elementType,
|
|
288
|
-
classes: PropTypes.object,
|
|
289
|
-
itemContent: PropTypes.elementType,
|
|
290
|
-
slotProps: PropTypes.object,
|
|
291
|
-
slots: PropTypes.object,
|
|
292
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
293
|
-
}),
|
|
294
|
-
/**
|
|
295
|
-
* Indicate which axis to display the top of the charts.
|
|
296
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
297
|
-
* @default null
|
|
298
|
-
*/
|
|
299
|
-
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
300
|
-
viewBox: PropTypes.shape({
|
|
301
|
-
height: PropTypes.number,
|
|
302
|
-
width: PropTypes.number,
|
|
303
|
-
x: PropTypes.number,
|
|
304
|
-
y: PropTypes.number
|
|
305
|
-
}),
|
|
306
189
|
/**
|
|
307
190
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
308
191
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
5
|
+
import { DrawingAreaContext } from "../context/DrawingAreaProvider/index.js";
|
|
6
6
|
import { PieArcPlot } from "./PieArcPlot.js";
|
|
7
7
|
import { PieArcLabelPlot } from "./PieArcLabelPlot.js";
|
|
8
8
|
import { getPercentageValue } from "../internals/getPercentageValue.js";
|
|
@@ -33,7 +33,7 @@ function PiePlot(props) {
|
|
|
33
33
|
top,
|
|
34
34
|
width,
|
|
35
35
|
height
|
|
36
|
-
} = React.useContext(
|
|
36
|
+
} = React.useContext(DrawingAreaContext);
|
|
37
37
|
const skipAnimation = useSkipAnimation(inSkipAnimation);
|
|
38
38
|
if (seriesData === undefined) {
|
|
39
39
|
return null;
|
|
@@ -5,9 +5,11 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
7
7
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
8
|
-
import {
|
|
8
|
+
import { useStore } from "../internals/useStore.js";
|
|
9
|
+
import { useSelector } from "../internals/useSelector.js";
|
|
9
10
|
import { useHighlighted } from "../context/index.js";
|
|
10
11
|
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
12
|
+
import { selectorChartsInteractionIsVoronoiEnabled } from "../context/InteractionSelectors.js";
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
/**
|
|
13
15
|
* Demos:
|
|
@@ -30,10 +32,9 @@ function Scatter(props) {
|
|
|
30
32
|
onItemClick
|
|
31
33
|
} = props;
|
|
32
34
|
const drawingArea = useDrawingArea();
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const skipInteractionHandlers = useVoronoiInteraction || series.disableHover;
|
|
35
|
+
const store = useStore();
|
|
36
|
+
const isVoronoiEnabled = useSelector(store, selectorChartsInteractionIsVoronoiEnabled);
|
|
37
|
+
const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
|
|
37
38
|
const getInteractionItemProps = useInteractionItemProps(skipInteractionHandlers);
|
|
38
39
|
const {
|
|
39
40
|
isFaded,
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import { ScatterPlot } from "./ScatterPlot.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ChartContainer } from "../ChartContainer/index.js";
|
|
9
9
|
import { ChartsAxis } from "../ChartsAxis/index.js";
|
|
10
10
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
11
11
|
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
@@ -41,17 +41,19 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(inProps
|
|
|
41
41
|
overlayProps,
|
|
42
42
|
legendProps,
|
|
43
43
|
axisHighlightProps,
|
|
44
|
-
tooltipProps,
|
|
45
44
|
children
|
|
46
45
|
} = useScatterChartProps(props);
|
|
47
|
-
|
|
46
|
+
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
47
|
+
return /*#__PURE__*/_jsx(ChartContainer, _extends({
|
|
48
48
|
ref: ref
|
|
49
49
|
}, chartContainerProps, {
|
|
50
50
|
children: /*#__PURE__*/_jsxs(ZAxisContextProvider, _extends({}, zAxisProps, {
|
|
51
51
|
children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
52
52
|
"data-drawing-container": true,
|
|
53
53
|
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
|
54
|
-
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(
|
|
54
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
55
|
+
trigger: "item"
|
|
56
|
+
}, props.slotProps?.tooltip)), children]
|
|
55
57
|
}))
|
|
56
58
|
}));
|
|
57
59
|
});
|
|
@@ -62,7 +64,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
62
64
|
// ----------------------------------------------------------------------
|
|
63
65
|
/**
|
|
64
66
|
* The configuration of axes highlight.
|
|
65
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
67
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
66
68
|
* @default { x: 'none', y: 'none' }
|
|
67
69
|
*/
|
|
68
70
|
axisHighlight: PropTypes.shape({
|
|
@@ -109,6 +111,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
109
111
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
110
112
|
*/
|
|
111
113
|
height: PropTypes.number,
|
|
114
|
+
/**
|
|
115
|
+
* If `true`, the legend is not rendered.
|
|
116
|
+
*/
|
|
117
|
+
hideLegend: PropTypes.bool,
|
|
112
118
|
/**
|
|
113
119
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
114
120
|
*/
|
|
@@ -122,32 +128,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
122
128
|
* @default yAxisIds[0] The id of the first provided axis
|
|
123
129
|
*/
|
|
124
130
|
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
125
|
-
/**
|
|
126
|
-
* @deprecated Consider using `slotProps.legend` instead.
|
|
127
|
-
*/
|
|
128
|
-
legend: PropTypes.shape({
|
|
129
|
-
classes: PropTypes.object,
|
|
130
|
-
direction: PropTypes.oneOf(['column', 'row']),
|
|
131
|
-
hidden: PropTypes.bool,
|
|
132
|
-
itemGap: PropTypes.number,
|
|
133
|
-
itemMarkHeight: PropTypes.number,
|
|
134
|
-
itemMarkWidth: PropTypes.number,
|
|
135
|
-
labelStyle: PropTypes.object,
|
|
136
|
-
markGap: PropTypes.number,
|
|
137
|
-
onItemClick: PropTypes.func,
|
|
138
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
139
|
-
bottom: PropTypes.number,
|
|
140
|
-
left: PropTypes.number,
|
|
141
|
-
right: PropTypes.number,
|
|
142
|
-
top: PropTypes.number
|
|
143
|
-
})]),
|
|
144
|
-
position: PropTypes.shape({
|
|
145
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
146
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
147
|
-
}),
|
|
148
|
-
slotProps: PropTypes.object,
|
|
149
|
-
slots: PropTypes.object
|
|
150
|
-
}),
|
|
151
131
|
/**
|
|
152
132
|
* If `true`, a loading overlay is displayed.
|
|
153
133
|
* @default false
|
|
@@ -177,16 +157,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
177
157
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
178
158
|
*/
|
|
179
159
|
onItemClick: PropTypes.func,
|
|
180
|
-
/**
|
|
181
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
182
|
-
* before it renders for the first time.
|
|
183
|
-
*
|
|
184
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
185
|
-
* the first render, like when used inside a grid.
|
|
186
|
-
*
|
|
187
|
-
* @default false
|
|
188
|
-
*/
|
|
189
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
190
160
|
/**
|
|
191
161
|
* Indicate which axis to display the right of the charts.
|
|
192
162
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -215,31 +185,12 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
215
185
|
slots: PropTypes.object,
|
|
216
186
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
217
187
|
title: PropTypes.string,
|
|
218
|
-
/**
|
|
219
|
-
* The configuration of the tooltip.
|
|
220
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
221
|
-
* @default { trigger: 'item' }
|
|
222
|
-
*/
|
|
223
|
-
tooltip: PropTypes.shape({
|
|
224
|
-
axisContent: PropTypes.elementType,
|
|
225
|
-
classes: PropTypes.object,
|
|
226
|
-
itemContent: PropTypes.elementType,
|
|
227
|
-
slotProps: PropTypes.object,
|
|
228
|
-
slots: PropTypes.object,
|
|
229
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
230
|
-
}),
|
|
231
188
|
/**
|
|
232
189
|
* Indicate which axis to display the top of the charts.
|
|
233
190
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
234
191
|
* @default null
|
|
235
192
|
*/
|
|
236
193
|
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
237
|
-
viewBox: PropTypes.shape({
|
|
238
|
-
height: PropTypes.number,
|
|
239
|
-
width: PropTypes.number,
|
|
240
|
-
x: PropTypes.number,
|
|
241
|
-
y: PropTypes.number
|
|
242
|
-
}),
|
|
243
194
|
/**
|
|
244
195
|
* Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
|
|
245
196
|
* If `undefined`, the radius is assumed to be infinite.
|
|
@@ -52,18 +52,15 @@ function ScatterPlot(props) {
|
|
|
52
52
|
children: seriesOrder.map(seriesId => {
|
|
53
53
|
const {
|
|
54
54
|
id,
|
|
55
|
-
xAxisKey,
|
|
56
|
-
yAxisKey,
|
|
57
|
-
zAxisKey,
|
|
58
55
|
xAxisId,
|
|
59
56
|
yAxisId,
|
|
60
57
|
zAxisId,
|
|
61
58
|
markerSize,
|
|
62
59
|
color
|
|
63
60
|
} = series[seriesId];
|
|
64
|
-
const colorGetter = getColor(series[seriesId], xAxis[xAxisId ??
|
|
65
|
-
const xScale = xAxis[xAxisId ??
|
|
66
|
-
const yScale = yAxis[yAxisId ??
|
|
61
|
+
const colorGetter = getColor(series[seriesId], xAxis[xAxisId ?? defaultXAxisId], yAxis[yAxisId ?? defaultYAxisId], zAxis[zAxisId ?? defaultZAxisId]);
|
|
62
|
+
const xScale = xAxis[xAxisId ?? defaultXAxisId].scale;
|
|
63
|
+
const yScale = yAxis[yAxisId ?? defaultYAxisId].scale;
|
|
67
64
|
return /*#__PURE__*/_jsx(ScatterItems, _extends({
|
|
68
65
|
xScale: xScale,
|
|
69
66
|
yScale: yScale,
|
|
@@ -9,14 +9,14 @@ export const getExtremumX = params => {
|
|
|
9
9
|
getFilters
|
|
10
10
|
} = params;
|
|
11
11
|
return Object.keys(series).filter(seriesId => {
|
|
12
|
-
const axisId = series[seriesId].xAxisId
|
|
12
|
+
const axisId = series[seriesId].xAxisId;
|
|
13
13
|
return axisId === axis.id || axisId === undefined && isDefaultAxis;
|
|
14
14
|
}).reduce((acc, seriesId) => {
|
|
15
15
|
const filter = getFilters?.({
|
|
16
16
|
currentAxisId: axis.id,
|
|
17
17
|
isDefaultAxis,
|
|
18
|
-
seriesXAxisId: series[seriesId].xAxisId
|
|
19
|
-
seriesYAxisId: series[seriesId].yAxisId
|
|
18
|
+
seriesXAxisId: series[seriesId].xAxisId,
|
|
19
|
+
seriesYAxisId: series[seriesId].yAxisId
|
|
20
20
|
});
|
|
21
21
|
const seriesMinMax = series[seriesId].data?.reduce((accSeries, d, dataIndex) => {
|
|
22
22
|
if (filter && !filter(d, dataIndex)) {
|
|
@@ -35,14 +35,14 @@ export const getExtremumY = params => {
|
|
|
35
35
|
getFilters
|
|
36
36
|
} = params;
|
|
37
37
|
return Object.keys(series).filter(seriesId => {
|
|
38
|
-
const axisId = series[seriesId].yAxisId
|
|
38
|
+
const axisId = series[seriesId].yAxisId;
|
|
39
39
|
return axisId === axis.id || axisId === undefined && isDefaultAxis;
|
|
40
40
|
}).reduce((acc, seriesId) => {
|
|
41
41
|
const filter = getFilters?.({
|
|
42
42
|
currentAxisId: axis.id,
|
|
43
43
|
isDefaultAxis,
|
|
44
|
-
seriesXAxisId: series[seriesId].xAxisId
|
|
45
|
-
seriesYAxisId: series[seriesId].yAxisId
|
|
44
|
+
seriesXAxisId: series[seriesId].xAxisId,
|
|
45
|
+
seriesYAxisId: series[seriesId].yAxisId
|
|
46
46
|
});
|
|
47
47
|
const seriesMinMax = series[seriesId].data?.reduce((accSeries, d, dataIndex) => {
|
|
48
48
|
if (filter && !filter(d, dataIndex)) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "
|
|
5
|
+
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
6
|
/**
|
|
7
7
|
* A helper function that extracts ScatterChartProps from the input props
|
|
8
8
|
* and returns an object with props for the children components of ScatterChart.
|
|
@@ -16,11 +16,9 @@ export const useScatterChartProps = props => {
|
|
|
16
16
|
yAxis,
|
|
17
17
|
zAxis,
|
|
18
18
|
series,
|
|
19
|
-
tooltip,
|
|
20
19
|
axisHighlight,
|
|
21
20
|
voronoiMaxRadius,
|
|
22
21
|
disableVoronoi,
|
|
23
|
-
legend,
|
|
24
22
|
width,
|
|
25
23
|
height,
|
|
26
24
|
margin,
|
|
@@ -85,20 +83,14 @@ export const useScatterChartProps = props => {
|
|
|
85
83
|
slots,
|
|
86
84
|
slotProps
|
|
87
85
|
};
|
|
88
|
-
const legendProps =
|
|
86
|
+
const legendProps = {
|
|
89
87
|
slots,
|
|
90
88
|
slotProps
|
|
91
|
-
}
|
|
89
|
+
};
|
|
92
90
|
const axisHighlightProps = _extends({
|
|
93
91
|
y: 'none',
|
|
94
92
|
x: 'none'
|
|
95
93
|
}, axisHighlight);
|
|
96
|
-
const tooltipProps = _extends({
|
|
97
|
-
trigger: 'item'
|
|
98
|
-
}, tooltip, {
|
|
99
|
-
slots,
|
|
100
|
-
slotProps
|
|
101
|
-
});
|
|
102
94
|
return {
|
|
103
95
|
chartContainerProps,
|
|
104
96
|
zAxisProps,
|
|
@@ -109,7 +101,6 @@ export const useScatterChartProps = props => {
|
|
|
109
101
|
overlayProps,
|
|
110
102
|
legendProps,
|
|
111
103
|
axisHighlightProps,
|
|
112
|
-
tooltipProps,
|
|
113
104
|
children
|
|
114
105
|
};
|
|
115
106
|
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "colors", "sx", "showTooltip", "
|
|
5
|
+
const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "colors", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { BarPlot } from "../BarChart/index.js";
|
|
9
9
|
import { LinePlot, AreaPlot, LineHighlightPlot } from "../LineChart/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { ChartContainer } from "../ChartContainer/index.js";
|
|
11
11
|
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
12
12
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
13
13
|
import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
|
|
@@ -38,7 +38,6 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
38
38
|
colors,
|
|
39
39
|
sx,
|
|
40
40
|
showTooltip,
|
|
41
|
-
tooltip,
|
|
42
41
|
showHighlight,
|
|
43
42
|
axisHighlight: inAxisHighlight,
|
|
44
43
|
children,
|
|
@@ -58,7 +57,8 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
58
57
|
x: 'none'
|
|
59
58
|
};
|
|
60
59
|
const axisHighlight = _extends({}, defaultXHighlight, inAxisHighlight);
|
|
61
|
-
|
|
60
|
+
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
61
|
+
return /*#__PURE__*/_jsxs(ChartContainer, _extends({}, other, {
|
|
62
62
|
ref: ref,
|
|
63
63
|
series: [_extends({
|
|
64
64
|
type: plotType,
|
|
@@ -86,7 +86,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
86
86
|
}, yAxis)],
|
|
87
87
|
colors: colors,
|
|
88
88
|
sx: sx,
|
|
89
|
-
disableAxisListener: (!showTooltip || tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
89
|
+
disableAxisListener: (!showTooltip || slotProps?.tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
90
90
|
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
91
91
|
skipAnimation: true,
|
|
92
92
|
slots: slots,
|
|
@@ -107,10 +107,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
107
107
|
slots: slots,
|
|
108
108
|
slotProps: slotProps
|
|
109
109
|
})]
|
|
110
|
-
}), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), showTooltip && /*#__PURE__*/_jsx(
|
|
111
|
-
slotProps: slotProps,
|
|
112
|
-
slots: slots
|
|
113
|
-
})), children]
|
|
110
|
+
}), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), showTooltip && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), children]
|
|
114
111
|
}));
|
|
115
112
|
});
|
|
116
113
|
process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
@@ -193,16 +190,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
193
190
|
* @default 'line'
|
|
194
191
|
*/
|
|
195
192
|
plotType: PropTypes.oneOf(['bar', 'line']),
|
|
196
|
-
/**
|
|
197
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
198
|
-
* before it renders for the first time.
|
|
199
|
-
*
|
|
200
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
201
|
-
* the first render, like when used inside a grid.
|
|
202
|
-
*
|
|
203
|
-
* @default false
|
|
204
|
-
*/
|
|
205
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
206
193
|
/**
|
|
207
194
|
* Set to `true` to highlight the value.
|
|
208
195
|
* With line, it shows a point.
|
|
@@ -232,14 +219,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
232
219
|
slots: PropTypes.object,
|
|
233
220
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
234
221
|
title: PropTypes.string,
|
|
235
|
-
tooltip: PropTypes.shape({
|
|
236
|
-
axisContent: PropTypes.elementType,
|
|
237
|
-
classes: PropTypes.object,
|
|
238
|
-
itemContent: PropTypes.elementType,
|
|
239
|
-
slotProps: PropTypes.object,
|
|
240
|
-
slots: PropTypes.object,
|
|
241
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
242
|
-
}),
|
|
243
222
|
/**
|
|
244
223
|
* Formatter used by the tooltip.
|
|
245
224
|
* @param {number} value The value to format.
|
|
@@ -247,12 +226,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
247
226
|
* @default (value: number | null) => (value === null ? '' : value.toString())
|
|
248
227
|
*/
|
|
249
228
|
valueFormatter: PropTypes.func,
|
|
250
|
-
viewBox: PropTypes.shape({
|
|
251
|
-
height: PropTypes.number,
|
|
252
|
-
width: PropTypes.number,
|
|
253
|
-
x: PropTypes.number,
|
|
254
|
-
y: PropTypes.number
|
|
255
|
-
}),
|
|
256
229
|
/**
|
|
257
230
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
258
231
|
*/
|