@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
|
@@ -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)) {
|
|
@@ -3,9 +3,8 @@ import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
|
3
3
|
import { ChartsGridProps } from '../ChartsGrid';
|
|
4
4
|
import { ChartsLegendProps } from '../ChartsLegend';
|
|
5
5
|
import { ChartsOverlayProps } from '../ChartsOverlay';
|
|
6
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
7
6
|
import type { ChartsVoronoiHandlerProps } from '../ChartsVoronoiHandler';
|
|
8
|
-
import {
|
|
7
|
+
import { ChartContainerProps } from '../ChartContainer';
|
|
9
8
|
import { ZAxisContextProviderProps } from '../context';
|
|
10
9
|
import type { ScatterChartProps } from './ScatterChart';
|
|
11
10
|
import type { ScatterPlotProps } from './ScatterPlot';
|
|
@@ -17,7 +16,7 @@ import type { ScatterPlotProps } from './ScatterPlot';
|
|
|
17
16
|
* @returns An object with props for the children components of ScatterChart
|
|
18
17
|
*/
|
|
19
18
|
export declare const useScatterChartProps: (props: ScatterChartProps) => {
|
|
20
|
-
chartContainerProps:
|
|
19
|
+
chartContainerProps: ChartContainerProps;
|
|
21
20
|
zAxisProps: Omit<ZAxisContextProviderProps, "children">;
|
|
22
21
|
voronoiHandlerProps: ChartsVoronoiHandlerProps;
|
|
23
22
|
chartsAxisProps: ChartsAxisProps;
|
|
@@ -26,6 +25,5 @@ export declare const useScatterChartProps: (props: ScatterChartProps) => {
|
|
|
26
25
|
overlayProps: ChartsOverlayProps;
|
|
27
26
|
legendProps: ChartsLegendProps;
|
|
28
27
|
axisHighlightProps: ChartsAxisHighlightProps;
|
|
29
|
-
tooltipProps: ChartsTooltipProps<"scatter">;
|
|
30
28
|
children: import("react").ReactNode;
|
|
31
29
|
};
|
|
@@ -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
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
import { ChartContainerProps } from '../ChartContainer';
|
|
4
|
+
import { ChartsTooltipSlots, ChartsTooltipSlotProps } from '../ChartsTooltip/ChartTooltip.types';
|
|
4
5
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
5
6
|
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
|
|
6
|
-
import { MakeOptional } from '../models/helpers';
|
|
7
7
|
import { LineSeriesType } from '../models/seriesType';
|
|
8
8
|
import { CardinalDirections } from '../models/layout';
|
|
9
9
|
import { AreaPlotSlots, AreaPlotSlotProps } from '../LineChart/AreaPlot';
|
|
@@ -11,11 +11,11 @@ import { LinePlotSlots, LinePlotSlotProps } from '../LineChart/LinePlot';
|
|
|
11
11
|
import { MarkPlotSlots, MarkPlotSlotProps } from '../LineChart/MarkPlot';
|
|
12
12
|
import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from '../LineChart/LineHighlightPlot';
|
|
13
13
|
import { BarPlotSlots, BarPlotSlotProps } from '../BarChart/BarPlot';
|
|
14
|
-
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots
|
|
14
|
+
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots {
|
|
15
15
|
}
|
|
16
|
-
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps
|
|
16
|
+
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {
|
|
17
17
|
}
|
|
18
|
-
export interface SparkLineChartProps extends Omit<
|
|
18
|
+
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'margin' | 'plugins'> {
|
|
19
19
|
/**
|
|
20
20
|
* The xAxis configuration.
|
|
21
21
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
|
@@ -26,7 +26,6 @@ export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps,
|
|
|
26
26
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
|
27
27
|
*/
|
|
28
28
|
yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, 'id'>;
|
|
29
|
-
tooltip?: ChartsTooltipProps<'line' | 'bar'>;
|
|
30
29
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
31
30
|
/**
|
|
32
31
|
* Type of plot used.
|
|
@@ -98,5 +97,5 @@ export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps,
|
|
|
98
97
|
*
|
|
99
98
|
* - [SparkLineChart API](https://mui.com/x/api/charts/spark-line-chart/)
|
|
100
99
|
*/
|
|
101
|
-
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps & React.RefAttributes<
|
|
100
|
+
declare const SparkLineChart: React.ForwardRefExoticComponent<SparkLineChartProps & React.RefAttributes<SVGSVGElement>>;
|
|
102
101
|
export { SparkLineChart };
|
|
@@ -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
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MakeOptional } from '
|
|
1
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
2
|
import { AxisConfig, ScaleName } from '../../models';
|
|
3
3
|
import { ChartsAxisProps } from '../../models/axis';
|
|
4
4
|
export declare const defaultizeAxis: (inAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, axisName: "x" | "y") => {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
import { DrawingAreaProviderProps } from '../DrawingAreaProvider';
|
|
4
|
+
import { SeriesProviderProps } from '../SeriesProvider';
|
|
5
|
+
import { CartesianProviderProps } from '../CartesianProvider';
|
|
6
|
+
import { PluginProviderProps } from '../PluginProvider';
|
|
7
|
+
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../../models/axis';
|
|
8
|
+
import { AnimationProviderProps } from '../AnimationProvider';
|
|
9
|
+
import { ZAxisContextProviderProps } from '../ZAxisContextProvider';
|
|
10
|
+
import { HighlightedProviderProps } from '../HighlightedProvider';
|
|
11
|
+
import { SizeProviderProps } from '../SizeProvider';
|
|
12
|
+
export type ChartDataProviderProps = Omit<SizeProviderProps & Omit<SeriesProviderProps, 'seriesFormatters'> & Pick<DrawingAreaProviderProps, 'margin'> & Pick<CartesianProviderProps, 'dataset'> & ZAxisContextProviderProps & HighlightedProviderProps & PluginProviderProps & AnimationProviderProps, 'children'> & {
|
|
13
|
+
/**
|
|
14
|
+
* The configuration of the x-axes.
|
|
15
|
+
* If not provided, a default axis config is used.
|
|
16
|
+
* An array of [[AxisConfig]] objects.
|
|
17
|
+
*/
|
|
18
|
+
xAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsXAxisProps>, 'id'>[];
|
|
19
|
+
/**
|
|
20
|
+
* The configuration of the y-axes.
|
|
21
|
+
* If not provided, a default axis config is used.
|
|
22
|
+
* An array of [[AxisConfig]] objects.
|
|
23
|
+
*/
|
|
24
|
+
yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, 'id'>[];
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
declare function ChartDataProvider(props: ChartDataProviderProps): React.JSX.Element;
|
|
28
|
+
declare namespace ChartDataProvider {
|
|
29
|
+
var propTypes: any;
|
|
30
|
+
}
|
|
31
|
+
export { ChartDataProvider };
|
|
@@ -3,27 +3,58 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { DrawingAreaProvider } from "../DrawingAreaProvider/index.js";
|
|
7
|
+
import { SeriesProvider } from "../SeriesProvider/index.js";
|
|
8
|
+
import { InteractionProvider } from "../InteractionProvider.js";
|
|
9
|
+
import { CartesianProvider } from "../CartesianProvider/index.js";
|
|
10
|
+
import { PluginProvider } from "../PluginProvider/index.js";
|
|
11
|
+
import { useChartDataProviderProps } from "./useChartDataProviderProps.js";
|
|
12
|
+
import { AnimationProvider } from "../AnimationProvider/index.js";
|
|
13
|
+
import { ZAxisContextProvider } from "../ZAxisContextProvider.js";
|
|
14
|
+
import { HighlightedProvider } from "../HighlightedProvider/index.js";
|
|
15
|
+
import { SizeProvider } from "../SizeProvider/index.js";
|
|
16
|
+
import { SvgRefProvider } from "../SvgRefProvider/index.js";
|
|
9
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
18
|
+
function ChartDataProvider(props) {
|
|
11
19
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
children,
|
|
21
|
+
drawingAreaProviderProps,
|
|
22
|
+
seriesProviderProps,
|
|
23
|
+
cartesianProviderProps,
|
|
24
|
+
zAxisContextProps,
|
|
25
|
+
highlightedProviderProps,
|
|
26
|
+
pluginProviderProps,
|
|
27
|
+
animationProviderProps,
|
|
28
|
+
sizeProviderProps
|
|
29
|
+
} = useChartDataProviderProps(props);
|
|
30
|
+
return /*#__PURE__*/_jsx(SizeProvider, _extends({}, sizeProviderProps, {
|
|
31
|
+
children: /*#__PURE__*/_jsx(DrawingAreaProvider, _extends({}, drawingAreaProviderProps, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(CartesianProvider, _extends({}, cartesianProviderProps, {
|
|
35
|
+
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
36
|
+
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
37
|
+
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
38
|
+
children: /*#__PURE__*/_jsx(AnimationProvider, _extends({}, animationProviderProps, {
|
|
39
|
+
children: /*#__PURE__*/_jsx(SvgRefProvider, {
|
|
40
|
+
children: children
|
|
41
|
+
})
|
|
42
|
+
}))
|
|
43
|
+
}))
|
|
44
|
+
})
|
|
45
|
+
}))
|
|
46
|
+
}))
|
|
47
|
+
}))
|
|
48
|
+
}))
|
|
49
|
+
}))
|
|
18
50
|
}));
|
|
19
|
-
}
|
|
20
|
-
process.env.NODE_ENV !== "production" ?
|
|
51
|
+
}
|
|
52
|
+
process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
21
53
|
// ----------------------------- Warning --------------------------------
|
|
22
54
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
23
55
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
24
56
|
// ----------------------------------------------------------------------
|
|
25
57
|
children: PropTypes.node,
|
|
26
|
-
className: PropTypes.string,
|
|
27
58
|
/**
|
|
28
59
|
* Color palette used to colorize multiple series.
|
|
29
60
|
* @default blueberryTwilightPalette
|
|
@@ -33,13 +64,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
33
64
|
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
34
65
|
*/
|
|
35
66
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
36
|
-
desc: PropTypes.string,
|
|
37
|
-
/**
|
|
38
|
-
* If `true`, the charts will not listen to the mouse move event.
|
|
39
|
-
* It might break interactive features, but will improve performance.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
disableAxisListener: PropTypes.bool,
|
|
43
67
|
/**
|
|
44
68
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
45
69
|
*/
|
|
@@ -74,16 +98,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
74
98
|
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
75
99
|
*/
|
|
76
100
|
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
77
|
-
/**
|
|
78
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
79
|
-
* before it renders for the first time.
|
|
80
|
-
*
|
|
81
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
82
|
-
* the first render, like when used inside a grid.
|
|
83
|
-
*
|
|
84
|
-
* @default false
|
|
85
|
-
*/
|
|
86
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
87
101
|
/**
|
|
88
102
|
* The array of series to display.
|
|
89
103
|
* Each type of series has its own specificity.
|
|
@@ -95,14 +109,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
95
109
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
96
110
|
*/
|
|
97
111
|
skipAnimation: PropTypes.bool,
|
|
98
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
99
|
-
title: PropTypes.string,
|
|
100
|
-
viewBox: PropTypes.shape({
|
|
101
|
-
height: PropTypes.number,
|
|
102
|
-
width: PropTypes.number,
|
|
103
|
-
x: PropTypes.number,
|
|
104
|
-
y: PropTypes.number
|
|
105
|
-
}),
|
|
106
112
|
/**
|
|
107
113
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
108
114
|
*/
|
|
@@ -241,4 +247,4 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
241
247
|
min: PropTypes.number
|
|
242
248
|
}))
|
|
243
249
|
} : void 0;
|
|
244
|
-
export {
|
|
250
|
+
export { ChartDataProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChartDataProvider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ChartDataProvider.js";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { DrawingAreaProviderProps } from '../DrawingAreaProvider';
|
|
2
|
+
import type { CartesianProviderProps } from '../CartesianProvider';
|
|
3
|
+
import type { SeriesProviderProps } from '../SeriesProvider';
|
|
4
|
+
import type { ZAxisContextProviderProps } from '../ZAxisContextProvider';
|
|
5
|
+
import type { ChartDataProviderProps } from './ChartDataProvider';
|
|
6
|
+
import { HighlightedProviderProps } from '../HighlightedProvider';
|
|
7
|
+
import { PluginProviderProps } from '../PluginProvider';
|
|
8
|
+
import { AnimationProviderProps } from '../AnimationProvider';
|
|
9
|
+
import { SizeProviderProps } from '../SizeProvider';
|
|
10
|
+
export declare const useChartDataProviderProps: (props: ChartDataProviderProps) => {
|
|
11
|
+
children: import("react").ReactNode;
|
|
12
|
+
drawingAreaProviderProps: Omit<DrawingAreaProviderProps, "children">;
|
|
13
|
+
seriesProviderProps: Omit<SeriesProviderProps, "children">;
|
|
14
|
+
cartesianProviderProps: Omit<CartesianProviderProps, "children">;
|
|
15
|
+
zAxisContextProps: Omit<ZAxisContextProviderProps, "children">;
|
|
16
|
+
highlightedProviderProps: Omit<HighlightedProviderProps, "children">;
|
|
17
|
+
pluginProviderProps: Omit<PluginProviderProps, "children">;
|
|
18
|
+
animationProviderProps: Omit<AnimationProviderProps, "children">;
|
|
19
|
+
xAxis: {
|
|
20
|
+
reverse?: boolean | undefined;
|
|
21
|
+
fill?: string | undefined;
|
|
22
|
+
stroke?: string | undefined;
|
|
23
|
+
data?: any[] | undefined;
|
|
24
|
+
label?: string | undefined;
|
|
25
|
+
max?: (number | Date) | undefined;
|
|
26
|
+
min?: (number | Date) | undefined;
|
|
27
|
+
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
28
|
+
dataKey?: string | undefined;
|
|
29
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
30
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
31
|
+
tickMaxStep?: number | undefined;
|
|
32
|
+
tickMinStep?: number | undefined;
|
|
33
|
+
tickNumber?: number | undefined;
|
|
34
|
+
disableLine?: boolean | undefined;
|
|
35
|
+
disableTicks?: boolean | undefined;
|
|
36
|
+
tickFontSize?: number | undefined;
|
|
37
|
+
tickLabelStyle?: import("../..").ChartsTextProps["style"];
|
|
38
|
+
labelStyle?: import("../..").ChartsTextProps["style"];
|
|
39
|
+
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
40
|
+
labelFontSize?: number | undefined;
|
|
41
|
+
tickSize?: number | undefined;
|
|
42
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
43
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
44
|
+
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
45
|
+
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
46
|
+
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
47
|
+
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
48
|
+
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
49
|
+
hideTooltip?: boolean | undefined;
|
|
50
|
+
domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
|
|
51
|
+
min: number;
|
|
52
|
+
max: number;
|
|
53
|
+
})) | undefined;
|
|
54
|
+
id: import("../../internals").AxisId;
|
|
55
|
+
}[];
|
|
56
|
+
yAxis: {
|
|
57
|
+
reverse?: boolean | undefined;
|
|
58
|
+
fill?: string | undefined;
|
|
59
|
+
stroke?: string | undefined;
|
|
60
|
+
data?: any[] | undefined;
|
|
61
|
+
label?: string | undefined;
|
|
62
|
+
max?: (number | Date) | undefined;
|
|
63
|
+
min?: (number | Date) | undefined;
|
|
64
|
+
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
65
|
+
dataKey?: string | undefined;
|
|
66
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
67
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
68
|
+
tickMaxStep?: number | undefined;
|
|
69
|
+
tickMinStep?: number | undefined;
|
|
70
|
+
tickNumber?: number | undefined;
|
|
71
|
+
disableLine?: boolean | undefined;
|
|
72
|
+
disableTicks?: boolean | undefined;
|
|
73
|
+
tickFontSize?: number | undefined;
|
|
74
|
+
tickLabelStyle?: import("../..").ChartsTextProps["style"];
|
|
75
|
+
labelStyle?: import("../..").ChartsTextProps["style"];
|
|
76
|
+
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
77
|
+
labelFontSize?: number | undefined;
|
|
78
|
+
tickSize?: number | undefined;
|
|
79
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
80
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
81
|
+
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
82
|
+
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
83
|
+
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
84
|
+
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
85
|
+
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
86
|
+
hideTooltip?: boolean | undefined;
|
|
87
|
+
domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
|
|
88
|
+
min: number;
|
|
89
|
+
max: number;
|
|
90
|
+
})) | undefined;
|
|
91
|
+
id: import("../../internals").AxisId;
|
|
92
|
+
}[];
|
|
93
|
+
sizeProviderProps: Omit<SizeProviderProps, "children">;
|
|
94
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useDefaultizeAxis } from "./useDefaultizeAxis.js";
|
|
4
|
+
export const useChartDataProviderProps = props => {
|
|
5
|
+
const {
|
|
6
|
+
width,
|
|
7
|
+
height,
|
|
8
|
+
series,
|
|
9
|
+
margin,
|
|
10
|
+
xAxis,
|
|
11
|
+
yAxis,
|
|
12
|
+
zAxis,
|
|
13
|
+
colors,
|
|
14
|
+
dataset,
|
|
15
|
+
highlightedItem,
|
|
16
|
+
onHighlightChange,
|
|
17
|
+
plugins,
|
|
18
|
+
children,
|
|
19
|
+
skipAnimation
|
|
20
|
+
} = props;
|
|
21
|
+
const [defaultizedXAxis, defaultizedYAxis] = useDefaultizeAxis(xAxis, yAxis, dataset);
|
|
22
|
+
const drawingAreaProviderProps = {
|
|
23
|
+
margin
|
|
24
|
+
};
|
|
25
|
+
const animationProviderProps = {
|
|
26
|
+
skipAnimation
|
|
27
|
+
};
|
|
28
|
+
const pluginProviderProps = {
|
|
29
|
+
plugins
|
|
30
|
+
};
|
|
31
|
+
const seriesProviderProps = {
|
|
32
|
+
series,
|
|
33
|
+
colors,
|
|
34
|
+
dataset
|
|
35
|
+
};
|
|
36
|
+
const cartesianProviderProps = {
|
|
37
|
+
xAxis: defaultizedXAxis,
|
|
38
|
+
yAxis: defaultizedYAxis,
|
|
39
|
+
dataset
|
|
40
|
+
};
|
|
41
|
+
const zAxisContextProps = {
|
|
42
|
+
zAxis,
|
|
43
|
+
dataset
|
|
44
|
+
};
|
|
45
|
+
const highlightedProviderProps = {
|
|
46
|
+
highlightedItem,
|
|
47
|
+
onHighlightChange
|
|
48
|
+
};
|
|
49
|
+
const sizeProviderProps = {
|
|
50
|
+
width,
|
|
51
|
+
height
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
children,
|
|
55
|
+
drawingAreaProviderProps,
|
|
56
|
+
seriesProviderProps,
|
|
57
|
+
cartesianProviderProps,
|
|
58
|
+
zAxisContextProps,
|
|
59
|
+
highlightedProviderProps,
|
|
60
|
+
pluginProviderProps,
|
|
61
|
+
animationProviderProps,
|
|
62
|
+
xAxis: defaultizedXAxis,
|
|
63
|
+
yAxis: defaultizedYAxis,
|
|
64
|
+
sizeProviderProps
|
|
65
|
+
};
|
|
66
|
+
};
|