@mui/x-charts 7.15.0 → 7.17.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 +26 -12
- package/BarChart/BarClipPath.js +1 -1
- package/BarChart/BarElement.js +4 -2
- package/BarChart/BarLabel/BarLabel.js +3 -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 +10 -8
- package/BarChart/checkScaleErrors.js +2 -2
- package/BarChart/formatter.js +2 -2
- package/BarChart/index.js +4 -4
- package/BarChart/legend.js +4 -3
- package/BarChart/plugin.js +3 -3
- package/BarChart/useBarChartProps.js +3 -1
- package/CHANGELOG.md +185 -1
- package/ChartContainer/ChartContainer.js +11 -9
- package/ChartContainer/index.js +1 -1
- package/ChartContainer/useChartContainerProps.js +4 -2
- package/ChartContainer/useDefaultizeAxis.js +3 -1
- package/ChartsAxis/ChartsAxis.js +5 -3
- package/ChartsAxis/index.js +2 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +6 -4
- package/ChartsAxisHighlight/index.js +1 -1
- package/ChartsClipPath/ChartsClipPath.js +3 -1
- package/ChartsClipPath/index.js +1 -1
- package/ChartsGrid/ChartsGrid.js +20 -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 +70 -26
- package/ChartsLegend/ChartsLegendItem.d.ts +26 -0
- package/ChartsLegend/ChartsLegendItem.js +65 -0
- package/ChartsLegend/ContinuousColorLegend.js +9 -7
- package/ChartsLegend/DefaultChartsLegend.d.ts +15 -2
- package/ChartsLegend/DefaultChartsLegend.js +31 -5
- package/ChartsLegend/LegendPerItem.d.ts +10 -6
- package/ChartsLegend/LegendPerItem.js +22 -35
- package/ChartsLegend/PiecewiseColorLegend.d.ts +9 -1
- package/ChartsLegend/PiecewiseColorLegend.js +31 -15
- package/ChartsLegend/chartsLegend.types.d.ts +39 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +2 -0
- package/ChartsLegend/chartsLegendClasses.js +1 -1
- package/ChartsLegend/index.js +6 -6
- package/ChartsLegend/useAxis.js +4 -2
- package/ChartsLegend/utils.js +4 -4
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +7 -5
- package/ChartsOnAxisClickHandler/index.js +1 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +3 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +3 -1
- package/ChartsOverlay/ChartsOverlay.js +5 -3
- package/ChartsOverlay/index.js +3 -3
- package/ChartsReferenceLine/ChartsReferenceLine.js +4 -2
- package/ChartsReferenceLine/ChartsXReferenceLine.js +7 -5
- package/ChartsReferenceLine/ChartsYReferenceLine.js +7 -5
- package/ChartsReferenceLine/common.js +1 -1
- package/ChartsReferenceLine/index.js +2 -2
- package/ChartsSurface/ChartsSurface.js +3 -1
- package/ChartsSurface/index.js +1 -1
- package/ChartsText/ChartsText.js +3 -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 +15 -11
- package/ChartsTooltip/ChartsTooltipTable.js +10 -5
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +7 -5
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +5 -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 +9 -7
- package/ChartsVoronoiHandler/index.js +1 -1
- package/ChartsXAxis/ChartsXAxis.js +20 -13
- package/ChartsXAxis/index.js +1 -1
- package/ChartsYAxis/ChartsYAxis.js +17 -10
- package/ChartsYAxis/index.js +1 -1
- package/Gauge/Gauge.js +7 -5
- package/Gauge/GaugeContainer.js +6 -4
- package/Gauge/GaugeProvider.js +3 -3
- package/Gauge/GaugeReferenceArc.js +3 -1
- package/Gauge/GaugeValueArc.js +3 -1
- package/Gauge/GaugeValueText.js +4 -2
- package/Gauge/index.js +7 -7
- package/LineChart/AnimatedArea.js +33 -14
- package/LineChart/AnimatedLine.js +34 -15
- package/LineChart/AreaElement.js +5 -3
- package/LineChart/AreaPlot.js +85 -78
- package/LineChart/CircleMarkElement.d.ts +34 -0
- package/LineChart/CircleMarkElement.js +107 -0
- package/LineChart/LineChart.d.ts +4 -0
- package/LineChart/LineChart.js +33 -15
- package/LineChart/LineElement.js +5 -3
- package/LineChart/LineHighlightElement.js +2 -0
- package/LineChart/LineHighlightPlot.js +10 -8
- package/LineChart/LinePlot.js +67 -60
- package/LineChart/MarkElement.d.ts +1 -19
- package/LineChart/MarkElement.js +7 -23
- package/LineChart/MarkPlot.d.ts +6 -0
- package/LineChart/MarkPlot.js +22 -12
- package/LineChart/formatter.js +2 -2
- package/LineChart/index.d.ts +2 -0
- package/LineChart/index.js +12 -11
- package/LineChart/legend.js +4 -3
- package/LineChart/markElementClasses.d.ts +20 -0
- package/LineChart/markElementClasses.js +19 -0
- package/LineChart/plugin.js +3 -3
- package/LineChart/useLineChartProps.js +8 -4
- package/PieChart/PieArc.js +3 -1
- package/PieChart/PieArcLabel.js +2 -0
- package/PieChart/PieArcLabelPlot.js +6 -4
- package/PieChart/PieArcPlot.js +6 -4
- package/PieChart/PieChart.js +22 -8
- package/PieChart/PiePlot.js +8 -6
- package/PieChart/dataTransform/useTransformData.js +3 -1
- package/PieChart/formatter.js +1 -1
- package/PieChart/getPieCoordinates.js +1 -1
- package/PieChart/index.js +7 -7
- package/PieChart/legend.js +4 -2
- package/PieChart/plugin.js +2 -2
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +5 -3
- package/ResponsiveChartContainer/index.js +1 -1
- package/ResponsiveChartContainer/useChartContainerDimensions.js +3 -1
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +3 -1
- package/ScatterChart/Scatter.js +7 -5
- package/ScatterChart/ScatterChart.js +26 -12
- package/ScatterChart/ScatterPlot.js +7 -5
- package/ScatterChart/formatter.js +1 -1
- package/ScatterChart/index.js +3 -3
- package/ScatterChart/legend.js +4 -3
- package/ScatterChart/plugin.js +3 -3
- package/ScatterChart/useScatterChartProps.js +2 -0
- package/SparkLineChart/SparkLineChart.js +8 -6
- package/SparkLineChart/index.js +1 -1
- package/colorPalettes/index.js +1 -1
- package/context/CartesianProvider/CartesianProvider.js +8 -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 +3 -1
- package/context/DrawingProvider.js +3 -1
- package/context/HighlightedProvider/HighlightedProvider.js +6 -4
- package/context/HighlightedProvider/index.js +4 -4
- package/context/HighlightedProvider/useHighlighted.js +3 -1
- package/context/HighlightedProvider/useItemHighlighted.js +3 -1
- package/context/InteractionProvider.js +2 -0
- package/context/PluginProvider/PluginProvider.js +4 -2
- package/context/PluginProvider/index.js +10 -10
- package/context/PluginProvider/mergePlugins.js +4 -4
- package/context/PluginProvider/useColorProcessor.js +3 -1
- package/context/PluginProvider/useSeriesFormatter.js +3 -1
- package/context/PluginProvider/useXExtremumGetter.js +1 -1
- package/context/PluginProvider/useYExtremumGetter.js +1 -1
- package/context/SeriesProvider/SeriesProvider.js +6 -4
- package/context/SeriesProvider/index.js +4 -4
- package/context/SeriesProvider/processSeries.js +1 -1
- package/context/ZAxisContextProvider.js +3 -1
- package/context/index.js +2 -2
- package/hooks/index.js +7 -7
- package/hooks/useAxis.js +3 -1
- package/hooks/useAxisEvents.js +8 -6
- package/hooks/useChartDimensions.js +3 -1
- package/hooks/useChartId.js +3 -1
- package/hooks/useColorScale.js +4 -2
- package/hooks/useDrawingArea.js +3 -1
- package/hooks/useInteractionItemProps.js +4 -2
- package/hooks/useMounted.js +2 -0
- package/hooks/useReducedMotion.js +15 -12
- package/hooks/useScale.js +4 -2
- package/hooks/useSeries.js +3 -1
- package/hooks/useSvgRef.js +3 -1
- package/hooks/useTicks.js +4 -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/{modern/internals/useAnimatedPath.js → internals/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 +26 -12
- package/modern/BarChart/BarClipPath.js +1 -1
- package/modern/BarChart/BarElement.js +4 -2
- package/modern/BarChart/BarLabel/BarLabel.js +3 -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 +10 -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 +4 -3
- package/modern/BarChart/plugin.js +3 -3
- package/modern/BarChart/useBarChartProps.js +3 -1
- package/modern/ChartContainer/ChartContainer.js +11 -9
- package/modern/ChartContainer/index.js +1 -1
- package/modern/ChartContainer/useChartContainerProps.js +4 -2
- package/modern/ChartContainer/useDefaultizeAxis.js +3 -1
- package/modern/ChartsAxis/ChartsAxis.js +5 -3
- package/modern/ChartsAxis/index.js +2 -2
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +6 -4
- package/modern/ChartsAxisHighlight/index.js +1 -1
- package/modern/ChartsClipPath/ChartsClipPath.js +3 -1
- package/modern/ChartsClipPath/index.js +1 -1
- package/modern/ChartsGrid/ChartsGrid.js +20 -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 +70 -26
- package/modern/ChartsLegend/ChartsLegendItem.js +65 -0
- package/modern/ChartsLegend/ContinuousColorLegend.js +9 -7
- package/modern/ChartsLegend/DefaultChartsLegend.js +31 -5
- package/modern/ChartsLegend/LegendPerItem.js +22 -35
- package/modern/ChartsLegend/PiecewiseColorLegend.js +31 -15
- package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
- package/modern/ChartsLegend/index.js +6 -6
- package/modern/ChartsLegend/useAxis.js +4 -2
- package/modern/ChartsLegend/utils.js +4 -4
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +7 -5
- package/modern/ChartsOnAxisClickHandler/index.js +1 -1
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +3 -1
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +3 -1
- package/modern/ChartsOverlay/ChartsOverlay.js +5 -3
- package/modern/ChartsOverlay/index.js +3 -3
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +4 -2
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +7 -5
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +7 -5
- package/modern/ChartsReferenceLine/common.js +1 -1
- package/modern/ChartsReferenceLine/index.js +2 -2
- package/modern/ChartsSurface/ChartsSurface.js +3 -1
- package/modern/ChartsSurface/index.js +1 -1
- package/modern/ChartsText/ChartsText.js +3 -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 +15 -11
- package/modern/ChartsTooltip/ChartsTooltipTable.js +10 -5
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +7 -5
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +5 -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 +9 -7
- package/modern/ChartsVoronoiHandler/index.js +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +20 -13
- package/modern/ChartsXAxis/index.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +17 -10
- package/modern/ChartsYAxis/index.js +1 -1
- package/modern/Gauge/Gauge.js +7 -5
- package/modern/Gauge/GaugeContainer.js +6 -4
- package/modern/Gauge/GaugeProvider.js +3 -3
- package/modern/Gauge/GaugeReferenceArc.js +3 -1
- package/modern/Gauge/GaugeValueArc.js +3 -1
- package/modern/Gauge/GaugeValueText.js +4 -2
- package/modern/Gauge/index.js +7 -7
- package/modern/LineChart/AnimatedArea.js +33 -14
- package/modern/LineChart/AnimatedLine.js +34 -15
- package/modern/LineChart/AreaElement.js +5 -3
- package/modern/LineChart/AreaPlot.js +85 -78
- package/modern/LineChart/CircleMarkElement.js +107 -0
- package/modern/LineChart/LineChart.js +33 -15
- package/modern/LineChart/LineElement.js +5 -3
- package/modern/LineChart/LineHighlightElement.js +2 -0
- package/modern/LineChart/LineHighlightPlot.js +10 -8
- package/modern/LineChart/LinePlot.js +67 -60
- package/modern/LineChart/MarkElement.js +7 -23
- package/modern/LineChart/MarkPlot.js +22 -12
- package/modern/LineChart/formatter.js +2 -2
- package/modern/LineChart/index.js +12 -11
- package/modern/LineChart/legend.js +4 -3
- package/modern/LineChart/markElementClasses.js +19 -0
- package/modern/LineChart/plugin.js +3 -3
- package/modern/LineChart/useLineChartProps.js +8 -4
- package/modern/PieChart/PieArc.js +3 -1
- package/modern/PieChart/PieArcLabel.js +2 -0
- package/modern/PieChart/PieArcLabelPlot.js +6 -4
- package/modern/PieChart/PieArcPlot.js +6 -4
- package/modern/PieChart/PieChart.js +22 -8
- package/modern/PieChart/PiePlot.js +8 -6
- package/modern/PieChart/dataTransform/useTransformData.js +3 -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 +4 -2
- package/modern/PieChart/plugin.js +2 -2
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +5 -3
- package/modern/ResponsiveChartContainer/index.js +1 -1
- package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +3 -1
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +3 -1
- package/modern/ScatterChart/Scatter.js +7 -5
- package/modern/ScatterChart/ScatterChart.js +26 -12
- package/modern/ScatterChart/ScatterPlot.js +7 -5
- package/modern/ScatterChart/formatter.js +1 -1
- package/modern/ScatterChart/index.js +3 -3
- package/modern/ScatterChart/legend.js +4 -3
- package/modern/ScatterChart/plugin.js +3 -3
- package/modern/ScatterChart/useScatterChartProps.js +2 -0
- package/modern/SparkLineChart/SparkLineChart.js +8 -6
- package/modern/SparkLineChart/index.js +1 -1
- package/modern/colorPalettes/index.js +1 -1
- package/modern/context/CartesianProvider/CartesianProvider.js +8 -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 +3 -1
- package/modern/context/DrawingProvider.js +3 -1
- package/modern/context/HighlightedProvider/HighlightedProvider.js +6 -4
- package/modern/context/HighlightedProvider/index.js +4 -4
- package/modern/context/HighlightedProvider/useHighlighted.js +3 -1
- package/modern/context/HighlightedProvider/useItemHighlighted.js +3 -1
- package/modern/context/InteractionProvider.js +2 -0
- package/modern/context/PluginProvider/PluginProvider.js +4 -2
- package/modern/context/PluginProvider/index.js +10 -10
- package/modern/context/PluginProvider/mergePlugins.js +4 -4
- package/modern/context/PluginProvider/useColorProcessor.js +3 -1
- package/modern/context/PluginProvider/useSeriesFormatter.js +3 -1
- package/modern/context/PluginProvider/useXExtremumGetter.js +1 -1
- package/modern/context/PluginProvider/useYExtremumGetter.js +1 -1
- package/modern/context/SeriesProvider/SeriesProvider.js +6 -4
- package/modern/context/SeriesProvider/index.js +4 -4
- package/modern/context/SeriesProvider/processSeries.js +1 -1
- package/modern/context/ZAxisContextProvider.js +3 -1
- package/modern/context/index.js +2 -2
- package/modern/hooks/index.js +7 -7
- package/modern/hooks/useAxis.js +3 -1
- package/modern/hooks/useAxisEvents.js +8 -6
- package/modern/hooks/useChartDimensions.js +3 -1
- package/modern/hooks/useChartId.js +3 -1
- package/modern/hooks/useColorScale.js +4 -2
- package/modern/hooks/useDrawingArea.js +3 -1
- package/modern/hooks/useInteractionItemProps.js +4 -2
- package/modern/hooks/useMounted.js +2 -0
- package/modern/hooks/useReducedMotion.js +15 -12
- package/modern/hooks/useScale.js +4 -2
- package/modern/hooks/useSeries.js +3 -1
- package/modern/hooks/useSvgRef.js +3 -1
- package/modern/hooks/useTicks.js +4 -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/{internals/useAnimatedPath.js → modern/internals/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 +16 -4
- package/node/BarChart/BarClipPath.js +2 -3
- package/node/BarChart/BarElement.js +3 -3
- package/node/BarChart/BarLabel/BarLabel.js +3 -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 +3 -3
- package/node/BarChart/formatter.js +1 -1
- package/node/BarChart/legend.js +3 -2
- package/node/BarChart/plugin.js +1 -1
- package/node/BarChart/useBarChartProps.js +2 -1
- package/node/ChartContainer/ChartContainer.js +3 -3
- package/node/ChartContainer/useChartContainerProps.js +3 -3
- package/node/ChartContainer/useDefaultizeAxis.js +3 -3
- package/node/ChartsAxis/ChartsAxis.js +3 -3
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +3 -3
- package/node/ChartsClipPath/ChartsClipPath.js +3 -3
- package/node/ChartsGrid/ChartsGrid.js +18 -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 +66 -24
- package/node/ChartsLegend/ChartsLegendItem.js +72 -0
- package/node/ChartsLegend/ContinuousColorLegend.js +3 -3
- package/node/ChartsLegend/DefaultChartsLegend.js +31 -7
- package/node/ChartsLegend/LegendPerItem.js +20 -35
- package/node/ChartsLegend/PiecewiseColorLegend.js +29 -15
- package/node/ChartsLegend/chartsLegendClasses.js +1 -1
- package/node/ChartsLegend/legendItemsPlacement.js +1 -1
- package/node/ChartsLegend/useAxis.js +2 -2
- package/node/ChartsLegend/utils.js +1 -1
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +4 -4
- package/node/ChartsOverlay/ChartsLoadingOverlay.js +3 -3
- package/node/ChartsOverlay/ChartsNoDataOverlay.js +3 -3
- package/node/ChartsOverlay/ChartsOverlay.js +3 -3
- package/node/ChartsReferenceLine/ChartsReferenceLine.js +3 -3
- package/node/ChartsReferenceLine/ChartsXReferenceLine.js +4 -4
- package/node/ChartsReferenceLine/ChartsYReferenceLine.js +4 -4
- package/node/ChartsReferenceLine/chartsReferenceLineClasses.js +1 -1
- package/node/ChartsReferenceLine/common.js +1 -1
- package/node/ChartsSurface/ChartsSurface.js +3 -3
- package/node/ChartsText/ChartsText.js +3 -3
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +2 -3
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +2 -3
- package/node/ChartsTooltip/ChartsTooltip.js +11 -9
- package/node/ChartsTooltip/ChartsTooltipTable.js +9 -4
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +4 -4
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +4 -4
- package/node/ChartsTooltip/chartsTooltipClasses.js +1 -1
- package/node/ChartsTooltip/utils.js +2 -3
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/node/ChartsXAxis/ChartsXAxis.js +9 -4
- package/node/ChartsYAxis/ChartsYAxis.js +9 -4
- package/node/Gauge/Gauge.js +3 -3
- package/node/Gauge/GaugeContainer.js +3 -3
- package/node/Gauge/GaugeProvider.js +1 -2
- package/node/Gauge/GaugeReferenceArc.js +3 -3
- package/node/Gauge/GaugeValueArc.js +3 -3
- package/node/Gauge/GaugeValueText.js +3 -3
- package/node/Gauge/gaugeClasses.js +1 -1
- package/node/LineChart/AnimatedArea.js +31 -14
- package/node/LineChart/AnimatedLine.js +31 -14
- package/node/LineChart/AreaElement.js +3 -3
- package/node/LineChart/AreaPlot.js +79 -74
- package/node/LineChart/CircleMarkElement.js +113 -0
- package/node/LineChart/LineChart.js +20 -4
- package/node/LineChart/LineElement.js +3 -3
- package/node/LineChart/LineHighlightElement.js +3 -3
- package/node/LineChart/LineHighlightPlot.js +3 -3
- package/node/LineChart/LinePlot.js +61 -56
- package/node/LineChart/MarkElement.js +5 -25
- package/node/LineChart/MarkPlot.js +14 -6
- package/node/LineChart/formatter.js +1 -1
- package/node/LineChart/index.js +29 -1
- package/node/LineChart/legend.js +3 -2
- package/node/LineChart/markElementClasses.js +28 -0
- package/node/LineChart/plugin.js +1 -1
- package/node/LineChart/useLineChartProps.js +7 -4
- package/node/PieChart/PieArc.js +3 -3
- package/node/PieChart/PieArcLabel.js +3 -3
- package/node/PieChart/PieArcLabelPlot.js +3 -3
- package/node/PieChart/PieArcPlot.js +3 -3
- package/node/PieChart/PieChart.js +15 -3
- package/node/PieChart/PiePlot.js +3 -3
- package/node/PieChart/dataTransform/useTransformData.js +3 -3
- package/node/PieChart/formatter.js +1 -1
- package/node/PieChart/legend.js +3 -1
- package/node/PieChart/plugin.js +1 -1
- package/node/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -3
- package/node/ResponsiveChartContainer/useChartContainerDimensions.js +4 -4
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +2 -1
- package/node/ScatterChart/Scatter.js +3 -3
- package/node/ScatterChart/ScatterChart.js +16 -4
- package/node/ScatterChart/ScatterPlot.js +3 -3
- package/node/ScatterChart/legend.js +3 -2
- package/node/ScatterChart/plugin.js +1 -1
- package/node/ScatterChart/useScatterChartProps.js +2 -1
- package/node/SparkLineChart/SparkLineChart.js +3 -3
- package/node/context/CartesianProvider/CartesianContext.js +1 -2
- package/node/context/CartesianProvider/CartesianProvider.js +2 -2
- package/node/context/CartesianProvider/computeValue.js +1 -1
- package/node/context/CartesianProvider/defaultizeAxis.js +1 -1
- package/node/context/CartesianProvider/useCartesianContext.js +2 -2
- package/node/context/DrawingProvider.js +3 -3
- package/node/context/HighlightedProvider/HighlightedContext.js +1 -2
- package/node/context/HighlightedProvider/HighlightedProvider.js +3 -3
- package/node/context/HighlightedProvider/useHighlighted.js +2 -2
- package/node/context/HighlightedProvider/useItemHighlighted.js +1 -0
- package/node/context/InteractionProvider.js +3 -3
- package/node/context/PluginProvider/PluginContext.js +1 -2
- package/node/context/PluginProvider/PluginProvider.js +2 -2
- package/node/context/PluginProvider/useColorProcessor.js +2 -2
- package/node/context/PluginProvider/useSeriesFormatter.js +2 -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 +2 -2
- package/node/context/SeriesProvider/processSeries.js +1 -1
- package/node/context/ZAxisContextProvider.js +3 -3
- package/node/hooks/useAxis.js +1 -0
- package/node/hooks/useAxisEvents.js +2 -2
- package/node/hooks/useChartDimensions.js +3 -3
- package/node/hooks/useChartId.js +2 -2
- package/node/hooks/useColorScale.js +2 -2
- package/node/hooks/useDrawingArea.js +2 -2
- package/node/hooks/useInteractionItemProps.js +2 -2
- package/node/hooks/useMounted.js +3 -3
- package/node/hooks/useReducedMotion.js +15 -12
- package/node/hooks/useScale.js +1 -0
- package/node/hooks/useSeries.js +2 -2
- package/node/hooks/useSvgRef.js +2 -2
- package/node/hooks/useTicks.js +2 -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/internals/warning.d.ts +0 -2
- package/internals/warning.js +0 -21
- package/modern/internals/warning.js +0 -21
- package/node/internals/useAnimatedPath.js +0 -42
- package/node/internals/warning.js +0 -28
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DrawingArea } from '../context/DrawingProvider';
|
|
3
|
-
import { DefaultizedProps } from '../models/helpers';
|
|
4
3
|
import { ChartsTextStyle } from '../ChartsText';
|
|
5
4
|
import { CardinalDirections } from '../models/layout';
|
|
6
|
-
import type { ChartsLegendProps } from './ChartsLegend';
|
|
7
5
|
import { LegendItemParams } from './chartsLegend.types';
|
|
8
|
-
import { AnchorPosition, Direction } from './legend.types';
|
|
6
|
+
import { AnchorPosition, Direction, LegendPlacement } from './legend.types';
|
|
7
|
+
import { ChartsLegendClasses } from './chartsLegendClasses';
|
|
8
|
+
import { DefaultizedProps } from '../models/helpers';
|
|
9
9
|
export type ChartsLegendRootOwnerState = {
|
|
10
10
|
position: AnchorPosition;
|
|
11
11
|
direction: Direction;
|
|
@@ -15,12 +15,15 @@ export type ChartsLegendRootOwnerState = {
|
|
|
15
15
|
seriesNumber: number;
|
|
16
16
|
};
|
|
17
17
|
export declare const ChartsLegendRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.SVGProps<SVGGElement>, keyof React.SVGProps<SVGGElement>>, {}>;
|
|
18
|
-
export interface LegendPerItemProps extends DefaultizedProps<
|
|
18
|
+
export interface LegendPerItemProps extends DefaultizedProps<LegendPlacement, keyof LegendPlacement> {
|
|
19
19
|
/**
|
|
20
20
|
* The ordered array of item to display in the legend.
|
|
21
21
|
*/
|
|
22
22
|
itemsToDisplay: LegendItemParams[];
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Override or extend the styles applied to the component.
|
|
25
|
+
*/
|
|
26
|
+
classes?: Partial<ChartsLegendClasses>;
|
|
24
27
|
/**
|
|
25
28
|
* Style applied to legend labels.
|
|
26
29
|
* @default theme.typography.subtitle1
|
|
@@ -52,10 +55,11 @@ export interface LegendPerItemProps extends DefaultizedProps<Omit<ChartsLegendPr
|
|
|
52
55
|
* @default 10
|
|
53
56
|
*/
|
|
54
57
|
padding?: number | Partial<CardinalDirections<number>>;
|
|
58
|
+
onItemClick?: (event: React.MouseEvent<SVGRectElement, MouseEvent>, index: number) => void;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* Internal component to display an array of items as a legend.
|
|
58
62
|
* Used for series legend, and threshold color legend.
|
|
59
63
|
* @ignore - Do not document
|
|
60
64
|
*/
|
|
61
|
-
export declare function LegendPerItem(props: LegendPerItemProps): React.JSX.Element
|
|
65
|
+
export declare function LegendPerItem(props: LegendPerItemProps): React.JSX.Element;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
5
|
const _excluded = ["rotate", "dominantBaseline"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import NoSsr from '@mui/material/NoSsr';
|
|
6
8
|
import { useTheme, styled } from '@mui/material/styles';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { jsx as _jsx
|
|
9
|
+
import { getWordsByLines } from "../internals/getWordsByLines.js";
|
|
10
|
+
import { legendItemPlacements } from "./legendItemsPlacement.js";
|
|
11
|
+
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
12
|
+
import { ChartsLegendItem } from "./ChartsLegendItem.js";
|
|
13
|
+
import { createElement as _createElement } from "react";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
15
|
export const ChartsLegendRoot = styled('g', {
|
|
14
16
|
name: 'MuiChartsLegend',
|
|
15
17
|
slot: 'Root',
|
|
@@ -42,7 +44,6 @@ const getStandardizedPadding = padding => {
|
|
|
42
44
|
*/
|
|
43
45
|
export function LegendPerItem(props) {
|
|
44
46
|
const {
|
|
45
|
-
hidden,
|
|
46
47
|
position,
|
|
47
48
|
direction,
|
|
48
49
|
itemsToDisplay,
|
|
@@ -52,10 +53,10 @@ export function LegendPerItem(props) {
|
|
|
52
53
|
markGap = 5,
|
|
53
54
|
itemGap = 10,
|
|
54
55
|
padding: paddingProps = 10,
|
|
55
|
-
labelStyle: inLabelStyle
|
|
56
|
+
labelStyle: inLabelStyle,
|
|
57
|
+
onItemClick
|
|
56
58
|
} = props;
|
|
57
59
|
const theme = useTheme();
|
|
58
|
-
const isRtl = useRtl();
|
|
59
60
|
const drawingArea = useDrawingArea();
|
|
60
61
|
const labelStyle = React.useMemo(() => _extends({}, theme.typography.subtitle1, {
|
|
61
62
|
color: 'inherit',
|
|
@@ -108,35 +109,21 @@ export function LegendPerItem(props) {
|
|
|
108
109
|
return (totalHeight - legendHeight) / 2;
|
|
109
110
|
}
|
|
110
111
|
}, [position.vertical, padding.top, padding.bottom, totalHeight, legendHeight]);
|
|
111
|
-
if (hidden) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
112
|
return /*#__PURE__*/_jsx(NoSsr, {
|
|
115
113
|
children: /*#__PURE__*/_jsx(ChartsLegendRoot, {
|
|
116
114
|
className: classes?.root,
|
|
117
|
-
children: itemsWithPosition.map(({
|
|
118
|
-
id,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
y: -itemMarkHeight / 2,
|
|
130
|
-
width: itemMarkWidth,
|
|
131
|
-
height: itemMarkHeight,
|
|
132
|
-
fill: color
|
|
133
|
-
}), /*#__PURE__*/_jsx(ChartsText, {
|
|
134
|
-
style: labelStyle,
|
|
135
|
-
text: label,
|
|
136
|
-
x: (isRtl ? -1 : 1) * (itemMarkWidth + markGap),
|
|
137
|
-
y: 0
|
|
138
|
-
})]
|
|
139
|
-
}, id))
|
|
115
|
+
children: itemsWithPosition.map((item, i) => /*#__PURE__*/_createElement(ChartsLegendItem, _extends({}, item, {
|
|
116
|
+
key: item.id,
|
|
117
|
+
gapX: gapX,
|
|
118
|
+
gapY: gapY,
|
|
119
|
+
legendWidth: legendWidth,
|
|
120
|
+
itemMarkHeight: itemMarkHeight,
|
|
121
|
+
itemMarkWidth: itemMarkWidth,
|
|
122
|
+
markGap: markGap,
|
|
123
|
+
labelStyle: labelStyle,
|
|
124
|
+
classes: classes,
|
|
125
|
+
onClick: onItemClick ? e => onItemClick(e, i) : undefined
|
|
126
|
+
})))
|
|
140
127
|
})
|
|
141
128
|
});
|
|
142
129
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ColorLegendSelector, PiecewiseLabelFormatterParams } from './legend.types';
|
|
3
3
|
import { LegendPerItemProps } from './LegendPerItem';
|
|
4
|
-
|
|
4
|
+
import { PiecewiseColorLegendItemContext } from './chartsLegend.types';
|
|
5
|
+
export interface PiecewiseColorLegendProps extends ColorLegendSelector, Omit<LegendPerItemProps, 'itemsToDisplay' | 'onItemClick'> {
|
|
5
6
|
/**
|
|
6
7
|
* Hide the first item of the legend, corresponding to the [-infinity, min] piece.
|
|
7
8
|
* @default false
|
|
@@ -18,6 +19,13 @@ export interface PiecewiseColorLegendProps extends ColorLegendSelector, Omit<Leg
|
|
|
18
19
|
* @returns {string|null} The displayed label, or `null` to skip the item.
|
|
19
20
|
*/
|
|
20
21
|
labelFormatter?: (params: PiecewiseLabelFormatterParams) => string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Callback fired when a legend item is clicked.
|
|
24
|
+
* @param {React.MouseEvent<SVGRectElement, MouseEvent>} event The click event.
|
|
25
|
+
* @param {PiecewiseColorLegendItemContext} legendItem The legend item data.
|
|
26
|
+
* @param {number} index The index of the clicked legend item.
|
|
27
|
+
*/
|
|
28
|
+
onItemClick?: (event: React.MouseEvent<SVGRectElement, MouseEvent>, legendItem: PiecewiseColorLegendItemContext, index: number) => void;
|
|
21
29
|
}
|
|
22
30
|
declare function PiecewiseColorLegend(props: PiecewiseColorLegendProps): React.JSX.Element | null;
|
|
23
31
|
declare namespace PiecewiseColorLegend {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["axisDirection", "axisId", "hideFirst", "hideLast", "labelFormatter"];
|
|
5
|
+
const _excluded = ["axisDirection", "axisId", "hideFirst", "hideLast", "labelFormatter", "onItemClick"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { useAxis } from
|
|
7
|
-
import { LegendPerItem } from
|
|
8
|
-
import { notNull } from
|
|
8
|
+
import { useAxis } from "./useAxis.js";
|
|
9
|
+
import { LegendPerItem } from "./LegendPerItem.js";
|
|
10
|
+
import { notNull } from "../internals/notNull.js";
|
|
9
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
12
|
function defaultLabelFormatter(params) {
|
|
11
13
|
if (params.min === null) {
|
|
@@ -16,13 +18,21 @@ function defaultLabelFormatter(params) {
|
|
|
16
18
|
}
|
|
17
19
|
return `${params.formattedMin}-${params.formattedMax}`;
|
|
18
20
|
}
|
|
21
|
+
const piecewiseColorContextBuilder = context => ({
|
|
22
|
+
type: 'piecewiseColor',
|
|
23
|
+
color: context.color,
|
|
24
|
+
label: context.label,
|
|
25
|
+
maxValue: context.maxValue,
|
|
26
|
+
minValue: context.minValue
|
|
27
|
+
});
|
|
19
28
|
function PiecewiseColorLegend(props) {
|
|
20
29
|
const {
|
|
21
30
|
axisDirection,
|
|
22
31
|
axisId,
|
|
23
32
|
hideFirst,
|
|
24
33
|
hideLast,
|
|
25
|
-
labelFormatter = defaultLabelFormatter
|
|
34
|
+
labelFormatter = defaultLabelFormatter,
|
|
35
|
+
onItemClick
|
|
26
36
|
} = props,
|
|
27
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
28
38
|
const axisItem = useAxis({
|
|
@@ -43,30 +53,34 @@ function PiecewiseColorLegend(props) {
|
|
|
43
53
|
if (hideFirst && isFirst || hideLast && isLast) {
|
|
44
54
|
return null;
|
|
45
55
|
}
|
|
46
|
-
const
|
|
56
|
+
const data = _extends({}, isFirst ? {
|
|
47
57
|
min: null,
|
|
48
58
|
formattedMin: null
|
|
49
59
|
} : {
|
|
50
60
|
min: colorMap.thresholds[index - 1],
|
|
51
61
|
formattedMin: formattedLabels[index - 1]
|
|
52
|
-
},
|
|
62
|
+
}, isLast ? {
|
|
53
63
|
max: null,
|
|
54
64
|
formattedMax: null
|
|
55
65
|
} : {
|
|
56
66
|
max: colorMap.thresholds[index],
|
|
57
67
|
formattedMax: formattedLabels[index]
|
|
58
|
-
})
|
|
68
|
+
});
|
|
69
|
+
const label = labelFormatter(data);
|
|
59
70
|
if (label === null) {
|
|
60
71
|
return null;
|
|
61
72
|
}
|
|
62
73
|
return {
|
|
63
74
|
id: label,
|
|
64
75
|
color,
|
|
65
|
-
label
|
|
76
|
+
label,
|
|
77
|
+
minValue: data.min,
|
|
78
|
+
maxValue: data.max
|
|
66
79
|
};
|
|
67
80
|
}).filter(notNull);
|
|
68
81
|
return /*#__PURE__*/_jsx(LegendPerItem, _extends({}, other, {
|
|
69
|
-
itemsToDisplay: itemsToDisplay
|
|
82
|
+
itemsToDisplay: itemsToDisplay,
|
|
83
|
+
onItemClick: onItemClick ? (e, i) => onItemClick(e, piecewiseColorContextBuilder(itemsToDisplay[i]), i) : undefined
|
|
70
84
|
}));
|
|
71
85
|
}
|
|
72
86
|
process.env.NODE_ENV !== "production" ? PiecewiseColorLegend.propTypes = {
|
|
@@ -93,11 +107,6 @@ process.env.NODE_ENV !== "production" ? PiecewiseColorLegend.propTypes = {
|
|
|
93
107
|
* The default depends on the chart.
|
|
94
108
|
*/
|
|
95
109
|
direction: PropTypes.oneOf(['column', 'row']).isRequired,
|
|
96
|
-
/**
|
|
97
|
-
* Set to true to hide the legend.
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
hidden: PropTypes.bool,
|
|
101
110
|
/**
|
|
102
111
|
* Hide the first item of the legend, corresponding to the [-infinity, min] piece.
|
|
103
112
|
* @default false
|
|
@@ -139,6 +148,13 @@ process.env.NODE_ENV !== "production" ? PiecewiseColorLegend.propTypes = {
|
|
|
139
148
|
* @default 5
|
|
140
149
|
*/
|
|
141
150
|
markGap: PropTypes.number,
|
|
151
|
+
/**
|
|
152
|
+
* Callback fired when a legend item is clicked.
|
|
153
|
+
* @param {React.MouseEvent<SVGRectElement, MouseEvent>} event The click event.
|
|
154
|
+
* @param {PiecewiseColorLegendItemContext} legendItem The legend item data.
|
|
155
|
+
* @param {number} index The index of the clicked legend item.
|
|
156
|
+
*/
|
|
157
|
+
onItemClick: PropTypes.func,
|
|
142
158
|
/**
|
|
143
159
|
* Legend padding (in px).
|
|
144
160
|
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ChartsTextStyle } from '../ChartsText';
|
|
2
|
-
|
|
2
|
+
import { PieItemId } from '../models';
|
|
3
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
4
|
+
interface LegendItemContextBase {
|
|
3
5
|
/**
|
|
4
6
|
* The color used in the legend
|
|
5
7
|
*/
|
|
@@ -8,12 +10,47 @@ export interface LegendItemParams {
|
|
|
8
10
|
* The label displayed in the legend
|
|
9
11
|
*/
|
|
10
12
|
label: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LegendItemParams extends Partial<Omit<SeriesLegendItemContext, 'type' | keyof LegendItemContextBase>>, Partial<Omit<PiecewiseColorLegendItemContext, 'type' | keyof LegendItemContextBase>>, LegendItemContextBase {
|
|
11
15
|
/**
|
|
12
16
|
* The identifier of the legend element.
|
|
13
17
|
* Used for internal purpose such as `key` props
|
|
14
18
|
*/
|
|
15
19
|
id: number | string;
|
|
16
20
|
}
|
|
21
|
+
export interface SeriesLegendItemContext extends LegendItemContextBase {
|
|
22
|
+
/**
|
|
23
|
+
* The type of the legend item
|
|
24
|
+
* - `series` is used for series legend item
|
|
25
|
+
* - `piecewiseColor` is used for piecewise color legend item
|
|
26
|
+
*/
|
|
27
|
+
type: 'series';
|
|
28
|
+
/**
|
|
29
|
+
* The identifier of the series
|
|
30
|
+
*/
|
|
31
|
+
seriesId: SeriesId;
|
|
32
|
+
/**
|
|
33
|
+
* The identifier of the pie item
|
|
34
|
+
*/
|
|
35
|
+
itemId?: PieItemId;
|
|
36
|
+
}
|
|
37
|
+
export interface PiecewiseColorLegendItemContext extends LegendItemContextBase {
|
|
38
|
+
/**
|
|
39
|
+
* The type of the legend item
|
|
40
|
+
* - `series` is used for series legend item
|
|
41
|
+
* - `piecewiseColor` is used for piecewise color legend item
|
|
42
|
+
*/
|
|
43
|
+
type: 'piecewiseColor';
|
|
44
|
+
/**
|
|
45
|
+
* The minimum value of the category
|
|
46
|
+
*/
|
|
47
|
+
minValue: number | Date | null;
|
|
48
|
+
/**
|
|
49
|
+
* The maximum value of the category
|
|
50
|
+
*/
|
|
51
|
+
maxValue: number | Date | null;
|
|
52
|
+
}
|
|
53
|
+
export type LegendItemContext = SeriesLegendItemContext | PiecewiseColorLegendItemContext;
|
|
17
54
|
export interface LegendItemWithPosition extends LegendItemParams {
|
|
18
55
|
positionX: number;
|
|
19
56
|
positionY: number;
|
|
@@ -29,3 +66,4 @@ export type GetItemSpaceType = (label: string, inStyle?: ChartsTextStyle) => {
|
|
|
29
66
|
outerWidth: number;
|
|
30
67
|
outerHeight: number;
|
|
31
68
|
};
|
|
69
|
+
export {};
|
|
@@ -3,6 +3,8 @@ export interface ChartsLegendClasses {
|
|
|
3
3
|
root: string;
|
|
4
4
|
/** Styles applied to a series element. */
|
|
5
5
|
series: string;
|
|
6
|
+
/** Styles applied to the item background. */
|
|
7
|
+
itemBackground: string;
|
|
6
8
|
/** Styles applied to series mark element. */
|
|
7
9
|
mark: string;
|
|
8
10
|
/** Styles applied to the series label. */
|
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generat
|
|
|
2
2
|
export function getLegendUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiChartsLegend', slot);
|
|
4
4
|
}
|
|
5
|
-
export const legendClasses = generateUtilityClasses('MuiChartsLegend', ['root', 'series', 'mark', 'label', 'column', 'row']);
|
|
5
|
+
export const legendClasses = generateUtilityClasses('MuiChartsLegend', ['root', 'series', 'itemBackground', 'mark', 'label', 'column', 'row']);
|
package/ChartsLegend/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./ChartsLegend.js";
|
|
2
|
+
export * from "./DefaultChartsLegend.js";
|
|
3
|
+
export * from "./ContinuousColorLegend.js";
|
|
4
|
+
export * from "./PiecewiseColorLegend.js";
|
|
5
|
+
export * from "./chartsLegendClasses.js";
|
|
6
|
+
export * from "./utils.js";
|
package/ChartsLegend/useAxis.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { ZAxisContext } from
|
|
3
|
-
import { useCartesianContext } from
|
|
4
|
+
import { ZAxisContext } from "../context/ZAxisContextProvider.js";
|
|
5
|
+
import { useCartesianContext } from "../context/CartesianProvider/useCartesianContext.js";
|
|
4
6
|
/**
|
|
5
7
|
* Helper to select an axis definition according to its direction and id.
|
|
6
8
|
*/
|
package/ChartsLegend/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import getBarLegend from
|
|
2
|
-
import getScatterLegend from
|
|
3
|
-
import getLineLegend from
|
|
4
|
-
import getPieLegend from
|
|
1
|
+
import getBarLegend from "../BarChart/legend.js";
|
|
2
|
+
import getScatterLegend from "../ScatterChart/legend.js";
|
|
3
|
+
import getLineLegend from "../LineChart/legend.js";
|
|
4
|
+
import getPieLegend from "../PieChart/legend.js";
|
|
5
5
|
const legendGetter = {
|
|
6
6
|
bar: getBarLegend,
|
|
7
7
|
scatter: getScatterLegend,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { InteractionContext } from
|
|
4
|
-
import { useSeries } from
|
|
5
|
-
import { useSvgRef } from
|
|
6
|
-
import { useCartesianContext } from
|
|
5
|
+
import { InteractionContext } from "../context/InteractionProvider.js";
|
|
6
|
+
import { useSeries } from "../hooks/useSeries.js";
|
|
7
|
+
import { useSvgRef } from "../hooks/index.js";
|
|
8
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
function ChartsOnAxisClickHandler(props) {
|
|
9
11
|
const {
|
|
@@ -27,7 +29,7 @@ function ChartsOnAxisClickHandler(props) {
|
|
|
27
29
|
}
|
|
28
30
|
const handleMouseClick = event => {
|
|
29
31
|
event.preventDefault();
|
|
30
|
-
const isXaxis =
|
|
32
|
+
const isXaxis = axis.x && axis.x.index !== -1;
|
|
31
33
|
const USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
|
|
32
34
|
const dataIndex = isXaxis ? axis.x && axis.x.index : axis.y && axis.y.index;
|
|
33
35
|
if (dataIndex == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./ChartsOnAxisClickHandler.js";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
5
|
const _excluded = ["message"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import { styled } from '@mui/material/styles';
|
|
6
|
-
import { useDrawingArea } from
|
|
8
|
+
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
const StyledText = styled('text')(({
|
|
9
11
|
theme
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
5
|
const _excluded = ["message"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import { styled } from '@mui/material/styles';
|
|
6
|
-
import { useDrawingArea } from
|
|
8
|
+
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
const StyledText = styled('text')(({
|
|
9
11
|
theme
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import * as React from 'react';
|
|
3
|
-
import { ChartsLoadingOverlay } from
|
|
4
|
-
import { useSeries } from
|
|
5
|
-
import { ChartsNoDataOverlay } from
|
|
5
|
+
import { ChartsLoadingOverlay } from "./ChartsLoadingOverlay.js";
|
|
6
|
+
import { useSeries } from "../hooks/useSeries.js";
|
|
7
|
+
import { ChartsNoDataOverlay } from "./ChartsNoDataOverlay.js";
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
9
|
export function useNoData() {
|
|
8
10
|
const seriesPerType = useSeries();
|
package/ChartsOverlay/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ChartsOverlay } from
|
|
2
|
-
export { ChartsLoadingOverlay } from
|
|
3
|
-
export { ChartsNoDataOverlay } from
|
|
1
|
+
export { ChartsOverlay } from "./ChartsOverlay.js";
|
|
2
|
+
export { ChartsLoadingOverlay } from "./ChartsLoadingOverlay.js";
|
|
3
|
+
export { ChartsNoDataOverlay } from "./ChartsNoDataOverlay.js";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { ChartsXReferenceLine } from
|
|
5
|
-
import { ChartsYReferenceLine } from
|
|
6
|
+
import { ChartsXReferenceLine } from "./ChartsXReferenceLine.js";
|
|
7
|
+
import { ChartsYReferenceLine } from "./ChartsYReferenceLine.js";
|
|
6
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
9
|
function ChartsReferenceLine(props) {
|
|
8
10
|
const {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
7
|
+
import { useDrawingArea, useXScale } from "../hooks/index.js";
|
|
8
|
+
import { ReferenceLineRoot } from "./common.js";
|
|
9
|
+
import { ChartsText } from "../ChartsText/index.js";
|
|
10
|
+
import { getReferenceLineUtilityClass } from "./chartsReferenceLineClasses.js";
|
|
9
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
const getTextParams = ({
|
|
11
13
|
top,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import * as React from 'react';
|
|
3
5
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
7
|
+
import { useDrawingArea, useYScale } from "../hooks/index.js";
|
|
8
|
+
import { ReferenceLineRoot } from "./common.js";
|
|
9
|
+
import { ChartsText } from "../ChartsText/index.js";
|
|
10
|
+
import { getReferenceLineUtilityClass } from "./chartsReferenceLineClasses.js";
|
|
9
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
const getTextParams = ({
|
|
11
13
|
left,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import { referenceLineClasses } from
|
|
3
|
+
import { referenceLineClasses } from "./chartsReferenceLineClasses.js";
|
|
4
4
|
export const ReferenceLineRoot = styled('g')(({
|
|
5
5
|
theme
|
|
6
6
|
}) => ({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./ChartsReferenceLine.js";
|
|
2
|
+
export * from "./chartsReferenceLineClasses.js";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className", "title", "desc"];
|
|
4
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
5
7
|
import PropTypes from 'prop-types';
|
|
6
8
|
import * as React from 'react';
|
|
7
|
-
import { useAxisEvents } from
|
|
9
|
+
import { useAxisEvents } from "../hooks/useAxisEvents.js";
|
|
8
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
11
|
const ChartChartsSurfaceStyles = styled('svg', {
|
|
10
12
|
name: 'MuiChartsSurface',
|
package/ChartsSurface/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./ChartsSurface.js";
|
package/ChartsText/ChartsText.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
5
|
const _excluded = ["x", "y", "style", "text", "ownerState"],
|
|
4
6
|
_excluded2 = ["angle", "textAnchor", "dominantBaseline"];
|
|
5
7
|
import * as React from 'react';
|
|
6
8
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { getWordsByLines } from
|
|
9
|
+
import { getWordsByLines } from "../internals/getWordsByLines.js";
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
/**
|
|
10
12
|
* Helper component to manage multiline text in SVG
|
package/ChartsText/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ChartsText } from
|
|
1
|
+
export { ChartsText } from "./ChartsText.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
4
|
-
import { useCartesianContext } from
|
|
5
|
-
import { DefaultChartsAxisTooltipContent } from
|
|
6
|
-
import { ZAxisContext } from
|
|
7
|
-
import { useColorProcessor } from
|
|
8
|
-
import { isCartesianSeriesType } from
|
|
9
|
-
import { useSeries } from
|
|
4
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
5
|
+
import { DefaultChartsAxisTooltipContent } from "./DefaultChartsAxisTooltipContent.js";
|
|
6
|
+
import { ZAxisContext } from "../context/ZAxisContextProvider.js";
|
|
7
|
+
import { useColorProcessor } from "../context/PluginProvider/useColorProcessor.js";
|
|
8
|
+
import { isCartesianSeriesType } from "../internals/isCartesian.js";
|
|
9
|
+
import { useSeries } from "../hooks/useSeries.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
/**
|
|
12
12
|
* @ignore - internal component.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
4
|
-
import { DefaultChartsItemTooltipContent } from
|
|
5
|
-
import { useCartesianContext } from
|
|
6
|
-
import { ZAxisContext } from
|
|
7
|
-
import { useColorProcessor } from
|
|
8
|
-
import { useSeries } from
|
|
4
|
+
import { DefaultChartsItemTooltipContent } from "./DefaultChartsItemTooltipContent.js";
|
|
5
|
+
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
6
|
+
import { ZAxisContext } from "../context/ZAxisContextProvider.js";
|
|
7
|
+
import { useColorProcessor } from "../context/PluginProvider/useColorProcessor.js";
|
|
8
|
+
import { useSeries } from "../hooks/useSeries.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
/**
|
|
11
11
|
* @ignore - internal component.
|