@mui/x-charts 8.0.0-alpha.7 → 8.0.0-alpha.9
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.d.ts +1 -1
- package/BarChart/BarChart.js +10 -2
- package/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/BarChart/BarPlot.js +8 -9
- package/BarChart/extremums.d.ts +3 -3
- package/BarChart/formatter.d.ts +2 -2
- package/BarChart/formatter.js +2 -1
- package/BarChart/getColor.d.ts +1 -1
- package/BarChart/legend.d.ts +1 -1
- package/BarChart/legend.js +1 -1
- package/BarChart/plugin.d.ts +2 -2
- package/BarChart/plugin.js +3 -2
- package/BarChart/useBarChartProps.d.ts +1 -1
- package/CHANGELOG.md +551 -3
- package/ChartContainer/ChartContainer.d.ts +8 -4
- package/ChartContainer/ChartContainer.js +15 -9
- package/ChartContainer/useChartContainerProps.d.ts +6 -4
- package/ChartContainer/useChartContainerProps.js +7 -5
- package/ChartDataProvider/ChartDataProvider.d.ts +42 -0
- package/ChartDataProvider/ChartDataProvider.js +108 -0
- package/ChartDataProvider/package.json +6 -0
- package/ChartDataProvider/useChartDataProviderProps.d.ts +13 -0
- package/ChartDataProvider/useChartDataProviderProps.js +52 -0
- package/ChartsAxis/ChartsAxis.js +5 -3
- package/ChartsGrid/ChartsGrid.js +9 -5
- package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +4 -3
- package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +4 -3
- package/ChartsLabel/ChartsLabelGradient.js +11 -12
- package/ChartsLegend/ContinuousColorLegend.js +3 -3
- package/ChartsLegend/useAxis.js +7 -5
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +7 -6
- package/ChartsSurface/ChartsSurface.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.js +17 -27
- package/ChartsTooltip/ChartsAxisTooltipContent.js +6 -3
- package/ChartsTooltip/ChartsItemTooltipContent.js +6 -3
- package/ChartsTooltip/ChartsTooltipTable.d.ts +0 -6
- package/ChartsTooltip/ChartsTooltipTable.js +0 -20
- package/ChartsTooltip/useAxisTooltip.d.ts +3 -1
- package/ChartsTooltip/useAxisTooltip.js +13 -9
- package/ChartsTooltip/useItemTooltip.d.ts +3 -1
- package/ChartsTooltip/useItemTooltip.js +14 -10
- package/ChartsTooltip/utils.js +2 -0
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +16 -9
- package/ChartsXAxis/ChartsXAxis.js +11 -8
- package/ChartsYAxis/ChartsYAxis.js +8 -5
- package/Gauge/Gauge.js +5 -1
- package/Gauge/GaugeContainer.d.ts +3 -10
- package/Gauge/GaugeContainer.js +38 -38
- package/Gauge/GaugeProvider.js +2 -0
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AppearingMask.js +1 -1
- package/LineChart/AreaPlot.js +59 -25
- package/LineChart/CircleMarkElement.d.ts +0 -4
- package/LineChart/CircleMarkElement.js +2 -7
- package/LineChart/LineChart.d.ts +0 -4
- package/LineChart/LineChart.js +10 -6
- package/LineChart/LineHighlightElement.d.ts +5 -1
- package/LineChart/LineHighlightElement.js +29 -9
- package/LineChart/LineHighlightPlot.js +18 -13
- package/LineChart/LinePlot.js +59 -24
- package/LineChart/MarkPlot.d.ts +0 -6
- package/LineChart/MarkPlot.js +20 -23
- package/LineChart/extremums.d.ts +3 -3
- package/LineChart/formatter.d.ts +2 -2
- package/LineChart/formatter.js +3 -1
- package/LineChart/getColor.d.ts +1 -1
- package/LineChart/legend.d.ts +1 -1
- package/LineChart/legend.js +1 -1
- package/LineChart/plugin.d.ts +2 -2
- package/LineChart/plugin.js +3 -2
- package/LineChart/useLineChartProps.d.ts +1 -1
- package/LineChart/useLineChartProps.js +3 -5
- package/PieChart/PieArcLabelPlot.js +2 -2
- package/PieChart/PieArcPlot.js +2 -2
- package/PieChart/PieChart.js +10 -2
- package/PieChart/dataTransform/transition.d.ts +2 -2
- package/PieChart/dataTransform/transition.js +6 -6
- package/PieChart/formatter.d.ts +2 -2
- package/PieChart/formatter.js +4 -1
- package/PieChart/getColor.d.ts +1 -1
- package/PieChart/getPieCoordinates.d.ts +2 -2
- package/PieChart/legend.d.ts +1 -1
- package/PieChart/legend.js +1 -1
- package/PieChart/plugin.d.ts +2 -2
- package/PieChart/plugin.js +3 -2
- package/ScatterChart/Scatter.js +6 -4
- package/ScatterChart/ScatterChart.d.ts +1 -2
- package/ScatterChart/ScatterChart.js +17 -13
- package/ScatterChart/ScatterPlot.js +11 -10
- package/ScatterChart/extremums.d.ts +3 -3
- package/ScatterChart/extremums.js +3 -1
- package/ScatterChart/formatter.d.ts +2 -2
- package/ScatterChart/formatter.js +3 -1
- package/ScatterChart/getColor.d.ts +1 -1
- package/ScatterChart/legend.d.ts +1 -1
- package/ScatterChart/legend.js +1 -1
- package/ScatterChart/plugin.d.ts +2 -2
- package/ScatterChart/plugin.js +3 -2
- package/ScatterChart/useScatterChartProps.d.ts +1 -3
- package/ScatterChart/useScatterChartProps.js +1 -4
- package/SparkLineChart/SparkLineChart.d.ts +2 -2
- package/SparkLineChart/SparkLineChart.js +11 -2
- package/context/AnimationProvider/AnimationProvider.js +1 -1
- package/context/ChartProvider/ChartProvider.d.ts +5 -1
- package/context/ChartProvider/ChartProvider.js +22 -2
- package/context/ChartProvider/ChartProvider.types.d.ts +17 -2
- package/context/InteractionSelectors.d.ts +22 -22
- package/context/PolarProvider/PolarProvider.d.ts +0 -4
- package/context/PolarProvider/PolarProvider.js +59 -47
- package/context/PolarProvider/getAxisExtremum.d.ts +0 -4
- package/context/PolarProvider/getAxisExtremum.js +48 -20
- package/context/PolarProvider/usePolarContext.d.ts +0 -2
- package/context/PolarProvider/usePolarContext.js +9 -8
- package/context/index.d.ts +0 -4
- package/context/index.js +1 -3
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +3 -1
- package/hooks/useAxis.d.ts +9 -1
- package/hooks/useAxis.js +32 -6
- package/hooks/useAxisEvents.js +12 -8
- package/hooks/useChartGradientId.d.ts +31 -0
- package/hooks/useChartGradientId.js +47 -0
- package/hooks/useColorScale.js +5 -5
- package/hooks/useDrawingArea.d.ts +16 -2
- package/hooks/useDrawingArea.js +5 -20
- package/hooks/useLegend.js +8 -13
- package/hooks/useSeries.d.ts +11 -6
- package/hooks/useSeries.js +5 -10
- package/hooks/useZAxis.d.ts +3 -2
- package/hooks/useZAxis.js +25 -6
- package/index.d.ts +1 -0
- package/index.js +3 -2
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +0 -3
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +19 -27
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/internals/defaultizeColor.d.ts +24 -22
- package/internals/index.d.ts +14 -10
- package/internals/index.js +17 -11
- package/internals/plugins/allPlugins.d.ts +12 -1
- package/internals/plugins/allPlugins.js +5 -2
- package/internals/plugins/corePlugins/corePlugins.d.ts +1 -1
- package/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/internals/plugins/corePlugins/useChartDimensions/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartDimensions/index.js +2 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +175 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +264 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +25 -0
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +99 -0
- package/internals/plugins/corePlugins/useChartId/index.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartId/index.js +2 -1
- package/internals/plugins/corePlugins/useChartId/useChartId.js +1 -1
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartSeries/index.js +2 -0
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +18 -0
- package/{modern/context/SeriesProvider → internals/plugins/corePlugins/useChartSeries}/processSeries.js +9 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +72 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +61 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +4 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +51 -0
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.d.ts +10 -0
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +29 -0
- package/internals/{computeAxisValue.js → plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js} +19 -27
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +61 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +39 -0
- package/{modern/context/ChartDataProvider/useDefaultizeAxis.js → internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +3 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +22 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +68 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts +1336 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +75 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +11 -11
- package/internals/plugins/featurePlugins/useChartZAxis/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartZAxis/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +86 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +45 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +3 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +39 -0
- package/internals/plugins/featurePlugins/useChartZAxis/utils.d.ts +0 -0
- package/internals/plugins/featurePlugins/useChartZAxis/utils.js +0 -0
- package/internals/plugins/models/index.d.ts +1 -0
- package/internals/plugins/models/index.js +2 -1
- package/internals/plugins/models/plugin.d.ts +32 -2
- package/internals/plugins/models/seriesConfig/colorProcessor.types.d.ts +5 -0
- package/internals/plugins/models/seriesConfig/extremumGetter.types.d.ts +22 -0
- package/internals/plugins/models/seriesConfig/index.d.ts +4 -0
- package/internals/plugins/models/seriesConfig/index.js +4 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +15 -0
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +18 -0
- package/internals/store/extractPluginParamsFromProps.d.ts +7 -0
- package/internals/store/extractPluginParamsFromProps.js +28 -0
- package/internals/store/useChartModels.d.ts +7 -0
- package/internals/store/useChartModels.js +64 -0
- package/internals/store/useCharts.d.ts +4 -2
- package/internals/store/useCharts.js +14 -9
- package/internals/store/useCharts.types.d.ts +1 -1
- package/internals/store/useStore.d.ts +5 -1
- package/internals/store/useStore.js +1 -9
- package/models/layout.d.ts +2 -1
- package/models/seriesType/line.d.ts +11 -0
- package/modern/BarChart/BarChart.js +10 -2
- package/modern/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/modern/BarChart/BarPlot.js +8 -9
- package/modern/BarChart/formatter.js +2 -1
- package/modern/BarChart/legend.js +1 -1
- package/modern/BarChart/plugin.js +3 -2
- package/modern/ChartContainer/ChartContainer.js +15 -9
- package/modern/ChartContainer/useChartContainerProps.js +7 -5
- package/modern/ChartDataProvider/ChartDataProvider.js +108 -0
- package/modern/ChartDataProvider/useChartDataProviderProps.js +52 -0
- package/modern/ChartsAxis/ChartsAxis.js +5 -3
- package/modern/ChartsGrid/ChartsGrid.js +9 -5
- package/modern/ChartsGrid/ChartsHorizontalGrid.js +4 -3
- package/modern/ChartsGrid/ChartsVerticalGrid.js +4 -3
- package/modern/ChartsLabel/ChartsLabelGradient.js +11 -12
- package/modern/ChartsLegend/ContinuousColorLegend.js +3 -3
- package/modern/ChartsLegend/useAxis.js +7 -5
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +7 -6
- package/modern/ChartsSurface/ChartsSurface.js +17 -27
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +6 -3
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +6 -3
- package/modern/ChartsTooltip/ChartsTooltipTable.js +0 -20
- package/modern/ChartsTooltip/useAxisTooltip.js +13 -9
- package/modern/ChartsTooltip/useItemTooltip.js +14 -10
- package/modern/ChartsTooltip/utils.js +2 -0
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +16 -9
- package/modern/ChartsXAxis/ChartsXAxis.js +11 -8
- package/modern/ChartsYAxis/ChartsYAxis.js +8 -5
- package/modern/Gauge/Gauge.js +5 -1
- package/modern/Gauge/GaugeContainer.js +38 -38
- package/modern/Gauge/GaugeProvider.js +2 -0
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AppearingMask.js +1 -1
- package/modern/LineChart/AreaPlot.js +59 -25
- package/modern/LineChart/CircleMarkElement.js +2 -7
- package/modern/LineChart/LineChart.js +10 -6
- package/modern/LineChart/LineHighlightElement.js +29 -9
- package/modern/LineChart/LineHighlightPlot.js +18 -13
- package/modern/LineChart/LinePlot.js +59 -24
- package/modern/LineChart/MarkPlot.js +20 -23
- package/modern/LineChart/formatter.js +3 -1
- package/modern/LineChart/legend.js +1 -1
- package/modern/LineChart/plugin.js +3 -2
- package/modern/LineChart/useLineChartProps.js +3 -5
- package/modern/PieChart/PieArcLabelPlot.js +2 -2
- package/modern/PieChart/PieArcPlot.js +2 -2
- package/modern/PieChart/PieChart.js +10 -2
- package/modern/PieChart/dataTransform/transition.js +6 -6
- package/modern/PieChart/formatter.js +4 -1
- package/modern/PieChart/legend.js +1 -1
- package/modern/PieChart/plugin.js +3 -2
- package/modern/ScatterChart/Scatter.js +6 -4
- package/modern/ScatterChart/ScatterChart.js +17 -13
- package/modern/ScatterChart/ScatterPlot.js +11 -10
- package/modern/ScatterChart/extremums.js +3 -1
- package/modern/ScatterChart/formatter.js +3 -1
- package/modern/ScatterChart/legend.js +1 -1
- package/modern/ScatterChart/plugin.js +3 -2
- package/modern/ScatterChart/useScatterChartProps.js +1 -4
- package/modern/SparkLineChart/SparkLineChart.js +11 -2
- package/modern/context/AnimationProvider/AnimationProvider.js +1 -1
- package/modern/context/ChartProvider/ChartProvider.js +22 -2
- package/modern/context/PolarProvider/PolarProvider.js +59 -47
- package/modern/context/PolarProvider/getAxisExtremum.js +48 -20
- package/modern/context/PolarProvider/usePolarContext.js +9 -8
- package/modern/context/index.js +1 -3
- package/modern/hooks/index.js +3 -1
- package/modern/hooks/useAxis.js +32 -6
- package/modern/hooks/useAxisEvents.js +12 -8
- package/modern/hooks/useChartGradientId.js +47 -0
- package/modern/hooks/useColorScale.js +5 -5
- package/modern/hooks/useDrawingArea.js +5 -20
- package/modern/hooks/useLegend.js +8 -13
- package/modern/hooks/useSeries.js +5 -10
- package/modern/hooks/useZAxis.js +25 -6
- package/modern/index.js +3 -2
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +19 -27
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/modern/internals/index.js +17 -11
- package/modern/internals/plugins/allPlugins.js +5 -2
- package/modern/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/modern/internals/plugins/corePlugins/useChartDimensions/index.js +2 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +175 -0
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +25 -0
- package/modern/internals/plugins/corePlugins/useChartId/index.js +2 -1
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +1 -1
- package/modern/internals/plugins/corePlugins/useChartSeries/index.js +2 -0
- package/{context/SeriesProvider → modern/internals/plugins/corePlugins/useChartSeries}/processSeries.js +9 -6
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +72 -0
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +4 -0
- package/modern/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +21 -0
- package/modern/internals/{computeAxisValue.js → plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js} +19 -27
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +61 -0
- package/{context/ChartDataProvider/useDefaultizeAxis.js → modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +3 -11
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +22 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +5 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +68 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +89 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +86 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +3 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/utils.js +0 -0
- package/modern/internals/plugins/models/index.js +2 -1
- package/modern/internals/plugins/models/seriesConfig/index.js +4 -0
- package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/seriesProcessor.types.js +1 -0
- package/modern/internals/store/extractPluginParamsFromProps.js +28 -0
- package/modern/internals/store/useChartModels.js +64 -0
- package/modern/internals/store/useCharts.js +14 -9
- package/modern/internals/store/useStore.js +1 -9
- package/node/BarChart/BarChart.js +11 -3
- package/node/BarChart/BarLabel/BarLabelPlot.js +1 -1
- package/node/BarChart/BarPlot.js +6 -6
- package/node/BarChart/formatter.js +2 -1
- package/node/BarChart/legend.js +1 -1
- package/node/BarChart/plugin.js +3 -2
- package/node/ChartContainer/ChartContainer.js +15 -9
- package/node/ChartContainer/useChartContainerProps.js +7 -5
- package/node/ChartDataProvider/ChartDataProvider.js +114 -0
- package/node/ChartDataProvider/useChartDataProviderProps.js +59 -0
- package/node/ChartsAxis/ChartsAxis.js +5 -3
- package/node/ChartsGrid/ChartsGrid.js +9 -5
- package/node/ChartsGrid/ChartsHorizontalGrid.js +4 -3
- package/node/ChartsGrid/ChartsVerticalGrid.js +4 -3
- package/node/ChartsLabel/ChartsLabelGradient.js +11 -12
- package/node/ChartsLegend/ContinuousColorLegend.js +3 -3
- package/node/ChartsLegend/useAxis.js +6 -4
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +6 -5
- package/node/ChartsSurface/ChartsSurface.js +18 -28
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +5 -2
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +5 -2
- package/node/ChartsTooltip/ChartsTooltipTable.js +1 -21
- package/node/ChartsTooltip/useAxisTooltip.js +11 -7
- package/node/ChartsTooltip/useItemTooltip.js +13 -9
- package/node/ChartsTooltip/utils.js +1 -0
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +19 -12
- package/node/ChartsXAxis/ChartsXAxis.js +11 -8
- package/node/ChartsYAxis/ChartsYAxis.js +8 -5
- package/node/Gauge/Gauge.js +5 -1
- package/node/Gauge/GaugeContainer.js +38 -38
- package/node/Gauge/GaugeProvider.js +2 -2
- package/node/LineChart/AnimatedArea.js +1 -1
- package/node/LineChart/AnimatedLine.js +1 -1
- package/node/LineChart/AppearingMask.js +1 -1
- package/node/LineChart/AreaPlot.js +59 -25
- package/node/LineChart/CircleMarkElement.js +2 -7
- package/node/LineChart/LineChart.js +11 -7
- package/node/LineChart/LineHighlightElement.js +29 -9
- package/node/LineChart/LineHighlightPlot.js +18 -13
- package/node/LineChart/LinePlot.js +59 -24
- package/node/LineChart/MarkPlot.js +20 -23
- package/node/LineChart/formatter.js +3 -1
- package/node/LineChart/legend.js +1 -1
- package/node/LineChart/plugin.js +3 -2
- package/node/LineChart/useLineChartProps.js +3 -5
- package/node/PieChart/PieArcLabelPlot.js +1 -1
- package/node/PieChart/PieArcPlot.js +1 -1
- package/node/PieChart/PieChart.js +11 -3
- package/node/PieChart/dataTransform/transition.js +9 -7
- package/node/PieChart/formatter.js +4 -1
- package/node/PieChart/legend.js +1 -1
- package/node/PieChart/plugin.js +3 -2
- package/node/ScatterChart/Scatter.js +6 -4
- package/node/ScatterChart/ScatterChart.js +18 -14
- package/node/ScatterChart/ScatterPlot.js +10 -9
- package/node/ScatterChart/extremums.js +3 -1
- package/node/ScatterChart/formatter.js +3 -1
- package/node/ScatterChart/legend.js +1 -1
- package/node/ScatterChart/plugin.js +3 -2
- package/node/ScatterChart/useScatterChartProps.js +1 -4
- package/node/SparkLineChart/SparkLineChart.js +10 -1
- package/node/context/AnimationProvider/AnimationProvider.js +1 -1
- package/node/context/ChartProvider/ChartProvider.js +23 -2
- package/node/context/PolarProvider/PolarProvider.js +59 -51
- package/node/context/PolarProvider/getAxisExtremum.js +49 -27
- package/node/context/PolarProvider/usePolarContext.js +9 -14
- package/node/context/index.js +1 -20
- package/node/hooks/index.js +29 -2
- package/node/hooks/useAxis.js +34 -6
- package/node/hooks/useAxisEvents.js +12 -8
- package/node/hooks/useChartGradientId.js +56 -0
- package/node/hooks/useColorScale.js +4 -4
- package/node/hooks/useDrawingArea.js +5 -21
- package/node/hooks/useLegend.js +8 -14
- package/node/hooks/useSeries.js +5 -9
- package/node/hooks/useZAxis.js +27 -9
- package/node/index.js +12 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +17 -27
- package/node/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/node/internals/index.js +111 -63
- package/node/internals/plugins/allPlugins.js +4 -2
- package/node/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/node/internals/plugins/corePlugins/useChartDimensions/index.js +27 -0
- package/node/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +183 -0
- package/node/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +32 -0
- package/node/internals/plugins/corePlugins/useChartId/index.js +16 -1
- package/node/internals/plugins/corePlugins/useChartId/useChartId.js +1 -1
- package/node/internals/plugins/corePlugins/useChartSeries/index.js +27 -0
- package/node/{context/SeriesProvider → internals/plugins/corePlugins/useChartSeries}/processSeries.js +9 -6
- package/node/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +80 -0
- package/node/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +11 -0
- package/node/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +27 -0
- package/node/internals/{computeAxisValue.js → plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js} +19 -27
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +69 -0
- package/node/{context/ChartDataProvider/useDefaultizeAxis.js → internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js} +4 -13
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +29 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +59 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +76 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +98 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +94 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +9 -0
- package/node/internals/plugins/featurePlugins/useChartZAxis/utils.js +1 -0
- package/node/internals/plugins/models/index.js +11 -0
- package/node/internals/plugins/models/seriesConfig/index.js +49 -0
- package/node/internals/plugins/models/seriesConfig/seriesProcessor.types.js +5 -0
- package/node/internals/store/extractPluginParamsFromProps.js +36 -0
- package/node/internals/store/useChartModels.js +73 -0
- package/node/internals/store/useCharts.js +14 -9
- package/node/internals/store/useStore.js +1 -9
- package/package.json +3 -3
- package/context/CartesianProvider/Cartesian.types.d.ts +0 -59
- package/context/CartesianProvider/CartesianContext.d.ts +0 -4
- package/context/CartesianProvider/CartesianContext.js +0 -13
- package/context/CartesianProvider/CartesianProvider.d.ts +0 -4
- package/context/CartesianProvider/CartesianProvider.js +0 -49
- package/context/CartesianProvider/defaultizeAxis.d.ts +0 -38
- package/context/CartesianProvider/defaultizeAxis.js +0 -13
- package/context/CartesianProvider/getAxisExtremum.d.ts +0 -5
- package/context/CartesianProvider/getAxisExtremum.js +0 -21
- package/context/CartesianProvider/index.d.ts +0 -4
- package/context/CartesianProvider/index.js +0 -4
- package/context/CartesianProvider/useCartesianContext.d.ts +0 -2
- package/context/CartesianProvider/useCartesianContext.js +0 -10
- package/context/ChartDataProvider/ChartDataProvider.d.ts +0 -58
- package/context/ChartDataProvider/ChartDataProvider.js +0 -270
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +0 -90
- package/context/ChartDataProvider/useChartDataProviderProps.js +0 -66
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +0 -39
- package/context/DrawingAreaProvider/DrawingArea.types.d.ts +0 -51
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +0 -3
- package/context/DrawingAreaProvider/DrawingAreaContext.js +0 -15
- package/context/DrawingAreaProvider/DrawingAreaProvider.d.ts +0 -3
- package/context/DrawingAreaProvider/DrawingAreaProvider.js +0 -48
- package/context/DrawingAreaProvider/index.d.ts +0 -3
- package/context/DrawingAreaProvider/index.js +0 -3
- package/context/PluginProvider/ColorProcessor.types.d.ts +0 -8
- package/context/PluginProvider/ExtremumGetter.types.d.ts +0 -25
- package/context/PluginProvider/Plugin.types.d.ts +0 -29
- package/context/PluginProvider/PluginContext.d.ts +0 -4
- package/context/PluginProvider/PluginContext.js +0 -15
- package/context/PluginProvider/PluginProvider.d.ts +0 -4
- package/context/PluginProvider/PluginProvider.js +0 -21
- package/context/PluginProvider/SeriesFormatter.types.d.ts +0 -21
- package/context/PluginProvider/index.d.ts +0 -12
- package/context/PluginProvider/index.js +0 -12
- package/context/PluginProvider/mergePlugins.d.ts +0 -46
- package/context/PluginProvider/mergePlugins.js +0 -40
- package/context/PluginProvider/useColorProcessor.d.ts +0 -4
- package/context/PluginProvider/useColorProcessor.js +0 -17
- package/context/PluginProvider/useRadiusExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useRadiusExtremumGetter.js +0 -17
- package/context/PluginProvider/useRotationExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useRotationExtremumGetter.js +0 -17
- package/context/PluginProvider/useSeriesFormatter.d.ts +0 -4
- package/context/PluginProvider/useSeriesFormatter.js +0 -17
- package/context/PluginProvider/useXExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useXExtremumGetter.js +0 -15
- package/context/PluginProvider/useYExtremumGetter.d.ts +0 -4
- package/context/PluginProvider/useYExtremumGetter.js +0 -15
- package/context/SeriesProvider/Series.types.d.ts +0 -26
- package/context/SeriesProvider/SeriesContext.d.ts +0 -4
- package/context/SeriesProvider/SeriesContext.js +0 -8
- package/context/SeriesProvider/SeriesProvider.d.ts +0 -5
- package/context/SeriesProvider/SeriesProvider.js +0 -33
- package/context/SeriesProvider/index.d.ts +0 -12
- package/context/SeriesProvider/index.js +0 -8
- package/context/SeriesProvider/processSeries.d.ts +0 -18
- package/context/SizeProvider/Size.types.d.ts +0 -30
- package/context/SizeProvider/SizeContext.d.ts +0 -4
- package/context/SizeProvider/SizeContext.js +0 -15
- package/context/SizeProvider/SizeProvider.d.ts +0 -11
- package/context/SizeProvider/SizeProvider.js +0 -26
- package/context/SizeProvider/index.d.ts +0 -4
- package/context/SizeProvider/index.js +0 -4
- package/context/SizeProvider/useChartContainerDimensions.d.ts +0 -9
- package/context/SizeProvider/useChartContainerDimensions.js +0 -108
- package/context/SizeProvider/useSize.d.ts +0 -5
- package/context/SizeProvider/useSize.js +0 -13
- package/context/ZAxisContextProvider.d.ts +0 -33
- package/context/ZAxisContextProvider.js +0 -96
- package/internals/computeAxisValue.d.ts +0 -38
- package/modern/context/CartesianProvider/CartesianContext.js +0 -13
- package/modern/context/CartesianProvider/CartesianProvider.js +0 -49
- package/modern/context/CartesianProvider/defaultizeAxis.js +0 -13
- package/modern/context/CartesianProvider/getAxisExtremum.js +0 -21
- package/modern/context/CartesianProvider/index.js +0 -4
- package/modern/context/CartesianProvider/useCartesianContext.js +0 -10
- package/modern/context/ChartDataProvider/ChartDataProvider.js +0 -270
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +0 -66
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +0 -15
- package/modern/context/DrawingAreaProvider/DrawingAreaProvider.js +0 -48
- package/modern/context/DrawingAreaProvider/index.js +0 -3
- package/modern/context/PluginProvider/PluginContext.js +0 -15
- package/modern/context/PluginProvider/PluginProvider.js +0 -21
- package/modern/context/PluginProvider/index.js +0 -12
- package/modern/context/PluginProvider/mergePlugins.js +0 -40
- package/modern/context/PluginProvider/useColorProcessor.js +0 -17
- package/modern/context/PluginProvider/useRadiusExtremumGetter.js +0 -17
- package/modern/context/PluginProvider/useRotationExtremumGetter.js +0 -17
- package/modern/context/PluginProvider/useSeriesFormatter.js +0 -17
- package/modern/context/PluginProvider/useXExtremumGetter.js +0 -15
- package/modern/context/PluginProvider/useYExtremumGetter.js +0 -15
- package/modern/context/SeriesProvider/SeriesContext.js +0 -8
- package/modern/context/SeriesProvider/SeriesProvider.js +0 -33
- package/modern/context/SeriesProvider/index.js +0 -8
- package/modern/context/SizeProvider/SizeContext.js +0 -15
- package/modern/context/SizeProvider/SizeProvider.js +0 -26
- package/modern/context/SizeProvider/index.js +0 -4
- package/modern/context/SizeProvider/useChartContainerDimensions.js +0 -108
- package/modern/context/SizeProvider/useSize.js +0 -13
- package/modern/context/ZAxisContextProvider.js +0 -96
- package/node/context/CartesianProvider/CartesianContext.js +0 -20
- package/node/context/CartesianProvider/CartesianProvider.js +0 -54
- package/node/context/CartesianProvider/defaultizeAxis.js +0 -21
- package/node/context/CartesianProvider/getAxisExtremum.js +0 -28
- package/node/context/CartesianProvider/index.js +0 -49
- package/node/context/CartesianProvider/useCartesianContext.js +0 -17
- package/node/context/ChartDataProvider/ChartDataProvider.js +0 -276
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +0 -72
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +0 -21
- package/node/context/DrawingAreaProvider/DrawingAreaProvider.js +0 -55
- package/node/context/DrawingAreaProvider/index.js +0 -38
- package/node/context/PluginProvider/PluginContext.js +0 -22
- package/node/context/PluginProvider/PluginProvider.js +0 -26
- package/node/context/PluginProvider/index.js +0 -137
- package/node/context/PluginProvider/mergePlugins.js +0 -47
- package/node/context/PluginProvider/useColorProcessor.js +0 -23
- package/node/context/PluginProvider/useRadiusExtremumGetter.js +0 -23
- package/node/context/PluginProvider/useRotationExtremumGetter.js +0 -23
- package/node/context/PluginProvider/useSeriesFormatter.js +0 -23
- package/node/context/PluginProvider/useXExtremumGetter.js +0 -22
- package/node/context/PluginProvider/useYExtremumGetter.js +0 -22
- package/node/context/SeriesProvider/SeriesContext.js +0 -15
- package/node/context/SeriesProvider/SeriesProvider.js +0 -38
- package/node/context/SeriesProvider/index.js +0 -49
- package/node/context/SizeProvider/SizeContext.js +0 -22
- package/node/context/SizeProvider/SizeProvider.js +0 -29
- package/node/context/SizeProvider/index.js +0 -49
- package/node/context/SizeProvider/useChartContainerDimensions.js +0 -116
- package/node/context/SizeProvider/useSize.js +0 -20
- package/node/context/ZAxisContextProvider.js +0 -103
- /package/{context/ChartDataProvider → ChartDataProvider}/index.d.ts +0 -0
- /package/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/{context/CartesianProvider/Cartesian.types.js → internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js} +0 -0
- /package/{context/DrawingAreaProvider/DrawingArea.types.js → internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js} +0 -0
- /package/{context/PluginProvider/ColorProcessor.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js} +0 -0
- /package/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.d.ts +0 -0
- /package/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/{context/PluginProvider/ExtremumGetter.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js} +0 -0
- /package/{context/PluginProvider/Plugin.types.js → internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.js} +0 -0
- /package/{context/PluginProvider/SeriesFormatter.types.js → internals/plugins/models/seriesConfig/colorProcessor.types.js} +0 -0
- /package/{context/SeriesProvider/Series.types.js → internals/plugins/models/seriesConfig/extremumGetter.types.js} +0 -0
- /package/{context/SizeProvider/Size.types.js → internals/plugins/models/seriesConfig/seriesConfig.types.js} +0 -0
- /package/{modern/context/CartesianProvider/Cartesian.types.js → internals/plugins/models/seriesConfig/seriesProcessor.types.js} +0 -0
- /package/modern/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/modern/{context/DrawingAreaProvider/DrawingArea.types.js → internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js} +0 -0
- /package/modern/{context/PluginProvider/ColorProcessor.types.js → internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js} +0 -0
- /package/modern/{context/PluginProvider/ExtremumGetter.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js} +0 -0
- /package/modern/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/modern/{context/PluginProvider/Plugin.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js} +0 -0
- /package/modern/{context/PluginProvider/SeriesFormatter.types.js → internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.js} +0 -0
- /package/modern/{context/SeriesProvider/Series.types.js → internals/plugins/models/seriesConfig/colorProcessor.types.js} +0 -0
- /package/modern/{context/SizeProvider/Size.types.js → internals/plugins/models/seriesConfig/extremumGetter.types.js} +0 -0
- /package/node/{context/ChartDataProvider → ChartDataProvider}/index.js +0 -0
- /package/node/{context/CartesianProvider/Cartesian.types.js → internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js} +0 -0
- /package/node/{context/DrawingAreaProvider/DrawingArea.types.js → internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js} +0 -0
- /package/node/{context/PluginProvider/ColorProcessor.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.js} +0 -0
- /package/node/{context/CartesianProvider → internals/plugins/featurePlugins/useChartCartesianAxis}/zoom.js +0 -0
- /package/node/{context/PluginProvider/ExtremumGetter.types.js → internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.js} +0 -0
- /package/node/{context/PluginProvider/Plugin.types.js → internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.js} +0 -0
- /package/node/{context/PluginProvider/SeriesFormatter.types.js → internals/plugins/models/seriesConfig/colorProcessor.types.js} +0 -0
- /package/node/{context/SeriesProvider/Series.types.js → internals/plugins/models/seriesConfig/extremumGetter.types.js} +0 -0
- /package/node/{context/SizeProvider/Size.types.js → internals/plugins/models/seriesConfig/seriesConfig.types.js} +0 -0
|
@@ -15,7 +15,6 @@ var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
16
|
var _styles = require("@mui/material/styles");
|
|
17
17
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
18
|
-
var _CartesianProvider = require("../context/CartesianProvider");
|
|
19
18
|
var _useTicks = require("../hooks/useTicks");
|
|
20
19
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
21
20
|
var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
|
|
@@ -23,6 +22,8 @@ var _ChartsText = require("../ChartsText");
|
|
|
23
22
|
var _axisClasses = require("../ChartsAxis/axisClasses");
|
|
24
23
|
var _isInfinity = require("../internals/isInfinity");
|
|
25
24
|
var _isBandScale = require("../internals/isBandScale");
|
|
25
|
+
var _ChartProvider = require("../context/ChartProvider");
|
|
26
|
+
var _hooks = require("../hooks");
|
|
26
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
28
|
const _excluded = ["scale", "tickNumber"];
|
|
28
29
|
const useUtilityClasses = ownerState => {
|
|
@@ -65,7 +66,7 @@ function ChartsYAxis(inProps) {
|
|
|
65
66
|
const {
|
|
66
67
|
yAxisIds,
|
|
67
68
|
yAxis
|
|
68
|
-
} = (0,
|
|
69
|
+
} = (0, _hooks.useYAxes)();
|
|
69
70
|
const _yAxis = yAxis[inProps.axisId ?? yAxisIds[0]],
|
|
70
71
|
{
|
|
71
72
|
scale: yScale,
|
|
@@ -99,12 +100,14 @@ function ChartsYAxis(inProps) {
|
|
|
99
100
|
const classes = useUtilityClasses((0, _extends2.default)({}, defaultizedProps, {
|
|
100
101
|
theme
|
|
101
102
|
}));
|
|
103
|
+
const {
|
|
104
|
+
instance
|
|
105
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
102
106
|
const {
|
|
103
107
|
left,
|
|
104
108
|
top,
|
|
105
109
|
width,
|
|
106
|
-
height
|
|
107
|
-
isPointInside
|
|
110
|
+
height
|
|
108
111
|
} = (0, _useDrawingArea.useDrawingArea)();
|
|
109
112
|
const tickSize = disableTicks ? 4 : tickSizeProp;
|
|
110
113
|
const yTicks = (0, _useTicks.useTicks)({
|
|
@@ -185,7 +188,7 @@ function ChartsYAxis(inProps) {
|
|
|
185
188
|
const xTickLabel = positionSign * (tickSize + 2);
|
|
186
189
|
const yTickLabel = labelOffset;
|
|
187
190
|
const skipLabel = typeof tickLabelInterval === 'function' && !tickLabelInterval?.(value, index);
|
|
188
|
-
const showLabel = isPointInside({
|
|
191
|
+
const showLabel = instance.isPointInside({
|
|
189
192
|
x: -1,
|
|
190
193
|
y: offset
|
|
191
194
|
}, {
|
package/node/Gauge/Gauge.js
CHANGED
|
@@ -95,6 +95,11 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
|
|
|
95
95
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
96
96
|
*/
|
|
97
97
|
height: _propTypes.default.number,
|
|
98
|
+
/**
|
|
99
|
+
* This prop is used to help implement the accessibility logic.
|
|
100
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
101
|
+
*/
|
|
102
|
+
id: _propTypes.default.string,
|
|
98
103
|
/**
|
|
99
104
|
* The radius between circle center and the beginning of the arc.
|
|
100
105
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -106,7 +111,6 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
|
|
|
106
111
|
* The margin between the SVG and the drawing area.
|
|
107
112
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
108
113
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
109
|
-
* @default object Depends on the charts type.
|
|
110
114
|
*/
|
|
111
115
|
margin: _propTypes.default.shape({
|
|
112
116
|
bottom: _propTypes.default.number,
|
|
@@ -13,9 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _ChartsSurface = require("../ChartsSurface");
|
|
16
|
-
var _DrawingAreaProvider = require("../context/DrawingAreaProvider");
|
|
17
16
|
var _GaugeProvider = require("./GaugeProvider");
|
|
18
|
-
var _SizeProvider = require("../context/SizeProvider");
|
|
19
17
|
var _ChartProvider = require("../context/ChartProvider");
|
|
20
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
19
|
const _excluded = ["width", "height", "margin", "title", "desc", "value", "valueMin", "valueMax", "startAngle", "endAngle", "outerRadius", "innerRadius", "cornerRadius", "cx", "cy", "children"];
|
|
@@ -47,44 +45,42 @@ const GaugeContainer = exports.GaugeContainer = /*#__PURE__*/React.forwardRef(fu
|
|
|
47
45
|
} = props,
|
|
48
46
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
49
47
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartProvider.ChartProvider, {
|
|
50
|
-
|
|
48
|
+
pluginParams: {
|
|
51
49
|
width: inWidth,
|
|
52
50
|
height: inHeight,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
})
|
|
85
|
-
}))
|
|
51
|
+
margin: (0, _extends2.default)({
|
|
52
|
+
left: 10,
|
|
53
|
+
right: 10,
|
|
54
|
+
top: 10,
|
|
55
|
+
bottom: 10
|
|
56
|
+
}, margin)
|
|
57
|
+
},
|
|
58
|
+
plugins: [],
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GaugeProvider.GaugeProvider, {
|
|
60
|
+
value: value,
|
|
61
|
+
valueMin: valueMin,
|
|
62
|
+
valueMax: valueMax,
|
|
63
|
+
startAngle: startAngle,
|
|
64
|
+
endAngle: endAngle,
|
|
65
|
+
outerRadius: outerRadius,
|
|
66
|
+
innerRadius: innerRadius,
|
|
67
|
+
cornerRadius: cornerRadius,
|
|
68
|
+
cx: cx,
|
|
69
|
+
cy: cy,
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({
|
|
71
|
+
title: title,
|
|
72
|
+
desc: desc,
|
|
73
|
+
role: "meter",
|
|
74
|
+
"aria-valuenow": value === null ? undefined : value,
|
|
75
|
+
"aria-valuemin": valueMin,
|
|
76
|
+
"aria-valuemax": valueMax
|
|
77
|
+
}, other, {
|
|
78
|
+
ref: ref,
|
|
79
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GStyled, {
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
children: children
|
|
86
82
|
})
|
|
87
|
-
})
|
|
83
|
+
}))
|
|
88
84
|
})
|
|
89
85
|
});
|
|
90
86
|
});
|
|
@@ -129,6 +125,11 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
|
|
|
129
125
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
130
126
|
*/
|
|
131
127
|
height: _propTypes.default.number,
|
|
128
|
+
/**
|
|
129
|
+
* This prop is used to help implement the accessibility logic.
|
|
130
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
131
|
+
*/
|
|
132
|
+
id: _propTypes.default.string,
|
|
132
133
|
/**
|
|
133
134
|
* The radius between circle center and the beginning of the arc.
|
|
134
135
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -140,7 +141,6 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
|
|
|
140
141
|
* The margin between the SVG and the drawing area.
|
|
141
142
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
142
143
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
143
|
-
* @default object Depends on the charts type.
|
|
144
144
|
*/
|
|
145
145
|
margin: _propTypes.default.shape({
|
|
146
146
|
bottom: _propTypes.default.number,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// @ignore - do not document.
|
|
3
|
+
'use client';
|
|
2
4
|
|
|
3
5
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
6
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -12,8 +14,6 @@ var _getPercentageValue = require("../internals/getPercentageValue");
|
|
|
12
14
|
var _utils = require("./utils");
|
|
13
15
|
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
14
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
// @ignore - do not document.
|
|
16
|
-
|
|
17
17
|
const GaugeContext = exports.GaugeContext = /*#__PURE__*/React.createContext({
|
|
18
18
|
value: null,
|
|
19
19
|
valueMin: 0,
|
|
@@ -35,7 +35,7 @@ function AnimatedArea(props) {
|
|
|
35
35
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
36
36
|
const stringInterpolator = (0, _useStringInterpolator.useStringInterpolator)(d);
|
|
37
37
|
const transitionChange = (0, _web.useTransition)([stringInterpolator], {
|
|
38
|
-
from: {
|
|
38
|
+
from: skipAnimation ? undefined : {
|
|
39
39
|
value: 0
|
|
40
40
|
},
|
|
41
41
|
to: {
|
|
@@ -35,7 +35,7 @@ function AnimatedLine(props) {
|
|
|
35
35
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
36
36
|
const stringInterpolator = (0, _useStringInterpolator.useStringInterpolator)(d);
|
|
37
37
|
const transitionChange = (0, _web.useTransition)([stringInterpolator], {
|
|
38
|
-
from: {
|
|
38
|
+
from: skipAnimation ? undefined : {
|
|
39
39
|
value: 0
|
|
40
40
|
},
|
|
41
41
|
to: {
|
|
@@ -18,7 +18,7 @@ function AppearingMask(props) {
|
|
|
18
18
|
const drawingArea = (0, _hooks.useDrawingArea)();
|
|
19
19
|
const chartId = (0, _hooks.useChartId)();
|
|
20
20
|
const transitionAppear = (0, _web.useTransition)([drawingArea], {
|
|
21
|
-
from: v => ({
|
|
21
|
+
from: props.skipAnimation ? undefined : v => ({
|
|
22
22
|
animatedWidth: v.left
|
|
23
23
|
}),
|
|
24
24
|
enter: v => ({
|
|
@@ -13,14 +13,15 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
16
|
-
var _CartesianProvider = require("../context/CartesianProvider");
|
|
17
16
|
var _AreaElement = require("./AreaElement");
|
|
18
17
|
var _useScale = require("../hooks/useScale");
|
|
19
18
|
var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
|
|
19
|
+
var _isBandScale = require("../internals/isBandScale");
|
|
20
20
|
var _constants = require("../constants");
|
|
21
|
-
var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
|
|
22
21
|
var _useSeries = require("../hooks/useSeries");
|
|
23
22
|
var _AnimationProvider = require("../context/AnimationProvider");
|
|
23
|
+
var _useChartGradientId = require("../hooks/useChartGradientId");
|
|
24
|
+
var _useAxis = require("../hooks/useAxis");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["slots", "slotProps", "onItemClick", "skipAnimation"];
|
|
26
27
|
const AreaPlotRoot = (0, _styles.styled)('g', {
|
|
@@ -34,7 +35,15 @@ const AreaPlotRoot = (0, _styles.styled)('g', {
|
|
|
34
35
|
});
|
|
35
36
|
const useAggregatedData = () => {
|
|
36
37
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
37
|
-
const
|
|
38
|
+
const {
|
|
39
|
+
xAxis,
|
|
40
|
+
xAxisIds
|
|
41
|
+
} = (0, _useAxis.useXAxes)();
|
|
42
|
+
const {
|
|
43
|
+
yAxis,
|
|
44
|
+
yAxisIds
|
|
45
|
+
} = (0, _useAxis.useYAxes)();
|
|
46
|
+
const getGradientId = (0, _useChartGradientId.useChartGradientIdBuilder)();
|
|
38
47
|
|
|
39
48
|
// This memo prevents odd line chart behavior when hydrating.
|
|
40
49
|
const allData = React.useMemo(() => {
|
|
@@ -45,12 +54,6 @@ const useAggregatedData = () => {
|
|
|
45
54
|
series,
|
|
46
55
|
stackingGroups
|
|
47
56
|
} = seriesData;
|
|
48
|
-
const {
|
|
49
|
-
xAxis,
|
|
50
|
-
yAxis,
|
|
51
|
-
xAxisIds,
|
|
52
|
-
yAxisIds
|
|
53
|
-
} = axisData;
|
|
54
57
|
const defaultXAxisId = xAxisIds[0];
|
|
55
58
|
const defaultYAxisId = yAxisIds[0];
|
|
56
59
|
return stackingGroups.flatMap(({
|
|
@@ -64,12 +67,15 @@ const useAggregatedData = () => {
|
|
|
64
67
|
stackedData,
|
|
65
68
|
data,
|
|
66
69
|
connectNulls,
|
|
67
|
-
baseline
|
|
70
|
+
baseline,
|
|
71
|
+
curve,
|
|
72
|
+
strictStepCurve
|
|
68
73
|
} = series[seriesId];
|
|
69
|
-
const xScale =
|
|
74
|
+
const xScale = xAxis[xAxisId].scale;
|
|
75
|
+
const xPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
70
76
|
const yScale = yAxis[yAxisId].scale;
|
|
71
77
|
const xData = xAxis[xAxisId].data;
|
|
72
|
-
const
|
|
78
|
+
const gradientId = yAxis[yAxisId].colorScale && getGradientId(yAxisId) || xAxis[xAxisId].colorScale && getGradientId(xAxisId) || undefined;
|
|
73
79
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
80
|
if (xData === undefined) {
|
|
75
81
|
throw new Error(`MUI X: ${xAxisId === _constants.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.`);
|
|
@@ -78,7 +84,42 @@ const useAggregatedData = () => {
|
|
|
78
84
|
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).`);
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
|
-
const
|
|
87
|
+
const shouldExpand = curve?.includes('step') && !strictStepCurve && (0, _isBandScale.isBandScale)(xScale);
|
|
88
|
+
const formattedData = xData?.flatMap((x, index) => {
|
|
89
|
+
const nullData = data[index] == null;
|
|
90
|
+
if (shouldExpand) {
|
|
91
|
+
const rep = [{
|
|
92
|
+
x,
|
|
93
|
+
y: stackedData[index],
|
|
94
|
+
nullData,
|
|
95
|
+
isExtension: false
|
|
96
|
+
}];
|
|
97
|
+
if (!nullData && (index === 0 || data[index - 1] == null)) {
|
|
98
|
+
rep.unshift({
|
|
99
|
+
x: (xScale(x) ?? 0) - (xScale.step() - xScale.bandwidth()) / 2,
|
|
100
|
+
y: stackedData[index],
|
|
101
|
+
nullData,
|
|
102
|
+
isExtension: true
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (!nullData && (index === data.length - 1 || data[index + 1] == null)) {
|
|
106
|
+
rep.push({
|
|
107
|
+
x: (xScale(x) ?? 0) + (xScale.step() + xScale.bandwidth()) / 2,
|
|
108
|
+
y: stackedData[index],
|
|
109
|
+
nullData,
|
|
110
|
+
isExtension: true
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return rep;
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
x,
|
|
117
|
+
y: stackedData[index],
|
|
118
|
+
nullData
|
|
119
|
+
};
|
|
120
|
+
}) ?? [];
|
|
121
|
+
const d3Data = connectNulls ? formattedData.filter(d => !d.nullData) : formattedData;
|
|
122
|
+
const areaPath = (0, _d3Shape.area)().x(d => d.isExtension ? d.x : xPosition(d.x)).defined(d => connectNulls || !d.nullData || !!d.isExtension).y0(d => {
|
|
82
123
|
if (typeof baseline === 'number') {
|
|
83
124
|
return yScale(baseline);
|
|
84
125
|
}
|
|
@@ -94,21 +135,15 @@ const useAggregatedData = () => {
|
|
|
94
135
|
}
|
|
95
136
|
return value;
|
|
96
137
|
}).y1(d => d.y && yScale(d.y[1]));
|
|
97
|
-
const
|
|
98
|
-
const formattedData = xData?.map((x, index) => ({
|
|
99
|
-
x,
|
|
100
|
-
y: stackedData[index]
|
|
101
|
-
})) ?? [];
|
|
102
|
-
const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
|
|
103
|
-
const d = areaPath.curve(curve)(d3Data) || '';
|
|
138
|
+
const d = areaPath.curve((0, _getCurve.default)(curve))(d3Data) || '';
|
|
104
139
|
return (0, _extends2.default)({}, series[seriesId], {
|
|
105
|
-
|
|
140
|
+
gradientId,
|
|
106
141
|
d,
|
|
107
142
|
seriesId
|
|
108
143
|
});
|
|
109
144
|
});
|
|
110
145
|
});
|
|
111
|
-
}, [seriesData,
|
|
146
|
+
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis, getGradientId]);
|
|
112
147
|
return allData;
|
|
113
148
|
};
|
|
114
149
|
|
|
@@ -132,7 +167,6 @@ function AreaPlot(props) {
|
|
|
132
167
|
} = props,
|
|
133
168
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
134
169
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(inSkipAnimation);
|
|
135
|
-
const getGradientId = (0, _ChartsAxesGradients.useChartGradient)();
|
|
136
170
|
const completedData = useAggregatedData();
|
|
137
171
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AreaPlotRoot, (0, _extends2.default)({}, other, {
|
|
138
172
|
children: completedData.map(({
|
|
@@ -140,12 +174,12 @@ function AreaPlot(props) {
|
|
|
140
174
|
seriesId,
|
|
141
175
|
color,
|
|
142
176
|
area,
|
|
143
|
-
|
|
177
|
+
gradientId
|
|
144
178
|
}) => !!area && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AreaElement.AreaElement, {
|
|
145
179
|
id: seriesId,
|
|
146
180
|
d: d,
|
|
147
181
|
color: color,
|
|
148
|
-
gradientId:
|
|
182
|
+
gradientId: gradientId,
|
|
149
183
|
slots: slots,
|
|
150
184
|
slotProps: slotProps,
|
|
151
185
|
onClick: onItemClick && (event => onItemClick(event, {
|
|
@@ -12,7 +12,6 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
|
-
var _warning = require("@mui/x-internals/warning");
|
|
16
15
|
var _web = require("@react-spring/web");
|
|
17
16
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
18
17
|
var _context = require("../context");
|
|
@@ -21,7 +20,7 @@ var _useSelector = require("../internals/store/useSelector");
|
|
|
21
20
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
22
21
|
var _useStore = require("../internals/store/useStore");
|
|
23
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation"
|
|
23
|
+
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation"];
|
|
25
24
|
/**
|
|
26
25
|
* The line mark element that only render circle for performance improvement.
|
|
27
26
|
*
|
|
@@ -43,13 +42,9 @@ function CircleMarkElement(props) {
|
|
|
43
42
|
color,
|
|
44
43
|
dataIndex,
|
|
45
44
|
onClick,
|
|
46
|
-
skipAnimation
|
|
47
|
-
shape
|
|
45
|
+
skipAnimation
|
|
48
46
|
} = props,
|
|
49
47
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
50
|
-
if (shape !== 'circle') {
|
|
51
|
-
(0, _warning.warnOnce)([`MUI X: The mark element of your line chart have shape "${shape}" which is not supported when using \`experimentalRendering=true\`.`, 'Only "circle" are supported with `experimentalRendering`.'].join('\n'), 'error');
|
|
52
|
-
}
|
|
53
48
|
const theme = (0, _styles.useTheme)();
|
|
54
49
|
const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)();
|
|
55
50
|
const {
|
|
@@ -25,7 +25,7 @@ var _ChartsOnAxisClickHandler = require("../ChartsOnAxisClickHandler");
|
|
|
25
25
|
var _ChartsOverlay = require("../ChartsOverlay");
|
|
26
26
|
var _useLineChartProps = require("./useLineChartProps");
|
|
27
27
|
var _useChartContainerProps = require("../ChartContainer/useChartContainerProps");
|
|
28
|
-
var
|
|
28
|
+
var _ChartDataProvider = require("../ChartDataProvider");
|
|
29
29
|
var _ChartsSurface = require("../ChartsSurface");
|
|
30
30
|
var _ChartsWrapper = require("../internals/components/ChartsWrapper");
|
|
31
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -66,7 +66,7 @@ const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function Lin
|
|
|
66
66
|
chartsSurfaceProps
|
|
67
67
|
} = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps, ref);
|
|
68
68
|
const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
69
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
70
70
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
71
71
|
children: [!props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
72
72
|
children: [props.onAxisClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOnAxisClickHandler.ChartsOnAxisClickHandler, (0, _extends2.default)({}, axisClickHandlerProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
@@ -84,6 +84,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
84
84
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
85
85
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
86
86
|
// ----------------------------------------------------------------------
|
|
87
|
+
apiRef: _propTypes.default.shape({
|
|
88
|
+
current: _propTypes.default.object
|
|
89
|
+
}),
|
|
87
90
|
/**
|
|
88
91
|
* The configuration of axes highlight.
|
|
89
92
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -121,10 +124,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
121
124
|
* If `true`, render the line highlight item.
|
|
122
125
|
*/
|
|
123
126
|
disableLineItemHighlight: _propTypes.default.bool,
|
|
124
|
-
/**
|
|
125
|
-
* If `true` marks will render `<circle />` instead of `<path />` and drop theme override for faster rendering.
|
|
126
|
-
*/
|
|
127
|
-
experimentalMarkRendering: _propTypes.default.bool,
|
|
128
127
|
/**
|
|
129
128
|
* Option to display a cartesian grid in the background.
|
|
130
129
|
*/
|
|
@@ -147,6 +146,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
147
146
|
dataIndex: _propTypes.default.number,
|
|
148
147
|
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
149
148
|
}),
|
|
149
|
+
/**
|
|
150
|
+
* This prop is used to help implement the accessibility logic.
|
|
151
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
152
|
+
*/
|
|
153
|
+
id: _propTypes.default.string,
|
|
150
154
|
/**
|
|
151
155
|
* Indicate which axis to display the left of the charts.
|
|
152
156
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -162,7 +166,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
162
166
|
* The margin between the SVG and the drawing area.
|
|
163
167
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
164
168
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
165
|
-
* @default object Depends on the charts type.
|
|
166
169
|
*/
|
|
167
170
|
margin: _propTypes.default.shape({
|
|
168
171
|
bottom: _propTypes.default.number,
|
|
@@ -222,6 +225,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
222
225
|
*/
|
|
223
226
|
slots: _propTypes.default.object,
|
|
224
227
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
228
|
+
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
225
229
|
title: _propTypes.default.string,
|
|
226
230
|
/**
|
|
227
231
|
* Indicate which axis to display the top of the charts.
|
|
@@ -13,12 +13,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
13
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
14
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
|
+
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
16
17
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
17
18
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
18
19
|
var _styles = require("@mui/material/styles");
|
|
19
20
|
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
21
|
+
var _getSymbol = require("../internals/getSymbol");
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["x", "y", "id", "classes", "color"];
|
|
23
|
+
const _excluded = ["x", "y", "id", "classes", "color", "shape"];
|
|
22
24
|
function getHighlightElementUtilityClass(slot) {
|
|
23
25
|
return (0, _generateUtilityClass.default)('MuiHighlightElement', slot);
|
|
24
26
|
}
|
|
@@ -33,7 +35,18 @@ const useUtilityClasses = ownerState => {
|
|
|
33
35
|
};
|
|
34
36
|
return (0, _composeClasses.default)(slots, getHighlightElementUtilityClass, classes);
|
|
35
37
|
};
|
|
36
|
-
const
|
|
38
|
+
const HighlightPathElement = (0, _styles.styled)('path', {
|
|
39
|
+
name: 'MuiHighlightElement',
|
|
40
|
+
slot: 'Root',
|
|
41
|
+
overridesResolver: (_, styles) => styles.root
|
|
42
|
+
})(({
|
|
43
|
+
ownerState
|
|
44
|
+
}) => ({
|
|
45
|
+
transform: `translate(${ownerState.x}px, ${ownerState.y}px)`,
|
|
46
|
+
transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
|
|
47
|
+
fill: ownerState.color
|
|
48
|
+
}));
|
|
49
|
+
const HighlightCircleElement = (0, _styles.styled)('circle', {
|
|
37
50
|
name: 'MuiHighlightElement',
|
|
38
51
|
slot: 'Root',
|
|
39
52
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -60,7 +73,8 @@ function LineHighlightElement(props) {
|
|
|
60
73
|
y,
|
|
61
74
|
id,
|
|
62
75
|
classes: innerClasses,
|
|
63
|
-
color
|
|
76
|
+
color,
|
|
77
|
+
shape
|
|
64
78
|
} = props,
|
|
65
79
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
66
80
|
const ownerState = {
|
|
@@ -71,14 +85,19 @@ function LineHighlightElement(props) {
|
|
|
71
85
|
y
|
|
72
86
|
};
|
|
73
87
|
const classes = useUtilityClasses(ownerState);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
ownerState: ownerState,
|
|
77
|
-
className: classes.root,
|
|
88
|
+
const Element = shape === 'circle' ? HighlightCircleElement : HighlightPathElement;
|
|
89
|
+
const additionalProps = shape === 'circle' ? {
|
|
78
90
|
cx: 0,
|
|
79
91
|
cy: 0,
|
|
80
92
|
r: other.r === undefined ? 5 : other.r
|
|
81
|
-
}
|
|
93
|
+
} : {
|
|
94
|
+
d: (0, _d3Shape.symbol)(_d3Shape.symbolsFill[(0, _getSymbol.getSymbol)(shape)])()
|
|
95
|
+
};
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Element, (0, _extends2.default)({
|
|
97
|
+
pointerEvents: "none",
|
|
98
|
+
ownerState: ownerState,
|
|
99
|
+
className: classes.root
|
|
100
|
+
}, additionalProps, other));
|
|
82
101
|
}
|
|
83
102
|
process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
|
|
84
103
|
// ----------------------------- Warning --------------------------------
|
|
@@ -86,5 +105,6 @@ process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
|
|
|
86
105
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
87
106
|
// ----------------------------------------------------------------------
|
|
88
107
|
classes: _propTypes.default.object,
|
|
89
|
-
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
108
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
109
|
+
shape: _propTypes.default.oneOf(['circle', 'cross', 'diamond', 'square', 'star', 'triangle', 'wye']).isRequired
|
|
90
110
|
} : void 0;
|
|
@@ -13,14 +13,14 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _useStore = require("../internals/store/useStore");
|
|
15
15
|
var _useSelector = require("../internals/store/useSelector");
|
|
16
|
-
var _CartesianProvider = require("../context/CartesianProvider");
|
|
17
16
|
var _LineHighlightElement = require("./LineHighlightElement");
|
|
18
17
|
var _useScale = require("../hooks/useScale");
|
|
19
18
|
var _constants = require("../constants");
|
|
20
19
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
21
20
|
var _useSeries = require("../hooks/useSeries");
|
|
22
|
-
var
|
|
21
|
+
var _ChartProvider = require("../context/ChartProvider");
|
|
23
22
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
23
|
+
var _useAxis = require("../hooks/useAxis");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
const _excluded = ["slots", "slotProps"];
|
|
26
26
|
/**
|
|
@@ -40,8 +40,17 @@ function LineHighlightPlot(props) {
|
|
|
40
40
|
} = props,
|
|
41
41
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
42
42
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const {
|
|
44
|
+
xAxis,
|
|
45
|
+
xAxisIds
|
|
46
|
+
} = (0, _useAxis.useXAxes)();
|
|
47
|
+
const {
|
|
48
|
+
yAxis,
|
|
49
|
+
yAxisIds
|
|
50
|
+
} = (0, _useAxis.useYAxes)();
|
|
51
|
+
const {
|
|
52
|
+
instance
|
|
53
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
45
54
|
const store = (0, _useStore.useStore)();
|
|
46
55
|
const xAxisIdentifier = (0, _useSelector.useSelector)(store, _useChartInteraction.selectorChartsInteractionXAxis);
|
|
47
56
|
const highlightedIndex = xAxisIdentifier?.index;
|
|
@@ -55,12 +64,6 @@ function LineHighlightPlot(props) {
|
|
|
55
64
|
series,
|
|
56
65
|
stackingGroups
|
|
57
66
|
} = seriesData;
|
|
58
|
-
const {
|
|
59
|
-
xAxis,
|
|
60
|
-
yAxis,
|
|
61
|
-
xAxisIds,
|
|
62
|
-
yAxisIds
|
|
63
|
-
} = axisData;
|
|
64
67
|
const defaultXAxisId = xAxisIds[0];
|
|
65
68
|
const defaultYAxisId = yAxisIds[0];
|
|
66
69
|
const Element = slots?.lineHighlight ?? _LineHighlightElement.LineHighlightElement;
|
|
@@ -74,7 +77,8 @@ function LineHighlightPlot(props) {
|
|
|
74
77
|
yAxisId = defaultYAxisId,
|
|
75
78
|
stackedData,
|
|
76
79
|
data,
|
|
77
|
-
disableHighlight
|
|
80
|
+
disableHighlight,
|
|
81
|
+
shape = 'circle'
|
|
78
82
|
} = series[seriesId];
|
|
79
83
|
if (disableHighlight || data[highlightedIndex] == null) {
|
|
80
84
|
return null;
|
|
@@ -88,7 +92,7 @@ function LineHighlightPlot(props) {
|
|
|
88
92
|
const x = xScale(xData[highlightedIndex]);
|
|
89
93
|
const y = yScale(stackedData[highlightedIndex][1]); // This should not be undefined since y should not be a band scale
|
|
90
94
|
|
|
91
|
-
if (!
|
|
95
|
+
if (!instance.isPointInside({
|
|
92
96
|
x,
|
|
93
97
|
y
|
|
94
98
|
})) {
|
|
@@ -99,7 +103,8 @@ function LineHighlightPlot(props) {
|
|
|
99
103
|
id: seriesId,
|
|
100
104
|
color: colorGetter(highlightedIndex),
|
|
101
105
|
x: x,
|
|
102
|
-
y: y
|
|
106
|
+
y: y,
|
|
107
|
+
shape: shape
|
|
103
108
|
}, slotProps?.lineHighlight), `${seriesId}`);
|
|
104
109
|
});
|
|
105
110
|
})
|