@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,13 +2,18 @@
|
|
|
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 = ["children", "
|
|
5
|
+
const _excluded = ["children", "disableAxisListener", "className", "title", "desc"];
|
|
6
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import * as React from 'react';
|
|
9
|
+
import useForkRef from '@mui/utils/useForkRef';
|
|
9
10
|
import { useAxisEvents } from "../hooks/useAxisEvents.js";
|
|
11
|
+
import { ChartsAxesGradients } from "../internals/components/ChartsAxesGradients/index.js";
|
|
12
|
+
import { useDrawingArea } from "../hooks/index.js";
|
|
13
|
+
import { useSurfaceRef } from "../context/SvgRefProvider/index.js";
|
|
14
|
+
import { useSize } from "../context/SizeProvider/index.js";
|
|
10
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
const
|
|
16
|
+
const ChartsSurfaceStyles = styled('svg', {
|
|
12
17
|
name: 'MuiChartsSurface',
|
|
13
18
|
slot: 'Root'
|
|
14
19
|
})(() => ({
|
|
@@ -17,40 +22,50 @@ const ChartChartsSurfaceStyles = styled('svg', {
|
|
|
17
22
|
touchAction: 'none'
|
|
18
23
|
}));
|
|
19
24
|
const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inProps, ref) {
|
|
20
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
left,
|
|
29
|
+
right,
|
|
30
|
+
top,
|
|
31
|
+
bottom
|
|
32
|
+
} = useDrawingArea();
|
|
33
|
+
const {
|
|
34
|
+
hasIntrinsicSize
|
|
35
|
+
} = useSize();
|
|
36
|
+
const surfaceRef = useSurfaceRef();
|
|
37
|
+
const handleRef = useForkRef(surfaceRef, ref);
|
|
38
|
+
const themeProps = useThemeProps({
|
|
21
39
|
props: inProps,
|
|
22
40
|
name: 'MuiChartsSurface'
|
|
23
41
|
});
|
|
24
42
|
const {
|
|
25
43
|
children,
|
|
26
|
-
width,
|
|
27
|
-
height,
|
|
28
|
-
viewBox,
|
|
29
44
|
disableAxisListener = false,
|
|
30
45
|
className,
|
|
31
46
|
title,
|
|
32
47
|
desc
|
|
33
|
-
} =
|
|
34
|
-
other = _objectWithoutPropertiesLoose(
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
} = themeProps,
|
|
49
|
+
other = _objectWithoutPropertiesLoose(themeProps, _excluded);
|
|
50
|
+
const svgWidth = width + left + right;
|
|
51
|
+
const svgHeight = height + top + bottom;
|
|
52
|
+
const svgView = {
|
|
53
|
+
width: svgWidth,
|
|
54
|
+
height: svgHeight,
|
|
38
55
|
x: 0,
|
|
39
56
|
y: 0
|
|
40
|
-
}
|
|
57
|
+
};
|
|
41
58
|
useAxisEvents(disableAxisListener);
|
|
42
|
-
return /*#__PURE__*/_jsxs(
|
|
43
|
-
width: width,
|
|
44
|
-
height: height,
|
|
59
|
+
return /*#__PURE__*/_jsxs(ChartsSurfaceStyles, _extends({
|
|
45
60
|
viewBox: `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`,
|
|
46
|
-
ref: ref,
|
|
47
61
|
className: className
|
|
48
62
|
}, other, {
|
|
49
|
-
|
|
63
|
+
ref: handleRef,
|
|
64
|
+
children: [title && /*#__PURE__*/_jsx("title", {
|
|
50
65
|
children: title
|
|
51
|
-
}), /*#__PURE__*/_jsx("desc", {
|
|
66
|
+
}), desc && /*#__PURE__*/_jsx("desc", {
|
|
52
67
|
children: desc
|
|
53
|
-
}), children]
|
|
68
|
+
}), /*#__PURE__*/_jsx(ChartsAxesGradients, {}), hasIntrinsicSize && children]
|
|
54
69
|
}));
|
|
55
70
|
});
|
|
56
71
|
process.env.NODE_ENV !== "production" ? ChartsSurface.propTypes = {
|
|
@@ -67,21 +82,7 @@ process.env.NODE_ENV !== "production" ? ChartsSurface.propTypes = {
|
|
|
67
82
|
* @default false
|
|
68
83
|
*/
|
|
69
84
|
disableAxisListener: PropTypes.bool,
|
|
70
|
-
/**
|
|
71
|
-
* The height of the chart in px.
|
|
72
|
-
*/
|
|
73
|
-
height: PropTypes.number.isRequired,
|
|
74
85
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
75
|
-
title: PropTypes.string
|
|
76
|
-
viewBox: PropTypes.shape({
|
|
77
|
-
height: PropTypes.number,
|
|
78
|
-
width: PropTypes.number,
|
|
79
|
-
x: PropTypes.number,
|
|
80
|
-
y: PropTypes.number
|
|
81
|
-
}),
|
|
82
|
-
/**
|
|
83
|
-
* The width of the chart in px.
|
|
84
|
-
*/
|
|
85
|
-
width: PropTypes.number.isRequired
|
|
86
|
+
title: PropTypes.string
|
|
86
87
|
} : void 0;
|
|
87
88
|
export { ChartsSurface };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,80 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
/**
|
|
12
|
-
* @ignore - internal component.
|
|
13
|
-
*/
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { useUtilityClasses } from "./chartsTooltipClasses.js";
|
|
8
|
+
import { ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow, ChartsTooltipTable } from "./ChartsTooltipTable.js";
|
|
9
|
+
import { useAxisTooltip } from "./useAxisTooltip.js";
|
|
10
|
+
import { useXAxis, useYAxis } from "../hooks/index.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
12
|
function ChartsAxisTooltipContent(props) {
|
|
15
13
|
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
axisData,
|
|
19
|
-
sx,
|
|
20
|
-
classes
|
|
14
|
+
classes: propClasses,
|
|
15
|
+
sx
|
|
21
16
|
} = props;
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
17
|
+
const tootlipData = useAxisTooltip();
|
|
18
|
+
const xAxis = useXAxis();
|
|
19
|
+
const yAxis = useYAxis();
|
|
20
|
+
const classes = useUtilityClasses(propClasses);
|
|
21
|
+
if (tootlipData === null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
25
24
|
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} =
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
25
|
+
axisDirection,
|
|
26
|
+
axisValue,
|
|
27
|
+
axisFormattedValue,
|
|
28
|
+
seriesItems
|
|
29
|
+
} = tootlipData;
|
|
30
|
+
const axis = axisDirection === 'x' ? xAxis : yAxis;
|
|
31
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
32
|
+
sx: sx,
|
|
33
|
+
className: classes.paper,
|
|
34
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
35
|
+
className: classes.table,
|
|
36
|
+
children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
|
|
37
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipRow, {
|
|
38
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
39
|
+
colSpan: 3,
|
|
40
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
41
|
+
children: axisFormattedValue
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}), /*#__PURE__*/_jsx("tbody", {
|
|
46
|
+
children: seriesItems.map(({
|
|
47
|
+
seriesId,
|
|
48
|
+
color,
|
|
49
|
+
formattedValue,
|
|
50
|
+
formattedLabel
|
|
51
|
+
}) => {
|
|
52
|
+
if (formattedValue == null) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
56
|
+
className: classes.row,
|
|
57
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
58
|
+
className: clsx(classes.markCell, classes.cell),
|
|
59
|
+
children: color && /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
60
|
+
color: color,
|
|
61
|
+
className: classes.mark
|
|
62
|
+
})
|
|
63
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
64
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
65
|
+
children: formattedLabel ? /*#__PURE__*/_jsx(Typography, {
|
|
66
|
+
children: formattedLabel
|
|
67
|
+
}) : null
|
|
68
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
69
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
70
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
71
|
+
children: formattedValue
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
}, seriesId);
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
77
|
+
})
|
|
77
78
|
});
|
|
78
|
-
return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
|
|
79
79
|
}
|
|
80
|
+
process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
|
|
81
|
+
// ----------------------------- Warning --------------------------------
|
|
82
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
83
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
84
|
+
// ----------------------------------------------------------------------
|
|
85
|
+
/**
|
|
86
|
+
* Override or extend the styles applied to the component.
|
|
87
|
+
*/
|
|
88
|
+
classes: PropTypes.object,
|
|
89
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
90
|
+
} : void 0;
|
|
80
91
|
export { ChartsAxisTooltipContent };
|
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
/**
|
|
11
|
-
* @ignore - internal component.
|
|
12
|
-
*/
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useUtilityClasses } from "./chartsTooltipClasses.js";
|
|
7
|
+
import { useItemTooltip } from "./useItemTooltip.js";
|
|
8
|
+
import { ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow, ChartsTooltipTable } from "./ChartsTooltipTable.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
10
|
function ChartsItemTooltipContent(props) {
|
|
14
11
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
sx,
|
|
18
|
-
classes,
|
|
19
|
-
contentProps
|
|
12
|
+
classes: propClasses,
|
|
13
|
+
sx
|
|
20
14
|
} = props;
|
|
21
|
-
const
|
|
15
|
+
const tooltipData = useItemTooltip();
|
|
16
|
+
const classes = useUtilityClasses(propClasses);
|
|
17
|
+
if (!tooltipData) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
22
20
|
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
21
|
+
color,
|
|
22
|
+
label,
|
|
23
|
+
formattedValue
|
|
24
|
+
} = tooltipData;
|
|
25
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
26
|
+
sx: sx,
|
|
27
|
+
className: classes.paper,
|
|
28
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
|
|
29
|
+
className: classes.table,
|
|
30
|
+
children: /*#__PURE__*/_jsx("tbody", {
|
|
31
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
32
|
+
className: classes.row,
|
|
33
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
34
|
+
className: clsx(classes.markCell, classes.cell),
|
|
35
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
36
|
+
color: color,
|
|
37
|
+
className: classes.mark
|
|
38
|
+
})
|
|
39
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
40
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
41
|
+
children: label
|
|
42
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
43
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
44
|
+
children: formattedValue
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
49
|
});
|
|
50
|
-
return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
|
|
51
50
|
}
|
|
51
|
+
process.env.NODE_ENV !== "production" ? ChartsItemTooltipContent.propTypes = {
|
|
52
|
+
// ----------------------------- Warning --------------------------------
|
|
53
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
55
|
+
// ----------------------------------------------------------------------
|
|
56
|
+
/**
|
|
57
|
+
* Override or extend the styles applied to the component.
|
|
58
|
+
*/
|
|
59
|
+
classes: PropTypes.object,
|
|
60
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
61
|
+
} : void 0;
|
|
52
62
|
export { ChartsItemTooltipContent };
|