@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,38 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["seriesId"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useRadarSeriesData } from "./useRadarSeriesData.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function RadarSeriesMarks(props) {
|
|
9
|
+
const other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
10
|
+
const seriesCoordinates = useRadarSeriesData(props.seriesId);
|
|
11
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
12
|
+
children: seriesCoordinates?.map(({
|
|
13
|
+
seriesId: id,
|
|
14
|
+
points,
|
|
15
|
+
color
|
|
16
|
+
}) => /*#__PURE__*/_jsx("g", {
|
|
17
|
+
children: points.map((point, index) => /*#__PURE__*/_jsx("circle", _extends({
|
|
18
|
+
cx: point.x,
|
|
19
|
+
cy: point.y,
|
|
20
|
+
r: 5,
|
|
21
|
+
fill: color,
|
|
22
|
+
stroke: color
|
|
23
|
+
}, other), index))
|
|
24
|
+
}, id))
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
process.env.NODE_ENV !== "production" ? RadarSeriesMarks.propTypes = {
|
|
28
|
+
// ----------------------------- Warning --------------------------------
|
|
29
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
30
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
31
|
+
// ----------------------------------------------------------------------
|
|
32
|
+
/**
|
|
33
|
+
* The id of the series to display.
|
|
34
|
+
* If undefined all series are displayed.
|
|
35
|
+
*/
|
|
36
|
+
seriesId: PropTypes.string
|
|
37
|
+
} : void 0;
|
|
38
|
+
export { RadarSeriesMarks };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RadarSeriesPlotProps } from "./RadarSeriesPlot.types.js";
|
|
3
|
+
declare function RadarSeriesPlot(props: RadarSeriesPlotProps): React.JSX.Element;
|
|
4
|
+
declare namespace RadarSeriesPlot {
|
|
5
|
+
var propTypes: any;
|
|
6
|
+
}
|
|
7
|
+
export { RadarSeriesPlot };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useRadarSeriesData } from "./useRadarSeriesData.js";
|
|
4
|
+
import { getAreaPath } from "./getAreaPath.js";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
function RadarSeriesPlot(props) {
|
|
7
|
+
const seriesCoordinates = useRadarSeriesData(props.seriesId);
|
|
8
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
9
|
+
children: seriesCoordinates?.map(({
|
|
10
|
+
seriesId,
|
|
11
|
+
points,
|
|
12
|
+
color,
|
|
13
|
+
showMark
|
|
14
|
+
}) => /*#__PURE__*/_jsxs("g", {
|
|
15
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
16
|
+
d: getAreaPath(points),
|
|
17
|
+
fill: color,
|
|
18
|
+
stroke: color,
|
|
19
|
+
fillOpacity: 0.4
|
|
20
|
+
}, seriesId), showMark && points.map((point, index) => /*#__PURE__*/_jsx("circle", {
|
|
21
|
+
cx: point.x,
|
|
22
|
+
cy: point.y,
|
|
23
|
+
r: 5,
|
|
24
|
+
fill: color,
|
|
25
|
+
stroke: color
|
|
26
|
+
}, index))]
|
|
27
|
+
}, seriesId))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
process.env.NODE_ENV !== "production" ? RadarSeriesPlot.propTypes = {
|
|
31
|
+
// ----------------------------- Warning --------------------------------
|
|
32
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
33
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
34
|
+
// ----------------------------------------------------------------------
|
|
35
|
+
/**
|
|
36
|
+
* The id of the series to display.
|
|
37
|
+
* If undefined all series are displayed.
|
|
38
|
+
*/
|
|
39
|
+
seriesId: PropTypes.string
|
|
40
|
+
} : void 0;
|
|
41
|
+
export { RadarSeriesPlot };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface CommonRadarSeriesPlotProps {
|
|
3
|
+
/**
|
|
4
|
+
* The id of the series to display.
|
|
5
|
+
* If undefined all series are displayed.
|
|
6
|
+
*/
|
|
7
|
+
seriesId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {}
|
|
10
|
+
export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {}
|
|
11
|
+
export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SeriesId } from "../../models/seriesType/common.js";
|
|
2
|
+
/**
|
|
3
|
+
* This hook provides all the data needed to display radar series.
|
|
4
|
+
* @param querySeriesId The id of the series to display
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function useRadarSeriesData(querySeriesId?: SeriesId): {
|
|
8
|
+
seriesId: SeriesId;
|
|
9
|
+
isSeriesHighlighted: boolean;
|
|
10
|
+
isSeriesFaded: boolean;
|
|
11
|
+
points: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
isItemHighlighted: boolean;
|
|
15
|
+
isItemFaded: boolean;
|
|
16
|
+
dataIndex: number;
|
|
17
|
+
}[];
|
|
18
|
+
type: "radar";
|
|
19
|
+
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
20
|
+
highlightScope?: Partial<import("../..").HighlightScope> | undefined;
|
|
21
|
+
labelMarkType?: "line" | "square" | "circle" | import("react").ComponentType<import("../..").ChartsLabelCustomMarkProps> | undefined;
|
|
22
|
+
showMark?: boolean | undefined;
|
|
23
|
+
data: number[];
|
|
24
|
+
color: string;
|
|
25
|
+
id: SeriesId;
|
|
26
|
+
valueFormatter: import("../../internals").SeriesValueFormatter<number>;
|
|
27
|
+
}[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { useRotationScale } from "../../hooks/useScale.js";
|
|
3
|
+
import { useDrawingArea } from "../../hooks/useDrawingArea.js";
|
|
4
|
+
import { useRadarSeries } from "../../hooks/useRadarSeries.js";
|
|
5
|
+
import { useRadiusAxes } from "../../hooks/useAxis.js";
|
|
6
|
+
import { useItemHighlightedGetter } from "../../hooks/useItemHighlightedGetter.js";
|
|
7
|
+
/**
|
|
8
|
+
* This hook provides all the data needed to display radar series.
|
|
9
|
+
* @param querySeriesId The id of the series to display
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export function useRadarSeriesData(querySeriesId) {
|
|
13
|
+
const rotationScale = useRotationScale();
|
|
14
|
+
const {
|
|
15
|
+
radiusAxis
|
|
16
|
+
} = useRadiusAxes();
|
|
17
|
+
const radarSeries = useRadarSeries(querySeriesId === undefined ? undefined : [querySeriesId]);
|
|
18
|
+
const drawingArea = useDrawingArea();
|
|
19
|
+
const {
|
|
20
|
+
isFaded: isItemFaded,
|
|
21
|
+
isHighlighted: isItemHighlighted
|
|
22
|
+
} = useItemHighlightedGetter();
|
|
23
|
+
const cx = drawingArea.left + drawingArea.width / 2;
|
|
24
|
+
const cy = drawingArea.top + drawingArea.height / 2;
|
|
25
|
+
const metrics = rotationScale.domain();
|
|
26
|
+
const angles = metrics.map(key => rotationScale(key));
|
|
27
|
+
return radarSeries.map(series => {
|
|
28
|
+
const seriesId = series.id;
|
|
29
|
+
const isSeriesHighlighted = isItemHighlighted({
|
|
30
|
+
seriesId
|
|
31
|
+
});
|
|
32
|
+
const isSeriesFaded = !isSeriesHighlighted && isItemFaded({
|
|
33
|
+
seriesId
|
|
34
|
+
});
|
|
35
|
+
return _extends({}, series, {
|
|
36
|
+
seriesId: series.id,
|
|
37
|
+
isSeriesHighlighted,
|
|
38
|
+
isSeriesFaded,
|
|
39
|
+
points: series.data.map((value, dataIndex) => {
|
|
40
|
+
const highlighted = isItemHighlighted({
|
|
41
|
+
seriesId,
|
|
42
|
+
dataIndex
|
|
43
|
+
});
|
|
44
|
+
const faded = !highlighted && isItemFaded({
|
|
45
|
+
seriesId,
|
|
46
|
+
dataIndex
|
|
47
|
+
});
|
|
48
|
+
const r = radiusAxis[metrics[dataIndex]].scale(value);
|
|
49
|
+
const angle = angles[dataIndex];
|
|
50
|
+
return {
|
|
51
|
+
x: cx + r * Math.sin(angle),
|
|
52
|
+
y: cy - r * Math.cos(angle),
|
|
53
|
+
isItemHighlighted: highlighted,
|
|
54
|
+
isItemFaded: faded,
|
|
55
|
+
dataIndex
|
|
56
|
+
};
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { RadarChart as Unstable_RadarChart } from "./RadarChart.js";
|
|
2
|
+
export { RadarDataProvider as Unstable_RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
3
|
+
export type { RadarChartProps } from './RadarChart';
|
|
4
|
+
export type { RadarDataProviderProps } from './RadarDataProvider';
|
|
5
|
+
export * from "./RadarGrid/index.js";
|
|
6
|
+
export * from "./RadarSeriesPlot/index.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const radiusExtremumGetter = ({
|
|
2
|
+
series,
|
|
3
|
+
axisIndex
|
|
4
|
+
}) => {
|
|
5
|
+
return Object.keys(series).filter(seriesId => series[seriesId].type === 'radar').reduce((acc, seriesId) => {
|
|
6
|
+
const {
|
|
7
|
+
data
|
|
8
|
+
} = series[seriesId];
|
|
9
|
+
return [Math.min(data[axisIndex], acc[0]), Math.max(data[axisIndex], acc[1])];
|
|
10
|
+
}, [Infinity, -Infinity]);
|
|
11
|
+
};
|
|
12
|
+
export const rotationExtremumGetter = ({
|
|
13
|
+
axis
|
|
14
|
+
}) => {
|
|
15
|
+
const min = Math.min(...(axis.data ?? []));
|
|
16
|
+
const max = Math.max(...(axis.data ?? []));
|
|
17
|
+
return [min, max];
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defaultizeValueFormatter } from "../../internals/defaultizeValueFormatter.js";
|
|
2
|
+
const formatter = params => {
|
|
3
|
+
const {
|
|
4
|
+
seriesOrder,
|
|
5
|
+
series
|
|
6
|
+
} = params;
|
|
7
|
+
return {
|
|
8
|
+
seriesOrder,
|
|
9
|
+
series: defaultizeValueFormatter(series, v => v == null ? '' : v.toLocaleString())
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default formatter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
|
+
return _extends({
|
|
4
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
5
|
+
color: colors[seriesIndex % colors.length]
|
|
6
|
+
}, seriesData);
|
|
7
|
+
};
|
|
8
|
+
export default getSeriesWithDefaultValues;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import formatter from "./formatter.js";
|
|
2
|
+
import getColor from "./getColor.js";
|
|
3
|
+
import { radiusExtremumGetter, rotationExtremumGetter } from "./extremums.js";
|
|
4
|
+
import legendGetter from "./legend.js";
|
|
5
|
+
import tooltipGetter from "./tooltip.js";
|
|
6
|
+
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
|
+
export const radarSeriesConfig = {
|
|
8
|
+
colorProcessor: getColor,
|
|
9
|
+
seriesProcessor: formatter,
|
|
10
|
+
legendGetter,
|
|
11
|
+
tooltipGetter,
|
|
12
|
+
getSeriesWithDefaultValues,
|
|
13
|
+
radiusExtremumGetter,
|
|
14
|
+
rotationExtremumGetter
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getLabel } from "../../internals/getLabel.js";
|
|
2
|
+
const legendGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
seriesOrder,
|
|
5
|
+
series
|
|
6
|
+
} = params;
|
|
7
|
+
return seriesOrder.reduce((acc, seriesId) => {
|
|
8
|
+
const formattedLabel = getLabel(series[seriesId].label, 'legend');
|
|
9
|
+
if (formattedLabel === undefined) {
|
|
10
|
+
return acc;
|
|
11
|
+
}
|
|
12
|
+
acc.push({
|
|
13
|
+
id: seriesId,
|
|
14
|
+
seriesId,
|
|
15
|
+
color: series[seriesId].color,
|
|
16
|
+
label: formattedLabel,
|
|
17
|
+
markType: series[seriesId].labelMarkType ?? 'square'
|
|
18
|
+
});
|
|
19
|
+
return acc;
|
|
20
|
+
}, []);
|
|
21
|
+
};
|
|
22
|
+
export default legendGetter;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getLabel } from "../../internals/getLabel.js";
|
|
2
|
+
const tooltipGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
series,
|
|
5
|
+
getColor,
|
|
6
|
+
identifier
|
|
7
|
+
} = params;
|
|
8
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const label = getLabel(series.label, 'tooltip');
|
|
12
|
+
const value = series.data[identifier.dataIndex];
|
|
13
|
+
const formattedValue = series.valueFormatter(value, {
|
|
14
|
+
dataIndex: identifier.dataIndex
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
identifier,
|
|
18
|
+
color: getColor(identifier.dataIndex),
|
|
19
|
+
label,
|
|
20
|
+
value,
|
|
21
|
+
formattedValue,
|
|
22
|
+
markType: series.labelMarkType
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default tooltipGetter;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RadarChartProps } from './RadarChart';
|
|
2
|
+
import { ChartsOverlayProps } from "../ChartsOverlay/index.js";
|
|
3
|
+
import { ChartsLegendSlotExtension } from "../ChartsLegend/index.js";
|
|
4
|
+
import type { ChartsWrapperProps } from '../internals/components/ChartsWrapper';
|
|
5
|
+
import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
|
|
6
|
+
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
7
|
+
import { RadarGridProps } from "./RadarGrid/RadarGrid.js";
|
|
8
|
+
/**
|
|
9
|
+
* A helper function that extracts RadarChartProps from the input props
|
|
10
|
+
* and returns an object with props for the children components of RadarChart.
|
|
11
|
+
*
|
|
12
|
+
* @param props The input props for RadarChart
|
|
13
|
+
* @returns An object with props for the children components of RadarChart
|
|
14
|
+
*/
|
|
15
|
+
export declare const useRadarChartProps: (props: RadarChartProps) => {
|
|
16
|
+
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
17
|
+
chartsSurfaceProps: ChartsSurfaceProps;
|
|
18
|
+
radarDataProviderProps: RadarDataProviderProps;
|
|
19
|
+
radarGrid: RadarGridProps;
|
|
20
|
+
overlayProps: ChartsOverlayProps;
|
|
21
|
+
legendProps: ChartsLegendSlotExtension;
|
|
22
|
+
children: import("react").ReactNode;
|
|
23
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
const _excluded = ["series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions"];
|
|
5
|
+
/**
|
|
6
|
+
* A helper function that extracts RadarChartProps from the input props
|
|
7
|
+
* and returns an object with props for the children components of RadarChart.
|
|
8
|
+
*
|
|
9
|
+
* @param props The input props for RadarChart
|
|
10
|
+
* @returns An object with props for the children components of RadarChart
|
|
11
|
+
*/
|
|
12
|
+
export const useRadarChartProps = props => {
|
|
13
|
+
const {
|
|
14
|
+
series,
|
|
15
|
+
radar,
|
|
16
|
+
width,
|
|
17
|
+
height,
|
|
18
|
+
margin,
|
|
19
|
+
colors,
|
|
20
|
+
sx,
|
|
21
|
+
children,
|
|
22
|
+
slots,
|
|
23
|
+
slotProps,
|
|
24
|
+
skipAnimation,
|
|
25
|
+
loading,
|
|
26
|
+
highlightedItem,
|
|
27
|
+
onHighlightChange,
|
|
28
|
+
divisions
|
|
29
|
+
} = props,
|
|
30
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
|
+
const radarDataProviderProps = {
|
|
32
|
+
series,
|
|
33
|
+
radar,
|
|
34
|
+
width,
|
|
35
|
+
height,
|
|
36
|
+
margin,
|
|
37
|
+
colors,
|
|
38
|
+
highlightedItem,
|
|
39
|
+
onHighlightChange,
|
|
40
|
+
skipAnimation
|
|
41
|
+
};
|
|
42
|
+
const overlayProps = {
|
|
43
|
+
slots,
|
|
44
|
+
slotProps,
|
|
45
|
+
loading
|
|
46
|
+
};
|
|
47
|
+
const legendProps = {
|
|
48
|
+
slots,
|
|
49
|
+
slotProps
|
|
50
|
+
};
|
|
51
|
+
const chartsWrapperProps = {
|
|
52
|
+
sx
|
|
53
|
+
};
|
|
54
|
+
const radarGrid = {
|
|
55
|
+
divisions
|
|
56
|
+
};
|
|
57
|
+
const chartsSurfaceProps = other;
|
|
58
|
+
return {
|
|
59
|
+
chartsWrapperProps,
|
|
60
|
+
chartsSurfaceProps,
|
|
61
|
+
radarDataProviderProps,
|
|
62
|
+
radarGrid,
|
|
63
|
+
overlayProps,
|
|
64
|
+
legendProps,
|
|
65
|
+
children
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -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<'scatter'>;
|
|
3
3
|
export declare const getExtremumY: CartesianExtremumGetter<'scatter'>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
|
+
return _extends({
|
|
4
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
5
|
+
color: colors[seriesIndex % colors.length]
|
|
6
|
+
}, seriesData);
|
|
7
|
+
};
|
|
8
|
+
export default getSeriesWithDefaultValues;
|
|
@@ -3,11 +3,13 @@ import seriesProcessor from "./seriesProcessor.js";
|
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
import legendGetter from "./legend.js";
|
|
5
5
|
import tooltipGetter from "./tooltip.js";
|
|
6
|
+
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
6
7
|
export const seriesConfig = {
|
|
7
8
|
seriesProcessor,
|
|
8
9
|
colorProcessor: getColor,
|
|
9
10
|
legendGetter,
|
|
10
11
|
tooltipGetter,
|
|
11
12
|
xExtremumGetter: getExtremumX,
|
|
12
|
-
yExtremumGetter: getExtremumY
|
|
13
|
+
yExtremumGetter: getExtremumY,
|
|
14
|
+
getSeriesWithDefaultValues
|
|
13
15
|
};
|
|
@@ -14,7 +14,7 @@ import { BarPlotSlots, BarPlotSlotProps } from "../BarChart/BarPlot.js";
|
|
|
14
14
|
import { ChartMargin } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js";
|
|
15
15
|
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots {}
|
|
16
16
|
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {}
|
|
17
|
-
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'margin' | 'plugins' | 'colors'> {
|
|
17
|
+
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors'> {
|
|
18
18
|
/**
|
|
19
19
|
* The xAxis configuration.
|
|
20
20
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
package/esm/constants/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const DEFAULT_X_AXIS_KEY = "DEFAULT_X_AXIS_KEY";
|
|
2
2
|
export declare const DEFAULT_Y_AXIS_KEY = "DEFAULT_Y_AXIS_KEY";
|
|
3
|
+
export declare const DEFAULT_ROTATION_AXIS_KEY = "DEFAULT_ROTATION_AXIS_KEY";
|
|
4
|
+
export declare const DEFAULT_RADIUS_AXIS_KEY = "DEFAULT_RADIUS_AXIS_KEY";
|
|
3
5
|
export declare const DEFAULT_MARGINS: {
|
|
4
6
|
top: number;
|
|
5
7
|
bottom: number;
|
|
@@ -8,9 +10,4 @@ export declare const DEFAULT_MARGINS: {
|
|
|
8
10
|
};
|
|
9
11
|
export declare const DEFAULT_AXIS_SIZE_WIDTH = 30;
|
|
10
12
|
export declare const DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
11
|
-
export declare const
|
|
12
|
-
top: number;
|
|
13
|
-
bottom: number;
|
|
14
|
-
left: number;
|
|
15
|
-
right: number;
|
|
16
|
-
};
|
|
13
|
+
export declare const AXIS_LABEL_DEFAULT_HEIGHT = 20;
|
package/esm/constants/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export const DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY';
|
|
2
2
|
export const DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY';
|
|
3
|
+
export const DEFAULT_ROTATION_AXIS_KEY = 'DEFAULT_ROTATION_AXIS_KEY';
|
|
4
|
+
export const DEFAULT_RADIUS_AXIS_KEY = 'DEFAULT_RADIUS_AXIS_KEY';
|
|
3
5
|
export const DEFAULT_MARGINS = {
|
|
4
6
|
top: 20,
|
|
5
7
|
bottom: 20,
|
|
@@ -8,9 +10,6 @@ export const DEFAULT_MARGINS = {
|
|
|
8
10
|
};
|
|
9
11
|
export const DEFAULT_AXIS_SIZE_WIDTH = 30;
|
|
10
12
|
export const DEFAULT_AXIS_SIZE_HEIGHT = 25;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
left: 0,
|
|
15
|
-
right: 0
|
|
16
|
-
};
|
|
13
|
+
|
|
14
|
+
// How many pixels to add to the default axis size if that axis has a label
|
|
15
|
+
export const AXIS_LABEL_DEFAULT_HEIGHT = 20;
|
package/esm/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/esm/hooks/useAxis.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { selectorChartXAxis, selectorChartYAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js";
|
|
4
|
+
import { selectorChartRadiusAxis, selectorChartRotationAxis } from "../internals/plugins/featurePlugins/useChartPolarAxis/index.js";
|
|
4
5
|
import { useSelector } from "../internals/store/useSelector.js";
|
|
5
6
|
import { useStore } from "../internals/store/useStore.js";
|
|
6
7
|
/**
|
|
@@ -75,4 +76,44 @@ export function useYAxis(axisId) {
|
|
|
75
76
|
} = useSelector(store, selectorChartYAxis);
|
|
76
77
|
const id = axisId ?? yAxisIds[0];
|
|
77
78
|
return yAxis[id];
|
|
79
|
+
}
|
|
80
|
+
export function useRotationAxes() {
|
|
81
|
+
const store = useStore();
|
|
82
|
+
const {
|
|
83
|
+
axis: rotationAxis,
|
|
84
|
+
axisIds: rotationAxisIds
|
|
85
|
+
} = useSelector(store, selectorChartRotationAxis);
|
|
86
|
+
return {
|
|
87
|
+
rotationAxis,
|
|
88
|
+
rotationAxisIds
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export function useRadiusAxes() {
|
|
92
|
+
const store = useStore();
|
|
93
|
+
const {
|
|
94
|
+
axis: radiusAxis,
|
|
95
|
+
axisIds: radiusAxisIds
|
|
96
|
+
} = useSelector(store, selectorChartRadiusAxis);
|
|
97
|
+
return {
|
|
98
|
+
radiusAxis,
|
|
99
|
+
radiusAxisIds
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export function useRotationAxis(identifier) {
|
|
103
|
+
const store = useStore();
|
|
104
|
+
const {
|
|
105
|
+
axis: rotationAxis,
|
|
106
|
+
axisIds: rotationAxisIds
|
|
107
|
+
} = useSelector(store, selectorChartRotationAxis);
|
|
108
|
+
const id = typeof identifier === 'string' ? identifier : rotationAxisIds[identifier ?? 0];
|
|
109
|
+
return rotationAxis[id];
|
|
110
|
+
}
|
|
111
|
+
export function useRadiusAxis(identifier) {
|
|
112
|
+
const store = useStore();
|
|
113
|
+
const {
|
|
114
|
+
axis: radiusAxis,
|
|
115
|
+
axisIds: radiusAxisIds
|
|
116
|
+
} = useSelector(store, selectorChartRadiusAxis);
|
|
117
|
+
const id = typeof identifier === 'string' ? identifier : radiusAxisIds[identifier ?? 0];
|
|
118
|
+
return radiusAxis[id];
|
|
78
119
|
}
|