@mui/x-charts 8.0.0-alpha.13 → 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/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/CHANGELOG.md +131 -0
- package/ChartContainer/ChartContainer.d.ts +1 -1
- package/ChartContainer/ChartContainer.js +107 -0
- package/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/ChartContainer/useChartContainerProps.js +6 -2
- package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +38 -8
- package/ChartsYAxis/ChartsYAxis.js +12 -7
- 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/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/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/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/constants/index.d.ts +3 -6
- package/constants/index.js +6 -7
- 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/ChartContainer/ChartContainer.d.ts +1 -1
- package/esm/ChartContainer/ChartContainer.js +107 -0
- package/esm/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/esm/ChartContainer/useChartContainerProps.js +6 -2
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +38 -8
- package/esm/ChartsYAxis/ChartsYAxis.js +13 -8
- 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/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/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/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/constants/index.d.ts +3 -6
- package/esm/constants/index.js +5 -6
- package/esm/hooks/useAxis.d.ts +11 -1
- package/esm/hooks/useAxis.js +41 -0
- 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/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/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/useChartSeries/processSeries.js +7 -13
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +59 -19
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +0 -18
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +10 -10
- 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/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +3 -0
- package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.js +1 -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/polarExtremumGetter.types.js +1 -0
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +8 -2
- package/esm/internals/stackSeries.d.ts +4 -6
- package/esm/models/axis.d.ts +27 -12
- package/esm/models/axis.js +4 -0
- package/esm/models/seriesType/config.d.ts +19 -9
- package/esm/models/seriesType/index.d.ts +1 -0
- package/esm/models/seriesType/index.js +1 -0
- package/esm/models/seriesType/radar.d.ts +24 -0
- package/esm/models/seriesType/radar.js +1 -0
- package/hooks/useAxis.d.ts +11 -1
- package/hooks/useAxis.js +45 -0
- 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/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/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/useChartSeries/processSeries.js +7 -14
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +5 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +60 -19
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +10 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +0 -18
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +10 -10
- 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/useChartPolarAxis/useChartPolarAxis.types.js +5 -0
- 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/stackSeries.d.ts +4 -6
- package/models/axis.d.ts +27 -12
- package/models/axis.js +4 -0
- package/models/seriesType/config.d.ts +19 -9
- package/models/seriesType/index.d.ts +1 -0
- package/models/seriesType/index.js +12 -0
- package/models/seriesType/radar.d.ts +24 -0
- package/models/seriesType/radar.js +5 -0
- 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/ChartContainer/ChartContainer.d.ts +1 -1
- package/modern/ChartContainer/ChartContainer.js +107 -0
- package/modern/ChartContainer/useChartContainerProps.d.ts +1 -1
- package/modern/ChartContainer/useChartContainerProps.js +6 -2
- package/modern/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +38 -8
- package/modern/ChartsYAxis/ChartsYAxis.js +13 -8
- 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/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/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/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/modern/constants/index.d.ts +3 -6
- package/modern/constants/index.js +5 -6
- package/modern/hooks/useAxis.d.ts +11 -1
- package/modern/hooks/useAxis.js +41 -0
- 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/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/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/useChartSeries/processSeries.js +7 -13
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +5 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +2 -2
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +59 -19
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -1
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -5
- package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +0 -18
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +10 -10
- 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/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/stackSeries.d.ts +4 -6
- package/modern/models/axis.d.ts +27 -12
- package/modern/models/axis.js +4 -0
- package/modern/models/seriesType/config.d.ts +19 -9
- package/modern/models/seriesType/index.d.ts +1 -0
- package/modern/models/seriesType/index.js +1 -0
- package/modern/models/seriesType/radar.d.ts +24 -0
- package/modern/models/seriesType/radar.js +1 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/context/PolarProvider/Polar.types.d.ts +0 -43
- 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 -43
- 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/defaultizeColor.d.ts +0 -107
- package/esm/internals/defaultizeColor.js +0 -13
- package/internals/defaultizeColor.d.ts +0 -107
- package/modern/context/PolarProvider/Polar.types.d.ts +0 -43
- 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/defaultizeColor.d.ts +0 -107
- package/modern/internals/defaultizeColor.js +0 -13
- /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/{modern/context/PolarProvider/Polar.types.js → esm/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/internals/plugins/models/seriesConfig/extremumGetter.types.js → esm/internals/plugins/models/seriesConfig/cartesianExtremumGetter.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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/index.js";
|
|
2
|
+
import { selectorChartSeriesConfig, selectorChartSeriesProcessed } from "../../corePlugins/useChartSeries/index.js";
|
|
3
|
+
import { createSelector } from "../../utils/selectors.js";
|
|
4
|
+
import { computeAxisValue } from "./computeAxisValue.js";
|
|
5
|
+
export const selectorChartPolarAxisState = state => state.polarAxis;
|
|
6
|
+
export const selectorChartRawRotationAxis = createSelector(selectorChartPolarAxisState, axis => axis?.rotation);
|
|
7
|
+
export const selectorChartRawRadiusAxis = createSelector(selectorChartPolarAxisState, axis => axis?.radius);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The only interesting selectors that merge axis data and zoom if provided.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const selectorChartRotationAxis = createSelector([selectorChartRawRotationAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig], (axis, drawingArea, formattedSeries, seriesConfig) => computeAxisValue({
|
|
14
|
+
drawingArea,
|
|
15
|
+
formattedSeries,
|
|
16
|
+
axis,
|
|
17
|
+
seriesConfig,
|
|
18
|
+
axisDirection: 'rotation'
|
|
19
|
+
}));
|
|
20
|
+
export const selectorChartRadiusAxis = createSelector([selectorChartRawRadiusAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig], (axis, drawingArea, formattedSeries, seriesConfig) => computeAxisValue({
|
|
21
|
+
drawingArea,
|
|
22
|
+
formattedSeries,
|
|
23
|
+
axis,
|
|
24
|
+
seriesConfig,
|
|
25
|
+
axisDirection: 'radius'
|
|
26
|
+
}));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChartPluginSignature } from "../../models/index.js";
|
|
2
|
+
import { ChartSeriesType, DatasetType } from "../../../../models/seriesType/config.js";
|
|
3
|
+
import { ScaleName, AxisId, AxisConfig, ChartsRotationAxisProps, ChartsRadiusAxisProps } from "../../../../models/axis.js";
|
|
4
|
+
import { UseChartSeriesSignature } from "../../corePlugins/useChartSeries/index.js";
|
|
5
|
+
import { DefaultizedAxisConfig } from "../useChartCartesianAxis/index.js";
|
|
6
|
+
export type PolarAxisState = {
|
|
7
|
+
/**
|
|
8
|
+
* Mapping from rotation-axis key to scaling configuration.
|
|
9
|
+
*/
|
|
10
|
+
rotationAxis: DefaultizedAxisConfig<ChartsRotationAxisProps>;
|
|
11
|
+
/**
|
|
12
|
+
* Mapping from radius-axis key to scaling configuration.
|
|
13
|
+
*/
|
|
14
|
+
radiusAxis: DefaultizedAxisConfig<ChartsRadiusAxisProps>;
|
|
15
|
+
/**
|
|
16
|
+
* The rotation-axes IDs sorted by order they were provided.
|
|
17
|
+
*/
|
|
18
|
+
rotationAxisIds: AxisId[];
|
|
19
|
+
/**
|
|
20
|
+
* The radius-axes IDs sorted by order they were provided.
|
|
21
|
+
*/
|
|
22
|
+
radiusAxisIds: AxisId[];
|
|
23
|
+
};
|
|
24
|
+
export interface UseChartPolarAxisParameters {
|
|
25
|
+
/**
|
|
26
|
+
* The configuration of the rotation-axes.
|
|
27
|
+
* If not provided, a default axis config is used.
|
|
28
|
+
* An array of [[AxisConfig]] objects.
|
|
29
|
+
*/
|
|
30
|
+
rotationAxis?: AxisConfig<ScaleName, any, ChartsRotationAxisProps>[];
|
|
31
|
+
/**
|
|
32
|
+
* The configuration of the radial-axes.
|
|
33
|
+
* If not provided, a default axis config is used.
|
|
34
|
+
* An array of [[AxisConfig]] objects.
|
|
35
|
+
*/
|
|
36
|
+
radiusAxis?: AxisConfig<'linear', any, ChartsRadiusAxisProps>[];
|
|
37
|
+
/**
|
|
38
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
39
|
+
*/
|
|
40
|
+
dataset?: Readonly<DatasetType>;
|
|
41
|
+
}
|
|
42
|
+
export type UseChartPolarAxisDefaultizedParameters = UseChartPolarAxisParameters & {};
|
|
43
|
+
export interface UseChartPolarAxisState {
|
|
44
|
+
polarAxis: {
|
|
45
|
+
rotation: AxisConfig<ScaleName, any, ChartsRotationAxisProps>[];
|
|
46
|
+
radius: AxisConfig<'linear', any, ChartsRadiusAxisProps>[];
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface UseChartPolarAxisInstance {}
|
|
50
|
+
export type UseChartPolarAxisSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
51
|
+
params: UseChartPolarAxisParameters;
|
|
52
|
+
defaultizedParams: UseChartPolarAxisDefaultizedParameters;
|
|
53
|
+
state: UseChartPolarAxisState;
|
|
54
|
+
dependencies: [UseChartSeriesSignature<SeriesType>];
|
|
55
|
+
}>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ChartSeries, ChartSeriesType } from '../../../../models/seriesType/config';
|
|
2
|
+
import type { AllSeriesType } from '../../../../models/seriesType';
|
|
3
|
+
export type GetSeriesWithDefaultValues<T extends ChartSeriesType> = (series: AllSeriesType<T>, seriesIndex: number, colors: string[]) => ChartSeries<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./colorProcessor.types.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./cartesianExtremumGetter.types.js";
|
|
3
|
+
export * from "./polarExtremumGetter.types.js";
|
|
3
4
|
export * from "./seriesConfig.types.js";
|
|
4
5
|
export * from "./seriesProcessor.types.js";
|
|
5
6
|
export * from "./tooltipGetter.types.js";
|
|
6
|
-
export * from "./legendGetter.types.js";
|
|
7
|
+
export * from "./legendGetter.types.js";
|
|
8
|
+
export * from "./getSeriesWithDefaultValues.types.js";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./colorProcessor.types.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./cartesianExtremumGetter.types.js";
|
|
3
|
+
export * from "./polarExtremumGetter.types.js";
|
|
3
4
|
export * from "./seriesConfig.types.js";
|
|
4
5
|
export * from "./seriesProcessor.types.js";
|
|
5
6
|
export * from "./tooltipGetter.types.js";
|
|
6
|
-
export * from "./legendGetter.types.js";
|
|
7
|
+
export * from "./legendGetter.types.js";
|
|
8
|
+
export * from "./getSeriesWithDefaultValues.types.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PolarChartSeriesType, ChartSeriesDefaultized } from '../../../../models/seriesType/config';
|
|
2
|
+
import type { AxisConfig } from '../../../../models/axis';
|
|
3
|
+
import type { SeriesId } from '../../../../models/seriesType/common';
|
|
4
|
+
type PolarExtremumGetterParams<TSeriesType extends PolarChartSeriesType> = {
|
|
5
|
+
series: Record<SeriesId, ChartSeriesDefaultized<TSeriesType>>;
|
|
6
|
+
axis: AxisConfig;
|
|
7
|
+
axisIndex: number;
|
|
8
|
+
isDefaultAxis: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type PolarExtremumGetterResult = [number, number];
|
|
11
|
+
export type PolarExtremumGetter<TSeriesType extends PolarChartSeriesType> = (params: PolarExtremumGetterParams<TSeriesType>) => PolarExtremumGetterResult;
|
|
12
|
+
export type PolarExtremumFilter = (value: {
|
|
13
|
+
x: number | Date | string | null;
|
|
14
|
+
y: number | Date | string | null;
|
|
15
|
+
}, dataIndex: number) => boolean;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import type { SeriesProcessor } from './seriesProcessor.types';
|
|
2
|
-
import type { CartesianChartSeriesType, ChartSeriesType } from '../../../../models/seriesType/config';
|
|
2
|
+
import type { CartesianChartSeriesType, ChartSeriesType, PolarChartSeriesType } from '../../../../models/seriesType/config';
|
|
3
3
|
import type { ColorProcessor } from './colorProcessor.types';
|
|
4
|
-
import type { CartesianExtremumGetter } from './
|
|
4
|
+
import type { CartesianExtremumGetter } from './cartesianExtremumGetter.types';
|
|
5
5
|
import type { LegendGetter } from './legendGetter.types';
|
|
6
6
|
import type { TooltipGetter } from './tooltipGetter.types';
|
|
7
|
+
import { PolarExtremumGetter } from "./polarExtremumGetter.types.js";
|
|
8
|
+
import { GetSeriesWithDefaultValues } from "./getSeriesWithDefaultValues.types.js";
|
|
7
9
|
export type ChartSeriesTypeConfig<TSeriesType extends ChartSeriesType> = {
|
|
8
10
|
seriesProcessor: SeriesProcessor<TSeriesType>;
|
|
9
11
|
colorProcessor: ColorProcessor<TSeriesType>;
|
|
10
12
|
legendGetter: LegendGetter<TSeriesType>;
|
|
11
13
|
tooltipGetter: TooltipGetter<TSeriesType>;
|
|
14
|
+
getSeriesWithDefaultValues: GetSeriesWithDefaultValues<TSeriesType>;
|
|
12
15
|
} & (TSeriesType extends CartesianChartSeriesType ? {
|
|
13
16
|
xExtremumGetter: CartesianExtremumGetter<TSeriesType>;
|
|
14
17
|
yExtremumGetter: CartesianExtremumGetter<TSeriesType>;
|
|
18
|
+
} : {}) & (TSeriesType extends PolarChartSeriesType ? {
|
|
19
|
+
rotationExtremumGetter: PolarExtremumGetter<TSeriesType>;
|
|
20
|
+
radiusExtremumGetter: PolarExtremumGetter<TSeriesType>;
|
|
15
21
|
} : {});
|
|
16
22
|
export type ChartSeriesConfig<TSeriesType extends ChartSeriesType> = { [Key in TSeriesType]: ChartSeriesTypeConfig<Key> };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Series } from '@mui/x-charts-vendor/d3-shape';
|
|
2
|
-
import type { BarSeriesType, LineSeriesType } from '../models/seriesType';
|
|
3
2
|
import type { StackOffsetType, StackOrderType } from '../models/stacking';
|
|
4
|
-
import { SeriesId } from "../models/seriesType/common.js";
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
series: StackableSeries;
|
|
3
|
+
import { SeriesId, StackableSeriesType } from "../models/seriesType/common.js";
|
|
4
|
+
type FormatterParams<T> = {
|
|
5
|
+
series: Record<SeriesId, T>;
|
|
8
6
|
seriesOrder: SeriesId[];
|
|
9
7
|
defaultStrategy?: {
|
|
10
8
|
stackOrder?: StackOrderType;
|
|
@@ -23,5 +21,5 @@ export declare const StackOffset: { [key in StackOffsetType]: (series: Series<an
|
|
|
23
21
|
* @param series the object of all bars series
|
|
24
22
|
* @returns an array of groups, including the ids, the stacking order, and the stacking offset.
|
|
25
23
|
*/
|
|
26
|
-
export declare const getStackingGroups: (params: FormatterParams) => StackingGroupsType;
|
|
24
|
+
export declare const getStackingGroups: <T extends StackableSeriesType>(params: FormatterParams<T>) => StackingGroupsType;
|
|
27
25
|
export {};
|
package/esm/models/axis.d.ts
CHANGED
|
@@ -280,7 +280,10 @@ export type AxisValueFormatterContext<S extends ScaleName = ScaleName> = {
|
|
|
280
280
|
*/
|
|
281
281
|
scale: AxisScaleConfig[S]['scale'];
|
|
282
282
|
};
|
|
283
|
-
|
|
283
|
+
/**
|
|
284
|
+
* Config that is shared between cartesian and polar axes.
|
|
285
|
+
*/
|
|
286
|
+
type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
|
|
284
287
|
/**
|
|
285
288
|
* Id used to identify the axis.
|
|
286
289
|
*/
|
|
@@ -318,31 +321,43 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps exten
|
|
|
318
321
|
* If `true`, Reverse the axis scaleBand.
|
|
319
322
|
*/
|
|
320
323
|
reverse?: boolean;
|
|
321
|
-
/**
|
|
322
|
-
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
323
|
-
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
324
|
-
* Y-axis: A left axis will move left, and a right axis will move right.
|
|
325
|
-
* @default 0
|
|
326
|
-
*/
|
|
327
|
-
offset?: number;
|
|
328
324
|
/**
|
|
329
325
|
* Defines the axis scale domain based on the min/max values of series linked to it.
|
|
330
326
|
* - 'nice': Rounds the domain at human friendly values.
|
|
331
|
-
* - 'strict': Set the domain to the min/max value provided. No
|
|
327
|
+
* - 'strict': Set the domain to the min/max value provided. No extra space is added.
|
|
332
328
|
* - function: Receives the calculated extremums as parameters, and should return the axis domain.
|
|
333
329
|
*/
|
|
334
330
|
domainLimit?: 'nice' | 'strict' | ((min: number, max: number) => {
|
|
335
331
|
min: number;
|
|
336
332
|
max: number;
|
|
337
333
|
});
|
|
338
|
-
}
|
|
334
|
+
};
|
|
335
|
+
export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
|
|
336
|
+
/**
|
|
337
|
+
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
338
|
+
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
339
|
+
* Y-axis: A left axis will move left, and a right axis will move right.
|
|
340
|
+
* @default 0
|
|
341
|
+
*/
|
|
342
|
+
offset?: number;
|
|
343
|
+
} & CommonAxisConfig<S, V> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisConfigExtension;
|
|
344
|
+
export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
|
|
345
|
+
/**
|
|
346
|
+
* The offset of the axis in pixels. It can be used to move the axis from its default position.
|
|
347
|
+
* X-axis: A top axis will move up, and a bottom axis will move down.
|
|
348
|
+
* Y-axis: A left axis will move left, and a right axis will move right.
|
|
349
|
+
* @default 0
|
|
350
|
+
*/
|
|
351
|
+
offset?: number;
|
|
352
|
+
} & CommonAxisConfig<S, V> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
|
|
339
353
|
export interface AxisConfigExtension {}
|
|
340
|
-
export type
|
|
354
|
+
export type PolarAxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = Omit<PolarAxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S];
|
|
355
|
+
export type AxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = MakeRequired<Omit<AxisConfig<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
|
|
341
356
|
/**
|
|
342
357
|
* An indication of the expected number of ticks.
|
|
343
358
|
*/
|
|
344
359
|
tickNumber: number;
|
|
345
|
-
};
|
|
360
|
+
} & (AxisProps extends ChartsXAxisProps ? MakeRequired<AxisSideConfig<AxisProps>, 'height'> : AxisProps extends ChartsYAxisProps ? MakeRequired<AxisSideConfig<AxisProps>, 'width'> : AxisSideConfig<AxisProps>);
|
|
346
361
|
export declare function isBandScaleConfig(scaleConfig: AxisConfig<ScaleName>): scaleConfig is AxisConfig<'band'> & {
|
|
347
362
|
scaleType: 'band';
|
|
348
363
|
};
|
package/esm/models/axis.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier,
|
|
|
3
3
|
import { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.js";
|
|
4
4
|
import { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.js";
|
|
5
5
|
import { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, DefaultizedPieValueType } from "./pie.js";
|
|
6
|
+
import { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.js";
|
|
6
7
|
export interface ChartsSeriesConfig {
|
|
7
8
|
bar: {
|
|
8
9
|
/**
|
|
@@ -22,7 +23,7 @@ export interface ChartsSeriesConfig {
|
|
|
22
23
|
itemIdentifier: BarItemIdentifier;
|
|
23
24
|
valueType: number | null;
|
|
24
25
|
canBeStacked: true;
|
|
25
|
-
|
|
26
|
+
axisType: 'cartesian';
|
|
26
27
|
};
|
|
27
28
|
line: {
|
|
28
29
|
seriesInput: DefaultizedProps<LineSeriesType, 'id'> & {
|
|
@@ -33,7 +34,7 @@ export interface ChartsSeriesConfig {
|
|
|
33
34
|
itemIdentifier: LineItemIdentifier;
|
|
34
35
|
valueType: number | null;
|
|
35
36
|
canBeStacked: true;
|
|
36
|
-
|
|
37
|
+
axisType: 'cartesian';
|
|
37
38
|
};
|
|
38
39
|
scatter: {
|
|
39
40
|
seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & {
|
|
@@ -43,7 +44,7 @@ export interface ChartsSeriesConfig {
|
|
|
43
44
|
seriesProp: ScatterSeriesType;
|
|
44
45
|
valueType: ScatterValueType;
|
|
45
46
|
itemIdentifier: ScatterItemIdentifier;
|
|
46
|
-
|
|
47
|
+
axisType: 'cartesian';
|
|
47
48
|
};
|
|
48
49
|
pie: {
|
|
49
50
|
seriesInput: Omit<DefaultizedProps<PieSeriesType, 'id'>, 'data'> & {
|
|
@@ -56,19 +57,28 @@ export interface ChartsSeriesConfig {
|
|
|
56
57
|
itemIdentifier: PieItemIdentifier;
|
|
57
58
|
valueType: DefaultizedPieValueType;
|
|
58
59
|
};
|
|
60
|
+
radar: {
|
|
61
|
+
seriesInput: DefaultizedProps<RadarSeriesType, 'id'> & {
|
|
62
|
+
color: string;
|
|
63
|
+
};
|
|
64
|
+
series: DefaultizedRadarSeriesType;
|
|
65
|
+
seriesProp: RadarSeriesType;
|
|
66
|
+
itemIdentifier: RadarItemIdentifier;
|
|
67
|
+
valueType: number;
|
|
68
|
+
axisType: 'polar';
|
|
69
|
+
};
|
|
59
70
|
}
|
|
60
71
|
export type ChartSeriesType = keyof ChartsSeriesConfig;
|
|
61
72
|
export type CartesianChartSeriesType = keyof Pick<ChartsSeriesConfig, { [Key in ChartSeriesType]: ChartsSeriesConfig[Key] extends {
|
|
62
|
-
|
|
73
|
+
axisType: 'cartesian';
|
|
74
|
+
} ? Key : never }[ChartSeriesType]>;
|
|
75
|
+
export type PolarChartSeriesType = keyof Pick<ChartsSeriesConfig, { [Key in ChartSeriesType]: ChartsSeriesConfig[Key] extends {
|
|
76
|
+
axisType: 'polar';
|
|
63
77
|
} ? Key : never }[ChartSeriesType]>;
|
|
64
78
|
export type StackableChartSeriesType = keyof Pick<ChartsSeriesConfig, { [Key in ChartSeriesType]: ChartsSeriesConfig[Key] extends {
|
|
65
79
|
canBeStacked: true;
|
|
66
80
|
} ? Key : never }[ChartSeriesType]>;
|
|
67
|
-
export type ChartSeries<T extends ChartSeriesType> = ChartsSeriesConfig[T]
|
|
68
|
-
canBeStacked: true;
|
|
69
|
-
} ? ChartsSeriesConfig[T]['seriesInput'] & {
|
|
70
|
-
stackedData: [number, number][];
|
|
71
|
-
} : ChartsSeriesConfig[T]['seriesInput'];
|
|
81
|
+
export type ChartSeries<T extends ChartSeriesType> = ChartsSeriesConfig[T]['seriesInput'];
|
|
72
82
|
export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConfig[T] extends {
|
|
73
83
|
canBeStacked: true;
|
|
74
84
|
} ? ChartsSeriesConfig[T]['series'] & {
|
|
@@ -10,6 +10,7 @@ export * from "./line.js";
|
|
|
10
10
|
export * from "./bar.js";
|
|
11
11
|
export * from "./scatter.js";
|
|
12
12
|
export * from "./pie.js";
|
|
13
|
+
export * from "./radar.js";
|
|
13
14
|
export type { AllSeriesType, CartesianSeriesType, DefaultizedSeriesType, DefaultizedCartesianSeriesType, StackableSeriesType };
|
|
14
15
|
export declare function isDefaultizedBarSeries(series: DefaultizedSeriesType): series is DefaultizedBarSeriesType;
|
|
15
16
|
export declare function isBarSeries(series: AllSeriesType): series is BarSeriesType;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
+
import { CommonDefaultizedProps, CommonSeriesType, SeriesId } from "./common.js";
|
|
3
|
+
export interface RadarSeriesType extends CommonSeriesType<number> {
|
|
4
|
+
type: 'radar';
|
|
5
|
+
data: number[];
|
|
6
|
+
/**
|
|
7
|
+
* The label to display on the tooltip or the legend. It can be a string or a function.
|
|
8
|
+
*/
|
|
9
|
+
label?: string | ((location: 'tooltip' | 'legend') => string);
|
|
10
|
+
/**
|
|
11
|
+
* If `true` show marks at value position.
|
|
12
|
+
*/
|
|
13
|
+
showMark?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* An object that allows to identify either a radar series or a radar point (if dataIndex is defined).
|
|
17
|
+
* Used for item interaction
|
|
18
|
+
*/
|
|
19
|
+
export type RadarItemIdentifier = {
|
|
20
|
+
type: 'radar';
|
|
21
|
+
seriesId: SeriesId;
|
|
22
|
+
dataIndex?: number;
|
|
23
|
+
};
|
|
24
|
+
export interface DefaultizedRadarSeriesType extends DefaultizedProps<RadarSeriesType, CommonDefaultizedProps | 'color'> {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/hooks/useAxis.d.ts
CHANGED
|
@@ -38,4 +38,14 @@ export declare function useXAxis(axisId?: AxisId): import("../internals").AxisDe
|
|
|
38
38
|
* @param {AxisId | undefined} axisId - If provided returns the y axis with axisId, else returns the values for the default y axis.
|
|
39
39
|
* @returns The Y axis.
|
|
40
40
|
*/
|
|
41
|
-
export declare function useYAxis(axisId?: AxisId): import("../internals").AxisDefaultized<keyof import("../internals").AxisScaleConfig, any, import("..").ChartsYAxisProps>;
|
|
41
|
+
export declare function useYAxis(axisId?: AxisId): import("../internals").AxisDefaultized<keyof import("../internals").AxisScaleConfig, any, import("..").ChartsYAxisProps>;
|
|
42
|
+
export declare function useRotationAxes(): {
|
|
43
|
+
rotationAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue").DefaultizedAxisConfig<import("../internals").ChartsAxisProps>;
|
|
44
|
+
rotationAxisIds: string[];
|
|
45
|
+
};
|
|
46
|
+
export declare function useRadiusAxes(): {
|
|
47
|
+
radiusAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue").DefaultizedAxisConfig<import("..").ChartsYAxisProps>;
|
|
48
|
+
radiusAxisIds: string[];
|
|
49
|
+
};
|
|
50
|
+
export declare function useRotationAxis(identifier?: number | string): import("../internals").PolarAxisDefaultized<keyof import("../internals").AxisScaleConfig, any, import("../internals").ChartsAxisProps>;
|
|
51
|
+
export declare function useRadiusAxis(identifier?: number | string): import("../internals").PolarAxisDefaultized<keyof import("../internals").AxisScaleConfig, any, import("..").ChartsYAxisProps>;
|
package/hooks/useAxis.js
CHANGED
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.useRadiusAxes = useRadiusAxes;
|
|
8
|
+
exports.useRadiusAxis = useRadiusAxis;
|
|
9
|
+
exports.useRotationAxes = useRotationAxes;
|
|
10
|
+
exports.useRotationAxis = useRotationAxis;
|
|
7
11
|
exports.useXAxes = useXAxes;
|
|
8
12
|
exports.useXAxis = useXAxis;
|
|
9
13
|
exports.useYAxes = useYAxes;
|
|
10
14
|
exports.useYAxis = useYAxis;
|
|
11
15
|
var _useChartCartesianAxisRendering = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors");
|
|
16
|
+
var _useChartPolarAxis = require("../internals/plugins/featurePlugins/useChartPolarAxis");
|
|
12
17
|
var _useSelector = require("../internals/store/useSelector");
|
|
13
18
|
var _useStore = require("../internals/store/useStore");
|
|
14
19
|
/**
|
|
@@ -83,4 +88,44 @@ function useYAxis(axisId) {
|
|
|
83
88
|
} = (0, _useSelector.useSelector)(store, _useChartCartesianAxisRendering.selectorChartYAxis);
|
|
84
89
|
const id = axisId ?? yAxisIds[0];
|
|
85
90
|
return yAxis[id];
|
|
91
|
+
}
|
|
92
|
+
function useRotationAxes() {
|
|
93
|
+
const store = (0, _useStore.useStore)();
|
|
94
|
+
const {
|
|
95
|
+
axis: rotationAxis,
|
|
96
|
+
axisIds: rotationAxisIds
|
|
97
|
+
} = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartRotationAxis);
|
|
98
|
+
return {
|
|
99
|
+
rotationAxis,
|
|
100
|
+
rotationAxisIds
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function useRadiusAxes() {
|
|
104
|
+
const store = (0, _useStore.useStore)();
|
|
105
|
+
const {
|
|
106
|
+
axis: radiusAxis,
|
|
107
|
+
axisIds: radiusAxisIds
|
|
108
|
+
} = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartRadiusAxis);
|
|
109
|
+
return {
|
|
110
|
+
radiusAxis,
|
|
111
|
+
radiusAxisIds
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function useRotationAxis(identifier) {
|
|
115
|
+
const store = (0, _useStore.useStore)();
|
|
116
|
+
const {
|
|
117
|
+
axis: rotationAxis,
|
|
118
|
+
axisIds: rotationAxisIds
|
|
119
|
+
} = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartRotationAxis);
|
|
120
|
+
const id = typeof identifier === 'string' ? identifier : rotationAxisIds[identifier ?? 0];
|
|
121
|
+
return rotationAxis[id];
|
|
122
|
+
}
|
|
123
|
+
function useRadiusAxis(identifier) {
|
|
124
|
+
const store = (0, _useStore.useStore)();
|
|
125
|
+
const {
|
|
126
|
+
axis: radiusAxis,
|
|
127
|
+
axisIds: radiusAxisIds
|
|
128
|
+
} = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartRadiusAxis);
|
|
129
|
+
const id = typeof identifier === 'string' ? identifier : radiusAxisIds[identifier ?? 0];
|
|
130
|
+
return radiusAxis[id];
|
|
86
131
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ProcessedSeries } from "../internals/plugins/corePlugins/useChartSeries/useChartSeries.types.js";
|
|
2
|
+
import { SeriesId } from "../models/seriesType/common.js";
|
|
3
|
+
import { ChartSeriesDefaultized } from "../models/seriesType/config.js";
|
|
4
|
+
export type UseRadarSeriesReturnValue = ChartSeriesDefaultized<'radar'>;
|
|
5
|
+
export type UseRadarSeriesContextReturnValue = ProcessedSeries['radar'];
|
|
6
|
+
/**
|
|
7
|
+
* Get access to the internal state of radar series.
|
|
8
|
+
*
|
|
9
|
+
* @param {SeriesId} seriesId The id of the series to get.
|
|
10
|
+
* @returns {UseRadarSeriesReturnValue} the radar series
|
|
11
|
+
*/
|
|
12
|
+
export declare function useRadarSeries(seriesId: SeriesId): UseRadarSeriesReturnValue | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Get access to the internal state of radar series.
|
|
15
|
+
*
|
|
16
|
+
* When called without arguments, it returns all radar series.
|
|
17
|
+
*
|
|
18
|
+
* @returns {UseRadarSeriesReturnValue[]} the radar series
|
|
19
|
+
*/
|
|
20
|
+
export declare function useRadarSeries(): UseRadarSeriesReturnValue[];
|
|
21
|
+
/**
|
|
22
|
+
* Get access to the internal state of radar series.
|
|
23
|
+
*
|
|
24
|
+
* @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
|
|
25
|
+
* @returns {UseRadarSeriesReturnValue[]} the radar series
|
|
26
|
+
*/
|
|
27
|
+
export declare function useRadarSeries(seriesIds?: SeriesId[]): UseRadarSeriesReturnValue[];
|
|
28
|
+
/**
|
|
29
|
+
* Get access to the internal state of radar series.
|
|
30
|
+
* The returned object contains:
|
|
31
|
+
* - series: a mapping from ids to series attributes.
|
|
32
|
+
* - seriesOrder: the array of series ids.
|
|
33
|
+
* @returns the radar series
|
|
34
|
+
*/
|
|
35
|
+
export declare function useRadarSeriesContext(): UseRadarSeriesContextReturnValue;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useRadarSeries = useRadarSeries;
|
|
8
|
+
exports.useRadarSeriesContext = useRadarSeriesContext;
|
|
9
|
+
var _createSeriesSelectorOfType = require("../internals/createSeriesSelectorOfType");
|
|
10
|
+
const useSelectorSeries = (0, _createSeriesSelectorOfType.createSeriesSelectorsOfType)('radar');
|
|
11
|
+
const useSelectorSeriesContext = (0, _createSeriesSelectorOfType.createAllSeriesSelectorOfType)('radar');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get access to the internal state of radar series.
|
|
15
|
+
*
|
|
16
|
+
* @param {SeriesId} seriesId The id of the series to get.
|
|
17
|
+
* @returns {UseRadarSeriesReturnValue} the radar series
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get access to the internal state of radar series.
|
|
22
|
+
*
|
|
23
|
+
* When called without arguments, it returns all radar series.
|
|
24
|
+
*
|
|
25
|
+
* @returns {UseRadarSeriesReturnValue[]} the radar series
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get access to the internal state of radar series.
|
|
30
|
+
*
|
|
31
|
+
* @param {SeriesId[]} seriesIds The ids of the series to get. Order is preserved.
|
|
32
|
+
* @returns {UseRadarSeriesReturnValue[]} the radar series
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
function useRadarSeries(seriesIds) {
|
|
36
|
+
return useSelectorSeries(seriesIds);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get access to the internal state of radar series.
|
|
41
|
+
* The returned object contains:
|
|
42
|
+
* - series: a mapping from ids to series attributes.
|
|
43
|
+
* - seriesOrder: the array of series ids.
|
|
44
|
+
* @returns the radar series
|
|
45
|
+
*/
|
|
46
|
+
function useRadarSeriesContext() {
|
|
47
|
+
return useSelectorSeriesContext();
|
|
48
|
+
}
|
package/hooks/useScale.d.ts
CHANGED
|
@@ -19,4 +19,6 @@ export declare function useXScale<S extends ScaleName>(axisId?: AxisId): AxisSca
|
|
|
19
19
|
* @param {AxisId | undefined} axisId - If provided returns the scale for the y axis with axisId, else returns the values for the default y axis.
|
|
20
20
|
* @returns {AxisScaleConfig[S]['scale']} The scale for the specified Y axis.
|
|
21
21
|
*/
|
|
22
|
-
export declare function useYScale<S extends ScaleName>(axisId?: AxisId): AxisScaleConfig[S]['scale'];
|
|
22
|
+
export declare function useYScale<S extends ScaleName>(axisId?: AxisId): AxisScaleConfig[S]['scale'];
|
|
23
|
+
export declare function useRotationScale<S extends ScaleName>(identifier?: number | string): AxisScaleConfig[S]['scale'];
|
|
24
|
+
export declare function useRadiusScale<S extends ScaleName>(identifier?: number | string): AxisScaleConfig[S]['scale'];
|
package/hooks/useScale.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getValueToPositionMapper = getValueToPositionMapper;
|
|
8
|
+
exports.useRadiusScale = useRadiusScale;
|
|
9
|
+
exports.useRotationScale = useRotationScale;
|
|
8
10
|
exports.useXScale = useXScale;
|
|
9
11
|
exports.useYScale = useYScale;
|
|
10
12
|
var _isBandScale = require("../internals/isBandScale");
|
|
@@ -42,4 +44,12 @@ function useXScale(axisId) {
|
|
|
42
44
|
function useYScale(axisId) {
|
|
43
45
|
const axis = (0, _useAxis.useYAxis)(axisId);
|
|
44
46
|
return axis.scale;
|
|
47
|
+
}
|
|
48
|
+
function useRotationScale(identifier) {
|
|
49
|
+
const axis = (0, _useAxis.useRotationAxis)(identifier);
|
|
50
|
+
return axis.scale;
|
|
51
|
+
}
|
|
52
|
+
function useRadiusScale(identifier) {
|
|
53
|
+
const axis = (0, _useAxis.useRadiusAxis)(identifier);
|
|
54
|
+
return axis.scale;
|
|
45
55
|
}
|
package/hooks/useTicks.js
CHANGED
|
@@ -36,12 +36,13 @@ function useTicks(options) {
|
|
|
36
36
|
valueFormatter,
|
|
37
37
|
tickInterval,
|
|
38
38
|
tickPlacement = 'extremities',
|
|
39
|
-
tickLabelPlacement
|
|
39
|
+
tickLabelPlacement: tickLabelPlacementProp
|
|
40
40
|
} = options;
|
|
41
41
|
return React.useMemo(() => {
|
|
42
42
|
// band scale
|
|
43
43
|
if ((0, _isBandScale.isBandScale)(scale)) {
|
|
44
44
|
const domain = scale.domain();
|
|
45
|
+
const tickLabelPlacement = tickLabelPlacementProp ?? 'middle';
|
|
45
46
|
if (scale.bandwidth() > 0) {
|
|
46
47
|
// scale type = 'band'
|
|
47
48
|
const filteredDomain = typeof tickInterval === 'function' && domain.filter(tickInterval) || typeof tickInterval === 'object' && tickInterval || domain;
|
|
@@ -78,15 +79,20 @@ function useTicks(options) {
|
|
|
78
79
|
if (domain.some(_isInfinity.isInfinity)) {
|
|
79
80
|
return [];
|
|
80
81
|
}
|
|
82
|
+
const tickLabelPlacement = tickLabelPlacementProp;
|
|
81
83
|
const ticks = typeof tickInterval === 'object' ? tickInterval : scale.ticks(tickNumber);
|
|
82
|
-
return ticks.map(value =>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
return ticks.map((value, i) => {
|
|
85
|
+
return {
|
|
86
|
+
value,
|
|
87
|
+
formattedValue: valueFormatter?.(value, {
|
|
88
|
+
location: 'tick',
|
|
89
|
+
scale
|
|
90
|
+
}) ?? scale.tickFormat(tickNumber)(value),
|
|
91
|
+
offset: scale(value),
|
|
92
|
+
// Allowing the label to be placed in the middle of a continuous scale is weird.
|
|
93
|
+
// But it is useful in some cases, like funnel categories with a linear scale.
|
|
94
|
+
labelOffset: tickLabelPlacement === 'middle' ? scale(ticks[i - 1] ?? 0) - (scale(value) + scale(ticks[i - 1] ?? 0)) / 2 : 0
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}, [scale, tickInterval, tickNumber, valueFormatter, tickPlacement, tickLabelPlacementProp]);
|
|
92
98
|
}
|
package/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./PieChart/index.js";
|
|
|
20
20
|
export * from "./ScatterChart/index.js";
|
|
21
21
|
export * from "./SparkLineChart/index.js";
|
|
22
22
|
export * from "./Gauge/index.js";
|
|
23
|
+
export * from "./RadarChart/index.js";
|
|
23
24
|
export * from "./ChartsSurface/index.js";
|
|
24
25
|
export * from "./ChartContainer/index.js";
|
|
25
26
|
export * from "./ChartDataProvider/index.js";
|