@mui/x-charts 8.0.0-alpha.12 → 8.0.0-alpha.14
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 +14 -30
- package/BarChart/BarPlot.js +10 -7
- package/BarChart/checkScaleErrors.d.ts +4 -1
- package/BarChart/checkScaleErrors.js +7 -1
- package/BarChart/seriesConfig/extremums.d.ts +1 -1
- package/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/{internals/defaultizeColor.js → BarChart/seriesConfig/getSeriesWithDefaultValues.js} +6 -11
- package/BarChart/seriesConfig/index.js +3 -1
- package/BarChart/useBarChartProps.js +3 -18
- package/CHANGELOG.md +430 -0
- package/ChartContainer/ChartContainer.d.ts +2 -2
- package/ChartContainer/ChartContainer.js +122 -7
- package/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/ChartContainer/useChartContainerProps.js +6 -2
- package/ChartDataProvider/ChartDataProvider.d.ts +2 -2
- package/ChartDataProvider/ChartDataProvider.js +4 -3
- package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/ChartsAxis/ChartsAxis.d.ts +1 -25
- package/ChartsAxis/ChartsAxis.js +25 -87
- package/ChartsAxis/axisClasses.d.ts +5 -1
- package/ChartsLabel/ChartsLabelMark.d.ts +6 -1
- package/ChartsLabel/ChartsLabelMark.js +15 -2
- package/ChartsLabel/index.d.ts +1 -1
- package/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.js +1 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +107 -64
- package/ChartsYAxis/ChartsYAxis.js +21 -20
- package/Gauge/Gauge.js +4 -3
- package/Gauge/GaugeContainer.js +7 -5
- package/LineChart/LineChart.d.ts +1 -1
- package/LineChart/LineChart.js +14 -30
- package/LineChart/LinePlot.js +2 -1
- package/LineChart/seriesConfig/extremums.d.ts +1 -1
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/LineChart/seriesConfig/index.js +3 -1
- package/LineChart/useLineChartProps.js +2 -17
- package/PieChart/PieArcLabelPlot.js +1 -1
- package/PieChart/PieArcPlot.js +1 -1
- package/PieChart/PieChart.d.ts +1 -1
- package/PieChart/PieChart.js +6 -4
- package/PieChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/PieChart/seriesConfig/getSeriesWithDefaultValues.js +18 -0
- package/PieChart/seriesConfig/index.js +3 -1
- package/RadarChart/RadarChart.d.ts +24 -0
- package/RadarChart/RadarChart.js +150 -0
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +24 -0
- package/RadarChart/RadarDataProvider/RadarDataProvider.js +168 -0
- package/RadarChart/RadarDataProvider/index.d.ts +1 -0
- package/RadarChart/RadarDataProvider/index.js +16 -0
- package/RadarChart/RadarDataProvider/radar.types.d.ts +32 -0
- package/RadarChart/RadarGrid/RadarGrid.d.ts +13 -0
- package/RadarChart/RadarGrid/RadarGrid.js +51 -0
- package/RadarChart/RadarGrid/index.d.ts +1 -0
- package/RadarChart/RadarGrid/index.js +16 -0
- package/RadarChart/RadarGrid/useRadarGridData.d.ts +10 -0
- package/RadarChart/RadarGrid/useRadarGridData.js +35 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +7 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +46 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +7 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +45 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +7 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +48 -0
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +12 -0
- package/RadarChart/RadarSeriesPlot/getAreaPath.d.ts +4 -0
- package/RadarChart/RadarSeriesPlot/getAreaPath.js +9 -0
- package/RadarChart/RadarSeriesPlot/index.d.ts +4 -0
- package/RadarChart/RadarSeriesPlot/index.js +38 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +27 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +67 -0
- package/RadarChart/index.d.ts +6 -0
- package/RadarChart/index.js +47 -0
- package/RadarChart/seriesConfig/extremums.d.ts +3 -0
- package/RadarChart/seriesConfig/extremums.js +26 -0
- package/RadarChart/seriesConfig/formatter.d.ts +3 -0
- package/RadarChart/seriesConfig/formatter.js +18 -0
- package/RadarChart/seriesConfig/getColor.d.ts +3 -0
- package/RadarChart/seriesConfig/getColor.js +10 -0
- package/RadarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/RadarChart/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/RadarChart/seriesConfig/index.d.ts +2 -0
- package/RadarChart/seriesConfig/index.js +22 -0
- package/RadarChart/seriesConfig/legend.d.ts +3 -0
- package/RadarChart/seriesConfig/legend.js +28 -0
- package/RadarChart/seriesConfig/tooltip.d.ts +3 -0
- package/RadarChart/seriesConfig/tooltip.js +31 -0
- package/RadarChart/useRadarChartProps.d.ts +23 -0
- package/RadarChart/useRadarChartProps.js +74 -0
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterChart.js +14 -30
- package/ScatterChart/seriesConfig/extremums.d.ts +1 -1
- package/ScatterChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/ScatterChart/seriesConfig/getSeriesWithDefaultValues.js +15 -0
- package/ScatterChart/seriesConfig/index.js +3 -1
- package/ScatterChart/useScatterChartProps.js +2 -17
- package/SparkLineChart/SparkLineChart.d.ts +5 -9
- package/SparkLineChart/SparkLineChart.js +23 -21
- package/constants/index.d.ts +5 -1
- package/constants/index.js +12 -6
- package/context/AnimationProvider/useSkipAnimation.js +1 -1
- package/context/ChartProvider/ChartProvider.types.d.ts +6 -6
- package/esm/BarChart/BarChart.d.ts +1 -1
- package/esm/BarChart/BarChart.js +14 -30
- package/esm/BarChart/BarPlot.js +10 -7
- package/esm/BarChart/checkScaleErrors.d.ts +4 -1
- package/esm/BarChart/checkScaleErrors.js +7 -1
- package/esm/BarChart/seriesConfig/extremums.d.ts +1 -1
- package/esm/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/BarChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/BarChart/seriesConfig/index.js +3 -1
- package/esm/BarChart/useBarChartProps.js +3 -18
- package/esm/ChartContainer/ChartContainer.d.ts +2 -2
- package/esm/ChartContainer/ChartContainer.js +122 -7
- package/esm/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/esm/ChartContainer/useChartContainerProps.js +6 -2
- package/esm/ChartDataProvider/ChartDataProvider.d.ts +2 -2
- package/esm/ChartDataProvider/ChartDataProvider.js +4 -3
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/esm/ChartsAxis/ChartsAxis.d.ts +1 -25
- package/esm/ChartsAxis/ChartsAxis.js +24 -86
- package/esm/ChartsAxis/axisClasses.d.ts +5 -1
- package/esm/ChartsLabel/ChartsLabelMark.d.ts +6 -1
- package/esm/ChartsLabel/ChartsLabelMark.js +15 -2
- package/esm/ChartsLabel/index.d.ts +1 -1
- package/esm/ChartsLabel/index.js +0 -3
- package/esm/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/esm/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/esm/ChartsLabel/labelMarkClasses.js +1 -1
- package/esm/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +107 -64
- package/esm/ChartsYAxis/ChartsYAxis.js +22 -21
- package/esm/Gauge/Gauge.js +4 -3
- package/esm/Gauge/GaugeContainer.js +7 -5
- package/esm/LineChart/LineChart.d.ts +1 -1
- package/esm/LineChart/LineChart.js +14 -30
- package/esm/LineChart/LinePlot.js +2 -1
- package/esm/LineChart/seriesConfig/extremums.d.ts +1 -1
- package/esm/LineChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/LineChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/LineChart/seriesConfig/index.js +3 -1
- package/esm/LineChart/useLineChartProps.js +2 -17
- package/esm/PieChart/PieArcLabelPlot.js +1 -1
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.d.ts +1 -1
- package/esm/PieChart/PieChart.js +6 -4
- package/esm/PieChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/PieChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/esm/PieChart/seriesConfig/index.js +3 -1
- package/esm/RadarChart/RadarChart.d.ts +24 -0
- package/esm/RadarChart/RadarChart.js +144 -0
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +24 -0
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.js +162 -0
- package/esm/RadarChart/RadarDataProvider/index.d.ts +1 -0
- package/esm/RadarChart/RadarDataProvider/index.js +1 -0
- package/esm/RadarChart/RadarDataProvider/radar.types.d.ts +32 -0
- package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +13 -0
- package/esm/RadarChart/RadarGrid/RadarGrid.js +44 -0
- package/esm/RadarChart/RadarGrid/index.d.ts +1 -0
- package/esm/RadarChart/RadarGrid/index.js +1 -0
- package/esm/RadarChart/RadarGrid/useRadarGridData.d.ts +10 -0
- package/esm/RadarChart/RadarGrid/useRadarGridData.js +29 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +7 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +39 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +7 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +38 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +7 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +41 -0
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +12 -0
- package/esm/RadarChart/RadarSeriesPlot/getAreaPath.d.ts +4 -0
- package/esm/RadarChart/RadarSeriesPlot/getAreaPath.js +3 -0
- package/esm/RadarChart/RadarSeriesPlot/index.d.ts +4 -0
- package/esm/RadarChart/RadarSeriesPlot/index.js +3 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +27 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +60 -0
- package/esm/RadarChart/index.d.ts +6 -0
- package/esm/RadarChart/index.js +4 -0
- package/esm/RadarChart/seriesConfig/extremums.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/extremums.js +18 -0
- package/esm/RadarChart/seriesConfig/formatter.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/formatter.js +12 -0
- package/esm/RadarChart/seriesConfig/getColor.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/getColor.js +4 -0
- package/esm/RadarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/RadarChart/seriesConfig/index.d.ts +2 -0
- package/esm/RadarChart/seriesConfig/index.js +15 -0
- package/esm/RadarChart/seriesConfig/legend.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/legend.js +22 -0
- package/esm/RadarChart/seriesConfig/tooltip.d.ts +3 -0
- package/esm/RadarChart/seriesConfig/tooltip.js +25 -0
- package/esm/RadarChart/useRadarChartProps.d.ts +23 -0
- package/esm/RadarChart/useRadarChartProps.js +67 -0
- package/esm/ScatterChart/ScatterChart.d.ts +1 -1
- package/esm/ScatterChart/ScatterChart.js +14 -30
- package/esm/ScatterChart/seriesConfig/extremums.d.ts +1 -1
- package/esm/ScatterChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/esm/ScatterChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/esm/ScatterChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChart/useScatterChartProps.js +2 -17
- package/esm/SparkLineChart/SparkLineChart.d.ts +5 -9
- package/esm/SparkLineChart/SparkLineChart.js +23 -21
- package/esm/constants/index.d.ts +5 -1
- package/esm/constants/index.js +11 -5
- package/esm/context/AnimationProvider/useSkipAnimation.js +1 -1
- package/esm/context/ChartProvider/ChartProvider.types.d.ts +6 -6
- package/esm/hooks/useAxis.d.ts +13 -3
- package/esm/hooks/useAxis.js +42 -1
- package/esm/hooks/useRadarSeries.d.ts +35 -0
- package/esm/hooks/useRadarSeries.js +42 -0
- package/esm/hooks/useScale.d.ts +3 -1
- package/esm/hooks/useScale.js +9 -1
- package/esm/hooks/useSvgRef.js +1 -1
- package/esm/hooks/useTicks.js +17 -11
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/internals/clampAngle.d.ts +2 -0
- package/esm/internals/clampAngle.js +4 -0
- package/esm/internals/components/AxisSharedComponents.js +2 -2
- package/esm/internals/configInit.d.ts +11 -4
- package/esm/internals/configInit.js +22 -4
- package/esm/internals/defaultizeMargin.d.ts +3 -0
- package/esm/internals/defaultizeMargin.js +15 -0
- package/esm/internals/domUtils.js +1 -0
- package/esm/internals/index.d.ts +5 -0
- package/esm/internals/index.js +5 -0
- package/esm/internals/invertTextAnchor.d.ts +2 -0
- package/esm/internals/invertTextAnchor.js +10 -0
- package/esm/internals/isPolar.d.ts +7 -0
- package/esm/internals/isPolar.js +7 -0
- package/esm/internals/plugins/allPlugins.d.ts +3 -2
- package/esm/internals/plugins/allPlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +52 -31
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +19 -18
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.js +7 -13
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +10 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +37 -35
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +81 -13
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +6 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +20 -19
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -31
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/{useChartCartesianAxis.selectors.d.ts → useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
- package/{modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js → esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js} +4 -6
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +9 -4
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +27 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +133 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.js +24 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.js +21 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +57 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +1453 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +26 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +55 -0
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
- package/esm/internals/plugins/models/plugin.d.ts +1 -1
- package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +3 -0
- package/esm/internals/plugins/models/seriesConfig/index.d.ts +4 -2
- package/esm/internals/plugins/models/seriesConfig/index.js +4 -2
- package/esm/internals/plugins/models/seriesConfig/polarExtremumGetter.types.d.ts +16 -0
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +8 -2
- package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/esm/internals/plugins/utils/ChartStore.d.ts +7 -7
- package/esm/internals/plugins/utils/selectors.d.ts +1 -0
- package/esm/internals/stackSeries.d.ts +4 -6
- package/esm/internals/store/useCharts.js +0 -8
- package/esm/internals/store/useSelector.d.ts +1 -1
- package/esm/internals/store/useSelector.js +4 -1
- package/esm/internals/store/useStore.js +1 -1
- package/esm/models/axis.d.ts +73 -12
- package/esm/models/axis.js +4 -0
- package/esm/models/colorMapping.d.ts +1 -1
- package/esm/models/index.d.ts +0 -1
- package/esm/models/index.js +0 -1
- package/esm/models/seriesType/bar.d.ts +1 -1
- package/esm/models/seriesType/config.d.ts +20 -10
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/models/seriesType/line.d.ts +1 -1
- package/esm/models/seriesType/pie.d.ts +1 -1
- package/esm/models/seriesType/radar.d.ts +24 -0
- package/esm/models/seriesType/radar.js +1 -0
- package/esm/models/seriesType/scatter.d.ts +1 -1
- package/esm/models/z-axis.d.ts +1 -1
- package/hooks/useAxis.d.ts +13 -3
- package/hooks/useAxis.js +50 -5
- package/hooks/useRadarSeries.d.ts +35 -0
- package/hooks/useRadarSeries.js +48 -0
- package/hooks/useScale.d.ts +3 -1
- package/hooks/useScale.js +10 -0
- package/hooks/useSvgRef.js +1 -1
- package/hooks/useTicks.js +17 -11
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/clampAngle.d.ts +2 -0
- package/internals/clampAngle.js +10 -0
- package/internals/components/AxisSharedComponents.js +2 -2
- package/internals/configInit.d.ts +11 -4
- package/internals/configInit.js +23 -5
- package/internals/defaultizeMargin.d.ts +3 -0
- package/internals/defaultizeMargin.js +22 -0
- package/internals/domUtils.js +1 -0
- package/internals/index.d.ts +5 -0
- package/internals/index.js +60 -0
- package/internals/invertTextAnchor.d.ts +2 -0
- package/internals/invertTextAnchor.js +16 -0
- package/internals/isPolar.d.ts +7 -0
- package/internals/isPolar.js +14 -0
- package/internals/plugins/allPlugins.d.ts +3 -2
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +51 -30
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +20 -19
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
- package/internals/plugins/corePlugins/useChartSeries/processSeries.js +7 -14
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +10 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +39 -37
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +82 -13
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +14 -7
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +12 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +20 -19
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -31
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +11 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/{useChartCartesianAxis.selectors.d.ts → useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
- package/internals/plugins/featurePlugins/useChartCartesianAxis/{useChartCartesianAxis.selectors.js → useChartCartesianAxisRendering.selectors.js} +10 -13
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +27 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +140 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.js +31 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.js +28 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +65 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +1453 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +33 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +55 -0
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
- package/internals/plugins/models/plugin.d.ts +1 -1
- package/internals/plugins/models/seriesConfig/cartesianExtremumGetter.types.js +5 -0
- package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +3 -0
- package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.js +5 -0
- package/internals/plugins/models/seriesConfig/index.d.ts +4 -2
- package/internals/plugins/models/seriesConfig/index.js +26 -4
- package/internals/plugins/models/seriesConfig/polarExtremumGetter.types.d.ts +16 -0
- package/internals/plugins/models/seriesConfig/polarExtremumGetter.types.js +5 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +8 -2
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/internals/plugins/utils/ChartStore.d.ts +7 -7
- package/internals/plugins/utils/selectors.d.ts +1 -0
- package/internals/stackSeries.d.ts +4 -6
- package/internals/store/useCharts.js +0 -8
- package/internals/store/useSelector.d.ts +1 -1
- package/internals/store/useSelector.js +5 -1
- package/internals/store/useStore.js +1 -1
- package/models/axis.d.ts +73 -12
- package/models/axis.js +4 -0
- package/models/colorMapping.d.ts +1 -1
- package/models/index.d.ts +0 -1
- package/models/index.js +0 -11
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/config.d.ts +20 -10
- package/models/seriesType/index.d.ts +1 -0
- package/models/seriesType/index.js +12 -0
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/radar.d.ts +24 -0
- package/models/seriesType/radar.js +5 -0
- package/models/seriesType/scatter.d.ts +1 -1
- package/models/z-axis.d.ts +1 -1
- package/modern/BarChart/BarChart.d.ts +1 -1
- package/modern/BarChart/BarChart.js +14 -30
- package/modern/BarChart/BarPlot.js +10 -7
- package/modern/BarChart/checkScaleErrors.d.ts +4 -1
- package/modern/BarChart/checkScaleErrors.js +7 -1
- package/modern/BarChart/seriesConfig/extremums.d.ts +1 -1
- package/modern/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/BarChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/BarChart/seriesConfig/index.js +3 -1
- package/modern/BarChart/useBarChartProps.js +3 -18
- package/modern/ChartContainer/ChartContainer.d.ts +2 -2
- package/modern/ChartContainer/ChartContainer.js +122 -7
- package/modern/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/modern/ChartContainer/useChartContainerProps.js +6 -2
- package/modern/ChartDataProvider/ChartDataProvider.d.ts +2 -2
- package/modern/ChartDataProvider/ChartDataProvider.js +4 -3
- package/modern/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/modern/ChartsAxis/ChartsAxis.d.ts +1 -25
- package/modern/ChartsAxis/ChartsAxis.js +24 -86
- package/modern/ChartsAxis/axisClasses.d.ts +5 -1
- package/modern/ChartsLabel/ChartsLabelMark.d.ts +6 -1
- package/modern/ChartsLabel/ChartsLabelMark.js +15 -2
- package/modern/ChartsLabel/index.d.ts +1 -1
- package/modern/ChartsLabel/index.js +0 -3
- package/modern/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/modern/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/modern/ChartsLabel/labelMarkClasses.js +1 -1
- package/modern/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
- package/modern/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
- package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +107 -64
- package/modern/ChartsYAxis/ChartsYAxis.js +22 -21
- package/modern/Gauge/Gauge.js +4 -3
- package/modern/Gauge/GaugeContainer.js +7 -5
- package/modern/LineChart/LineChart.d.ts +1 -1
- package/modern/LineChart/LineChart.js +14 -30
- package/modern/LineChart/LinePlot.js +2 -1
- package/modern/LineChart/seriesConfig/extremums.d.ts +1 -1
- package/modern/LineChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/LineChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/LineChart/seriesConfig/index.js +3 -1
- package/modern/LineChart/useLineChartProps.js +2 -17
- package/modern/PieChart/PieArcLabelPlot.js +1 -1
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.d.ts +1 -1
- package/modern/PieChart/PieChart.js +6 -4
- package/modern/PieChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/PieChart/seriesConfig/getSeriesWithDefaultValues.js +11 -0
- package/modern/PieChart/seriesConfig/index.js +3 -1
- package/modern/RadarChart/RadarChart.d.ts +24 -0
- package/modern/RadarChart/RadarChart.js +144 -0
- package/modern/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +24 -0
- package/modern/RadarChart/RadarDataProvider/RadarDataProvider.js +162 -0
- package/modern/RadarChart/RadarDataProvider/index.d.ts +1 -0
- package/modern/RadarChart/RadarDataProvider/index.js +1 -0
- package/modern/RadarChart/RadarDataProvider/radar.types.d.ts +32 -0
- package/modern/RadarChart/RadarDataProvider/radar.types.js +1 -0
- package/modern/RadarChart/RadarGrid/RadarGrid.d.ts +13 -0
- package/modern/RadarChart/RadarGrid/RadarGrid.js +44 -0
- package/modern/RadarChart/RadarGrid/index.d.ts +1 -0
- package/modern/RadarChart/RadarGrid/index.js +1 -0
- package/modern/RadarChart/RadarGrid/useRadarGridData.d.ts +10 -0
- package/modern/RadarChart/RadarGrid/useRadarGridData.js +29 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +7 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +39 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +7 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +38 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +7 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +41 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +12 -0
- package/modern/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.js +1 -0
- package/modern/RadarChart/RadarSeriesPlot/getAreaPath.d.ts +4 -0
- package/modern/RadarChart/RadarSeriesPlot/getAreaPath.js +3 -0
- package/modern/RadarChart/RadarSeriesPlot/index.d.ts +4 -0
- package/modern/RadarChart/RadarSeriesPlot/index.js +3 -0
- package/modern/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +27 -0
- package/modern/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +60 -0
- package/modern/RadarChart/index.d.ts +6 -0
- package/modern/RadarChart/index.js +4 -0
- package/modern/RadarChart/seriesConfig/extremums.d.ts +3 -0
- package/modern/RadarChart/seriesConfig/extremums.js +18 -0
- package/modern/RadarChart/seriesConfig/formatter.d.ts +3 -0
- package/modern/RadarChart/seriesConfig/formatter.js +12 -0
- package/modern/RadarChart/seriesConfig/getColor.d.ts +3 -0
- package/modern/RadarChart/seriesConfig/getColor.js +4 -0
- package/modern/RadarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/RadarChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/RadarChart/seriesConfig/index.d.ts +2 -0
- package/modern/RadarChart/seriesConfig/index.js +15 -0
- package/modern/RadarChart/seriesConfig/legend.d.ts +3 -0
- package/modern/RadarChart/seriesConfig/legend.js +22 -0
- package/modern/RadarChart/seriesConfig/tooltip.d.ts +3 -0
- package/modern/RadarChart/seriesConfig/tooltip.js +25 -0
- package/modern/RadarChart/useRadarChartProps.d.ts +23 -0
- package/modern/RadarChart/useRadarChartProps.js +67 -0
- package/modern/ScatterChart/ScatterChart.d.ts +1 -1
- package/modern/ScatterChart/ScatterChart.js +14 -30
- package/modern/ScatterChart/seriesConfig/extremums.d.ts +1 -1
- package/modern/ScatterChart/seriesConfig/getSeriesWithDefaultValues.d.ts +3 -0
- package/modern/ScatterChart/seriesConfig/getSeriesWithDefaultValues.js +8 -0
- package/modern/ScatterChart/seriesConfig/index.js +3 -1
- package/modern/ScatterChart/useScatterChartProps.js +2 -17
- package/modern/SparkLineChart/SparkLineChart.d.ts +5 -9
- package/modern/SparkLineChart/SparkLineChart.js +23 -21
- package/modern/constants/index.d.ts +5 -1
- package/modern/constants/index.js +11 -5
- package/modern/context/AnimationProvider/useSkipAnimation.js +1 -1
- package/modern/context/ChartProvider/ChartProvider.types.d.ts +6 -6
- package/modern/hooks/useAxis.d.ts +13 -3
- package/modern/hooks/useAxis.js +42 -1
- package/modern/hooks/useRadarSeries.d.ts +35 -0
- package/modern/hooks/useRadarSeries.js +42 -0
- package/modern/hooks/useScale.d.ts +3 -1
- package/modern/hooks/useScale.js +9 -1
- package/modern/hooks/useSvgRef.js +1 -1
- package/modern/hooks/useTicks.js +17 -11
- package/modern/index.d.ts +1 -0
- package/modern/index.js +2 -1
- package/modern/internals/clampAngle.d.ts +2 -0
- package/modern/internals/clampAngle.js +4 -0
- package/modern/internals/components/AxisSharedComponents.js +2 -2
- package/modern/internals/configInit.d.ts +11 -4
- package/modern/internals/configInit.js +22 -4
- package/modern/internals/defaultizeMargin.d.ts +3 -0
- package/modern/internals/defaultizeMargin.js +15 -0
- package/modern/internals/domUtils.js +1 -0
- package/modern/internals/index.d.ts +5 -0
- package/modern/internals/index.js +5 -0
- package/modern/internals/invertTextAnchor.d.ts +2 -0
- package/modern/internals/invertTextAnchor.js +10 -0
- package/modern/internals/isPolar.d.ts +7 -0
- package/modern/internals/isPolar.js +7 -0
- package/modern/internals/plugins/allPlugins.d.ts +3 -2
- package/modern/internals/plugins/allPlugins.js +2 -1
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +52 -31
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +19 -18
- package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
- package/modern/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
- package/modern/internals/plugins/corePlugins/useChartSeries/processSeries.js +7 -13
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
- package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +10 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +37 -35
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +81 -13
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +6 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +20 -19
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -31
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -0
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/{useChartCartesianAxis.selectors.d.ts → useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
- package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js → modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js} +4 -6
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
- package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +9 -4
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +27 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +133 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.d.ts +5 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.js +24 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +5 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.js +21 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/index.d.ts +3 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.d.ts +3 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +57 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +1453 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +26 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +55 -0
- package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.js +1 -0
- package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
- package/modern/internals/plugins/models/plugin.d.ts +1 -1
- package/modern/internals/plugins/models/seriesConfig/cartesianExtremumGetter.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +3 -0
- package/modern/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/index.d.ts +4 -2
- package/modern/internals/plugins/models/seriesConfig/index.js +4 -2
- package/modern/internals/plugins/models/seriesConfig/polarExtremumGetter.types.d.ts +16 -0
- package/modern/internals/plugins/models/seriesConfig/polarExtremumGetter.types.js +1 -0
- package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +8 -2
- package/modern/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/modern/internals/plugins/utils/ChartStore.d.ts +7 -7
- package/modern/internals/plugins/utils/selectors.d.ts +1 -0
- package/modern/internals/stackSeries.d.ts +4 -6
- package/modern/internals/store/useCharts.js +0 -8
- package/modern/internals/store/useSelector.d.ts +1 -1
- package/modern/internals/store/useSelector.js +4 -1
- package/modern/internals/store/useStore.js +1 -1
- package/modern/models/axis.d.ts +73 -12
- package/modern/models/axis.js +4 -0
- package/modern/models/colorMapping.d.ts +1 -1
- package/modern/models/index.d.ts +0 -1
- package/modern/models/index.js +0 -1
- package/modern/models/seriesType/bar.d.ts +1 -1
- package/modern/models/seriesType/config.d.ts +20 -10
- package/modern/models/seriesType/index.d.ts +1 -0
- package/modern/models/seriesType/index.js +1 -0
- package/modern/models/seriesType/line.d.ts +1 -1
- package/modern/models/seriesType/pie.d.ts +1 -1
- package/modern/models/seriesType/radar.d.ts +24 -0
- package/modern/models/seriesType/radar.js +1 -0
- package/modern/models/seriesType/scatter.d.ts +1 -1
- package/modern/models/z-axis.d.ts +1 -1
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/context/PolarProvider/Polar.types.d.ts +0 -42
- package/context/PolarProvider/PolarContext.d.ts +0 -4
- package/context/PolarProvider/PolarContext.js +0 -20
- package/context/PolarProvider/PolarProvider.d.ts +0 -0
- package/context/PolarProvider/PolarProvider.js +0 -62
- package/context/PolarProvider/getAxisExtremum.d.ts +0 -0
- package/context/PolarProvider/getAxisExtremum.js +0 -49
- package/context/PolarProvider/index.d.ts +0 -0
- package/context/PolarProvider/index.js +0 -1
- package/context/PolarProvider/usePolarContext.d.ts +0 -0
- package/context/PolarProvider/usePolarContext.js +0 -12
- package/esm/context/PolarProvider/Polar.types.d.ts +0 -42
- package/esm/context/PolarProvider/PolarContext.d.ts +0 -4
- package/esm/context/PolarProvider/PolarContext.js +0 -13
- package/esm/context/PolarProvider/PolarProvider.d.ts +0 -0
- package/esm/context/PolarProvider/PolarProvider.js +0 -61
- package/esm/context/PolarProvider/getAxisExtremum.d.ts +0 -0
- package/esm/context/PolarProvider/getAxisExtremum.js +0 -48
- package/esm/context/PolarProvider/index.d.ts +0 -0
- package/esm/context/PolarProvider/index.js +0 -0
- package/esm/context/PolarProvider/usePolarContext.d.ts +0 -0
- package/esm/context/PolarProvider/usePolarContext.js +0 -11
- package/esm/internals/calculateMargins.d.ts +0 -7
- package/esm/internals/calculateMargins.js +0 -25
- package/esm/internals/defaultizeColor.d.ts +0 -107
- package/esm/internals/defaultizeColor.js +0 -13
- package/esm/models/layout.d.ts +0 -18
- package/internals/calculateMargins.d.ts +0 -7
- package/internals/calculateMargins.js +0 -33
- package/internals/defaultizeColor.d.ts +0 -107
- package/models/layout.d.ts +0 -18
- package/modern/context/PolarProvider/Polar.types.d.ts +0 -42
- package/modern/context/PolarProvider/PolarContext.d.ts +0 -4
- package/modern/context/PolarProvider/PolarContext.js +0 -13
- package/modern/context/PolarProvider/PolarProvider.d.ts +0 -0
- package/modern/context/PolarProvider/PolarProvider.js +0 -61
- package/modern/context/PolarProvider/getAxisExtremum.d.ts +0 -0
- package/modern/context/PolarProvider/getAxisExtremum.js +0 -48
- package/modern/context/PolarProvider/index.d.ts +0 -0
- package/modern/context/PolarProvider/index.js +0 -0
- package/modern/context/PolarProvider/usePolarContext.d.ts +0 -0
- package/modern/context/PolarProvider/usePolarContext.js +0 -11
- package/modern/internals/calculateMargins.d.ts +0 -7
- package/modern/internals/calculateMargins.js +0 -25
- package/modern/internals/defaultizeColor.d.ts +0 -107
- package/modern/internals/defaultizeColor.js +0 -13
- package/modern/models/layout.d.ts +0 -18
- /package/{context/PolarProvider/Polar.types.js → RadarChart/RadarDataProvider/radar.types.js} +0 -0
- /package/{internals/plugins/models/seriesConfig/extremumGetter.types.js → RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.js} +0 -0
- /package/esm/{context/PolarProvider/Polar.types.js → RadarChart/RadarDataProvider/radar.types.js} +0 -0
- /package/esm/{internals/plugins/models/seriesConfig/extremumGetter.types.js → RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.js} +0 -0
- /package/esm/{models/layout.js → internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.js} +0 -0
- /package/esm/internals/plugins/models/seriesConfig/{extremumGetter.types.d.ts → cartesianExtremumGetter.types.d.ts} +0 -0
- /package/{modern/context/PolarProvider/Polar.types.js → esm/internals/plugins/models/seriesConfig/cartesianExtremumGetter.types.js} +0 -0
- /package/{modern/internals/plugins/models/seriesConfig/extremumGetter.types.js → esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.js} +0 -0
- /package/{modern/models/layout.js → esm/internals/plugins/models/seriesConfig/polarExtremumGetter.types.js} +0 -0
- /package/{models/layout.js → internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.js} +0 -0
- /package/internals/plugins/models/seriesConfig/{extremumGetter.types.d.ts → cartesianExtremumGetter.types.d.ts} +0 -0
- /package/modern/internals/plugins/models/seriesConfig/{extremumGetter.types.d.ts → cartesianExtremumGetter.types.d.ts} +0 -0
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["scale", "tickNumber", "reverse"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import { useThemeProps, useTheme, styled } from '@mui/material/styles';
|
|
11
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
12
|
+
import { clampAngle } from "../internals/clampAngle.js";
|
|
13
|
+
import { getStringSize } from "../internals/domUtils.js";
|
|
11
14
|
import { useTicks } from "../hooks/useTicks.js";
|
|
12
15
|
import { getAxisUtilityClass } from "../ChartsAxis/axisClasses.js";
|
|
13
16
|
import { AxisRoot } from "../internals/components/AxisSharedComponents.js";
|
|
@@ -20,6 +23,7 @@ import { isInfinity } from "../internals/isInfinity.js";
|
|
|
20
23
|
import { isBandScale } from "../internals/isBandScale.js";
|
|
21
24
|
import { useChartContext } from "../context/ChartProvider/useChartContext.js";
|
|
22
25
|
import { useXAxes } from "../hooks/useAxis.js";
|
|
26
|
+
import { invertTextAnchor } from "../internals/invertTextAnchor.js";
|
|
23
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
28
|
const useUtilityClasses = ownerState => {
|
|
25
29
|
const {
|
|
@@ -36,61 +40,88 @@ const useUtilityClasses = ownerState => {
|
|
|
36
40
|
};
|
|
37
41
|
return composeClasses(slots, getAxisUtilityClass, classes);
|
|
38
42
|
};
|
|
39
|
-
|
|
43
|
+
|
|
44
|
+
/* Returns a set of indices of the tick labels that should be visible. */
|
|
45
|
+
function getVisibleLabels(xTicks, {
|
|
40
46
|
tickLabelStyle: style,
|
|
41
47
|
tickLabelInterval,
|
|
48
|
+
tickLabelMinGap,
|
|
42
49
|
reverse,
|
|
43
|
-
isMounted
|
|
50
|
+
isMounted,
|
|
51
|
+
isPointInside
|
|
44
52
|
}) {
|
|
45
|
-
const
|
|
53
|
+
const getTickLabelSize = tick => {
|
|
46
54
|
if (!isMounted || tick.formattedValue === undefined) {
|
|
47
|
-
return
|
|
55
|
+
return {
|
|
48
56
|
width: 0,
|
|
49
57
|
height: 0
|
|
50
|
-
}
|
|
58
|
+
};
|
|
51
59
|
}
|
|
52
60
|
const tickSizes = getWordsByLines({
|
|
53
61
|
style,
|
|
54
62
|
needsComputation: true,
|
|
55
63
|
text: tick.formattedValue
|
|
56
64
|
});
|
|
57
|
-
return
|
|
65
|
+
return {
|
|
58
66
|
width: Math.max(...tickSizes.map(size => size.width)),
|
|
59
67
|
height: Math.max(tickSizes.length * tickSizes[0].height)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
62
70
|
if (typeof tickLabelInterval === 'function') {
|
|
63
|
-
return
|
|
64
|
-
skipLabel: !tickLabelInterval(item.value, index)
|
|
65
|
-
}));
|
|
71
|
+
return new Set(xTicks.filter((item, index) => tickLabelInterval(item.value, index)));
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
// Filter label to avoid overlap
|
|
69
|
-
let currentTextLimit = 0;
|
|
70
75
|
let previousTextLimit = 0;
|
|
71
76
|
const direction = reverse ? -1 : 1;
|
|
72
|
-
return
|
|
77
|
+
return new Set(xTicks.filter((item, labelIndex) => {
|
|
73
78
|
const {
|
|
74
|
-
width,
|
|
75
79
|
offset,
|
|
76
|
-
labelOffset
|
|
77
|
-
height
|
|
80
|
+
labelOffset
|
|
78
81
|
} = item;
|
|
79
|
-
const distance = getMinXTranslation(width, height, style?.angle);
|
|
80
82
|
const textPosition = offset + labelOffset;
|
|
81
|
-
|
|
83
|
+
if (labelIndex > 0 && direction * textPosition < direction * (previousTextLimit + tickLabelMinGap)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (!isPointInside(textPosition)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
82
89
|
|
|
83
|
-
|
|
84
|
-
|
|
90
|
+
/* Measuring text width is expensive, so we need to delay it as much as possible to improve performance. */
|
|
91
|
+
const {
|
|
92
|
+
width,
|
|
93
|
+
height
|
|
94
|
+
} = getTickLabelSize(item);
|
|
95
|
+
const distance = getMinXTranslation(width, height, style?.angle);
|
|
96
|
+
const currentTextLimit = textPosition - direction * distance / 2;
|
|
97
|
+
if (labelIndex > 0 && direction * currentTextLimit < direction * (previousTextLimit + tickLabelMinGap)) {
|
|
85
98
|
// Except for the first label, we skip all label that overlap with the last accepted.
|
|
86
99
|
// Notice that the early return prevents `previousTextLimit` from being updated.
|
|
87
|
-
return
|
|
88
|
-
skipLabel: true
|
|
89
|
-
});
|
|
100
|
+
return false;
|
|
90
101
|
}
|
|
91
|
-
previousTextLimit = textPosition + direction *
|
|
92
|
-
return
|
|
93
|
-
});
|
|
102
|
+
previousTextLimit = textPosition + direction * distance / 2;
|
|
103
|
+
return true;
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
function getDefaultTextAnchor(angle) {
|
|
107
|
+
const adjustedAngle = clampAngle(angle);
|
|
108
|
+
if (adjustedAngle === 0 || adjustedAngle === 180) {
|
|
109
|
+
return 'middle';
|
|
110
|
+
}
|
|
111
|
+
if (adjustedAngle < 180) {
|
|
112
|
+
return 'start';
|
|
113
|
+
}
|
|
114
|
+
return 'end';
|
|
115
|
+
}
|
|
116
|
+
function getDefaultBaseline(angle, position) {
|
|
117
|
+
const adjustedAngle = clampAngle(angle);
|
|
118
|
+
if (adjustedAngle === 0) {
|
|
119
|
+
return position === 'bottom' ? 'hanging' : 'auto';
|
|
120
|
+
}
|
|
121
|
+
if (adjustedAngle === 180) {
|
|
122
|
+
return position === 'bottom' ? 'auto' : 'hanging';
|
|
123
|
+
}
|
|
124
|
+
return 'central';
|
|
94
125
|
}
|
|
95
126
|
const XAxisRoot = styled(AxisRoot, {
|
|
96
127
|
name: 'MuiChartsXAxis',
|
|
@@ -98,10 +129,10 @@ const XAxisRoot = styled(AxisRoot, {
|
|
|
98
129
|
overridesResolver: (props, styles) => styles.root
|
|
99
130
|
})({});
|
|
100
131
|
const defaultProps = {
|
|
101
|
-
position: 'bottom',
|
|
102
132
|
disableLine: false,
|
|
103
133
|
disableTicks: false,
|
|
104
|
-
tickSize: 6
|
|
134
|
+
tickSize: 6,
|
|
135
|
+
tickLabelMinGap: 4
|
|
105
136
|
};
|
|
106
137
|
|
|
107
138
|
/**
|
|
@@ -146,12 +177,14 @@ function ChartsXAxis(inProps) {
|
|
|
146
177
|
tickLabelInterval,
|
|
147
178
|
tickPlacement,
|
|
148
179
|
tickLabelPlacement,
|
|
149
|
-
|
|
180
|
+
tickLabelMinGap,
|
|
181
|
+
sx,
|
|
182
|
+
offset,
|
|
183
|
+
height: axisHeight
|
|
150
184
|
} = defaultizedProps;
|
|
151
185
|
const theme = useTheme();
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
}));
|
|
186
|
+
const isRtl = useRtl();
|
|
187
|
+
const classes = useUtilityClasses(defaultizedProps);
|
|
155
188
|
const {
|
|
156
189
|
left,
|
|
157
190
|
top,
|
|
@@ -167,14 +200,16 @@ function ChartsXAxis(inProps) {
|
|
|
167
200
|
const Tick = slots?.axisTick ?? 'line';
|
|
168
201
|
const TickLabel = slots?.axisTickLabel ?? ChartsText;
|
|
169
202
|
const Label = slots?.axisLabel ?? ChartsText;
|
|
203
|
+
const defaultTextAnchor = getDefaultTextAnchor(tickLabelStyle?.angle ?? 0);
|
|
204
|
+
const shouldInvertTextAnchor = isRtl && position !== 'top' || !isRtl && position === 'top';
|
|
170
205
|
const axisTickLabelProps = useSlotProps({
|
|
171
206
|
elementType: TickLabel,
|
|
172
207
|
externalSlotProps: slotProps?.axisTickLabel,
|
|
173
208
|
additionalProps: {
|
|
174
|
-
style: _extends({
|
|
209
|
+
style: _extends({}, theme.typography.caption, {
|
|
175
210
|
fontSize: 12,
|
|
176
|
-
textAnchor:
|
|
177
|
-
dominantBaseline:
|
|
211
|
+
textAnchor: shouldInvertTextAnchor ? invertTextAnchor(defaultTextAnchor) : defaultTextAnchor,
|
|
212
|
+
dominantBaseline: getDefaultBaseline(tickLabelStyle?.angle ?? 0, position)
|
|
178
213
|
}, tickLabelStyle)
|
|
179
214
|
},
|
|
180
215
|
className: classes.tickLabel,
|
|
@@ -188,21 +223,25 @@ function ChartsXAxis(inProps) {
|
|
|
188
223
|
tickPlacement,
|
|
189
224
|
tickLabelPlacement
|
|
190
225
|
});
|
|
191
|
-
const
|
|
226
|
+
const visibleLabels = getVisibleLabels(xTicks, {
|
|
192
227
|
tickLabelStyle: axisTickLabelProps.style,
|
|
193
228
|
tickLabelInterval,
|
|
229
|
+
tickLabelMinGap,
|
|
194
230
|
reverse,
|
|
195
|
-
isMounted
|
|
231
|
+
isMounted,
|
|
232
|
+
isPointInside: x => instance.isPointInside({
|
|
233
|
+
x,
|
|
234
|
+
y: -1
|
|
235
|
+
}, {
|
|
236
|
+
direction: 'x'
|
|
237
|
+
})
|
|
196
238
|
});
|
|
197
|
-
const labelRefPoint = {
|
|
198
|
-
x: left + width / 2,
|
|
199
|
-
y: positionSign * (tickSize + 22)
|
|
200
|
-
};
|
|
201
239
|
const axisLabelProps = useSlotProps({
|
|
202
240
|
elementType: Label,
|
|
203
241
|
externalSlotProps: slotProps?.axisLabel,
|
|
204
242
|
additionalProps: {
|
|
205
|
-
style: _extends({
|
|
243
|
+
style: _extends({}, theme.typography.body1, {
|
|
244
|
+
lineHeight: 1,
|
|
206
245
|
fontSize: 14,
|
|
207
246
|
textAnchor: 'middle',
|
|
208
247
|
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto'
|
|
@@ -215,44 +254,45 @@ function ChartsXAxis(inProps) {
|
|
|
215
254
|
// Skip axis rendering if no data is available
|
|
216
255
|
// - The domain is an empty array for band/point scales.
|
|
217
256
|
// - The domains contains Infinity for continuous scales.
|
|
218
|
-
|
|
257
|
+
// - The position is set to 'none'.
|
|
258
|
+
if (ordinalAxis && domain.length === 0 || !ordinalAxis && domain.some(isInfinity) || position === 'none') {
|
|
219
259
|
return null;
|
|
220
260
|
}
|
|
261
|
+
const labelHeight = label ? getStringSize(label, axisLabelProps.style).height : 0;
|
|
262
|
+
const labelRefPoint = {
|
|
263
|
+
x: left + width / 2,
|
|
264
|
+
y: positionSign * (axisHeight - labelHeight)
|
|
265
|
+
};
|
|
221
266
|
return /*#__PURE__*/_jsxs(XAxisRoot, {
|
|
222
|
-
transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
|
|
267
|
+
transform: `translate(0, ${position === 'bottom' ? top + height + offset : top - offset})`,
|
|
223
268
|
className: classes.root,
|
|
224
269
|
sx: sx,
|
|
225
270
|
children: [!disableLine && /*#__PURE__*/_jsx(Line, _extends({
|
|
226
271
|
x1: left,
|
|
227
272
|
x2: left + width,
|
|
228
273
|
className: classes.line
|
|
229
|
-
}, slotProps?.axisLine)),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
274
|
+
}, slotProps?.axisLine)), xTicks.map((item, index) => {
|
|
275
|
+
const {
|
|
276
|
+
formattedValue,
|
|
277
|
+
offset: tickOffset,
|
|
278
|
+
labelOffset
|
|
279
|
+
} = item;
|
|
235
280
|
const xTickLabel = labelOffset ?? 0;
|
|
236
281
|
const yTickLabel = positionSign * (tickSize + 3);
|
|
237
282
|
const showTick = instance.isPointInside({
|
|
238
|
-
x:
|
|
239
|
-
y: -1
|
|
240
|
-
}, {
|
|
241
|
-
direction: 'x'
|
|
242
|
-
});
|
|
243
|
-
const showTickLabel = instance.isPointInside({
|
|
244
|
-
x: offset + xTickLabel,
|
|
283
|
+
x: tickOffset,
|
|
245
284
|
y: -1
|
|
246
285
|
}, {
|
|
247
286
|
direction: 'x'
|
|
248
287
|
});
|
|
288
|
+
const showTickLabel = visibleLabels.has(item);
|
|
249
289
|
return /*#__PURE__*/_jsxs("g", {
|
|
250
|
-
transform: `translate(${
|
|
290
|
+
transform: `translate(${tickOffset}, 0)`,
|
|
251
291
|
className: classes.tickContainer,
|
|
252
292
|
children: [!disableTicks && showTick && /*#__PURE__*/_jsx(Tick, _extends({
|
|
253
293
|
y2: positionSign * tickSize,
|
|
254
294
|
className: classes.tick
|
|
255
|
-
}, slotProps?.axisTick)), formattedValue !== undefined &&
|
|
295
|
+
}, slotProps?.axisTick)), formattedValue !== undefined && showTickLabel && /*#__PURE__*/_jsx(TickLabel, _extends({
|
|
256
296
|
x: xTickLabel,
|
|
257
297
|
y: yTickLabel
|
|
258
298
|
}, axisTickLabelProps, {
|
|
@@ -272,6 +312,7 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
272
312
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
273
313
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
274
314
|
// ----------------------------------------------------------------------
|
|
315
|
+
axis: PropTypes.oneOf(['x']),
|
|
275
316
|
/**
|
|
276
317
|
* The id of the axis to render.
|
|
277
318
|
* If undefined, it will be the first defined axis.
|
|
@@ -304,10 +345,6 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
304
345
|
* The style applied to the axis label.
|
|
305
346
|
*/
|
|
306
347
|
labelStyle: PropTypes.object,
|
|
307
|
-
/**
|
|
308
|
-
* Position of the axis.
|
|
309
|
-
*/
|
|
310
|
-
position: PropTypes.oneOf(['bottom', 'top']),
|
|
311
348
|
/**
|
|
312
349
|
* The props used for each component slot.
|
|
313
350
|
* @default {}
|
|
@@ -341,6 +378,12 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
341
378
|
* @default 'auto'
|
|
342
379
|
*/
|
|
343
380
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
381
|
+
/**
|
|
382
|
+
* The minimum gap in pixels between two tick labels.
|
|
383
|
+
* If two tick labels are closer than this minimum gap, one of them will be hidden.
|
|
384
|
+
* @default 4
|
|
385
|
+
*/
|
|
386
|
+
tickLabelMinGap: PropTypes.number,
|
|
344
387
|
/**
|
|
345
388
|
* The placement of ticks label. Can be the middle of the band, or the tick position.
|
|
346
389
|
* Only used if scale is 'band'.
|
|
@@ -7,8 +7,9 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import { useThemeProps,
|
|
10
|
+
import { useThemeProps, styled, useTheme } from '@mui/material/styles';
|
|
11
11
|
import { useRtl } from '@mui/system/RtlProvider';
|
|
12
|
+
import { getStringSize } from "../internals/domUtils.js";
|
|
12
13
|
import { useTicks } from "../hooks/useTicks.js";
|
|
13
14
|
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
14
15
|
import { AxisRoot } from "../internals/components/AxisSharedComponents.js";
|
|
@@ -40,7 +41,6 @@ const YAxisRoot = styled(AxisRoot, {
|
|
|
40
41
|
overridesResolver: (props, styles) => styles.root
|
|
41
42
|
})({});
|
|
42
43
|
const defaultProps = {
|
|
43
|
-
position: 'left',
|
|
44
44
|
disableLine: false,
|
|
45
45
|
disableTicks: false,
|
|
46
46
|
tickSize: 6
|
|
@@ -86,13 +86,13 @@ function ChartsYAxis(inProps) {
|
|
|
86
86
|
tickLabelPlacement,
|
|
87
87
|
tickInterval,
|
|
88
88
|
tickLabelInterval,
|
|
89
|
-
sx
|
|
89
|
+
sx,
|
|
90
|
+
offset,
|
|
91
|
+
width: axisWidth
|
|
90
92
|
} = defaultizedProps;
|
|
91
93
|
const theme = useTheme();
|
|
92
94
|
const isRtl = useRtl();
|
|
93
|
-
const classes = useUtilityClasses(
|
|
94
|
-
theme
|
|
95
|
-
}));
|
|
95
|
+
const classes = useUtilityClasses(defaultizedProps);
|
|
96
96
|
const {
|
|
97
97
|
instance
|
|
98
98
|
} = useChartContext();
|
|
@@ -113,10 +113,6 @@ function ChartsYAxis(inProps) {
|
|
|
113
113
|
});
|
|
114
114
|
const positionSign = position === 'right' ? 1 : -1;
|
|
115
115
|
const tickFontSize = typeof tickLabelStyle?.fontSize === 'number' ? tickLabelStyle.fontSize : 12;
|
|
116
|
-
const labelRefPoint = {
|
|
117
|
-
x: positionSign * (tickFontSize + tickSize + 10),
|
|
118
|
-
y: top + height / 2
|
|
119
|
-
};
|
|
120
116
|
const Line = slots?.axisLine ?? 'line';
|
|
121
117
|
const Tick = slots?.axisTick ?? 'line';
|
|
122
118
|
const TickLabel = slots?.axisTickLabel ?? ChartsText;
|
|
@@ -126,7 +122,7 @@ function ChartsYAxis(inProps) {
|
|
|
126
122
|
elementType: TickLabel,
|
|
127
123
|
externalSlotProps: slotProps?.axisTickLabel,
|
|
128
124
|
additionalProps: {
|
|
129
|
-
style: _extends({
|
|
125
|
+
style: _extends({}, theme.typography.caption, {
|
|
130
126
|
fontSize: tickFontSize,
|
|
131
127
|
textAnchor: revertAnchor ? 'start' : 'end',
|
|
132
128
|
dominantBaseline: 'central'
|
|
@@ -139,7 +135,8 @@ function ChartsYAxis(inProps) {
|
|
|
139
135
|
elementType: Label,
|
|
140
136
|
externalSlotProps: slotProps?.axisLabel,
|
|
141
137
|
additionalProps: {
|
|
142
|
-
style: _extends({
|
|
138
|
+
style: _extends({}, theme.typography.body1, {
|
|
139
|
+
lineHeight: 1,
|
|
143
140
|
fontSize: 14,
|
|
144
141
|
angle: positionSign * 90,
|
|
145
142
|
textAnchor: 'middle',
|
|
@@ -158,14 +155,21 @@ function ChartsYAxis(inProps) {
|
|
|
158
155
|
});
|
|
159
156
|
const domain = yScale.domain();
|
|
160
157
|
const ordinalAxis = isBandScale(yScale);
|
|
158
|
+
|
|
161
159
|
// Skip axis rendering if no data is available
|
|
162
160
|
// - The domain is an empty array for band/point scales.
|
|
163
161
|
// - The domains contains Infinity for continuous scales.
|
|
164
|
-
|
|
162
|
+
// - The position is 'none'.
|
|
163
|
+
if (ordinalAxis && domain.length === 0 || !ordinalAxis && domain.some(isInfinity) || position === 'none') {
|
|
165
164
|
return null;
|
|
166
165
|
}
|
|
166
|
+
const labelHeight = label ? getStringSize(label, axisLabelProps.style).height : 0;
|
|
167
|
+
const labelRefPoint = {
|
|
168
|
+
x: positionSign * (axisWidth - labelHeight),
|
|
169
|
+
y: top + height / 2
|
|
170
|
+
};
|
|
167
171
|
return /*#__PURE__*/_jsxs(YAxisRoot, {
|
|
168
|
-
transform: `translate(${position === 'right' ? left + width : left}, 0)`,
|
|
172
|
+
transform: `translate(${position === 'right' ? left + width + offset : left - offset}, 0)`,
|
|
169
173
|
className: classes.root,
|
|
170
174
|
sx: sx,
|
|
171
175
|
children: [!disableLine && /*#__PURE__*/_jsx(Line, _extends({
|
|
@@ -174,7 +178,7 @@ function ChartsYAxis(inProps) {
|
|
|
174
178
|
className: classes.line
|
|
175
179
|
}, lineSlotProps)), yTicks.map(({
|
|
176
180
|
formattedValue,
|
|
177
|
-
offset,
|
|
181
|
+
offset: tickOffset,
|
|
178
182
|
labelOffset,
|
|
179
183
|
value
|
|
180
184
|
}, index) => {
|
|
@@ -183,7 +187,7 @@ function ChartsYAxis(inProps) {
|
|
|
183
187
|
const skipLabel = typeof tickLabelInterval === 'function' && !tickLabelInterval?.(value, index);
|
|
184
188
|
const showLabel = instance.isPointInside({
|
|
185
189
|
x: -1,
|
|
186
|
-
y:
|
|
190
|
+
y: tickOffset
|
|
187
191
|
}, {
|
|
188
192
|
direction: 'y'
|
|
189
193
|
});
|
|
@@ -191,7 +195,7 @@ function ChartsYAxis(inProps) {
|
|
|
191
195
|
return null;
|
|
192
196
|
}
|
|
193
197
|
return /*#__PURE__*/_jsxs("g", {
|
|
194
|
-
transform: `translate(0, ${
|
|
198
|
+
transform: `translate(0, ${tickOffset})`,
|
|
195
199
|
className: classes.tickContainer,
|
|
196
200
|
children: [!disableTicks && /*#__PURE__*/_jsx(Tick, _extends({
|
|
197
201
|
x2: positionSign * tickSize,
|
|
@@ -215,6 +219,7 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
215
219
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
216
220
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
217
221
|
// ----------------------------------------------------------------------
|
|
222
|
+
axis: PropTypes.oneOf(['y']),
|
|
218
223
|
/**
|
|
219
224
|
* The id of the axis to render.
|
|
220
225
|
* If undefined, it will be the first defined axis.
|
|
@@ -247,10 +252,6 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
247
252
|
* The style applied to the axis label.
|
|
248
253
|
*/
|
|
249
254
|
labelStyle: PropTypes.object,
|
|
250
|
-
/**
|
|
251
|
-
* Position of the axis.
|
|
252
|
-
*/
|
|
253
|
-
position: PropTypes.oneOf(['left', 'right']),
|
|
254
255
|
/**
|
|
255
256
|
* The props used for each component slot.
|
|
256
257
|
* @default {}
|
package/esm/Gauge/Gauge.js
CHANGED
|
@@ -97,14 +97,15 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
|
|
|
97
97
|
/**
|
|
98
98
|
* The margin between the SVG and the drawing area.
|
|
99
99
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
100
|
-
*
|
|
100
|
+
*
|
|
101
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
101
102
|
*/
|
|
102
|
-
margin: PropTypes.shape({
|
|
103
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
103
104
|
bottom: PropTypes.number,
|
|
104
105
|
left: PropTypes.number,
|
|
105
106
|
right: PropTypes.number,
|
|
106
107
|
top: PropTypes.number
|
|
107
|
-
}),
|
|
108
|
+
})]),
|
|
108
109
|
/**
|
|
109
110
|
* The radius between circle center and the end of the arc.
|
|
110
111
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -9,6 +9,7 @@ import { styled } from '@mui/material/styles';
|
|
|
9
9
|
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
10
10
|
import { GaugeProvider } from "./GaugeProvider.js";
|
|
11
11
|
import { ChartProvider } from "../context/ChartProvider/index.js";
|
|
12
|
+
import { defaultizeMargin } from "../internals/defaultizeMargin.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
const GStyled = styled('g')(({
|
|
14
15
|
theme
|
|
@@ -41,12 +42,12 @@ const GaugeContainer = /*#__PURE__*/React.forwardRef(function GaugeContainer(pro
|
|
|
41
42
|
pluginParams: {
|
|
42
43
|
width: inWidth,
|
|
43
44
|
height: inHeight,
|
|
44
|
-
margin:
|
|
45
|
+
margin: defaultizeMargin(margin, {
|
|
45
46
|
left: 10,
|
|
46
47
|
right: 10,
|
|
47
48
|
top: 10,
|
|
48
49
|
bottom: 10
|
|
49
|
-
}
|
|
50
|
+
})
|
|
50
51
|
},
|
|
51
52
|
plugins: [],
|
|
52
53
|
children: /*#__PURE__*/_jsx(GaugeProvider, {
|
|
@@ -127,14 +128,15 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
|
|
|
127
128
|
/**
|
|
128
129
|
* The margin between the SVG and the drawing area.
|
|
129
130
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
130
|
-
*
|
|
131
|
+
*
|
|
132
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
131
133
|
*/
|
|
132
|
-
margin: PropTypes.shape({
|
|
134
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
133
135
|
bottom: PropTypes.number,
|
|
134
136
|
left: PropTypes.number,
|
|
135
137
|
right: PropTypes.number,
|
|
136
138
|
top: PropTypes.number
|
|
137
|
-
}),
|
|
139
|
+
})]),
|
|
138
140
|
/**
|
|
139
141
|
* The radius between circle center and the end of the arc.
|
|
140
142
|
* Can be a number (in px) or a string with a percentage such as '50%'.
|
|
@@ -21,7 +21,7 @@ export interface LineChartProps extends Omit<ChartContainerProps<'line', LineCha
|
|
|
21
21
|
* The series to display in the line chart.
|
|
22
22
|
* An array of [[LineSeriesType]] objects.
|
|
23
23
|
*/
|
|
24
|
-
series: MakeOptional<LineSeriesType, 'type'>[]
|
|
24
|
+
series: Readonly<MakeOptional<LineSeriesType, 'type'>[]>;
|
|
25
25
|
/**
|
|
26
26
|
* Option to display a cartesian grid in the background.
|
|
27
27
|
*/
|
|
@@ -87,12 +87,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
87
87
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
88
88
|
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
89
89
|
}),
|
|
90
|
-
/**
|
|
91
|
-
* Indicate which axis to display the bottom of the charts.
|
|
92
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
93
|
-
* @default xAxisIds[0] The id of the first provided axis
|
|
94
|
-
*/
|
|
95
|
-
bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
96
90
|
children: PropTypes.node,
|
|
97
91
|
className: PropTypes.string,
|
|
98
92
|
/**
|
|
@@ -143,12 +137,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
143
137
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
144
138
|
*/
|
|
145
139
|
id: PropTypes.string,
|
|
146
|
-
/**
|
|
147
|
-
* Indicate which axis to display the left of the charts.
|
|
148
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
149
|
-
* @default yAxisIds[0] The id of the first provided axis
|
|
150
|
-
*/
|
|
151
|
-
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
152
140
|
/**
|
|
153
141
|
* If `true`, a loading overlay is displayed.
|
|
154
142
|
* @default false
|
|
@@ -157,14 +145,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
157
145
|
/**
|
|
158
146
|
* The margin between the SVG and the drawing area.
|
|
159
147
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
160
|
-
*
|
|
148
|
+
*
|
|
149
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
161
150
|
*/
|
|
162
|
-
margin: PropTypes.shape({
|
|
151
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
163
152
|
bottom: PropTypes.number,
|
|
164
153
|
left: PropTypes.number,
|
|
165
154
|
right: PropTypes.number,
|
|
166
155
|
top: PropTypes.number
|
|
167
|
-
}),
|
|
156
|
+
})]),
|
|
168
157
|
/**
|
|
169
158
|
* Callback fired when an area element is clicked.
|
|
170
159
|
*/
|
|
@@ -190,12 +179,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
190
179
|
* Callback fired when a mark element is clicked.
|
|
191
180
|
*/
|
|
192
181
|
onMarkClick: PropTypes.func,
|
|
193
|
-
/**
|
|
194
|
-
* Indicate which axis to display the right of the charts.
|
|
195
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
196
|
-
* @default null
|
|
197
|
-
*/
|
|
198
|
-
rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
199
182
|
/**
|
|
200
183
|
* The series to display in the line chart.
|
|
201
184
|
* An array of [[LineSeriesType]] objects.
|
|
@@ -219,12 +202,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
219
202
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
220
203
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
221
204
|
title: PropTypes.string,
|
|
222
|
-
/**
|
|
223
|
-
* Indicate which axis to display the top of the charts.
|
|
224
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
225
|
-
* @default null
|
|
226
|
-
*/
|
|
227
|
-
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
228
205
|
/**
|
|
229
206
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
230
207
|
*/
|
|
@@ -235,6 +212,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
235
212
|
* An array of [[AxisConfig]] objects.
|
|
236
213
|
*/
|
|
237
214
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
215
|
+
axis: PropTypes.oneOf(['x']),
|
|
238
216
|
classes: PropTypes.object,
|
|
239
217
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
240
218
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -257,13 +235,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
257
235
|
disableTicks: PropTypes.bool,
|
|
258
236
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
259
237
|
fill: PropTypes.string,
|
|
238
|
+
height: PropTypes.number,
|
|
260
239
|
hideTooltip: PropTypes.bool,
|
|
261
240
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
262
241
|
label: PropTypes.string,
|
|
263
242
|
labelStyle: PropTypes.object,
|
|
264
243
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
265
244
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
266
|
-
|
|
245
|
+
offset: PropTypes.number,
|
|
246
|
+
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
267
247
|
reverse: PropTypes.bool,
|
|
268
248
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
269
249
|
slotProps: PropTypes.object,
|
|
@@ -272,6 +252,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
272
252
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
273
253
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
274
254
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
255
|
+
tickLabelMinGap: PropTypes.number,
|
|
275
256
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
276
257
|
tickLabelStyle: PropTypes.object,
|
|
277
258
|
tickMaxStep: PropTypes.number,
|
|
@@ -287,6 +268,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
287
268
|
* An array of [[AxisConfig]] objects.
|
|
288
269
|
*/
|
|
289
270
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
271
|
+
axis: PropTypes.oneOf(['y']),
|
|
290
272
|
classes: PropTypes.object,
|
|
291
273
|
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
292
274
|
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
@@ -315,7 +297,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
315
297
|
labelStyle: PropTypes.object,
|
|
316
298
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
317
299
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
318
|
-
|
|
300
|
+
offset: PropTypes.number,
|
|
301
|
+
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
319
302
|
reverse: PropTypes.bool,
|
|
320
303
|
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
321
304
|
slotProps: PropTypes.object,
|
|
@@ -331,7 +314,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
331
314
|
tickNumber: PropTypes.number,
|
|
332
315
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
333
316
|
tickSize: PropTypes.number,
|
|
334
|
-
valueFormatter: PropTypes.func
|
|
317
|
+
valueFormatter: PropTypes.func,
|
|
318
|
+
width: PropTypes.number
|
|
335
319
|
}))
|
|
336
320
|
} : void 0;
|
|
337
321
|
export { LineChart };
|
|
@@ -6,6 +6,7 @@ const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
9
10
|
import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
|
|
10
11
|
import { LineElement, lineElementClasses } from "./LineElement.js";
|
|
11
12
|
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
@@ -72,7 +73,7 @@ const useAggregatedData = () => {
|
|
|
72
73
|
throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
|
|
73
74
|
}
|
|
74
75
|
if (xData.length < stackedData.length) {
|
|
75
|
-
|
|
76
|
+
warnOnce(`MUI X: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`, 'error');
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
const shouldExpand = curve?.includes('step') && !strictStepCurve && isBandScale(xScale);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CartesianExtremumGetter } from "../../internals/plugins/models/seriesConfig/
|
|
1
|
+
import { CartesianExtremumGetter } from "../../internals/plugins/models/seriesConfig/index.js";
|
|
2
2
|
export declare const getExtremumX: CartesianExtremumGetter<'line'>;
|
|
3
3
|
export declare const getExtremumY: CartesianExtremumGetter<'line'>;
|