@mui/x-charts 7.16.0 → 7.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +13 -0
- package/BarChart/BarElement.js +2 -0
- package/BarChart/BarLabel/BarLabel.js +2 -0
- package/BarChart/BarPlot.js +2 -0
- package/BarChart/legend.js +3 -2
- package/BarChart/useBarChartProps.js +2 -0
- package/CHANGELOG.md +184 -4
- package/ChartContainer/ChartContainer.js +2 -0
- package/ChartContainer/useChartContainerProps.js +2 -0
- package/ChartContainer/useDefaultizeAxis.js +2 -0
- package/ChartsAxis/ChartsAxis.js +2 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -0
- package/ChartsClipPath/ChartsClipPath.js +2 -0
- package/ChartsGrid/ChartsGrid.js +2 -0
- package/ChartsLegend/ChartsLegend.d.ts +2 -2
- package/ChartsLegend/ChartsLegend.js +11 -1
- package/ChartsLegend/ChartsLegendItem.d.ts +26 -0
- package/ChartsLegend/ChartsLegendItem.js +65 -0
- package/ChartsLegend/ContinuousColorLegend.js +2 -0
- package/ChartsLegend/DefaultChartsLegend.d.ts +9 -1
- package/ChartsLegend/DefaultChartsLegend.js +26 -4
- package/ChartsLegend/LegendPerItem.d.ts +1 -0
- package/ChartsLegend/LegendPerItem.js +19 -28
- package/ChartsLegend/PiecewiseColorLegend.d.ts +9 -1
- package/ChartsLegend/PiecewiseColorLegend.js +28 -7
- package/ChartsLegend/chartsLegend.types.d.ts +39 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +2 -0
- package/ChartsLegend/chartsLegendClasses.js +1 -1
- package/ChartsLegend/useAxis.js +2 -0
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +2 -0
- package/ChartsOverlay/ChartsNoDataOverlay.js +2 -0
- package/ChartsOverlay/ChartsOverlay.js +2 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +3 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.js +3 -1
- package/ChartsSurface/ChartsSurface.js +2 -0
- package/ChartsText/ChartsText.js +2 -0
- package/ChartsTooltip/ChartsTooltip.js +2 -0
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -0
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -0
- package/ChartsTooltip/index.d.ts +3 -0
- package/ChartsTooltip/index.js +4 -1
- package/ChartsTooltip/useAxisTooltip.d.ts +18 -0
- package/ChartsTooltip/useAxisTooltip.js +84 -0
- package/ChartsTooltip/useItemTooltip.d.ts +10 -0
- package/ChartsTooltip/useItemTooltip.js +64 -0
- package/ChartsTooltip/utils.d.ts +2 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -0
- package/ChartsXAxis/ChartsXAxis.js +2 -0
- package/ChartsYAxis/ChartsYAxis.js +2 -0
- package/Gauge/Gauge.js +2 -0
- package/Gauge/GaugeContainer.js +2 -0
- package/Gauge/GaugeReferenceArc.js +2 -0
- package/Gauge/GaugeValueArc.js +2 -0
- package/Gauge/GaugeValueText.js +2 -0
- package/LineChart/AnimatedArea.js +2 -0
- package/LineChart/AnimatedLine.js +14 -22
- package/LineChart/AreaElement.js +2 -0
- package/LineChart/AreaPlot.js +2 -0
- package/LineChart/CircleMarkElement.d.ts +34 -0
- package/LineChart/CircleMarkElement.js +107 -0
- package/LineChart/LineChart.d.ts +4 -0
- package/LineChart/LineChart.js +17 -0
- package/LineChart/LineElement.js +2 -0
- package/LineChart/LineHighlightElement.js +2 -0
- package/LineChart/LineHighlightPlot.js +2 -0
- package/LineChart/LinePlot.js +2 -0
- package/LineChart/MarkElement.d.ts +1 -19
- package/LineChart/MarkElement.js +3 -19
- package/LineChart/MarkPlot.d.ts +6 -0
- package/LineChart/MarkPlot.js +13 -3
- package/LineChart/index.d.ts +2 -0
- package/LineChart/index.js +2 -1
- package/LineChart/legend.js +3 -2
- package/LineChart/markElementClasses.d.ts +20 -0
- package/LineChart/markElementClasses.js +19 -0
- package/LineChart/useLineChartProps.js +7 -3
- package/PieChart/PieArc.js +2 -0
- package/PieChart/PieArcLabel.js +2 -0
- package/PieChart/PieArcLabelPlot.js +2 -0
- package/PieChart/PieArcPlot.js +2 -0
- package/PieChart/PieChart.js +13 -0
- package/PieChart/PiePlot.js +2 -0
- package/PieChart/dataTransform/useTransformData.js +2 -0
- package/PieChart/legend.js +3 -1
- package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +10 -0
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +12 -0
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +1 -1
- package/ResponsiveChartContainer/useChartContainerDimensions.js +35 -9
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +5 -2
- package/ScatterChart/Scatter.js +2 -0
- package/ScatterChart/ScatterChart.js +13 -0
- package/ScatterChart/ScatterPlot.js +2 -0
- package/ScatterChart/legend.js +3 -2
- package/ScatterChart/useScatterChartProps.js +2 -0
- package/SparkLineChart/SparkLineChart.js +12 -0
- package/context/CartesianProvider/CartesianProvider.js +5 -3
- package/context/CartesianProvider/getAxisExtremum.d.ts +1 -1
- package/context/CartesianProvider/getAxisExtremum.js +5 -4
- package/context/CartesianProvider/index.d.ts +0 -5
- package/context/CartesianProvider/index.js +1 -6
- package/context/CartesianProvider/useCartesianContext.js +2 -0
- package/context/DrawingProvider.js +2 -0
- package/context/HighlightedProvider/HighlightedProvider.js +2 -0
- package/context/HighlightedProvider/useHighlighted.js +2 -0
- package/context/HighlightedProvider/useItemHighlighted.js +2 -0
- package/context/InteractionProvider.js +2 -0
- package/context/PluginProvider/ExtremumGetter.types.d.ts +1 -0
- package/context/PluginProvider/Plugin.types.d.ts +4 -0
- package/context/PluginProvider/PluginContext.js +3 -1
- package/context/PluginProvider/PluginProvider.js +2 -0
- package/context/PluginProvider/index.d.ts +2 -0
- package/context/PluginProvider/index.js +3 -1
- package/context/PluginProvider/mergePlugins.d.ts +10 -0
- package/context/PluginProvider/mergePlugins.js +11 -1
- package/context/PluginProvider/useColorProcessor.js +2 -0
- package/context/PluginProvider/useRadiusExtremumGetter.d.ts +4 -0
- package/context/PluginProvider/useRadiusExtremumGetter.js +17 -0
- package/context/PluginProvider/useRotationExtremumGetter.d.ts +4 -0
- package/context/PluginProvider/useRotationExtremumGetter.js +17 -0
- package/context/PluginProvider/useSeriesFormatter.js +2 -0
- package/context/PolarProvider/Polar.types.d.ts +42 -0
- package/context/PolarProvider/Polar.types.js +1 -0
- package/context/PolarProvider/PolarContext.d.ts +4 -0
- package/context/PolarProvider/PolarContext.js +13 -0
- package/context/PolarProvider/PolarProvider.d.ts +4 -0
- package/context/PolarProvider/PolarProvider.js +49 -0
- package/context/PolarProvider/getAxisExtremum.d.ts +4 -0
- package/context/PolarProvider/getAxisExtremum.js +20 -0
- package/context/PolarProvider/index.d.ts +0 -0
- package/context/PolarProvider/index.js +0 -0
- package/context/PolarProvider/usePolarContext.d.ts +2 -0
- package/context/PolarProvider/usePolarContext.js +10 -0
- package/context/SeriesProvider/SeriesProvider.js +2 -0
- package/context/ZAxisContextProvider.js +2 -0
- package/hooks/useAxis.js +2 -0
- package/hooks/useAxisEvents.js +2 -0
- package/hooks/useChartDimensions.js +2 -0
- package/hooks/useChartId.js +2 -0
- package/hooks/useColorScale.js +2 -0
- package/hooks/useDrawingArea.js +2 -0
- package/hooks/useInteractionItemProps.js +2 -0
- package/hooks/useMounted.js +2 -0
- package/hooks/useReducedMotion.js +2 -0
- package/hooks/useScale.js +2 -0
- package/hooks/useSeries.js +2 -0
- package/hooks/useSvgRef.js +2 -0
- package/hooks/useTicks.js +2 -0
- package/index.js +1 -1
- package/internals/computeAxisValue.d.ts +38 -0
- package/{modern/context/CartesianProvider/computeValue.js → internals/computeAxisValue.js} +28 -15
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/models/axis.d.ts +20 -0
- package/models/seriesType/config.d.ts +6 -2
- package/modern/BarChart/BarChart.js +13 -0
- package/modern/BarChart/BarElement.js +2 -0
- package/modern/BarChart/BarLabel/BarLabel.js +2 -0
- package/modern/BarChart/BarPlot.js +2 -0
- package/modern/BarChart/legend.js +3 -2
- package/modern/BarChart/useBarChartProps.js +2 -0
- package/modern/ChartContainer/ChartContainer.js +2 -0
- package/modern/ChartContainer/useChartContainerProps.js +2 -0
- package/modern/ChartContainer/useDefaultizeAxis.js +2 -0
- package/modern/ChartsAxis/ChartsAxis.js +2 -0
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -0
- package/modern/ChartsClipPath/ChartsClipPath.js +2 -0
- package/modern/ChartsGrid/ChartsGrid.js +2 -0
- package/modern/ChartsLegend/ChartsLegend.js +11 -1
- package/modern/ChartsLegend/ChartsLegendItem.js +65 -0
- package/modern/ChartsLegend/ContinuousColorLegend.js +2 -0
- package/modern/ChartsLegend/DefaultChartsLegend.js +26 -4
- package/modern/ChartsLegend/LegendPerItem.js +19 -28
- package/modern/ChartsLegend/PiecewiseColorLegend.js +28 -7
- package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
- package/modern/ChartsLegend/useAxis.js +2 -0
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
- package/modern/ChartsOverlay/ChartsLoadingOverlay.js +2 -0
- package/modern/ChartsOverlay/ChartsNoDataOverlay.js +2 -0
- package/modern/ChartsOverlay/ChartsOverlay.js +2 -0
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -0
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +3 -1
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +3 -1
- package/modern/ChartsSurface/ChartsSurface.js +2 -0
- package/modern/ChartsText/ChartsText.js +2 -0
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -0
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -0
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -0
- package/modern/ChartsTooltip/index.js +4 -1
- package/modern/ChartsTooltip/useAxisTooltip.js +84 -0
- package/modern/ChartsTooltip/useItemTooltip.js +64 -0
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -0
- package/modern/ChartsXAxis/ChartsXAxis.js +2 -0
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -0
- package/modern/Gauge/Gauge.js +2 -0
- package/modern/Gauge/GaugeContainer.js +2 -0
- package/modern/Gauge/GaugeReferenceArc.js +2 -0
- package/modern/Gauge/GaugeValueArc.js +2 -0
- package/modern/Gauge/GaugeValueText.js +2 -0
- package/modern/LineChart/AnimatedArea.js +2 -0
- package/modern/LineChart/AnimatedLine.js +14 -22
- package/modern/LineChart/AreaElement.js +2 -0
- package/modern/LineChart/AreaPlot.js +2 -0
- package/modern/LineChart/CircleMarkElement.js +107 -0
- package/modern/LineChart/LineChart.js +17 -0
- package/modern/LineChart/LineElement.js +2 -0
- package/modern/LineChart/LineHighlightElement.js +2 -0
- package/modern/LineChart/LineHighlightPlot.js +2 -0
- package/modern/LineChart/LinePlot.js +2 -0
- package/modern/LineChart/MarkElement.js +3 -19
- package/modern/LineChart/MarkPlot.js +13 -3
- package/modern/LineChart/index.js +2 -1
- package/modern/LineChart/legend.js +3 -2
- package/modern/LineChart/markElementClasses.js +19 -0
- package/modern/LineChart/useLineChartProps.js +7 -3
- package/modern/PieChart/PieArc.js +2 -0
- package/modern/PieChart/PieArcLabel.js +2 -0
- package/modern/PieChart/PieArcLabelPlot.js +2 -0
- package/modern/PieChart/PieArcPlot.js +2 -0
- package/modern/PieChart/PieChart.js +13 -0
- package/modern/PieChart/PiePlot.js +2 -0
- package/modern/PieChart/dataTransform/useTransformData.js +2 -0
- package/modern/PieChart/legend.js +3 -1
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +12 -0
- package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +35 -9
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +5 -2
- package/modern/ScatterChart/Scatter.js +2 -0
- package/modern/ScatterChart/ScatterChart.js +13 -0
- package/modern/ScatterChart/ScatterPlot.js +2 -0
- package/modern/ScatterChart/legend.js +3 -2
- package/modern/ScatterChart/useScatterChartProps.js +2 -0
- package/modern/SparkLineChart/SparkLineChart.js +12 -0
- package/modern/context/CartesianProvider/CartesianProvider.js +5 -3
- package/modern/context/CartesianProvider/getAxisExtremum.js +5 -4
- package/modern/context/CartesianProvider/index.js +1 -6
- package/modern/context/CartesianProvider/useCartesianContext.js +2 -0
- package/modern/context/DrawingProvider.js +2 -0
- package/modern/context/HighlightedProvider/HighlightedProvider.js +2 -0
- package/modern/context/HighlightedProvider/useHighlighted.js +2 -0
- package/modern/context/HighlightedProvider/useItemHighlighted.js +2 -0
- package/modern/context/InteractionProvider.js +2 -0
- package/modern/context/PluginProvider/PluginContext.js +3 -1
- package/modern/context/PluginProvider/PluginProvider.js +2 -0
- package/modern/context/PluginProvider/index.js +3 -1
- package/modern/context/PluginProvider/mergePlugins.js +11 -1
- package/modern/context/PluginProvider/useColorProcessor.js +2 -0
- package/modern/context/PluginProvider/useRadiusExtremumGetter.js +17 -0
- package/modern/context/PluginProvider/useRotationExtremumGetter.js +17 -0
- package/modern/context/PluginProvider/useSeriesFormatter.js +2 -0
- package/modern/context/PolarProvider/Polar.types.js +1 -0
- package/modern/context/PolarProvider/PolarContext.js +13 -0
- package/modern/context/PolarProvider/PolarProvider.js +49 -0
- package/modern/context/PolarProvider/getAxisExtremum.js +20 -0
- package/modern/context/PolarProvider/index.js +0 -0
- package/modern/context/PolarProvider/usePolarContext.js +10 -0
- package/modern/context/SeriesProvider/SeriesProvider.js +2 -0
- package/modern/context/ZAxisContextProvider.js +2 -0
- package/modern/hooks/useAxis.js +2 -0
- package/modern/hooks/useAxisEvents.js +2 -0
- package/modern/hooks/useChartDimensions.js +2 -0
- package/modern/hooks/useChartId.js +2 -0
- package/modern/hooks/useColorScale.js +2 -0
- package/modern/hooks/useDrawingArea.js +2 -0
- package/modern/hooks/useInteractionItemProps.js +2 -0
- package/modern/hooks/useMounted.js +2 -0
- package/modern/hooks/useReducedMotion.js +2 -0
- package/modern/hooks/useScale.js +2 -0
- package/modern/hooks/useSeries.js +2 -0
- package/modern/hooks/useSvgRef.js +2 -0
- package/modern/hooks/useTicks.js +2 -0
- package/modern/index.js +1 -1
- package/{context/CartesianProvider/computeValue.js → modern/internals/computeAxisValue.js} +28 -15
- package/modern/internals/index.js +1 -0
- package/node/BarChart/BarChart.js +12 -0
- package/node/BarChart/BarElement.js +1 -0
- package/node/BarChart/BarLabel/BarLabel.js +1 -0
- package/node/BarChart/BarPlot.js +1 -0
- package/node/BarChart/legend.js +3 -2
- package/node/BarChart/useBarChartProps.js +1 -0
- package/node/ChartContainer/ChartContainer.js +1 -0
- package/node/ChartContainer/useChartContainerProps.js +1 -0
- package/node/ChartContainer/useDefaultizeAxis.js +1 -0
- package/node/ChartsAxis/ChartsAxis.js +1 -0
- package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -0
- package/node/ChartsClipPath/ChartsClipPath.js +1 -0
- package/node/ChartsGrid/ChartsGrid.js +1 -0
- package/node/ChartsLegend/ChartsLegend.js +10 -1
- package/node/ChartsLegend/ChartsLegendItem.js +72 -0
- package/node/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/node/ChartsLegend/DefaultChartsLegend.js +25 -4
- package/node/ChartsLegend/LegendPerItem.js +18 -28
- package/node/ChartsLegend/PiecewiseColorLegend.js +27 -7
- package/node/ChartsLegend/chartsLegendClasses.js +1 -1
- package/node/ChartsLegend/useAxis.js +1 -0
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -1
- package/node/ChartsOverlay/ChartsLoadingOverlay.js +1 -0
- package/node/ChartsOverlay/ChartsNoDataOverlay.js +1 -0
- package/node/ChartsOverlay/ChartsOverlay.js +1 -0
- package/node/ChartsReferenceLine/ChartsReferenceLine.js +1 -0
- package/node/ChartsReferenceLine/ChartsXReferenceLine.js +2 -1
- package/node/ChartsReferenceLine/ChartsYReferenceLine.js +2 -1
- package/node/ChartsSurface/ChartsSurface.js +1 -0
- package/node/ChartsText/ChartsText.js +1 -0
- package/node/ChartsTooltip/ChartsTooltip.js +1 -0
- package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -0
- package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -0
- package/node/ChartsTooltip/index.js +42 -1
- package/node/ChartsTooltip/useAxisTooltip.js +90 -0
- package/node/ChartsTooltip/useItemTooltip.js +71 -0
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -0
- package/node/ChartsXAxis/ChartsXAxis.js +1 -0
- package/node/ChartsYAxis/ChartsYAxis.js +1 -0
- package/node/Gauge/Gauge.js +1 -0
- package/node/Gauge/GaugeContainer.js +1 -0
- package/node/Gauge/GaugeReferenceArc.js +1 -0
- package/node/Gauge/GaugeValueArc.js +1 -0
- package/node/Gauge/GaugeValueText.js +1 -0
- package/node/LineChart/AnimatedArea.js +1 -0
- package/node/LineChart/AnimatedLine.js +13 -22
- package/node/LineChart/AreaElement.js +1 -0
- package/node/LineChart/AreaPlot.js +1 -0
- package/node/LineChart/CircleMarkElement.js +113 -0
- package/node/LineChart/LineChart.js +16 -0
- package/node/LineChart/LineElement.js +1 -0
- package/node/LineChart/LineHighlightElement.js +1 -0
- package/node/LineChart/LineHighlightPlot.js +1 -0
- package/node/LineChart/LinePlot.js +1 -0
- package/node/LineChart/MarkElement.js +3 -22
- package/node/LineChart/MarkPlot.js +12 -3
- package/node/LineChart/index.js +29 -1
- package/node/LineChart/legend.js +3 -2
- package/node/LineChart/markElementClasses.js +28 -0
- package/node/LineChart/useLineChartProps.js +6 -3
- package/node/PieChart/PieArc.js +1 -0
- package/node/PieChart/PieArcLabel.js +1 -0
- package/node/PieChart/PieArcLabelPlot.js +1 -0
- package/node/PieChart/PieArcPlot.js +1 -0
- package/node/PieChart/PieChart.js +12 -0
- package/node/PieChart/PiePlot.js +1 -0
- package/node/PieChart/dataTransform/useTransformData.js +1 -0
- package/node/PieChart/legend.js +3 -1
- package/node/ResponsiveChartContainer/ResponsiveChartContainer.js +11 -0
- package/node/ResponsiveChartContainer/useChartContainerDimensions.js +34 -9
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +4 -2
- package/node/ScatterChart/Scatter.js +1 -0
- package/node/ScatterChart/ScatterChart.js +12 -0
- package/node/ScatterChart/ScatterPlot.js +1 -0
- package/node/ScatterChart/legend.js +3 -2
- package/node/ScatterChart/useScatterChartProps.js +1 -0
- package/node/SparkLineChart/SparkLineChart.js +11 -0
- package/node/context/CartesianProvider/CartesianProvider.js +4 -3
- package/node/context/CartesianProvider/getAxisExtremum.js +5 -4
- package/node/context/CartesianProvider/index.js +1 -13
- package/node/context/CartesianProvider/useCartesianContext.js +1 -0
- package/node/context/DrawingProvider.js +1 -0
- package/node/context/HighlightedProvider/HighlightedProvider.js +1 -0
- package/node/context/HighlightedProvider/useHighlighted.js +1 -0
- package/node/context/HighlightedProvider/useItemHighlighted.js +1 -0
- package/node/context/InteractionProvider.js +1 -0
- package/node/context/PluginProvider/PluginContext.js +3 -1
- package/node/context/PluginProvider/PluginProvider.js +1 -0
- package/node/context/PluginProvider/index.js +22 -0
- package/node/context/PluginProvider/mergePlugins.js +11 -1
- package/node/context/PluginProvider/useColorProcessor.js +1 -0
- package/node/context/PluginProvider/useRadiusExtremumGetter.js +23 -0
- package/node/context/PluginProvider/useRotationExtremumGetter.js +23 -0
- package/node/context/PluginProvider/useSeriesFormatter.js +1 -0
- package/node/context/PolarProvider/Polar.types.js +5 -0
- package/node/context/PolarProvider/PolarContext.js +20 -0
- package/node/context/PolarProvider/PolarProvider.js +54 -0
- package/node/context/PolarProvider/getAxisExtremum.js +27 -0
- package/node/context/PolarProvider/index.js +1 -0
- package/node/context/PolarProvider/usePolarContext.js +17 -0
- package/node/context/SeriesProvider/SeriesProvider.js +1 -0
- package/node/context/ZAxisContextProvider.js +1 -0
- package/node/hooks/useAxis.js +1 -0
- package/node/hooks/useAxisEvents.js +1 -0
- package/node/hooks/useChartDimensions.js +1 -0
- package/node/hooks/useChartId.js +1 -0
- package/node/hooks/useColorScale.js +1 -0
- package/node/hooks/useDrawingArea.js +1 -0
- package/node/hooks/useInteractionItemProps.js +1 -0
- package/node/hooks/useMounted.js +1 -0
- package/node/hooks/useReducedMotion.js +1 -0
- package/node/hooks/useScale.js +1 -0
- package/node/hooks/useSeries.js +1 -0
- package/node/hooks/useSvgRef.js +1 -0
- package/node/hooks/useTicks.js +1 -0
- package/node/index.js +1 -1
- package/node/{context/CartesianProvider/computeValue.js → internals/computeAxisValue.js} +29 -16
- package/node/internals/index.js +12 -0
- package/package.json +4 -4
- package/context/CartesianProvider/computeValue.d.ts +0 -30
- package/internals/warning.d.ts +0 -2
- package/internals/warning.js +0 -21
- package/modern/internals/warning.js +0 -21
- package/node/internals/warning.js +0 -28
|
@@ -12,7 +12,9 @@ const PluginContext = exports.PluginContext = /*#__PURE__*/React.createContext({
|
|
|
12
12
|
colorProcessors: {},
|
|
13
13
|
seriesFormatters: {},
|
|
14
14
|
xExtremumGetters: {},
|
|
15
|
-
yExtremumGetters: {}
|
|
15
|
+
yExtremumGetters: {},
|
|
16
|
+
rotationExtremumGetters: {},
|
|
17
|
+
radiusExtremumGetters: {}
|
|
16
18
|
}
|
|
17
19
|
});
|
|
18
20
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -112,4 +112,26 @@ Object.keys(_useYExtremumGetter).forEach(function (key) {
|
|
|
112
112
|
return _useYExtremumGetter[key];
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
+
});
|
|
116
|
+
var _useRadiusExtremumGetter = require("./useRadiusExtremumGetter");
|
|
117
|
+
Object.keys(_useRadiusExtremumGetter).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (key in exports && exports[key] === _useRadiusExtremumGetter[key]) return;
|
|
120
|
+
Object.defineProperty(exports, key, {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _useRadiusExtremumGetter[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
var _useRotationExtremumGetter = require("./useRotationExtremumGetter");
|
|
128
|
+
Object.keys(_useRotationExtremumGetter).forEach(function (key) {
|
|
129
|
+
if (key === "default" || key === "__esModule") return;
|
|
130
|
+
if (key in exports && exports[key] === _useRotationExtremumGetter[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return _useRotationExtremumGetter[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
115
137
|
});
|
|
@@ -16,6 +16,8 @@ function mergePlugins(plugins) {
|
|
|
16
16
|
const colorProcessors = {};
|
|
17
17
|
const xExtremumGetters = {};
|
|
18
18
|
const yExtremumGetters = {};
|
|
19
|
+
const rotationExtremumGetters = {};
|
|
20
|
+
const radiusExtremumGetters = {};
|
|
19
21
|
for (let i = 0; i < defaultizedPlugins.length; i += 1) {
|
|
20
22
|
const plugin = defaultizedPlugins[i];
|
|
21
23
|
const seriesType = plugin.seriesType;
|
|
@@ -27,11 +29,19 @@ function mergePlugins(plugins) {
|
|
|
27
29
|
if (plugin.yExtremumGetter) {
|
|
28
30
|
yExtremumGetters[seriesType] = plugin.yExtremumGetter;
|
|
29
31
|
}
|
|
32
|
+
if (plugin.rotationExtremumGetter) {
|
|
33
|
+
rotationExtremumGetters[seriesType] = plugin.rotationExtremumGetter;
|
|
34
|
+
}
|
|
35
|
+
if (plugin.radiusExtremumGetter) {
|
|
36
|
+
radiusExtremumGetters[seriesType] = plugin.radiusExtremumGetter;
|
|
37
|
+
}
|
|
30
38
|
}
|
|
31
39
|
return {
|
|
32
40
|
seriesFormatters,
|
|
33
41
|
colorProcessors,
|
|
34
42
|
xExtremumGetters,
|
|
35
|
-
yExtremumGetters
|
|
43
|
+
yExtremumGetters,
|
|
44
|
+
rotationExtremumGetters,
|
|
45
|
+
radiusExtremumGetters
|
|
36
46
|
};
|
|
37
47
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useRadiusExtremumGetter = useRadiusExtremumGetter;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _PluginContext = require("./PluginContext");
|
|
11
|
+
function useRadiusExtremumGetter(seriesType) {
|
|
12
|
+
const {
|
|
13
|
+
isInitialized,
|
|
14
|
+
data
|
|
15
|
+
} = React.useContext(_PluginContext.PluginContext);
|
|
16
|
+
if (!isInitialized) {
|
|
17
|
+
throw new Error(['MUI X: Could not find the plugin context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
18
|
+
}
|
|
19
|
+
if (!seriesType) {
|
|
20
|
+
return data.radiusExtremumGetters;
|
|
21
|
+
}
|
|
22
|
+
return data.radiusExtremumGetters[seriesType];
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useRotationExtremumGetter = useRotationExtremumGetter;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _PluginContext = require("./PluginContext");
|
|
11
|
+
function useRotationExtremumGetter(seriesType) {
|
|
12
|
+
const {
|
|
13
|
+
isInitialized,
|
|
14
|
+
data
|
|
15
|
+
} = React.useContext(_PluginContext.PluginContext);
|
|
16
|
+
if (!isInitialized) {
|
|
17
|
+
throw new Error(['MUI X: Could not find the plugin context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
18
|
+
}
|
|
19
|
+
if (!seriesType) {
|
|
20
|
+
return data.rotationExtremumGetters;
|
|
21
|
+
}
|
|
22
|
+
return data.rotationExtremumGetters[seriesType];
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PolarContext = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
const PolarContext = exports.PolarContext = /*#__PURE__*/React.createContext({
|
|
10
|
+
isInitialized: false,
|
|
11
|
+
data: {
|
|
12
|
+
rotationAxis: {},
|
|
13
|
+
radiusAxis: {},
|
|
14
|
+
rotationAxisIds: [],
|
|
15
|
+
radiusAxisIds: []
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
19
|
+
PolarContext.displayName = 'PolarContext';
|
|
20
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.PolarProvider = PolarProvider;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _computeAxisValue = require("../../internals/computeAxisValue");
|
|
11
|
+
var _useDrawingArea = require("../../hooks/useDrawingArea");
|
|
12
|
+
var _useSeries = require("../../hooks/useSeries");
|
|
13
|
+
var _PolarContext = require("./PolarContext");
|
|
14
|
+
var _useRadiusExtremumGetter = require("../PluginProvider/useRadiusExtremumGetter");
|
|
15
|
+
var _useRotationExtremumGetter = require("../PluginProvider/useRotationExtremumGetter");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function PolarProvider(props) {
|
|
18
|
+
const {
|
|
19
|
+
rotationAxis,
|
|
20
|
+
radiusAxis,
|
|
21
|
+
children
|
|
22
|
+
} = props;
|
|
23
|
+
const formattedSeries = (0, _useSeries.useSeries)();
|
|
24
|
+
const drawingArea = (0, _useDrawingArea.useDrawingArea)();
|
|
25
|
+
const rotationExtremumGetters = (0, _useRotationExtremumGetter.useRotationExtremumGetter)();
|
|
26
|
+
const radiusExtremumGetters = (0, _useRadiusExtremumGetter.useRadiusExtremumGetter)();
|
|
27
|
+
const rotationValues = React.useMemo(() => (0, _computeAxisValue.computeAxisValue)({
|
|
28
|
+
drawingArea,
|
|
29
|
+
formattedSeries,
|
|
30
|
+
axis: rotationAxis,
|
|
31
|
+
extremumGetters: rotationExtremumGetters,
|
|
32
|
+
axisDirection: 'rotation'
|
|
33
|
+
}), [drawingArea, formattedSeries, rotationAxis, rotationExtremumGetters]);
|
|
34
|
+
const radiusValues = React.useMemo(() => (0, _computeAxisValue.computeAxisValue)({
|
|
35
|
+
drawingArea,
|
|
36
|
+
formattedSeries,
|
|
37
|
+
axis: radiusAxis,
|
|
38
|
+
extremumGetters: radiusExtremumGetters,
|
|
39
|
+
axisDirection: 'radius'
|
|
40
|
+
}), [drawingArea, formattedSeries, radiusAxis, radiusExtremumGetters]);
|
|
41
|
+
const value = React.useMemo(() => ({
|
|
42
|
+
isInitialized: true,
|
|
43
|
+
data: {
|
|
44
|
+
rotationAxis: rotationValues.axis,
|
|
45
|
+
radiusAxis: radiusValues.axis,
|
|
46
|
+
rotationAxisIds: rotationValues.axisIds,
|
|
47
|
+
radiusAxisIds: radiusValues.axisIds
|
|
48
|
+
}
|
|
49
|
+
}), [rotationValues, radiusValues]);
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PolarContext.PolarContext.Provider, {
|
|
51
|
+
value: value,
|
|
52
|
+
children: children
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAxisExtremum = void 0;
|
|
7
|
+
const axisExtremumCallback = (acc, chartType, axis, getters, axisIndex, formattedSeries) => {
|
|
8
|
+
const getter = getters[chartType];
|
|
9
|
+
const series = formattedSeries[chartType]?.series ?? {};
|
|
10
|
+
const [minChartTypeData, maxChartTypeData] = getter?.({
|
|
11
|
+
series,
|
|
12
|
+
axis,
|
|
13
|
+
axisIndex,
|
|
14
|
+
isDefaultAxis: axisIndex === 0
|
|
15
|
+
}) ?? [Infinity, -Infinity];
|
|
16
|
+
const [minData, maxData] = acc;
|
|
17
|
+
return [Math.min(minChartTypeData, minData), Math.max(maxChartTypeData, maxData)];
|
|
18
|
+
};
|
|
19
|
+
const getAxisExtremum = (axis, getters, axisIndex, formattedSeries) => {
|
|
20
|
+
const charTypes = Object.keys(getters);
|
|
21
|
+
const extremums = charTypes.reduce((acc, charType) => axisExtremumCallback(acc, charType, axis, getters, axisIndex, formattedSeries), [Infinity, -Infinity]);
|
|
22
|
+
if (Number.isNaN(extremums[0]) || Number.isNaN(extremums[1])) {
|
|
23
|
+
return [Infinity, -Infinity];
|
|
24
|
+
}
|
|
25
|
+
return extremums;
|
|
26
|
+
};
|
|
27
|
+
exports.getAxisExtremum = getAxisExtremum;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.usePolarContext = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _PolarContext = require("./PolarContext");
|
|
11
|
+
const usePolarContext = () => {
|
|
12
|
+
const {
|
|
13
|
+
data
|
|
14
|
+
} = React.useContext(_PolarContext.PolarContext);
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
exports.usePolarContext = usePolarContext;
|
package/node/hooks/useAxis.js
CHANGED
package/node/hooks/useChartId.js
CHANGED
package/node/hooks/useMounted.js
CHANGED
package/node/hooks/useScale.js
CHANGED
package/node/hooks/useSeries.js
CHANGED
package/node/hooks/useSvgRef.js
CHANGED
package/node/hooks/useTicks.js
CHANGED
package/node/index.js
CHANGED
|
@@ -4,19 +4,33 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.computeAxisValue = computeAxisValue;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _d3Scale = require("@mui/x-charts-vendor/d3-scale");
|
|
10
|
-
var _axis = require("
|
|
11
|
-
var _colorScale = require("
|
|
12
|
-
var _useTicks = require("
|
|
13
|
-
var _getScale = require("
|
|
14
|
-
var _zoom = require("
|
|
15
|
-
var _getAxisExtremum = require("
|
|
16
|
-
|
|
10
|
+
var _axis = require("../models/axis");
|
|
11
|
+
var _colorScale = require("./colorScale");
|
|
12
|
+
var _useTicks = require("../hooks/useTicks");
|
|
13
|
+
var _getScale = require("./getScale");
|
|
14
|
+
var _zoom = require("../context/CartesianProvider/zoom");
|
|
15
|
+
var _getAxisExtremum = require("../context/CartesianProvider/getAxisExtremum");
|
|
16
|
+
function getRange(drawingArea, axisDirection, axis) {
|
|
17
|
+
if (axisDirection === 'rotation') {
|
|
18
|
+
const {
|
|
19
|
+
startAngle = 0,
|
|
20
|
+
endAngle = startAngle + 360
|
|
21
|
+
} = axis;
|
|
22
|
+
return axis.reverse ? [Math.PI * startAngle / 180, Math.PI * endAngle / 180] : [Math.PI * endAngle / 180, Math.PI * startAngle / 180];
|
|
23
|
+
}
|
|
24
|
+
if (axisDirection === 'radius') {
|
|
25
|
+
const {
|
|
26
|
+
minRadius = 0,
|
|
27
|
+
maxRadius = Math.min(drawingArea.width, drawingArea.height) / 2
|
|
28
|
+
} = axis;
|
|
29
|
+
return [minRadius, maxRadius];
|
|
30
|
+
}
|
|
17
31
|
const range = axisDirection === 'x' ? [drawingArea.left, drawingArea.left + drawingArea.width] : [drawingArea.top + drawingArea.height, drawingArea.top];
|
|
18
|
-
return
|
|
19
|
-
}
|
|
32
|
+
return axis.reverse ? [range[1], range[0]] : range;
|
|
33
|
+
}
|
|
20
34
|
const isDateData = data => data?.[0] instanceof Date;
|
|
21
35
|
function createDateFormatter(axis, range) {
|
|
22
36
|
const timeScale = (0, _d3Scale.scaleTime)(axis.data, range);
|
|
@@ -26,7 +40,7 @@ function createDateFormatter(axis, range) {
|
|
|
26
40
|
}
|
|
27
41
|
const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
|
|
28
42
|
const DEFAULT_BAR_GAP_RATIO = 0.1;
|
|
29
|
-
function
|
|
43
|
+
function computeAxisValue({
|
|
30
44
|
drawingArea,
|
|
31
45
|
formattedSeries,
|
|
32
46
|
axis: allAxis,
|
|
@@ -39,21 +53,20 @@ function computeValue({
|
|
|
39
53
|
const completeAxis = {};
|
|
40
54
|
allAxis.forEach((eachAxis, axisIndex) => {
|
|
41
55
|
const axis = eachAxis;
|
|
42
|
-
const isDefaultAxis = axisIndex === 0;
|
|
43
56
|
const zoomOption = zoomOptions?.[axis.id];
|
|
44
57
|
const zoom = zoomData?.find(({
|
|
45
58
|
axisId
|
|
46
59
|
}) => axisId === axis.id);
|
|
47
60
|
const zoomRange = zoom ? [zoom.start, zoom.end] : [0, 100];
|
|
48
|
-
const range = getRange(drawingArea, axisDirection, axis
|
|
49
|
-
const [minData, maxData] = (0, _getAxisExtremum.getAxisExtremum)(axis, extremumGetters,
|
|
61
|
+
const range = getRange(drawingArea, axisDirection, axis);
|
|
62
|
+
const [minData, maxData] = (0, _getAxisExtremum.getAxisExtremum)(axis, extremumGetters, axisIndex, formattedSeries, zoom === undefined && !zoomOption ? getFilters : undefined // Do not apply filtering if zoom is already defined.
|
|
50
63
|
);
|
|
51
64
|
const data = axis.data ?? [];
|
|
52
65
|
if ((0, _axis.isBandScaleConfig)(axis)) {
|
|
53
66
|
const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
|
|
54
67
|
const barGapRatio = axis.barGapRatio ?? DEFAULT_BAR_GAP_RATIO;
|
|
55
68
|
// Reverse range because ordinal scales are presented from top to bottom on y-axis
|
|
56
|
-
const scaleRange = axisDirection === '
|
|
69
|
+
const scaleRange = axisDirection === 'y' ? [range[1], range[0]] : range;
|
|
57
70
|
const zoomedRange = (0, _zoom.zoomScaleRange)(scaleRange, zoomRange);
|
|
58
71
|
completeAxis[axis.id] = (0, _extends2.default)({
|
|
59
72
|
categoryGapRatio,
|
|
@@ -72,7 +85,7 @@ function computeValue({
|
|
|
72
85
|
}
|
|
73
86
|
}
|
|
74
87
|
if ((0, _axis.isPointScaleConfig)(axis)) {
|
|
75
|
-
const scaleRange = axisDirection === '
|
|
88
|
+
const scaleRange = axisDirection === 'y' ? [...range].reverse() : range;
|
|
76
89
|
const zoomedRange = (0, _zoom.zoomScaleRange)(scaleRange, zoomRange);
|
|
77
90
|
completeAxis[axis.id] = (0, _extends2.default)({}, axis, {
|
|
78
91
|
data,
|
package/node/internals/index.js
CHANGED
|
@@ -200,6 +200,18 @@ Object.keys(_getScale).forEach(function (key) {
|
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
|
+
var _computeAxisValue = require("./computeAxisValue");
|
|
204
|
+
Object.keys(_computeAxisValue).forEach(function (key) {
|
|
205
|
+
if (key === "default" || key === "__esModule") return;
|
|
206
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
207
|
+
if (key in exports && exports[key] === _computeAxisValue[key]) return;
|
|
208
|
+
Object.defineProperty(exports, key, {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function () {
|
|
211
|
+
return _computeAxisValue[key];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
203
215
|
var _CartesianProvider = require("../context/CartesianProvider");
|
|
204
216
|
Object.keys(_CartesianProvider).forEach(function (key) {
|
|
205
217
|
if (key === "default" || key === "__esModule") return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.18.0",
|
|
4
4
|
"description": "The community edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/mui/mui-x.git",
|
|
28
|
+
"url": "git+https://github.com/mui/mui-x.git",
|
|
29
29
|
"directory": "packages/x-charts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@react-spring/web": "^9.7.4",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"prop-types": "^15.8.1",
|
|
38
|
-
"@mui/x-charts-vendor": "7.
|
|
39
|
-
"@mui/x-internals": "7.
|
|
38
|
+
"@mui/x-charts-vendor": "7.18.0",
|
|
39
|
+
"@mui/x-internals": "7.18.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AxisConfig, ScaleName } from '../../models';
|
|
2
|
-
import { ChartsXAxisProps, ChartsAxisProps, ChartsYAxisProps } from '../../models/axis';
|
|
3
|
-
import { CartesianChartSeriesType } from '../../models/seriesType/config';
|
|
4
|
-
import { DrawingArea } from '../DrawingProvider';
|
|
5
|
-
import { FormattedSeries } from '../SeriesProvider';
|
|
6
|
-
import { ExtremumGetter } from '../PluginProvider';
|
|
7
|
-
import { DefaultizedAxisConfig, ZoomData, ZoomOptions, GetZoomAxisFilters } from './Cartesian.types';
|
|
8
|
-
type ComputeResult<T extends ChartsAxisProps> = {
|
|
9
|
-
axis: DefaultizedAxisConfig<T>;
|
|
10
|
-
axisIds: string[];
|
|
11
|
-
};
|
|
12
|
-
type ComputeCommonParams = {
|
|
13
|
-
drawingArea: DrawingArea;
|
|
14
|
-
formattedSeries: FormattedSeries;
|
|
15
|
-
extremumGetters: {
|
|
16
|
-
[K in CartesianChartSeriesType]?: ExtremumGetter<K>;
|
|
17
|
-
};
|
|
18
|
-
zoomData?: ZoomData[];
|
|
19
|
-
zoomOptions?: ZoomOptions;
|
|
20
|
-
getFilters?: GetZoomAxisFilters;
|
|
21
|
-
};
|
|
22
|
-
export declare function computeValue(options: ComputeCommonParams & {
|
|
23
|
-
axis: AxisConfig<ScaleName, any, ChartsYAxisProps>[];
|
|
24
|
-
axisDirection: 'y';
|
|
25
|
-
}): ComputeResult<ChartsYAxisProps>;
|
|
26
|
-
export declare function computeValue(options: ComputeCommonParams & {
|
|
27
|
-
axis: AxisConfig<ScaleName, any, ChartsXAxisProps>[];
|
|
28
|
-
axisDirection: 'x';
|
|
29
|
-
}): ComputeResult<ChartsAxisProps>;
|
|
30
|
-
export {};
|
package/internals/warning.d.ts
DELETED
package/internals/warning.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const warnedOnceCache = new Set();
|
|
2
|
-
|
|
3
|
-
// TODO move to @mui/x-internals
|
|
4
|
-
// TODO eventually move to @base_ui/internals. Base UI, etc. too need this helper.
|
|
5
|
-
export function warnOnce(message, gravity = 'warning') {
|
|
6
|
-
if (process.env.NODE_ENV === 'production') {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const cleanMessage = Array.isArray(message) ? message.join('\n') : message;
|
|
10
|
-
if (!warnedOnceCache.has(cleanMessage)) {
|
|
11
|
-
warnedOnceCache.add(cleanMessage);
|
|
12
|
-
if (gravity === 'error') {
|
|
13
|
-
console.error(cleanMessage);
|
|
14
|
-
} else {
|
|
15
|
-
console.warn(cleanMessage);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export function clearWarningsCache() {
|
|
20
|
-
warnedOnceCache.clear();
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const warnedOnceCache = new Set();
|
|
2
|
-
|
|
3
|
-
// TODO move to @mui/x-internals
|
|
4
|
-
// TODO eventually move to @base_ui/internals. Base UI, etc. too need this helper.
|
|
5
|
-
export function warnOnce(message, gravity = 'warning') {
|
|
6
|
-
if (process.env.NODE_ENV === 'production') {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const cleanMessage = Array.isArray(message) ? message.join('\n') : message;
|
|
10
|
-
if (!warnedOnceCache.has(cleanMessage)) {
|
|
11
|
-
warnedOnceCache.add(cleanMessage);
|
|
12
|
-
if (gravity === 'error') {
|
|
13
|
-
console.error(cleanMessage);
|
|
14
|
-
} else {
|
|
15
|
-
console.warn(cleanMessage);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export function clearWarningsCache() {
|
|
20
|
-
warnedOnceCache.clear();
|
|
21
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.clearWarningsCache = clearWarningsCache;
|
|
7
|
-
exports.warnOnce = warnOnce;
|
|
8
|
-
const warnedOnceCache = new Set();
|
|
9
|
-
|
|
10
|
-
// TODO move to @mui/x-internals
|
|
11
|
-
// TODO eventually move to @base_ui/internals. Base UI, etc. too need this helper.
|
|
12
|
-
function warnOnce(message, gravity = 'warning') {
|
|
13
|
-
if (process.env.NODE_ENV === 'production') {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const cleanMessage = Array.isArray(message) ? message.join('\n') : message;
|
|
17
|
-
if (!warnedOnceCache.has(cleanMessage)) {
|
|
18
|
-
warnedOnceCache.add(cleanMessage);
|
|
19
|
-
if (gravity === 'error') {
|
|
20
|
-
console.error(cleanMessage);
|
|
21
|
-
} else {
|
|
22
|
-
console.warn(cleanMessage);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function clearWarningsCache() {
|
|
27
|
-
warnedOnceCache.clear();
|
|
28
|
-
}
|