@mui/x-charts 7.15.0 → 7.16.0
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/BarChart.js +23 -12
- package/BarChart/BarClipPath.js +1 -1
- package/BarChart/BarElement.js +2 -2
- package/BarChart/BarLabel/BarLabel.js +1 -1
- package/BarChart/BarLabel/BarLabelItem.js +4 -4
- package/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/BarChart/BarLabel/index.js +2 -2
- package/BarChart/BarPlot.js +8 -8
- package/BarChart/checkScaleErrors.js +2 -2
- package/BarChart/formatter.js +2 -2
- package/BarChart/index.js +4 -4
- package/BarChart/legend.js +1 -1
- package/BarChart/plugin.js +3 -3
- package/BarChart/useBarChartProps.js +1 -1
- package/CHANGELOG.md +98 -1
- package/ChartContainer/ChartContainer.js +9 -9
- package/ChartContainer/index.js +1 -1
- package/ChartContainer/useChartContainerProps.js +2 -2
- package/ChartContainer/useDefaultizeAxis.js +1 -1
- package/ChartsAxis/ChartsAxis.js +3 -3
- package/ChartsAxis/index.js +2 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +4 -4
- package/ChartsAxisHighlight/index.js +1 -1
- package/ChartsClipPath/ChartsClipPath.js +1 -1
- package/ChartsClipPath/index.js +1 -1
- package/ChartsGrid/ChartsGrid.js +18 -66
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +14 -0
- package/ChartsGrid/ChartsHorizontalGrid.js +36 -0
- package/ChartsGrid/ChartsVerticalGrid.d.ts +14 -0
- package/ChartsGrid/ChartsVerticalGrid.js +36 -0
- package/ChartsGrid/index.js +2 -2
- package/ChartsGrid/styledCommonents.d.ts +2 -0
- package/ChartsGrid/styledCommonents.js +22 -0
- package/ChartsLegend/ChartsLegend.d.ts +4 -13
- package/ChartsLegend/ChartsLegend.js +59 -25
- package/ChartsLegend/ContinuousColorLegend.js +7 -7
- package/ChartsLegend/DefaultChartsLegend.d.ts +6 -1
- package/ChartsLegend/DefaultChartsLegend.js +7 -3
- package/ChartsLegend/LegendPerItem.d.ts +9 -6
- package/ChartsLegend/LegendPerItem.js +4 -8
- package/ChartsLegend/PiecewiseColorLegend.js +3 -8
- package/ChartsLegend/index.js +6 -6
- package/ChartsLegend/useAxis.js +2 -2
- package/ChartsLegend/utils.js +4 -4
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +4 -4
- package/ChartsOnAxisClickHandler/index.js +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
- package/ChartsOverlay/ChartsOverlay.js +3 -3
- package/ChartsOverlay/index.js +3 -3
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.js +5 -5
- package/ChartsReferenceLine/ChartsYReferenceLine.js +5 -5
- package/ChartsReferenceLine/common.js +1 -1
- package/ChartsReferenceLine/index.js +2 -2
- package/ChartsSurface/ChartsSurface.js +1 -1
- package/ChartsSurface/index.js +1 -1
- package/ChartsText/ChartsText.js +1 -1
- package/ChartsText/index.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +6 -6
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +5 -5
- package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
- package/ChartsTooltip/ChartsTooltip.js +13 -11
- package/ChartsTooltip/ChartsTooltipTable.js +10 -5
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +5 -5
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +3 -3
- package/ChartsTooltip/chartsTooltipClasses.d.ts +2 -0
- package/ChartsTooltip/chartsTooltipClasses.js +1 -1
- package/ChartsTooltip/index.js +7 -7
- package/ChartsTooltip/utils.js +1 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +7 -7
- package/ChartsVoronoiHandler/index.js +1 -1
- package/ChartsXAxis/ChartsXAxis.js +18 -13
- package/ChartsXAxis/index.js +1 -1
- package/ChartsYAxis/ChartsYAxis.js +15 -10
- package/ChartsYAxis/index.js +1 -1
- package/Gauge/Gauge.js +5 -5
- package/Gauge/GaugeContainer.js +4 -4
- package/Gauge/GaugeProvider.js +3 -3
- package/Gauge/GaugeReferenceArc.js +1 -1
- package/Gauge/GaugeValueArc.js +1 -1
- package/Gauge/GaugeValueText.js +2 -2
- package/Gauge/index.js +7 -7
- package/LineChart/AnimatedArea.js +31 -14
- package/LineChart/AnimatedLine.js +32 -15
- package/LineChart/AreaElement.js +3 -3
- package/LineChart/AreaPlot.js +83 -78
- package/LineChart/LineChart.js +26 -15
- package/LineChart/LineElement.js +3 -3
- package/LineChart/LineHighlightPlot.js +8 -8
- package/LineChart/LinePlot.js +65 -60
- package/LineChart/MarkElement.js +4 -4
- package/LineChart/MarkPlot.js +9 -9
- package/LineChart/formatter.js +2 -2
- package/LineChart/index.js +11 -11
- package/LineChart/legend.js +1 -1
- package/LineChart/plugin.js +3 -3
- package/LineChart/useLineChartProps.js +1 -1
- package/PieChart/PieArc.js +1 -1
- package/PieChart/PieArcLabelPlot.js +4 -4
- package/PieChart/PieArcPlot.js +4 -4
- package/PieChart/PieChart.js +19 -8
- package/PieChart/PiePlot.js +6 -6
- package/PieChart/dataTransform/useTransformData.js +1 -1
- package/PieChart/formatter.js +1 -1
- package/PieChart/getPieCoordinates.js +1 -1
- package/PieChart/index.js +7 -7
- package/PieChart/legend.js +1 -1
- package/PieChart/plugin.js +2 -2
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -3
- package/ResponsiveChartContainer/index.js +1 -1
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +1 -1
- package/ScatterChart/Scatter.js +5 -5
- package/ScatterChart/ScatterChart.js +23 -12
- package/ScatterChart/ScatterPlot.js +5 -5
- package/ScatterChart/formatter.js +1 -1
- package/ScatterChart/index.js +3 -3
- package/ScatterChart/legend.js +1 -1
- package/ScatterChart/plugin.js +3 -3
- package/SparkLineChart/SparkLineChart.js +6 -6
- package/SparkLineChart/index.js +1 -1
- package/colorPalettes/index.js +1 -1
- package/context/CartesianProvider/CartesianProvider.js +6 -6
- package/context/CartesianProvider/computeValue.js +6 -6
- package/context/CartesianProvider/defaultizeAxis.js +1 -1
- package/context/CartesianProvider/index.js +5 -5
- package/context/CartesianProvider/useCartesianContext.js +1 -1
- package/context/DrawingProvider.js +1 -1
- package/context/HighlightedProvider/HighlightedProvider.js +4 -4
- package/context/HighlightedProvider/index.js +4 -4
- package/context/HighlightedProvider/useHighlighted.js +1 -1
- package/context/HighlightedProvider/useItemHighlighted.js +1 -1
- package/context/PluginProvider/PluginProvider.js +2 -2
- package/context/PluginProvider/index.js +10 -10
- package/context/PluginProvider/mergePlugins.js +4 -4
- package/context/PluginProvider/useColorProcessor.js +1 -1
- package/context/PluginProvider/useSeriesFormatter.js +1 -1
- package/context/PluginProvider/useXExtremumGetter.js +1 -1
- package/context/PluginProvider/useYExtremumGetter.js +1 -1
- package/context/SeriesProvider/SeriesProvider.js +4 -4
- package/context/SeriesProvider/index.js +4 -4
- package/context/SeriesProvider/processSeries.js +1 -1
- package/context/ZAxisContextProvider.js +1 -1
- package/context/index.js +2 -2
- package/hooks/index.js +7 -7
- package/hooks/useAxis.js +1 -1
- package/hooks/useAxisEvents.js +6 -6
- package/hooks/useChartDimensions.js +1 -1
- package/hooks/useChartId.js +1 -1
- package/hooks/useColorScale.js +2 -2
- package/hooks/useDrawingArea.js +1 -1
- package/hooks/useInteractionItemProps.js +2 -2
- package/hooks/useReducedMotion.js +13 -12
- package/hooks/useScale.js +2 -2
- package/hooks/useSeries.js +1 -1
- package/hooks/useSvgRef.js +1 -1
- package/hooks/useTicks.js +2 -2
- package/index.js +27 -27
- package/internals/components/AxisSharedComponents.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
- package/internals/components/ChartsAxesGradients/index.js +1 -1
- package/internals/getWordsByLines.js +1 -1
- package/internals/index.js +31 -31
- package/internals/isCartesian.js +1 -1
- package/internals/useStringInterpolator.d.ts +1 -0
- package/internals/{useAnimatedPath.js → useStringInterpolator.js} +2 -15
- package/models/index.d.ts +1 -0
- package/models/index.js +5 -3
- package/models/seriesType/index.js +4 -4
- package/modern/BarChart/BarChart.js +23 -12
- package/modern/BarChart/BarClipPath.js +1 -1
- package/modern/BarChart/BarElement.js +2 -2
- package/modern/BarChart/BarLabel/BarLabel.js +1 -1
- package/modern/BarChart/BarLabel/BarLabelItem.js +4 -4
- package/modern/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/modern/BarChart/BarLabel/index.js +2 -2
- package/modern/BarChart/BarPlot.js +8 -8
- package/modern/BarChart/checkScaleErrors.js +2 -2
- package/modern/BarChart/formatter.js +2 -2
- package/modern/BarChart/index.js +4 -4
- package/modern/BarChart/legend.js +1 -1
- package/modern/BarChart/plugin.js +3 -3
- package/modern/BarChart/useBarChartProps.js +1 -1
- package/modern/ChartContainer/ChartContainer.js +9 -9
- package/modern/ChartContainer/index.js +1 -1
- package/modern/ChartContainer/useChartContainerProps.js +2 -2
- package/modern/ChartContainer/useDefaultizeAxis.js +1 -1
- package/modern/ChartsAxis/ChartsAxis.js +3 -3
- package/modern/ChartsAxis/index.js +2 -2
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +4 -4
- package/modern/ChartsAxisHighlight/index.js +1 -1
- package/modern/ChartsClipPath/ChartsClipPath.js +1 -1
- package/modern/ChartsClipPath/index.js +1 -1
- package/modern/ChartsGrid/ChartsGrid.js +18 -66
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +36 -0
- package/modern/ChartsGrid/ChartsVerticalGrid.js +36 -0
- package/modern/ChartsGrid/index.js +2 -2
- package/modern/ChartsGrid/styledCommonents.js +22 -0
- package/modern/ChartsLegend/ChartsLegend.js +59 -25
- package/modern/ChartsLegend/ContinuousColorLegend.js +7 -7
- package/modern/ChartsLegend/DefaultChartsLegend.js +7 -3
- package/modern/ChartsLegend/LegendPerItem.js +4 -8
- package/modern/ChartsLegend/PiecewiseColorLegend.js +3 -8
- package/modern/ChartsLegend/index.js +6 -6
- package/modern/ChartsLegend/useAxis.js +2 -2
- package/modern/ChartsLegend/utils.js +4 -4
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +4 -4
- package/modern/ChartsOnAxisClickHandler/index.js +1 -1
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
- package/modern/ChartsOverlay/ChartsOverlay.js +3 -3
- package/modern/ChartsOverlay/index.js +3 -3
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +5 -5
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +5 -5
- package/modern/ChartsReferenceLine/common.js +1 -1
- package/modern/ChartsReferenceLine/index.js +2 -2
- package/modern/ChartsSurface/ChartsSurface.js +1 -1
- package/modern/ChartsSurface/index.js +1 -1
- package/modern/ChartsText/ChartsText.js +1 -1
- package/modern/ChartsText/index.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +6 -6
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +5 -5
- package/modern/ChartsTooltip/ChartsTooltip.js +13 -11
- package/modern/ChartsTooltip/ChartsTooltipTable.js +10 -5
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +5 -5
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +3 -3
- package/modern/ChartsTooltip/chartsTooltipClasses.js +1 -1
- package/modern/ChartsTooltip/index.js +7 -7
- package/modern/ChartsTooltip/utils.js +1 -1
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +7 -7
- package/modern/ChartsVoronoiHandler/index.js +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +18 -13
- package/modern/ChartsXAxis/index.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +15 -10
- package/modern/ChartsYAxis/index.js +1 -1
- package/modern/Gauge/Gauge.js +5 -5
- package/modern/Gauge/GaugeContainer.js +4 -4
- package/modern/Gauge/GaugeProvider.js +3 -3
- package/modern/Gauge/GaugeReferenceArc.js +1 -1
- package/modern/Gauge/GaugeValueArc.js +1 -1
- package/modern/Gauge/GaugeValueText.js +2 -2
- package/modern/Gauge/index.js +7 -7
- package/modern/LineChart/AnimatedArea.js +31 -14
- package/modern/LineChart/AnimatedLine.js +32 -15
- package/modern/LineChart/AreaElement.js +3 -3
- package/modern/LineChart/AreaPlot.js +83 -78
- package/modern/LineChart/LineChart.js +26 -15
- package/modern/LineChart/LineElement.js +3 -3
- package/modern/LineChart/LineHighlightPlot.js +8 -8
- package/modern/LineChart/LinePlot.js +65 -60
- package/modern/LineChart/MarkElement.js +4 -4
- package/modern/LineChart/MarkPlot.js +9 -9
- package/modern/LineChart/formatter.js +2 -2
- package/modern/LineChart/index.js +11 -11
- package/modern/LineChart/legend.js +1 -1
- package/modern/LineChart/plugin.js +3 -3
- package/modern/LineChart/useLineChartProps.js +1 -1
- package/modern/PieChart/PieArc.js +1 -1
- package/modern/PieChart/PieArcLabelPlot.js +4 -4
- package/modern/PieChart/PieArcPlot.js +4 -4
- package/modern/PieChart/PieChart.js +19 -8
- package/modern/PieChart/PiePlot.js +6 -6
- package/modern/PieChart/dataTransform/useTransformData.js +1 -1
- package/modern/PieChart/formatter.js +1 -1
- package/modern/PieChart/getPieCoordinates.js +1 -1
- package/modern/PieChart/index.js +7 -7
- package/modern/PieChart/legend.js +1 -1
- package/modern/PieChart/plugin.js +2 -2
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -3
- package/modern/ResponsiveChartContainer/index.js +1 -1
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +1 -1
- package/modern/ScatterChart/Scatter.js +5 -5
- package/modern/ScatterChart/ScatterChart.js +23 -12
- package/modern/ScatterChart/ScatterPlot.js +5 -5
- package/modern/ScatterChart/formatter.js +1 -1
- package/modern/ScatterChart/index.js +3 -3
- package/modern/ScatterChart/legend.js +1 -1
- package/modern/ScatterChart/plugin.js +3 -3
- package/modern/SparkLineChart/SparkLineChart.js +6 -6
- package/modern/SparkLineChart/index.js +1 -1
- package/modern/colorPalettes/index.js +1 -1
- package/modern/context/CartesianProvider/CartesianProvider.js +6 -6
- package/modern/context/CartesianProvider/computeValue.js +6 -6
- package/modern/context/CartesianProvider/defaultizeAxis.js +1 -1
- package/modern/context/CartesianProvider/index.js +5 -5
- package/modern/context/CartesianProvider/useCartesianContext.js +1 -1
- package/modern/context/DrawingProvider.js +1 -1
- package/modern/context/HighlightedProvider/HighlightedProvider.js +4 -4
- package/modern/context/HighlightedProvider/index.js +4 -4
- package/modern/context/HighlightedProvider/useHighlighted.js +1 -1
- package/modern/context/HighlightedProvider/useItemHighlighted.js +1 -1
- package/modern/context/PluginProvider/PluginProvider.js +2 -2
- package/modern/context/PluginProvider/index.js +10 -10
- package/modern/context/PluginProvider/mergePlugins.js +4 -4
- package/modern/context/PluginProvider/useColorProcessor.js +1 -1
- package/modern/context/PluginProvider/useSeriesFormatter.js +1 -1
- package/modern/context/PluginProvider/useXExtremumGetter.js +1 -1
- package/modern/context/PluginProvider/useYExtremumGetter.js +1 -1
- package/modern/context/SeriesProvider/SeriesProvider.js +4 -4
- package/modern/context/SeriesProvider/index.js +4 -4
- package/modern/context/SeriesProvider/processSeries.js +1 -1
- package/modern/context/ZAxisContextProvider.js +1 -1
- package/modern/context/index.js +2 -2
- package/modern/hooks/index.js +7 -7
- package/modern/hooks/useAxis.js +1 -1
- package/modern/hooks/useAxisEvents.js +6 -6
- package/modern/hooks/useChartDimensions.js +1 -1
- package/modern/hooks/useChartId.js +1 -1
- package/modern/hooks/useColorScale.js +2 -2
- package/modern/hooks/useDrawingArea.js +1 -1
- package/modern/hooks/useInteractionItemProps.js +2 -2
- package/modern/hooks/useReducedMotion.js +13 -12
- package/modern/hooks/useScale.js +2 -2
- package/modern/hooks/useSeries.js +1 -1
- package/modern/hooks/useSvgRef.js +1 -1
- package/modern/hooks/useTicks.js +2 -2
- package/modern/index.js +27 -27
- package/modern/internals/components/AxisSharedComponents.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
- package/modern/internals/components/ChartsAxesGradients/index.js +1 -1
- package/modern/internals/getWordsByLines.js +1 -1
- package/modern/internals/index.js +31 -31
- package/modern/internals/isCartesian.js +1 -1
- package/modern/internals/{useAnimatedPath.js → useStringInterpolator.js} +2 -15
- package/modern/models/index.js +5 -3
- package/modern/models/seriesType/index.js +4 -4
- package/modern/themeAugmentation/index.js +0 -3
- package/node/BarChart/BarChart.js +14 -4
- package/node/BarChart/BarClipPath.js +2 -3
- package/node/BarChart/BarElement.js +2 -3
- package/node/BarChart/BarLabel/BarLabel.js +2 -3
- package/node/BarChart/BarLabel/BarLabelItem.js +2 -3
- package/node/BarChart/BarLabel/BarLabelPlot.js +2 -3
- package/node/BarChart/BarLabel/barLabelClasses.js +1 -1
- package/node/BarChart/BarPlot.js +2 -3
- package/node/BarChart/formatter.js +1 -1
- package/node/BarChart/plugin.js +1 -1
- package/node/BarChart/useBarChartProps.js +1 -1
- package/node/ChartContainer/ChartContainer.js +2 -3
- package/node/ChartContainer/useChartContainerProps.js +2 -3
- package/node/ChartContainer/useDefaultizeAxis.js +2 -3
- package/node/ChartsAxis/ChartsAxis.js +2 -3
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -3
- package/node/ChartsClipPath/ChartsClipPath.js +2 -3
- package/node/ChartsGrid/ChartsGrid.js +17 -66
- package/node/ChartsGrid/ChartsHorizontalGrid.js +43 -0
- package/node/ChartsGrid/ChartsVerticalGrid.js +43 -0
- package/node/ChartsGrid/chartsGridClasses.js +1 -1
- package/node/ChartsGrid/styledCommonents.js +28 -0
- package/node/ChartsLegend/ChartsLegend.js +56 -23
- package/node/ChartsLegend/ContinuousColorLegend.js +2 -3
- package/node/ChartsLegend/DefaultChartsLegend.js +8 -5
- package/node/ChartsLegend/LegendPerItem.js +2 -7
- package/node/ChartsLegend/PiecewiseColorLegend.js +2 -8
- package/node/ChartsLegend/legendItemsPlacement.js +1 -1
- package/node/ChartsLegend/useAxis.js +1 -2
- package/node/ChartsLegend/utils.js +1 -1
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -3
- package/node/ChartsOverlay/ChartsLoadingOverlay.js +2 -3
- package/node/ChartsOverlay/ChartsNoDataOverlay.js +2 -3
- package/node/ChartsOverlay/ChartsOverlay.js +2 -3
- package/node/ChartsReferenceLine/ChartsReferenceLine.js +2 -3
- package/node/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
- package/node/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
- package/node/ChartsReferenceLine/chartsReferenceLineClasses.js +1 -1
- package/node/ChartsReferenceLine/common.js +1 -1
- package/node/ChartsSurface/ChartsSurface.js +2 -3
- package/node/ChartsText/ChartsText.js +2 -3
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +2 -3
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +2 -3
- package/node/ChartsTooltip/ChartsTooltip.js +10 -9
- package/node/ChartsTooltip/ChartsTooltipTable.js +9 -4
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -4
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +3 -4
- package/node/ChartsTooltip/chartsTooltipClasses.js +1 -1
- package/node/ChartsTooltip/utils.js +2 -3
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -3
- package/node/ChartsXAxis/ChartsXAxis.js +8 -4
- package/node/ChartsYAxis/ChartsYAxis.js +8 -4
- package/node/Gauge/Gauge.js +2 -3
- package/node/Gauge/GaugeContainer.js +2 -3
- package/node/Gauge/GaugeProvider.js +1 -2
- package/node/Gauge/GaugeReferenceArc.js +2 -3
- package/node/Gauge/GaugeValueArc.js +2 -3
- package/node/Gauge/GaugeValueText.js +2 -3
- package/node/Gauge/gaugeClasses.js +1 -1
- package/node/LineChart/AnimatedArea.js +30 -14
- package/node/LineChart/AnimatedLine.js +30 -14
- package/node/LineChart/AreaElement.js +2 -3
- package/node/LineChart/AreaPlot.js +78 -74
- package/node/LineChart/LineChart.js +14 -4
- package/node/LineChart/LineElement.js +2 -3
- package/node/LineChart/LineHighlightElement.js +2 -3
- package/node/LineChart/LineHighlightPlot.js +2 -3
- package/node/LineChart/LinePlot.js +60 -56
- package/node/LineChart/MarkElement.js +2 -3
- package/node/LineChart/MarkPlot.js +2 -3
- package/node/LineChart/formatter.js +1 -1
- package/node/LineChart/plugin.js +1 -1
- package/node/LineChart/useLineChartProps.js +1 -1
- package/node/PieChart/PieArc.js +2 -3
- package/node/PieChart/PieArcLabel.js +2 -3
- package/node/PieChart/PieArcLabelPlot.js +2 -3
- package/node/PieChart/PieArcPlot.js +2 -3
- package/node/PieChart/PieChart.js +13 -3
- package/node/PieChart/PiePlot.js +2 -3
- package/node/PieChart/dataTransform/useTransformData.js +2 -3
- package/node/PieChart/formatter.js +1 -1
- package/node/PieChart/plugin.js +1 -1
- package/node/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -3
- package/node/ResponsiveChartContainer/useChartContainerDimensions.js +2 -3
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +1 -1
- package/node/ScatterChart/Scatter.js +2 -3
- package/node/ScatterChart/ScatterChart.js +14 -4
- package/node/ScatterChart/ScatterPlot.js +2 -3
- package/node/ScatterChart/plugin.js +1 -1
- package/node/ScatterChart/useScatterChartProps.js +1 -1
- package/node/SparkLineChart/SparkLineChart.js +2 -3
- package/node/context/CartesianProvider/CartesianContext.js +1 -2
- package/node/context/CartesianProvider/CartesianProvider.js +1 -2
- package/node/context/CartesianProvider/computeValue.js +1 -1
- package/node/context/CartesianProvider/defaultizeAxis.js +1 -1
- package/node/context/CartesianProvider/useCartesianContext.js +1 -2
- package/node/context/DrawingProvider.js +2 -3
- package/node/context/HighlightedProvider/HighlightedContext.js +1 -2
- package/node/context/HighlightedProvider/HighlightedProvider.js +2 -3
- package/node/context/HighlightedProvider/useHighlighted.js +1 -2
- package/node/context/InteractionProvider.js +2 -3
- package/node/context/PluginProvider/PluginContext.js +1 -2
- package/node/context/PluginProvider/PluginProvider.js +1 -2
- package/node/context/PluginProvider/useColorProcessor.js +1 -2
- package/node/context/PluginProvider/useSeriesFormatter.js +1 -2
- package/node/context/PluginProvider/useXExtremumGetter.js +1 -2
- package/node/context/PluginProvider/useYExtremumGetter.js +1 -2
- package/node/context/SeriesProvider/SeriesContext.js +1 -2
- package/node/context/SeriesProvider/SeriesProvider.js +1 -2
- package/node/context/SeriesProvider/processSeries.js +1 -1
- package/node/context/ZAxisContextProvider.js +2 -3
- package/node/hooks/useAxisEvents.js +1 -2
- package/node/hooks/useChartDimensions.js +2 -3
- package/node/hooks/useChartId.js +1 -2
- package/node/hooks/useColorScale.js +1 -2
- package/node/hooks/useDrawingArea.js +1 -2
- package/node/hooks/useInteractionItemProps.js +1 -2
- package/node/hooks/useMounted.js +2 -3
- package/node/hooks/useReducedMotion.js +14 -12
- package/node/hooks/useSeries.js +1 -2
- package/node/hooks/useSvgRef.js +1 -2
- package/node/hooks/useTicks.js +1 -2
- package/node/index.js +1 -1
- package/node/internals/components/AxisSharedComponents.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -3
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -2
- package/node/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +1 -2
- package/node/internals/defaultizeColor.js +1 -1
- package/node/internals/defaultizeValueFormatter.js +1 -1
- package/node/internals/domUtils.js +1 -1
- package/node/internals/getWordsByLines.js +1 -1
- package/node/internals/useStringInterpolator.js +28 -0
- package/node/tests/firePointerEvent.js +1 -1
- package/node/themeAugmentation/index.js +1 -38
- package/package.json +4 -3
- package/themeAugmentation/components.d.ts +2 -0
- package/themeAugmentation/index.d.ts +3 -3
- package/themeAugmentation/index.js +0 -3
- package/themeAugmentation/overrides.d.ts +6 -4
- package/internals/useAnimatedPath.d.ts +0 -1
- package/node/internals/useAnimatedPath.js +0 -42
package/LineChart/AreaPlot.js
CHANGED
|
@@ -4,91 +4,96 @@ const _excluded = ["slots", "slotProps", "onItemClick", "skipAnimation"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { area as d3Area } from '@mui/x-charts-vendor/d3-shape';
|
|
7
|
-
import { useCartesianContext } from
|
|
8
|
-
import { AreaElement } from
|
|
9
|
-
import { getValueToPositionMapper } from
|
|
10
|
-
import getCurveFactory from
|
|
11
|
-
import { DEFAULT_X_AXIS_KEY } from
|
|
12
|
-
import { useChartGradient } from
|
|
13
|
-
import { useLineSeries } from
|
|
7
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
8
|
+
import { AreaElement } from "./AreaElement.js";
|
|
9
|
+
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
10
|
+
import getCurveFactory from "../internals/getCurve.js";
|
|
11
|
+
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
12
|
+
import { useChartGradient } from "../internals/components/ChartsAxesGradients/index.js";
|
|
13
|
+
import { useLineSeries } from "../hooks/useSeries.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const useAggregatedData = () => {
|
|
16
16
|
const seriesData = useLineSeries();
|
|
17
17
|
const axisData = useCartesianContext();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
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
|
-
return yScale(baseline);
|
|
65
|
-
}
|
|
66
|
-
if (baseline === 'max') {
|
|
67
|
-
return yScale.range()[1];
|
|
68
|
-
}
|
|
69
|
-
if (baseline === 'min') {
|
|
70
|
-
return yScale.range()[0];
|
|
71
|
-
}
|
|
72
|
-
const value = d.y && yScale(d.y[0]);
|
|
73
|
-
if (Number.isNaN(value)) {
|
|
74
|
-
return yScale.range()[0];
|
|
18
|
+
|
|
19
|
+
// This memo prevents odd line chart behavior when hydrating.
|
|
20
|
+
const allData = React.useMemo(() => {
|
|
21
|
+
if (seriesData === undefined) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
const {
|
|
25
|
+
series,
|
|
26
|
+
stackingGroups
|
|
27
|
+
} = seriesData;
|
|
28
|
+
const {
|
|
29
|
+
xAxis,
|
|
30
|
+
yAxis,
|
|
31
|
+
xAxisIds,
|
|
32
|
+
yAxisIds
|
|
33
|
+
} = axisData;
|
|
34
|
+
const defaultXAxisId = xAxisIds[0];
|
|
35
|
+
const defaultYAxisId = yAxisIds[0];
|
|
36
|
+
return stackingGroups.flatMap(({
|
|
37
|
+
ids: groupIds
|
|
38
|
+
}) => {
|
|
39
|
+
return [...groupIds].reverse() // Revert stacked area for a more pleasant animation
|
|
40
|
+
.map(seriesId => {
|
|
41
|
+
const {
|
|
42
|
+
xAxisId: xAxisIdProp,
|
|
43
|
+
yAxisId: yAxisIdProp,
|
|
44
|
+
xAxisKey = defaultXAxisId,
|
|
45
|
+
yAxisKey = defaultYAxisId,
|
|
46
|
+
stackedData,
|
|
47
|
+
data,
|
|
48
|
+
connectNulls,
|
|
49
|
+
baseline
|
|
50
|
+
} = series[seriesId];
|
|
51
|
+
const xAxisId = xAxisIdProp ?? xAxisKey;
|
|
52
|
+
const yAxisId = yAxisIdProp ?? yAxisKey;
|
|
53
|
+
const xScale = getValueToPositionMapper(xAxis[xAxisId].scale);
|
|
54
|
+
const yScale = yAxis[yAxisId].scale;
|
|
55
|
+
const xData = xAxis[xAxisId].data;
|
|
56
|
+
const gradientUsed = yAxis[yAxisId].colorScale && [yAxisId, 'y'] || xAxis[xAxisId].colorScale && [xAxisId, 'x'] || undefined;
|
|
57
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58
|
+
if (xData === undefined) {
|
|
59
|
+
throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
|
|
60
|
+
}
|
|
61
|
+
if (xData.length < stackedData.length) {
|
|
62
|
+
throw new Error(`MUI X: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
|
|
63
|
+
}
|
|
75
64
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
const areaPath = d3Area().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y0(d => {
|
|
66
|
+
if (typeof baseline === 'number') {
|
|
67
|
+
return yScale(baseline);
|
|
68
|
+
}
|
|
69
|
+
if (baseline === 'max') {
|
|
70
|
+
return yScale.range()[1];
|
|
71
|
+
}
|
|
72
|
+
if (baseline === 'min') {
|
|
73
|
+
return yScale.range()[0];
|
|
74
|
+
}
|
|
75
|
+
const value = d.y && yScale(d.y[0]);
|
|
76
|
+
if (Number.isNaN(value)) {
|
|
77
|
+
return yScale.range()[0];
|
|
78
|
+
}
|
|
79
|
+
return value;
|
|
80
|
+
}).y1(d => d.y && yScale(d.y[1]));
|
|
81
|
+
const curve = getCurveFactory(series[seriesId].curve);
|
|
82
|
+
const formattedData = xData?.map((x, index) => ({
|
|
83
|
+
x,
|
|
84
|
+
y: stackedData[index]
|
|
85
|
+
})) ?? [];
|
|
86
|
+
const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
|
|
87
|
+
const d = areaPath.curve(curve)(d3Data) || '';
|
|
88
|
+
return _extends({}, series[seriesId], {
|
|
89
|
+
gradientUsed,
|
|
90
|
+
d,
|
|
91
|
+
seriesId
|
|
92
|
+
});
|
|
89
93
|
});
|
|
90
94
|
});
|
|
91
|
-
});
|
|
95
|
+
}, [seriesData, axisData]);
|
|
96
|
+
return allData;
|
|
92
97
|
};
|
|
93
98
|
|
|
94
99
|
/**
|
package/LineChart/LineChart.js
CHANGED
|
@@ -2,20 +2,20 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useThemeProps } from '@mui/material/styles';
|
|
5
|
-
import { AreaPlot } from
|
|
6
|
-
import { LinePlot } from
|
|
7
|
-
import { ResponsiveChartContainer } from
|
|
8
|
-
import { MarkPlot } from
|
|
9
|
-
import { ChartsAxis } from
|
|
10
|
-
import { ChartsTooltip } from
|
|
11
|
-
import { ChartsLegend } from
|
|
12
|
-
import { ChartsAxisHighlight } from
|
|
13
|
-
import { ChartsClipPath } from
|
|
14
|
-
import { LineHighlightPlot } from
|
|
15
|
-
import { ChartsGrid } from
|
|
16
|
-
import { ChartsOnAxisClickHandler } from
|
|
17
|
-
import { ChartsOverlay } from
|
|
18
|
-
import { useLineChartProps } from
|
|
5
|
+
import { AreaPlot } from "./AreaPlot.js";
|
|
6
|
+
import { LinePlot } from "./LinePlot.js";
|
|
7
|
+
import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
|
|
8
|
+
import { MarkPlot } from "./MarkPlot.js";
|
|
9
|
+
import { ChartsAxis } from "../ChartsAxis/ChartsAxis.js";
|
|
10
|
+
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
11
|
+
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
12
|
+
import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
|
|
13
|
+
import { ChartsClipPath } from "../ChartsClipPath/index.js";
|
|
14
|
+
import { LineHighlightPlot } from "./LineHighlightPlot.js";
|
|
15
|
+
import { ChartsGrid } from "../ChartsGrid/index.js";
|
|
16
|
+
import { ChartsOnAxisClickHandler } from "../ChartsOnAxisClickHandler/index.js";
|
|
17
|
+
import { ChartsOverlay } from "../ChartsOverlay/index.js";
|
|
18
|
+
import { useLineChartProps } from "./useLineChartProps.js";
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
/**
|
|
21
21
|
* Demos:
|
|
@@ -52,7 +52,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(inProps, ref)
|
|
|
52
52
|
return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({
|
|
53
53
|
ref: ref
|
|
54
54
|
}, chartContainerProps, {
|
|
55
|
-
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)),
|
|
55
|
+
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
56
56
|
children: [/*#__PURE__*/_jsx(AreaPlot, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlot, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
57
57
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
|
|
58
58
|
"data-drawing-container": true,
|
|
@@ -133,6 +133,17 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
133
133
|
classes: PropTypes.object,
|
|
134
134
|
direction: PropTypes.oneOf(['column', 'row']),
|
|
135
135
|
hidden: PropTypes.bool,
|
|
136
|
+
itemGap: PropTypes.number,
|
|
137
|
+
itemMarkHeight: PropTypes.number,
|
|
138
|
+
itemMarkWidth: PropTypes.number,
|
|
139
|
+
labelStyle: PropTypes.object,
|
|
140
|
+
markGap: PropTypes.number,
|
|
141
|
+
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
142
|
+
bottom: PropTypes.number,
|
|
143
|
+
left: PropTypes.number,
|
|
144
|
+
right: PropTypes.number,
|
|
145
|
+
top: PropTypes.number
|
|
146
|
+
})]),
|
|
136
147
|
position: PropTypes.shape({
|
|
137
148
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
138
149
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
package/LineChart/LineElement.js
CHANGED
|
@@ -7,9 +7,9 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
7
7
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
9
9
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
10
|
-
import { useInteractionItemProps } from
|
|
11
|
-
import { AnimatedLine } from
|
|
12
|
-
import { useItemHighlighted } from
|
|
10
|
+
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
11
|
+
import { AnimatedLine } from "./AnimatedLine.js";
|
|
12
|
+
import { useItemHighlighted } from "../context/index.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
export function getLineElementUtilityClass(slot) {
|
|
15
15
|
return generateUtilityClass('MuiLineElement', slot);
|
|
@@ -3,14 +3,14 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { useCartesianContext } from
|
|
7
|
-
import { LineHighlightElement } from
|
|
8
|
-
import { getValueToPositionMapper } from
|
|
9
|
-
import { InteractionContext } from
|
|
10
|
-
import { DEFAULT_X_AXIS_KEY } from
|
|
11
|
-
import getColor from
|
|
12
|
-
import { useLineSeries } from
|
|
13
|
-
import { useDrawingArea } from
|
|
6
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
7
|
+
import { LineHighlightElement } from "./LineHighlightElement.js";
|
|
8
|
+
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
9
|
+
import { InteractionContext } from "../context/InteractionProvider.js";
|
|
10
|
+
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
11
|
+
import getColor from "./getColor.js";
|
|
12
|
+
import { useLineSeries } from "../hooks/useSeries.js";
|
|
13
|
+
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
/**
|
|
16
16
|
* Demos:
|
package/LineChart/LinePlot.js
CHANGED
|
@@ -4,73 +4,78 @@ const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
|
|
7
|
-
import { useCartesianContext } from
|
|
8
|
-
import { LineElement } from
|
|
9
|
-
import { getValueToPositionMapper } from
|
|
10
|
-
import getCurveFactory from
|
|
11
|
-
import { DEFAULT_X_AXIS_KEY } from
|
|
12
|
-
import { useChartGradient } from
|
|
13
|
-
import { useLineSeries } from
|
|
7
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
8
|
+
import { LineElement } from "./LineElement.js";
|
|
9
|
+
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
10
|
+
import getCurveFactory from "../internals/getCurve.js";
|
|
11
|
+
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
12
|
+
import { useChartGradient } from "../internals/components/ChartsAxesGradients/index.js";
|
|
13
|
+
import { useLineSeries } from "../hooks/useSeries.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const useAggregatedData = () => {
|
|
16
16
|
const seriesData = useLineSeries();
|
|
17
17
|
const axisData = useCartesianContext();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
18
|
+
|
|
19
|
+
// This memo prevents odd line chart behavior when hydrating.
|
|
20
|
+
const allData = React.useMemo(() => {
|
|
21
|
+
if (seriesData === undefined) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
const {
|
|
25
|
+
series,
|
|
26
|
+
stackingGroups
|
|
27
|
+
} = seriesData;
|
|
28
|
+
const {
|
|
29
|
+
xAxis,
|
|
30
|
+
yAxis,
|
|
31
|
+
xAxisIds,
|
|
32
|
+
yAxisIds
|
|
33
|
+
} = axisData;
|
|
34
|
+
const defaultXAxisId = xAxisIds[0];
|
|
35
|
+
const defaultYAxisId = yAxisIds[0];
|
|
36
|
+
return stackingGroups.flatMap(({
|
|
37
|
+
ids: groupIds
|
|
38
|
+
}) => {
|
|
39
|
+
return groupIds.flatMap(seriesId => {
|
|
40
|
+
const {
|
|
41
|
+
xAxisId: xAxisIdProp,
|
|
42
|
+
yAxisId: yAxisIdProp,
|
|
43
|
+
xAxisKey = defaultXAxisId,
|
|
44
|
+
yAxisKey = defaultYAxisId,
|
|
45
|
+
stackedData,
|
|
46
|
+
data,
|
|
47
|
+
connectNulls
|
|
48
|
+
} = series[seriesId];
|
|
49
|
+
const xAxisId = xAxisIdProp ?? xAxisKey;
|
|
50
|
+
const yAxisId = yAxisIdProp ?? yAxisKey;
|
|
51
|
+
const xScale = getValueToPositionMapper(xAxis[xAxisId].scale);
|
|
52
|
+
const yScale = yAxis[yAxisId].scale;
|
|
53
|
+
const xData = xAxis[xAxisId].data;
|
|
54
|
+
const gradientUsed = yAxis[yAxisId].colorScale && [yAxisId, 'y'] || xAxis[xAxisId].colorScale && [xAxisId, 'x'] || undefined;
|
|
55
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
56
|
+
if (xData === undefined) {
|
|
57
|
+
throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
|
|
58
|
+
}
|
|
59
|
+
if (xData.length < stackedData.length) {
|
|
60
|
+
throw new Error(`MUI X: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
|
|
61
|
+
}
|
|
58
62
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
const linePath = d3Line().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y(d => yScale(d.y[1]));
|
|
64
|
+
const formattedData = xData?.map((x, index) => ({
|
|
65
|
+
x,
|
|
66
|
+
y: stackedData[index]
|
|
67
|
+
})) ?? [];
|
|
68
|
+
const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
|
|
69
|
+
const d = linePath.curve(getCurveFactory(series[seriesId].curve))(d3Data) || '';
|
|
70
|
+
return _extends({}, series[seriesId], {
|
|
71
|
+
gradientUsed,
|
|
72
|
+
d,
|
|
73
|
+
seriesId
|
|
74
|
+
});
|
|
71
75
|
});
|
|
72
76
|
});
|
|
73
|
-
});
|
|
77
|
+
}, [seriesData, axisData]);
|
|
78
|
+
return allData;
|
|
74
79
|
};
|
|
75
80
|
|
|
76
81
|
/**
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -9,10 +9,10 @@ import { styled } from '@mui/material/styles';
|
|
|
9
9
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
10
10
|
import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from '@mui/x-charts-vendor/d3-shape';
|
|
11
11
|
import { animated, to, useSpring } from '@react-spring/web';
|
|
12
|
-
import { getSymbol } from
|
|
13
|
-
import { InteractionContext } from
|
|
14
|
-
import { useInteractionItemProps } from
|
|
15
|
-
import { useItemHighlighted } from
|
|
12
|
+
import { getSymbol } from "../internals/getSymbol.js";
|
|
13
|
+
import { InteractionContext } from "../context/InteractionProvider.js";
|
|
14
|
+
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
15
|
+
import { useItemHighlighted } from "../context/index.js";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
export function getMarkElementUtilityClass(slot) {
|
|
18
18
|
return generateUtilityClass('MuiMarkElement', slot);
|
package/LineChart/MarkPlot.js
CHANGED
|
@@ -3,15 +3,15 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { useCartesianContext } from
|
|
7
|
-
import { MarkElement } from
|
|
8
|
-
import { getValueToPositionMapper } from
|
|
9
|
-
import { useChartId } from
|
|
10
|
-
import { DEFAULT_X_AXIS_KEY } from
|
|
11
|
-
import { cleanId } from
|
|
12
|
-
import getColor from
|
|
13
|
-
import { useLineSeries } from
|
|
14
|
-
import { useDrawingArea } from
|
|
6
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
7
|
+
import { MarkElement } from "./MarkElement.js";
|
|
8
|
+
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
9
|
+
import { useChartId } from "../hooks/useChartId.js";
|
|
10
|
+
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
11
|
+
import { cleanId } from "../internals/cleanId.js";
|
|
12
|
+
import getColor from "./getColor.js";
|
|
13
|
+
import { useLineSeries } from "../hooks/useSeries.js";
|
|
14
|
+
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
/**
|
|
17
17
|
* Demos:
|
package/LineChart/formatter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
3
|
-
import { getStackingGroups } from
|
|
4
|
-
import { defaultizeValueFormatter } from
|
|
3
|
+
import { getStackingGroups } from "../internals/stackSeries.js";
|
|
4
|
+
import { defaultizeValueFormatter } from "../internals/defaultizeValueFormatter.js";
|
|
5
5
|
let warnedOnce = false;
|
|
6
6
|
|
|
7
7
|
// For now it's a copy past of bar charts formatter, but maybe will diverge later
|
package/LineChart/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
1
|
+
export * from "./LineChart.js";
|
|
2
|
+
export * from "./LinePlot.js";
|
|
3
|
+
export * from "./AreaPlot.js";
|
|
4
|
+
export * from "./MarkPlot.js";
|
|
5
|
+
export * from "./LineHighlightPlot.js";
|
|
6
|
+
export * from "./AreaElement.js";
|
|
7
|
+
export * from "./AnimatedArea.js";
|
|
8
|
+
export * from "./LineElement.js";
|
|
9
|
+
export * from "./AnimatedLine.js";
|
|
10
|
+
export * from "./MarkElement.js";
|
|
11
|
+
export * from "./LineHighlightElement.js";
|
package/LineChart/legend.js
CHANGED
package/LineChart/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getExtremumX, getExtremumY } from
|
|
2
|
-
import formatter from
|
|
3
|
-
import getColor from
|
|
1
|
+
import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
2
|
+
import formatter from "./formatter.js";
|
|
3
|
+
import getColor from "./getColor.js";
|
|
4
4
|
export const plugin = {
|
|
5
5
|
seriesType: 'line',
|
|
6
6
|
colorProcessor: getColor,
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
4
4
|
import useId from '@mui/utils/useId';
|
|
5
|
-
import { DEFAULT_X_AXIS_KEY } from
|
|
5
|
+
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* A helper function that extracts LineChartProps from the input props
|
|
8
8
|
* and returns an object with props for the children components of LineChart.
|
package/PieChart/PieArc.js
CHANGED
|
@@ -9,7 +9,7 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
9
9
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
10
10
|
import { styled } from '@mui/material/styles';
|
|
11
11
|
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
12
|
-
import { useInteractionItemProps } from
|
|
12
|
+
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
export function getPieArcUtilityClass(slot) {
|
|
15
15
|
return generateUtilityClass('MuiPieArc', slot);
|
|
@@ -5,10 +5,10 @@ const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadi
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { useTransition } from '@react-spring/web';
|
|
8
|
-
import { defaultLabelTransitionConfig } from
|
|
9
|
-
import { useTransformData } from
|
|
10
|
-
import { PieArcLabel } from
|
|
11
|
-
import { getLabel } from
|
|
8
|
+
import { defaultLabelTransitionConfig } from "./dataTransform/transition.js";
|
|
9
|
+
import { useTransformData } from "./dataTransform/useTransformData.js";
|
|
10
|
+
import { PieArcLabel } from "./PieArcLabel.js";
|
|
11
|
+
import { getLabel } from "../internals/getLabel.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const RATIO = 180 / Math.PI;
|
|
14
14
|
function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -5,10 +5,10 @@ const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRa
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { useTransition } from '@react-spring/web';
|
|
8
|
-
import { PieArc } from
|
|
9
|
-
import { defaultTransitionConfig } from
|
|
10
|
-
import { useTransformData } from
|
|
11
|
-
import { useHighlighted } from
|
|
8
|
+
import { PieArc } from "./PieArc.js";
|
|
9
|
+
import { defaultTransitionConfig } from "./dataTransform/transition.js";
|
|
10
|
+
import { useTransformData } from "./dataTransform/useTransformData.js";
|
|
11
|
+
import { useHighlighted } from "../context/index.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
function PieArcPlot(props) {
|
|
14
14
|
const {
|
package/PieChart/PieChart.js
CHANGED
|
@@ -5,14 +5,14 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
|
-
import { ResponsiveChartContainer } from
|
|
9
|
-
import { ChartsAxis } from
|
|
10
|
-
import { DEFAULT_X_AXIS_KEY } from
|
|
11
|
-
import { ChartsTooltip } from
|
|
12
|
-
import { ChartsLegend } from
|
|
13
|
-
import { ChartsAxisHighlight } from
|
|
14
|
-
import { PiePlot } from
|
|
15
|
-
import { ChartsOverlay } from
|
|
8
|
+
import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
|
|
9
|
+
import { ChartsAxis } from "../ChartsAxis/ChartsAxis.js";
|
|
10
|
+
import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
11
|
+
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
12
|
+
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
13
|
+
import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
|
|
14
|
+
import { PiePlot } from "./PiePlot.js";
|
|
15
|
+
import { ChartsOverlay } from "../ChartsOverlay/index.js";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const defaultMargin = {
|
|
18
18
|
top: 5,
|
|
@@ -192,6 +192,17 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
192
192
|
classes: PropTypes.object,
|
|
193
193
|
direction: PropTypes.oneOf(['column', 'row']),
|
|
194
194
|
hidden: PropTypes.bool,
|
|
195
|
+
itemGap: PropTypes.number,
|
|
196
|
+
itemMarkHeight: PropTypes.number,
|
|
197
|
+
itemMarkWidth: PropTypes.number,
|
|
198
|
+
labelStyle: PropTypes.object,
|
|
199
|
+
markGap: PropTypes.number,
|
|
200
|
+
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
201
|
+
bottom: PropTypes.number,
|
|
202
|
+
left: PropTypes.number,
|
|
203
|
+
right: PropTypes.number,
|
|
204
|
+
top: PropTypes.number
|
|
205
|
+
})]),
|
|
195
206
|
position: PropTypes.shape({
|
|
196
207
|
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
197
208
|
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|