@mui/x-charts 8.0.0-alpha.7 → 8.0.0-alpha.8
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 +9 -1
- 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 +1 -2
- package/BarChart/useBarChartProps.d.ts +1 -1
- package/CHANGELOG.md +115 -0
- package/ChartContainer/ChartContainer.d.ts +6 -2
- package/ChartContainer/ChartContainer.js +13 -7
- package/ChartContainer/useChartContainerProps.d.ts +5 -3
- package/ChartContainer/useChartContainerProps.js +7 -5
- 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.js +16 -26
- 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/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/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AppearingMask.js +1 -1
- package/LineChart/AreaPlot.js +16 -15
- package/LineChart/LineChart.js +9 -1
- package/LineChart/LineHighlightPlot.js +14 -11
- package/LineChart/LinePlot.js +16 -15
- package/LineChart/MarkPlot.js +14 -11
- 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 +1 -2
- package/LineChart/useLineChartProps.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +2 -2
- package/PieChart/PieArcPlot.js +2 -2
- package/PieChart/PieChart.js +9 -1
- 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 +1 -2
- package/ScatterChart/Scatter.js +6 -4
- package/ScatterChart/ScatterChart.d.ts +1 -2
- package/ScatterChart/ScatterChart.js +16 -12
- 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 +1 -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/ChartDataProvider/ChartDataProvider.d.ts +6 -22
- package/context/ChartDataProvider/ChartDataProvider.js +22 -184
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +6 -83
- package/context/ChartDataProvider/useChartDataProviderProps.js +33 -47
- 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 +33 -33
- 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 -2
- package/context/index.js +0 -1
- 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/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.js +1 -1
- 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 +22 -22
- package/internals/index.d.ts +13 -8
- package/internals/index.js +16 -9
- 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 +2 -2
- 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 +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +4 -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 +1372 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +87 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +76 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +18 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +22 -22
- 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 +14 -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/modern/BarChart/BarChart.js +9 -1
- 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 +1 -2
- package/modern/ChartContainer/ChartContainer.js +13 -7
- package/modern/ChartContainer/useChartContainerProps.js +7 -5
- 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 +16 -26
- 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/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/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AppearingMask.js +1 -1
- package/modern/LineChart/AreaPlot.js +16 -15
- package/modern/LineChart/LineChart.js +9 -1
- package/modern/LineChart/LineHighlightPlot.js +14 -11
- package/modern/LineChart/LinePlot.js +16 -15
- package/modern/LineChart/MarkPlot.js +14 -11
- package/modern/LineChart/formatter.js +3 -1
- package/modern/LineChart/legend.js +1 -1
- package/modern/LineChart/plugin.js +1 -2
- package/modern/PieChart/PieArcLabelPlot.js +2 -2
- package/modern/PieChart/PieArcPlot.js +2 -2
- package/modern/PieChart/PieChart.js +9 -1
- 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 +1 -2
- package/modern/ScatterChart/Scatter.js +6 -4
- package/modern/ScatterChart/ScatterChart.js +16 -12
- 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 +1 -2
- package/modern/ScatterChart/useScatterChartProps.js +1 -4
- package/modern/SparkLineChart/SparkLineChart.js +11 -2
- package/modern/context/ChartDataProvider/ChartDataProvider.js +22 -184
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +33 -47
- 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 +0 -1
- 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/useSeries.js +5 -10
- package/modern/hooks/useZAxis.js +25 -6
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +19 -27
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/modern/internals/index.js +16 -9
- 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 +4 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +68 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +87 -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 +9 -1
- 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 +1 -2
- package/node/ChartContainer/ChartContainer.js +13 -7
- package/node/ChartContainer/useChartContainerProps.js +7 -5
- 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 +17 -27
- 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/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/LineChart/AnimatedArea.js +1 -1
- package/node/LineChart/AnimatedLine.js +1 -1
- package/node/LineChart/AppearingMask.js +1 -1
- package/node/LineChart/AreaPlot.js +16 -15
- package/node/LineChart/LineChart.js +9 -1
- package/node/LineChart/LineHighlightPlot.js +14 -11
- package/node/LineChart/LinePlot.js +16 -15
- package/node/LineChart/MarkPlot.js +14 -11
- package/node/LineChart/formatter.js +3 -1
- package/node/LineChart/legend.js +1 -1
- package/node/LineChart/plugin.js +1 -2
- package/node/PieChart/PieArcLabelPlot.js +1 -1
- package/node/PieChart/PieArcPlot.js +1 -1
- package/node/PieChart/PieChart.js +9 -1
- 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 +1 -2
- package/node/ScatterChart/Scatter.js +6 -4
- package/node/ScatterChart/ScatterChart.js +16 -12
- 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 +1 -2
- package/node/ScatterChart/useScatterChartProps.js +1 -4
- package/node/SparkLineChart/SparkLineChart.js +10 -1
- package/node/context/ChartDataProvider/ChartDataProvider.js +22 -184
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +34 -47
- 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 +0 -8
- 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/useSeries.js +5 -9
- package/node/hooks/useZAxis.js +27 -9
- package/node/index.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +17 -27
- package/node/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/node/internals/index.js +122 -62
- 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 +47 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +76 -0
- package/node/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js +96 -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/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/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/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/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/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/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
|
@@ -14,7 +14,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
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
|
-
var _CartesianProvider = require("../context/CartesianProvider");
|
|
18
17
|
var _useTicks = require("../hooks/useTicks");
|
|
19
18
|
var _axisClasses = require("../ChartsAxis/axisClasses");
|
|
20
19
|
var _AxisSharedComponents = require("../internals/components/AxisSharedComponents");
|
|
@@ -25,6 +24,8 @@ var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
|
25
24
|
var _getWordsByLines = require("../internals/getWordsByLines");
|
|
26
25
|
var _isInfinity = require("../internals/isInfinity");
|
|
27
26
|
var _isBandScale = require("../internals/isBandScale");
|
|
27
|
+
var _useChartContext = require("../context/ChartProvider/useChartContext");
|
|
28
|
+
var _useAxis = require("../hooks/useAxis");
|
|
28
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
30
|
const _excluded = ["scale", "tickNumber", "reverse"];
|
|
30
31
|
const useUtilityClasses = ownerState => {
|
|
@@ -121,9 +122,9 @@ const defaultProps = {
|
|
|
121
122
|
*/
|
|
122
123
|
function ChartsXAxis(inProps) {
|
|
123
124
|
const {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} = (0,
|
|
125
|
+
xAxis,
|
|
126
|
+
xAxisIds
|
|
127
|
+
} = (0, _useAxis.useXAxes)();
|
|
127
128
|
const _xAxis = xAxis[inProps.axisId ?? xAxisIds[0]],
|
|
128
129
|
{
|
|
129
130
|
scale: xScale,
|
|
@@ -162,9 +163,11 @@ function ChartsXAxis(inProps) {
|
|
|
162
163
|
left,
|
|
163
164
|
top,
|
|
164
165
|
width,
|
|
165
|
-
height
|
|
166
|
-
isPointInside
|
|
166
|
+
height
|
|
167
167
|
} = (0, _useDrawingArea.useDrawingArea)();
|
|
168
|
+
const {
|
|
169
|
+
instance
|
|
170
|
+
} = (0, _useChartContext.useChartContext)();
|
|
168
171
|
const tickSize = disableTicks ? 4 : tickSizeProp;
|
|
169
172
|
const positionSign = position === 'bottom' ? 1 : -1;
|
|
170
173
|
const Line = slots?.axisLine ?? 'line';
|
|
@@ -238,13 +241,13 @@ function ChartsXAxis(inProps) {
|
|
|
238
241
|
}, index) => {
|
|
239
242
|
const xTickLabel = labelOffset ?? 0;
|
|
240
243
|
const yTickLabel = positionSign * (tickSize + 3);
|
|
241
|
-
const showTick = isPointInside({
|
|
244
|
+
const showTick = instance.isPointInside({
|
|
242
245
|
x: offset,
|
|
243
246
|
y: -1
|
|
244
247
|
}, {
|
|
245
248
|
direction: 'x'
|
|
246
249
|
});
|
|
247
|
-
const showTickLabel = isPointInside({
|
|
250
|
+
const showTickLabel = instance.isPointInside({
|
|
248
251
|
x: offset + xTickLabel,
|
|
249
252
|
y: -1
|
|
250
253
|
}, {
|
|
@@ -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,
|
|
@@ -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,14 @@ 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"));
|
|
20
19
|
var _constants = require("../constants");
|
|
21
|
-
var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
|
|
22
20
|
var _useSeries = require("../hooks/useSeries");
|
|
23
21
|
var _AnimationProvider = require("../context/AnimationProvider");
|
|
22
|
+
var _useChartGradientId = require("../hooks/useChartGradientId");
|
|
23
|
+
var _useAxis = require("../hooks/useAxis");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
const _excluded = ["slots", "slotProps", "onItemClick", "skipAnimation"];
|
|
26
26
|
const AreaPlotRoot = (0, _styles.styled)('g', {
|
|
@@ -34,7 +34,15 @@ const AreaPlotRoot = (0, _styles.styled)('g', {
|
|
|
34
34
|
});
|
|
35
35
|
const useAggregatedData = () => {
|
|
36
36
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
37
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
xAxis,
|
|
39
|
+
xAxisIds
|
|
40
|
+
} = (0, _useAxis.useXAxes)();
|
|
41
|
+
const {
|
|
42
|
+
yAxis,
|
|
43
|
+
yAxisIds
|
|
44
|
+
} = (0, _useAxis.useYAxes)();
|
|
45
|
+
const getGradientId = (0, _useChartGradientId.useChartGradientIdBuilder)();
|
|
38
46
|
|
|
39
47
|
// This memo prevents odd line chart behavior when hydrating.
|
|
40
48
|
const allData = React.useMemo(() => {
|
|
@@ -45,12 +53,6 @@ const useAggregatedData = () => {
|
|
|
45
53
|
series,
|
|
46
54
|
stackingGroups
|
|
47
55
|
} = seriesData;
|
|
48
|
-
const {
|
|
49
|
-
xAxis,
|
|
50
|
-
yAxis,
|
|
51
|
-
xAxisIds,
|
|
52
|
-
yAxisIds
|
|
53
|
-
} = axisData;
|
|
54
56
|
const defaultXAxisId = xAxisIds[0];
|
|
55
57
|
const defaultYAxisId = yAxisIds[0];
|
|
56
58
|
return stackingGroups.flatMap(({
|
|
@@ -69,7 +71,7 @@ const useAggregatedData = () => {
|
|
|
69
71
|
const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisId].scale);
|
|
70
72
|
const yScale = yAxis[yAxisId].scale;
|
|
71
73
|
const xData = xAxis[xAxisId].data;
|
|
72
|
-
const
|
|
74
|
+
const gradientId = yAxis[yAxisId].colorScale && getGradientId(yAxisId) || xAxis[xAxisId].colorScale && getGradientId(xAxisId) || undefined;
|
|
73
75
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
76
|
if (xData === undefined) {
|
|
75
77
|
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.`);
|
|
@@ -102,13 +104,13 @@ const useAggregatedData = () => {
|
|
|
102
104
|
const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
|
|
103
105
|
const d = areaPath.curve(curve)(d3Data) || '';
|
|
104
106
|
return (0, _extends2.default)({}, series[seriesId], {
|
|
105
|
-
|
|
107
|
+
gradientId,
|
|
106
108
|
d,
|
|
107
109
|
seriesId
|
|
108
110
|
});
|
|
109
111
|
});
|
|
110
112
|
});
|
|
111
|
-
}, [seriesData,
|
|
113
|
+
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis, getGradientId]);
|
|
112
114
|
return allData;
|
|
113
115
|
};
|
|
114
116
|
|
|
@@ -132,7 +134,6 @@ function AreaPlot(props) {
|
|
|
132
134
|
} = props,
|
|
133
135
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
134
136
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(inSkipAnimation);
|
|
135
|
-
const getGradientId = (0, _ChartsAxesGradients.useChartGradient)();
|
|
136
137
|
const completedData = useAggregatedData();
|
|
137
138
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AreaPlotRoot, (0, _extends2.default)({}, other, {
|
|
138
139
|
children: completedData.map(({
|
|
@@ -140,12 +141,12 @@ function AreaPlot(props) {
|
|
|
140
141
|
seriesId,
|
|
141
142
|
color,
|
|
142
143
|
area,
|
|
143
|
-
|
|
144
|
+
gradientId
|
|
144
145
|
}) => !!area && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AreaElement.AreaElement, {
|
|
145
146
|
id: seriesId,
|
|
146
147
|
d: d,
|
|
147
148
|
color: color,
|
|
148
|
-
gradientId:
|
|
149
|
+
gradientId: gradientId,
|
|
149
150
|
slots: slots,
|
|
150
151
|
slotProps: slotProps,
|
|
151
152
|
onClick: onItemClick && (event => onItemClick(event, {
|
|
@@ -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.
|
|
@@ -147,6 +150,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
147
150
|
dataIndex: _propTypes.default.number,
|
|
148
151
|
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
149
152
|
}),
|
|
153
|
+
/**
|
|
154
|
+
* This prop is used to help implement the accessibility logic.
|
|
155
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
156
|
+
*/
|
|
157
|
+
id: _propTypes.default.string,
|
|
150
158
|
/**
|
|
151
159
|
* Indicate which axis to display the left of the charts.
|
|
152
160
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -162,7 +170,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
162
170
|
* The margin between the SVG and the drawing area.
|
|
163
171
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
164
172
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
165
|
-
* @default object Depends on the charts type.
|
|
166
173
|
*/
|
|
167
174
|
margin: _propTypes.default.shape({
|
|
168
175
|
bottom: _propTypes.default.number,
|
|
@@ -222,6 +229,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
222
229
|
*/
|
|
223
230
|
slots: _propTypes.default.object,
|
|
224
231
|
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]),
|
|
232
|
+
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
225
233
|
title: _propTypes.default.string,
|
|
226
234
|
/**
|
|
227
235
|
* Indicate which axis to display the top of the charts.
|
|
@@ -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;
|
|
@@ -88,7 +91,7 @@ function LineHighlightPlot(props) {
|
|
|
88
91
|
const x = xScale(xData[highlightedIndex]);
|
|
89
92
|
const y = yScale(stackedData[highlightedIndex][1]); // This should not be undefined since y should not be a band scale
|
|
90
93
|
|
|
91
|
-
if (!
|
|
94
|
+
if (!instance.isPointInside({
|
|
92
95
|
x,
|
|
93
96
|
y
|
|
94
97
|
})) {
|
|
@@ -13,14 +13,14 @@ 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 _LineElement = require("./LineElement");
|
|
18
17
|
var _useScale = require("../hooks/useScale");
|
|
19
18
|
var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
|
|
20
19
|
var _constants = require("../constants");
|
|
21
|
-
var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
|
|
22
20
|
var _useSeries = require("../hooks/useSeries");
|
|
23
21
|
var _AnimationProvider = require("../context/AnimationProvider");
|
|
22
|
+
var _useChartGradientId = require("../hooks/useChartGradientId");
|
|
23
|
+
var _hooks = require("../hooks");
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
26
26
|
const LinePlotRoot = (0, _styles.styled)('g', {
|
|
@@ -34,7 +34,15 @@ const LinePlotRoot = (0, _styles.styled)('g', {
|
|
|
34
34
|
});
|
|
35
35
|
const useAggregatedData = () => {
|
|
36
36
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
37
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
xAxis,
|
|
39
|
+
xAxisIds
|
|
40
|
+
} = (0, _hooks.useXAxes)();
|
|
41
|
+
const {
|
|
42
|
+
yAxis,
|
|
43
|
+
yAxisIds
|
|
44
|
+
} = (0, _hooks.useYAxes)();
|
|
45
|
+
const getGradientId = (0, _useChartGradientId.useChartGradientIdBuilder)();
|
|
38
46
|
|
|
39
47
|
// This memo prevents odd line chart behavior when hydrating.
|
|
40
48
|
const allData = React.useMemo(() => {
|
|
@@ -45,12 +53,6 @@ const useAggregatedData = () => {
|
|
|
45
53
|
series,
|
|
46
54
|
stackingGroups
|
|
47
55
|
} = seriesData;
|
|
48
|
-
const {
|
|
49
|
-
xAxis,
|
|
50
|
-
yAxis,
|
|
51
|
-
xAxisIds,
|
|
52
|
-
yAxisIds
|
|
53
|
-
} = axisData;
|
|
54
56
|
const defaultXAxisId = xAxisIds[0];
|
|
55
57
|
const defaultYAxisId = yAxisIds[0];
|
|
56
58
|
return stackingGroups.flatMap(({
|
|
@@ -67,7 +69,7 @@ const useAggregatedData = () => {
|
|
|
67
69
|
const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisId].scale);
|
|
68
70
|
const yScale = yAxis[yAxisId].scale;
|
|
69
71
|
const xData = xAxis[xAxisId].data;
|
|
70
|
-
const
|
|
72
|
+
const gradientId = yAxis[yAxisId].colorScale && getGradientId(yAxisId) || xAxis[xAxisId].colorScale && getGradientId(xAxisId) || undefined;
|
|
71
73
|
if (process.env.NODE_ENV !== 'production') {
|
|
72
74
|
if (xData === undefined) {
|
|
73
75
|
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.`);
|
|
@@ -84,13 +86,13 @@ const useAggregatedData = () => {
|
|
|
84
86
|
const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
|
|
85
87
|
const d = linePath.curve((0, _getCurve.default)(series[seriesId].curve))(d3Data) || '';
|
|
86
88
|
return (0, _extends2.default)({}, series[seriesId], {
|
|
87
|
-
|
|
89
|
+
gradientId,
|
|
88
90
|
d,
|
|
89
91
|
seriesId
|
|
90
92
|
});
|
|
91
93
|
});
|
|
92
94
|
});
|
|
93
|
-
}, [seriesData,
|
|
95
|
+
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis, getGradientId]);
|
|
94
96
|
return allData;
|
|
95
97
|
};
|
|
96
98
|
|
|
@@ -113,20 +115,19 @@ function LinePlot(props) {
|
|
|
113
115
|
} = props,
|
|
114
116
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
115
117
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(inSkipAnimation);
|
|
116
|
-
const getGradientId = (0, _ChartsAxesGradients.useChartGradient)();
|
|
117
118
|
const completedData = useAggregatedData();
|
|
118
119
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinePlotRoot, (0, _extends2.default)({}, other, {
|
|
119
120
|
children: completedData.map(({
|
|
120
121
|
d,
|
|
121
122
|
seriesId,
|
|
122
123
|
color,
|
|
123
|
-
|
|
124
|
+
gradientId
|
|
124
125
|
}) => {
|
|
125
126
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineElement.LineElement, {
|
|
126
127
|
id: seriesId,
|
|
127
128
|
d: d,
|
|
128
129
|
color: color,
|
|
129
|
-
gradientId:
|
|
130
|
+
gradientId: gradientId,
|
|
130
131
|
skipAnimation: skipAnimation,
|
|
131
132
|
slots: slots,
|
|
132
133
|
slotProps: slotProps,
|
|
@@ -13,15 +13,15 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _constants = require("../constants");
|
|
15
15
|
var _AnimationProvider = require("../context/AnimationProvider");
|
|
16
|
-
var _CartesianProvider = require("../context/CartesianProvider");
|
|
17
16
|
var _useChartId = require("../hooks/useChartId");
|
|
18
|
-
var _useDrawingArea = require("../hooks/useDrawingArea");
|
|
19
17
|
var _useScale = require("../hooks/useScale");
|
|
20
18
|
var _useSeries = require("../hooks/useSeries");
|
|
21
19
|
var _cleanId = require("../internals/cleanId");
|
|
22
20
|
var _CircleMarkElement = require("./CircleMarkElement");
|
|
23
21
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
24
22
|
var _MarkElement = require("./MarkElement");
|
|
23
|
+
var _ChartProvider = require("../context/ChartProvider");
|
|
24
|
+
var _hooks = require("../hooks");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
26
|
const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick", "experimentalRendering"];
|
|
27
27
|
/**
|
|
@@ -45,9 +45,18 @@ function MarkPlot(props) {
|
|
|
45
45
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
46
46
|
const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(inSkipAnimation);
|
|
47
47
|
const seriesData = (0, _useSeries.useLineSeries)();
|
|
48
|
-
const
|
|
48
|
+
const {
|
|
49
|
+
xAxis,
|
|
50
|
+
xAxisIds
|
|
51
|
+
} = (0, _hooks.useXAxes)();
|
|
52
|
+
const {
|
|
53
|
+
yAxis,
|
|
54
|
+
yAxisIds
|
|
55
|
+
} = (0, _hooks.useYAxes)();
|
|
49
56
|
const chartId = (0, _useChartId.useChartId)();
|
|
50
|
-
const
|
|
57
|
+
const {
|
|
58
|
+
instance
|
|
59
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
51
60
|
const Mark = slots?.mark ?? (experimentalRendering ? _CircleMarkElement.CircleMarkElement : _MarkElement.MarkElement);
|
|
52
61
|
if (seriesData === undefined) {
|
|
53
62
|
return null;
|
|
@@ -56,12 +65,6 @@ function MarkPlot(props) {
|
|
|
56
65
|
series,
|
|
57
66
|
stackingGroups
|
|
58
67
|
} = seriesData;
|
|
59
|
-
const {
|
|
60
|
-
xAxis,
|
|
61
|
-
yAxis,
|
|
62
|
-
xAxisIds,
|
|
63
|
-
yAxisIds
|
|
64
|
-
} = axisData;
|
|
65
68
|
const defaultXAxisId = xAxisIds[0];
|
|
66
69
|
const defaultYAxisId = yAxisIds[0];
|
|
67
70
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, other, {
|
|
@@ -110,7 +113,7 @@ function MarkPlot(props) {
|
|
|
110
113
|
// Remove missing data point
|
|
111
114
|
return false;
|
|
112
115
|
}
|
|
113
|
-
if (!
|
|
116
|
+
if (!instance.isPointInside({
|
|
114
117
|
x,
|
|
115
118
|
y
|
|
116
119
|
})) {
|
|
@@ -56,7 +56,9 @@ const formatter = (params, dataset) => {
|
|
|
56
56
|
.order(stackingOrder).offset(stackingOffset)(d3Dataset);
|
|
57
57
|
ids.forEach((id, index) => {
|
|
58
58
|
const dataKey = series[id].dataKey;
|
|
59
|
-
completedSeries[id] = (0, _extends2.default)({
|
|
59
|
+
completedSeries[id] = (0, _extends2.default)({
|
|
60
|
+
labelMarkType: 'line'
|
|
61
|
+
}, series[id], {
|
|
60
62
|
data: dataKey ? dataset.map(data => {
|
|
61
63
|
const value = data[dataKey];
|
|
62
64
|
if (typeof value !== 'number') {
|
package/node/LineChart/legend.js
CHANGED
package/node/LineChart/plugin.js
CHANGED
|
@@ -9,9 +9,8 @@ var _extremums = require("./extremums");
|
|
|
9
9
|
var _formatter = _interopRequireDefault(require("./formatter"));
|
|
10
10
|
var _getColor = _interopRequireDefault(require("./getColor"));
|
|
11
11
|
const plugin = exports.plugin = {
|
|
12
|
-
seriesType: 'line',
|
|
13
12
|
colorProcessor: _getColor.default,
|
|
14
|
-
|
|
13
|
+
seriesProcessor: _formatter.default,
|
|
15
14
|
xExtremumGetter: _extremums.getExtremumX,
|
|
16
15
|
yExtremumGetter: _extremums.getExtremumY
|
|
17
16
|
};
|
|
@@ -72,7 +72,7 @@ function PieArcLabelPlot(props) {
|
|
|
72
72
|
faded,
|
|
73
73
|
data
|
|
74
74
|
});
|
|
75
|
-
const transition = (0, _web.useTransition)(transformedData, (0, _extends2.default)({}, _transition.
|
|
75
|
+
const transition = (0, _web.useTransition)(transformedData, (0, _extends2.default)({}, (0, _transition.getDefaultLabelTransitionConfig)(skipAnimation), {
|
|
76
76
|
immediate: skipAnimation
|
|
77
77
|
}));
|
|
78
78
|
if (data.length === 0) {
|