@mui/x-charts 8.7.0 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.d.ts +4 -3
- package/BarChart/BarChart.js +17 -1
- package/BarChart/barClasses.d.ts +1 -1
- package/BarChart/seriesConfig/seriesProcessor.js +5 -3
- package/BarChart/useBarPlotData.js +32 -5
- package/CHANGELOG.md +199 -24
- package/ChartContainer/ChartContainer.js +22 -0
- package/ChartContainer/useChartContainerProps.js +8 -2
- package/ChartDataProvider/ChartDataProvider.js +6 -0
- package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/ChartDataProvider/useChartDataProviderProps.js +6 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +34 -24
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +34 -24
- package/ChartsLabel/ChartsLabelMark.d.ts +2 -1
- package/ChartsLabel/index.d.ts +1 -0
- package/ChartsLabel/index.js +18 -0
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/Gauge/GaugeContainer.d.ts +1 -1
- package/LineChart/LineChart.d.ts +3 -2
- package/LineChart/LineChart.js +23 -1
- package/LineChart/LineHighlightPlot.js +10 -4
- package/LineChart/MarkPlot.js +17 -3
- package/LineChart/useAreaPlotData.js +3 -2
- package/PieChart/PieArcLabelPlot.js +3 -0
- package/PieChart/PieArcPlot.js +3 -0
- package/PieChart/PieChart.d.ts +4 -3
- package/PieChart/PieChart.js +1 -1
- package/PieChart/pieClasses.d.ts +1 -1
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +3 -5
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.d.ts +2 -13
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +8 -45
- package/RadarChart/RadarChart.d.ts +2 -1
- package/RadarChart/RadarChart.js +23 -2
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +4 -3
- package/RadarChart/RadarMetricLabels/useRadarMetricData.js +4 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +19 -3
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +20 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +38 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +32 -3
- package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.d.ts +8 -0
- package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +38 -0
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
- package/RadarChart/index.d.ts +1 -1
- package/RadarChart/useRadarChartProps.d.ts +3 -0
- package/RadarChart/useRadarChartProps.js +15 -3
- package/ScatterChart/ScatterChart.d.ts +4 -3
- package/ScatterChart/ScatterChart.js +1 -1
- package/ScatterChart/ScatterPlot.js +2 -2
- package/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +16 -0
- package/esm/BarChart/BarChart.d.ts +4 -3
- package/esm/BarChart/BarChart.js +17 -1
- package/esm/BarChart/barClasses.d.ts +1 -1
- package/esm/BarChart/seriesConfig/seriesProcessor.js +5 -3
- package/esm/BarChart/useBarPlotData.js +32 -5
- package/esm/ChartContainer/ChartContainer.js +22 -0
- package/esm/ChartContainer/useChartContainerProps.js +8 -2
- package/esm/ChartDataProvider/ChartDataProvider.js +6 -0
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +36 -26
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +36 -26
- package/esm/ChartsLabel/ChartsLabelMark.d.ts +2 -1
- package/esm/ChartsLabel/index.d.ts +1 -0
- package/esm/ChartsLabel/index.js +1 -0
- package/esm/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
- package/esm/Gauge/GaugeContainer.d.ts +1 -1
- package/esm/LineChart/LineChart.d.ts +3 -2
- package/esm/LineChart/LineChart.js +23 -1
- package/esm/LineChart/LineHighlightPlot.js +11 -5
- package/esm/LineChart/MarkPlot.js +17 -3
- package/esm/LineChart/useAreaPlotData.js +3 -2
- package/esm/PieChart/PieArcLabelPlot.js +3 -0
- package/esm/PieChart/PieArcPlot.js +3 -0
- package/esm/PieChart/PieChart.d.ts +4 -3
- package/esm/PieChart/PieChart.js +1 -1
- package/esm/PieChart/pieClasses.d.ts +1 -1
- package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +3 -5
- package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.d.ts +2 -13
- package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +8 -45
- package/esm/RadarChart/RadarChart.d.ts +2 -1
- package/esm/RadarChart/RadarChart.js +23 -2
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +4 -3
- package/esm/RadarChart/RadarMetricLabels/useRadarMetricData.js +4 -2
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +19 -3
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +20 -4
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +38 -4
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +32 -3
- package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.d.ts +8 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +32 -0
- package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
- package/esm/RadarChart/index.d.ts +1 -1
- package/esm/RadarChart/useRadarChartProps.d.ts +3 -0
- package/esm/RadarChart/useRadarChartProps.js +15 -3
- package/esm/ScatterChart/ScatterChart.d.ts +4 -3
- package/esm/ScatterChart/ScatterChart.js +1 -1
- package/esm/ScatterChart/ScatterPlot.js +2 -2
- package/esm/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +16 -0
- package/esm/hooks/useAxis.d.ts +2 -2
- package/esm/hooks/useTicks.d.ts +6 -1
- package/esm/hooks/useTicks.js +94 -58
- package/esm/index.js +1 -1
- package/esm/internals/constants.d.ts +3 -0
- package/esm/internals/constants.js +4 -0
- package/esm/internals/getLabel.d.ts +1 -1
- package/esm/internals/index.d.ts +1 -0
- package/esm/internals/index.js +1 -0
- package/esm/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/esm/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +2 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +27 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +14 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +46 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +76 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +48 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +16 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +19 -11
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +19 -11
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/esm/internals/plugins/utils/useLazySelectorEffect.js +70 -0
- package/esm/internals/store/useCharts.d.ts +1 -1
- package/esm/models/axis.d.ts +42 -1
- package/esm/models/axis.js +4 -0
- package/esm/models/index.d.ts +1 -1
- package/esm/models/seriesType/bar.d.ts +11 -1
- package/esm/models/seriesType/common.d.ts +9 -3
- package/esm/models/seriesType/line.d.ts +3 -1
- package/esm/models/seriesType/scatter.d.ts +14 -2
- package/esm/tests/web-components.js +49 -0
- package/esm/themeAugmentation/components.d.ts +3 -0
- package/esm/themeAugmentation/props.d.ts +2 -0
- package/hooks/useAxis.d.ts +2 -2
- package/hooks/useTicks.d.ts +6 -1
- package/hooks/useTicks.js +95 -58
- package/index.js +1 -1
- package/internals/constants.d.ts +3 -0
- package/internals/constants.js +5 -1
- package/internals/getLabel.d.ts +1 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +8 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +27 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +34 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +5 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +24 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +46 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +82 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +55 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +18 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +20 -13
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +20 -13
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/internals/plugins/utils/useLazySelectorEffect.js +77 -0
- package/internals/store/useCharts.d.ts +1 -1
- package/models/axis.d.ts +42 -1
- package/models/axis.js +4 -0
- package/models/index.d.ts +1 -1
- package/models/seriesType/bar.d.ts +11 -1
- package/models/seriesType/common.d.ts +9 -3
- package/models/seriesType/line.d.ts +3 -1
- package/models/seriesType/scatter.d.ts +14 -2
- package/package.json +5 -5
- package/tests/web-components.js +55 -0
- package/themeAugmentation/components.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
package/RadarChart/RadarChart.js
CHANGED
|
@@ -42,6 +42,8 @@ const RadarChart = exports.RadarChart = /*#__PURE__*/React.forwardRef(function R
|
|
|
42
42
|
chartsSurfaceProps,
|
|
43
43
|
radarDataProviderProps,
|
|
44
44
|
radarGrid,
|
|
45
|
+
radarSeriesAreaProps,
|
|
46
|
+
radarSeriesMarksProps,
|
|
45
47
|
overlayProps,
|
|
46
48
|
legendProps,
|
|
47
49
|
highlight,
|
|
@@ -53,7 +55,7 @@ const RadarChart = exports.RadarChart = /*#__PURE__*/React.forwardRef(function R
|
|
|
53
55
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
54
56
|
children: [props.showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
55
57
|
ref: ref,
|
|
56
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarGrid.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarMetricLabels.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarAxisHighlight.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesMarks, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarGrid.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarMetricLabels.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesArea, (0, _extends2.default)({}, radarSeriesAreaProps)), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarAxisHighlight.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesMarks, (0, _extends2.default)({}, radarSeriesMarksProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
|
|
57
59
|
})), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
|
|
58
60
|
}))
|
|
59
61
|
}));
|
|
@@ -132,12 +134,31 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
132
134
|
right: _propTypes.default.number,
|
|
133
135
|
top: _propTypes.default.number
|
|
134
136
|
})]),
|
|
137
|
+
/**
|
|
138
|
+
* Callback fired when an area is clicked.
|
|
139
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
140
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
141
|
+
*/
|
|
142
|
+
onAreaClick: _propTypes.default.func,
|
|
143
|
+
/**
|
|
144
|
+
* The function called for onClick events.
|
|
145
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
146
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
147
|
+
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
148
|
+
*/
|
|
149
|
+
onAxisClick: _propTypes.default.func,
|
|
135
150
|
/**
|
|
136
151
|
* The callback fired when the highlighted item changes.
|
|
137
152
|
*
|
|
138
153
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
139
154
|
*/
|
|
140
155
|
onHighlightChange: _propTypes.default.func,
|
|
156
|
+
/**
|
|
157
|
+
* Callback fired when a mark is clicked.
|
|
158
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
159
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
160
|
+
*/
|
|
161
|
+
onMarkClick: _propTypes.default.func,
|
|
141
162
|
/**
|
|
142
163
|
* The configuration of the radar scales.
|
|
143
164
|
*/
|
|
@@ -154,7 +175,7 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
154
175
|
}).isRequired,
|
|
155
176
|
/**
|
|
156
177
|
* The series to display in the bar chart.
|
|
157
|
-
* An array of [[
|
|
178
|
+
* An array of [[RadarSeries]] objects.
|
|
158
179
|
*/
|
|
159
180
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
160
181
|
/**
|
|
@@ -5,12 +5,13 @@ import { RadarSeriesType } from "../../models/seriesType/radar.js";
|
|
|
5
5
|
import { ChartDataProviderProps } from "../../ChartDataProvider/index.js";
|
|
6
6
|
import { RadarConfig } from "./radar.types.js";
|
|
7
7
|
import { ChartAnyPluginSignature } from "../../internals/plugins/models/plugin.js";
|
|
8
|
-
export type
|
|
8
|
+
export type RadarSeries = MakeOptional<RadarSeriesType, 'type'>;
|
|
9
|
+
export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset' | 'experimentalFeatures'> & {
|
|
9
10
|
/**
|
|
10
11
|
* The series to display in the bar chart.
|
|
11
|
-
* An array of [[
|
|
12
|
+
* An array of [[RadarSeries]] objects.
|
|
12
13
|
*/
|
|
13
|
-
series: Readonly<
|
|
14
|
+
series: Readonly<RadarSeries>[];
|
|
14
15
|
/**
|
|
15
16
|
* The configuration of the radar scales.
|
|
16
17
|
*/
|
|
@@ -27,14 +27,16 @@ function useRadarMetricData() {
|
|
|
27
27
|
const radiusScale = radiusAxis[metric].scale;
|
|
28
28
|
const r = radiusScale.range()[1] + labelGap;
|
|
29
29
|
const angle = angles[dataIndex];
|
|
30
|
+
const defaultTickLabel = metric;
|
|
30
31
|
return {
|
|
31
32
|
x: cx + r * Math.sin(angle),
|
|
32
33
|
y: cy - r * Math.cos(angle),
|
|
33
34
|
angle: (0, _angleConversion.rad2deg)(angle),
|
|
34
35
|
label: valueFormatter?.(metric, {
|
|
35
36
|
location: 'tick',
|
|
36
|
-
scale: rotationScale
|
|
37
|
-
|
|
37
|
+
scale: rotationScale,
|
|
38
|
+
defaultTickLabel
|
|
39
|
+
}) ?? defaultTickLabel
|
|
38
40
|
};
|
|
39
41
|
})
|
|
40
42
|
};
|
|
@@ -17,8 +17,9 @@ var _getAreaPath = require("./getAreaPath");
|
|
|
17
17
|
var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
|
|
18
18
|
var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
|
|
19
19
|
var _useInteractionItemProps = require("../../hooks/useInteractionItemProps");
|
|
20
|
+
var _useRadarRotationIndex = require("./useRadarRotationIndex");
|
|
20
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["seriesId"];
|
|
22
|
+
const _excluded = ["seriesId", "onItemClick"];
|
|
22
23
|
function getPathProps(params) {
|
|
23
24
|
const {
|
|
24
25
|
isHighlighted,
|
|
@@ -47,10 +48,12 @@ function getPathProps(params) {
|
|
|
47
48
|
}
|
|
48
49
|
function RadarSeriesArea(props) {
|
|
49
50
|
const {
|
|
50
|
-
seriesId
|
|
51
|
+
seriesId,
|
|
52
|
+
onItemClick
|
|
51
53
|
} = props,
|
|
52
54
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
53
55
|
const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(seriesId);
|
|
56
|
+
const getRotationIndex = (0, _useRadarRotationIndex.useRadarRotationIndex)();
|
|
54
57
|
const interactionProps = (0, _useInteractionItemProps.useInteractionAllItemProps)(seriesCoordinates);
|
|
55
58
|
const {
|
|
56
59
|
isFaded,
|
|
@@ -72,7 +75,14 @@ function RadarSeriesArea(props) {
|
|
|
72
75
|
isFaded,
|
|
73
76
|
isHighlighted,
|
|
74
77
|
classes
|
|
75
|
-
}),
|
|
78
|
+
}), {
|
|
79
|
+
onClick: event => onItemClick?.(event, {
|
|
80
|
+
type: 'radar',
|
|
81
|
+
seriesId: id,
|
|
82
|
+
dataIndex: getRotationIndex(event)
|
|
83
|
+
}),
|
|
84
|
+
cursor: onItemClick ? 'pointer' : 'unset'
|
|
85
|
+
}, interactionProps[seriesIndex], other), id);
|
|
76
86
|
})
|
|
77
87
|
});
|
|
78
88
|
}
|
|
@@ -85,6 +95,12 @@ process.env.NODE_ENV !== "production" ? RadarSeriesArea.propTypes = {
|
|
|
85
95
|
* Override or extend the styles applied to the component.
|
|
86
96
|
*/
|
|
87
97
|
classes: _propTypes.default.object,
|
|
98
|
+
/**
|
|
99
|
+
* Callback fired when an area is clicked.
|
|
100
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
101
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
102
|
+
*/
|
|
103
|
+
onItemClick: _propTypes.default.func,
|
|
88
104
|
/**
|
|
89
105
|
* The id of the series to display.
|
|
90
106
|
* If undefined all series are displayed.
|
|
@@ -16,7 +16,7 @@ var _useRadarSeriesData = require("./useRadarSeriesData");
|
|
|
16
16
|
var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
|
|
17
17
|
var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["seriesId"];
|
|
19
|
+
const _excluded = ["seriesId", "onItemClick"];
|
|
20
20
|
function getCircleProps(params) {
|
|
21
21
|
const {
|
|
22
22
|
isHighlighted,
|
|
@@ -40,12 +40,14 @@ function getCircleProps(params) {
|
|
|
40
40
|
fill: color,
|
|
41
41
|
stroke: color,
|
|
42
42
|
opacity: fillArea && isItemFaded ? 0.5 : 1,
|
|
43
|
-
pointerEvents: 'none',
|
|
44
43
|
className: (0, _clsx.clsx)(classes.mark, isItemHighlighted && classes.highlighted || isItemFaded && classes.faded)
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
function RadarSeriesMarks(props) {
|
|
48
|
-
const
|
|
47
|
+
const {
|
|
48
|
+
onItemClick
|
|
49
|
+
} = props,
|
|
50
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
49
51
|
const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(props.seriesId);
|
|
50
52
|
const classes = (0, _radarSeriesPlotClasses.useUtilityClasses)(props.classes);
|
|
51
53
|
const {
|
|
@@ -72,7 +74,15 @@ function RadarSeriesMarks(props) {
|
|
|
72
74
|
isFaded,
|
|
73
75
|
isHighlighted,
|
|
74
76
|
classes
|
|
75
|
-
}),
|
|
77
|
+
}), {
|
|
78
|
+
pointerEvents: onItemClick ? undefined : 'none',
|
|
79
|
+
onClick: event => onItemClick?.(event, {
|
|
80
|
+
type: 'radar',
|
|
81
|
+
seriesId: id,
|
|
82
|
+
dataIndex: index
|
|
83
|
+
}),
|
|
84
|
+
cursor: onItemClick ? 'pointer' : 'unset'
|
|
85
|
+
}, other), index))
|
|
76
86
|
}, id);
|
|
77
87
|
})
|
|
78
88
|
});
|
|
@@ -86,6 +96,12 @@ process.env.NODE_ENV !== "production" ? RadarSeriesMarks.propTypes = {
|
|
|
86
96
|
* Override or extend the styles applied to the component.
|
|
87
97
|
*/
|
|
88
98
|
classes: _propTypes.default.object,
|
|
99
|
+
/**
|
|
100
|
+
* Callback fired when a mark is clicked.
|
|
101
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
102
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
103
|
+
*/
|
|
104
|
+
onItemClick: _propTypes.default.func,
|
|
89
105
|
/**
|
|
90
106
|
* The id of the series to display.
|
|
91
107
|
* If undefined all series are displayed.
|
|
@@ -15,15 +15,23 @@ var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
|
|
|
15
15
|
var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
|
|
16
16
|
var _RadarSeriesArea = require("./RadarSeriesArea");
|
|
17
17
|
var _RadarSeriesMarks = require("./RadarSeriesMarks");
|
|
18
|
+
var _useRadarRotationIndex = require("./useRadarRotationIndex");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
function RadarSeriesPlot(props) {
|
|
20
|
-
const
|
|
21
|
+
const {
|
|
22
|
+
seriesId: inSeriesId,
|
|
23
|
+
classes: inClasses,
|
|
24
|
+
onAreaClick,
|
|
25
|
+
onMarkClick
|
|
26
|
+
} = props;
|
|
27
|
+
const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(inSeriesId);
|
|
28
|
+
const getRotationIndex = (0, _useRadarRotationIndex.useRadarRotationIndex)();
|
|
21
29
|
const interactionProps = (0, _useInteractionItemProps.useInteractionAllItemProps)(seriesCoordinates);
|
|
22
30
|
const {
|
|
23
31
|
isFaded,
|
|
24
32
|
isHighlighted
|
|
25
33
|
} = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
|
|
26
|
-
const classes = (0, _radarSeriesPlotClasses.useUtilityClasses)(
|
|
34
|
+
const classes = (0, _radarSeriesPlotClasses.useUtilityClasses)(inClasses);
|
|
27
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
28
36
|
className: classes.root,
|
|
29
37
|
children: seriesCoordinates?.map(({
|
|
@@ -42,7 +50,14 @@ function RadarSeriesPlot(props) {
|
|
|
42
50
|
isFaded,
|
|
43
51
|
isHighlighted,
|
|
44
52
|
classes
|
|
45
|
-
}),
|
|
53
|
+
}), {
|
|
54
|
+
onClick: event => onAreaClick?.(event, {
|
|
55
|
+
type: 'radar',
|
|
56
|
+
seriesId,
|
|
57
|
+
dataIndex: getRotationIndex(event)
|
|
58
|
+
}),
|
|
59
|
+
cursor: onAreaClick ? 'pointer' : 'unset'
|
|
60
|
+
}, interactionProps[seriesIndex]), seriesId), !hideMark && points.map((point, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", (0, _extends2.default)({}, (0, _RadarSeriesMarks.getCircleProps)({
|
|
46
61
|
seriesId,
|
|
47
62
|
point,
|
|
48
63
|
color,
|
|
@@ -50,7 +65,14 @@ function RadarSeriesPlot(props) {
|
|
|
50
65
|
isFaded,
|
|
51
66
|
isHighlighted,
|
|
52
67
|
classes
|
|
53
|
-
})
|
|
68
|
+
}), {
|
|
69
|
+
onClick: event => onMarkClick?.(event, {
|
|
70
|
+
type: 'radar',
|
|
71
|
+
seriesId,
|
|
72
|
+
dataIndex: index
|
|
73
|
+
}),
|
|
74
|
+
cursor: onMarkClick ? 'pointer' : 'unset'
|
|
75
|
+
}), index))]
|
|
54
76
|
}, seriesId);
|
|
55
77
|
})
|
|
56
78
|
});
|
|
@@ -64,6 +86,18 @@ process.env.NODE_ENV !== "production" ? RadarSeriesPlot.propTypes = {
|
|
|
64
86
|
* Override or extend the styles applied to the component.
|
|
65
87
|
*/
|
|
66
88
|
classes: _propTypes.default.object,
|
|
89
|
+
/**
|
|
90
|
+
* Callback fired when an area is clicked.
|
|
91
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
92
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
93
|
+
*/
|
|
94
|
+
onAreaClick: _propTypes.default.func,
|
|
95
|
+
/**
|
|
96
|
+
* Callback fired when a mark is clicked.
|
|
97
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
98
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
99
|
+
*/
|
|
100
|
+
onMarkClick: _propTypes.default.func,
|
|
67
101
|
/**
|
|
68
102
|
* The id of the series to display.
|
|
69
103
|
* If undefined all series are displayed.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { RadarSeriesPlotClasses } from "./radarSeriesPlotClasses.js";
|
|
3
|
+
import { RadarItemIdentifier } from "../../models/seriesType/radar.js";
|
|
3
4
|
interface CommonRadarSeriesPlotProps {
|
|
4
5
|
/**
|
|
5
6
|
* The id of the series to display.
|
|
@@ -11,7 +12,35 @@ interface CommonRadarSeriesPlotProps {
|
|
|
11
12
|
*/
|
|
12
13
|
classes?: Partial<RadarSeriesPlotClasses>;
|
|
13
14
|
}
|
|
14
|
-
export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {
|
|
16
|
+
/**
|
|
17
|
+
* Callback fired when an area is clicked.
|
|
18
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
19
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
20
|
+
*/
|
|
21
|
+
onAreaClick?: RadarSeriesAreaProps['onItemClick'];
|
|
22
|
+
/**
|
|
23
|
+
* Callback fired when a mark is clicked.
|
|
24
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
25
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
26
|
+
*/
|
|
27
|
+
onMarkClick?: RadarSeriesMarksProps['onItemClick'];
|
|
28
|
+
}
|
|
29
|
+
type RadarClickIdentifier = Required<RadarItemIdentifier>;
|
|
30
|
+
export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {
|
|
31
|
+
/**
|
|
32
|
+
* Callback fired when a mark is clicked.
|
|
33
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
34
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
35
|
+
*/
|
|
36
|
+
onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {
|
|
39
|
+
/**
|
|
40
|
+
* Callback fired when an area is clicked.
|
|
41
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
42
|
+
* @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
|
|
43
|
+
*/
|
|
44
|
+
onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
|
|
45
|
+
}
|
|
17
46
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook provides a function that from pointer event returns the rotation index.
|
|
3
|
+
* @return {(event: { clientX: number; clientY: number }) => number | null} rotationIndexGetter Returns the rotation data index.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useRadarRotationIndex(): (event: {
|
|
6
|
+
clientX: number;
|
|
7
|
+
clientY: number;
|
|
8
|
+
}) => number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useRadarRotationIndex = useRadarRotationIndex;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
|
|
10
|
+
var _getSVGPoint = require("../../internals/getSVGPoint");
|
|
11
|
+
var _coordinateTransformation = require("../../internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation");
|
|
12
|
+
var _useSelector = require("../../internals/store/useSelector");
|
|
13
|
+
var _getAxisIndex = require("../../internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex");
|
|
14
|
+
var _useStore = require("../../internals/store/useStore");
|
|
15
|
+
var _useSvgRef = require("../../hooks/useSvgRef");
|
|
16
|
+
var _useAxis = require("../../hooks/useAxis");
|
|
17
|
+
/**
|
|
18
|
+
* This hook provides a function that from pointer event returns the rotation index.
|
|
19
|
+
* @return {(event: { clientX: number; clientY: number }) => number | null} rotationIndexGetter Returns the rotation data index.
|
|
20
|
+
*/
|
|
21
|
+
function useRadarRotationIndex() {
|
|
22
|
+
const svgRef = (0, _useSvgRef.useSvgRef)();
|
|
23
|
+
const store = (0, _useStore.useStore)();
|
|
24
|
+
const rotationAxis = (0, _useAxis.useRotationAxis)();
|
|
25
|
+
const center = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
|
|
26
|
+
const rotationIndexGetter = React.useCallback(function rotationIndexGetter(event) {
|
|
27
|
+
const element = svgRef.current;
|
|
28
|
+
if (!element || !rotationAxis) {
|
|
29
|
+
// Should never append
|
|
30
|
+
throw new Error(`MUI X Charts: The ${!element ? 'SVG' : 'rotation axis'} was not found to compute radar dataIndex.`);
|
|
31
|
+
}
|
|
32
|
+
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, event);
|
|
33
|
+
const rotation = (0, _coordinateTransformation.generateSvg2rotation)(center)(svgPoint.x, svgPoint.y);
|
|
34
|
+
const rotationIndex = (0, _getAxisIndex.getAxisIndex)(rotationAxis, rotation);
|
|
35
|
+
return rotationIndex;
|
|
36
|
+
}, [center, rotationAxis, svgRef]);
|
|
37
|
+
return rotationIndexGetter;
|
|
38
|
+
}
|
|
@@ -17,8 +17,8 @@ export declare function useRadarSeriesData(querySeriesId?: SeriesId): {
|
|
|
17
17
|
}[];
|
|
18
18
|
type: "radar";
|
|
19
19
|
label?: string | ((location: "tooltip" | "legend") => string) | undefined;
|
|
20
|
-
highlightScope?:
|
|
21
|
-
labelMarkType?:
|
|
20
|
+
highlightScope?: import("../../index.js").HighlightScope | undefined;
|
|
21
|
+
labelMarkType?: import("../../internals/index.js").ChartsLabelMarkType | undefined;
|
|
22
22
|
hideMark?: boolean | undefined;
|
|
23
23
|
fillArea?: boolean | undefined;
|
|
24
24
|
data: number[];
|
package/RadarChart/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { RadarChart } from "./RadarChart.js";
|
|
|
3
3
|
export { RadarDataProvider as Unstable_RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
4
4
|
export { RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
5
5
|
export type { RadarChartProps, RadarChartSlots, RadarChartSlotProps } from "./RadarChart.js";
|
|
6
|
-
export type { RadarDataProviderProps } from "./RadarDataProvider/index.js";
|
|
6
|
+
export type { RadarDataProviderProps, RadarSeries } from "./RadarDataProvider/index.js";
|
|
7
7
|
export * from "./RadarGrid/index.js";
|
|
8
8
|
export * from "./RadarAxisHighlight/index.js";
|
|
9
9
|
export * from "./RadarMetricLabels/index.js";
|
|
@@ -6,6 +6,7 @@ import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js
|
|
|
6
6
|
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
7
7
|
import { RadarGridProps } from "./RadarGrid/index.js";
|
|
8
8
|
import { RadarChartPluginsSignatures } from "./RadarChart.plugins.js";
|
|
9
|
+
import { RadarSeriesAreaProps, RadarSeriesMarksProps } from "./RadarSeriesPlot/index.js";
|
|
9
10
|
/**
|
|
10
11
|
* A helper function that extracts RadarChartProps from the input props
|
|
11
12
|
* and returns an object with props for the children components of RadarChart.
|
|
@@ -19,6 +20,8 @@ export declare const useRadarChartProps: (props: RadarChartProps) => {
|
|
|
19
20
|
chartsSurfaceProps: ChartsSurfaceProps;
|
|
20
21
|
radarDataProviderProps: RadarDataProviderProps<RadarChartPluginsSignatures>;
|
|
21
22
|
radarGrid: RadarGridProps;
|
|
23
|
+
radarSeriesAreaProps: RadarSeriesAreaProps;
|
|
24
|
+
radarSeriesMarksProps: RadarSeriesMarksProps;
|
|
22
25
|
overlayProps: ChartsOverlayProps;
|
|
23
26
|
legendProps: ChartsLegendSlotExtension;
|
|
24
27
|
children: import("react").ReactNode;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.useRadarChartProps = void 0;
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
-
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar"];
|
|
10
|
+
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick"];
|
|
11
11
|
/**
|
|
12
12
|
* A helper function that extracts RadarChartProps from the input props
|
|
13
13
|
* and returns an object with props for the children components of RadarChart.
|
|
@@ -35,7 +35,10 @@ const useRadarChartProps = props => {
|
|
|
35
35
|
divisions,
|
|
36
36
|
shape,
|
|
37
37
|
stripeColor,
|
|
38
|
-
highlight = 'axis'
|
|
38
|
+
highlight = 'axis',
|
|
39
|
+
onAxisClick,
|
|
40
|
+
onAreaClick,
|
|
41
|
+
onMarkClick
|
|
39
42
|
} = props,
|
|
40
43
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
41
44
|
const radarDataProviderProps = {
|
|
@@ -49,7 +52,8 @@ const useRadarChartProps = props => {
|
|
|
49
52
|
colors,
|
|
50
53
|
highlightedItem,
|
|
51
54
|
onHighlightChange,
|
|
52
|
-
skipAnimation
|
|
55
|
+
skipAnimation,
|
|
56
|
+
onAxisClick
|
|
53
57
|
};
|
|
54
58
|
const overlayProps = {
|
|
55
59
|
slots,
|
|
@@ -68,6 +72,12 @@ const useRadarChartProps = props => {
|
|
|
68
72
|
shape,
|
|
69
73
|
stripeColor
|
|
70
74
|
};
|
|
75
|
+
const radarSeriesAreaProps = {
|
|
76
|
+
onItemClick: onAreaClick
|
|
77
|
+
};
|
|
78
|
+
const radarSeriesMarksProps = {
|
|
79
|
+
onItemClick: onMarkClick
|
|
80
|
+
};
|
|
71
81
|
const chartsSurfaceProps = other;
|
|
72
82
|
return {
|
|
73
83
|
highlight,
|
|
@@ -75,6 +85,8 @@ const useRadarChartProps = props => {
|
|
|
75
85
|
chartsSurfaceProps,
|
|
76
86
|
radarDataProviderProps,
|
|
77
87
|
radarGrid,
|
|
88
|
+
radarSeriesAreaProps,
|
|
89
|
+
radarSeriesMarksProps,
|
|
78
90
|
overlayProps,
|
|
79
91
|
legendProps,
|
|
80
92
|
children
|
|
@@ -16,12 +16,13 @@ import { UseChartVoronoiSignature } from "../internals/plugins/featurePlugins/us
|
|
|
16
16
|
import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
|
|
17
17
|
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
18
18
|
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
19
|
-
export
|
|
19
|
+
export type ScatterSeries = MakeOptional<ScatterSeriesType, 'type'>;
|
|
20
|
+
export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginsSignatures>, 'series' | 'plugins' | 'onItemClick' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
20
21
|
/**
|
|
21
22
|
* The series to display in the scatter chart.
|
|
22
|
-
* An array of [[
|
|
23
|
+
* An array of [[ScatterSeries]] objects.
|
|
23
24
|
*/
|
|
24
|
-
series: Readonly<
|
|
25
|
+
series: Readonly<ScatterSeries[]>;
|
|
25
26
|
/**
|
|
26
27
|
* The configuration of axes highlight.
|
|
27
28
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -180,7 +180,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
180
180
|
onItemClick: _propTypes.default.func,
|
|
181
181
|
/**
|
|
182
182
|
* The series to display in the scatter chart.
|
|
183
|
-
* An array of [[
|
|
183
|
+
* An array of [[ScatterSeries]] objects.
|
|
184
184
|
*/
|
|
185
185
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
186
186
|
/**
|
|
@@ -12,9 +12,9 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _Scatter = require("./Scatter");
|
|
14
14
|
var _useScatterSeries = require("../hooks/useScatterSeries");
|
|
15
|
-
var _getColor = _interopRequireDefault(require("./seriesConfig/getColor"));
|
|
16
15
|
var _hooks = require("../hooks");
|
|
17
16
|
var _useZAxis = require("../hooks/useZAxis");
|
|
17
|
+
var _seriesConfig = require("./seriesConfig");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
/**
|
|
20
20
|
* Demos:
|
|
@@ -65,7 +65,7 @@ function ScatterPlot(props) {
|
|
|
65
65
|
zAxisId,
|
|
66
66
|
color
|
|
67
67
|
} = series[seriesId];
|
|
68
|
-
const colorGetter =
|
|
68
|
+
const colorGetter = _seriesConfig.seriesConfig.colorProcessor(series[seriesId], xAxis[xAxisId ?? defaultXAxisId], yAxis[yAxisId ?? defaultYAxisId], zAxis[zAxisId ?? defaultZAxisId]);
|
|
69
69
|
const xScale = xAxis[xAxisId ?? defaultXAxisId].scale;
|
|
70
70
|
const yScale = yAxis[yAxisId ?? defaultYAxisId].scale;
|
|
71
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScatterItems, (0, _extends2.default)({
|
|
@@ -28,6 +28,9 @@ const seriesProcessor = ({
|
|
|
28
28
|
labelMarkType: 'circle',
|
|
29
29
|
markerSize: 4
|
|
30
30
|
}, seriesData, {
|
|
31
|
+
preview: (0, _extends2.default)({
|
|
32
|
+
markerSize: 1
|
|
33
|
+
}, seriesData?.preview),
|
|
31
34
|
data,
|
|
32
35
|
valueFormatter: seriesData.valueFormatter ?? (v => v && `(${v.x}, ${v.y})`)
|
|
33
36
|
})];
|
|
@@ -13,7 +13,7 @@ import { BarPlotSlots, BarPlotSlotProps } from "../BarChart/BarPlot.js";
|
|
|
13
13
|
import { ChartMargin } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js";
|
|
14
14
|
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots {}
|
|
15
15
|
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {}
|
|
16
|
-
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps'> {
|
|
16
|
+
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
17
17
|
/**
|
|
18
18
|
* The xAxis configuration.
|
|
19
19
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
|
@@ -213,6 +213,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
213
213
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
214
214
|
*/
|
|
215
215
|
height: _propTypes.default.number,
|
|
216
|
+
/**
|
|
217
|
+
* The controlled axis highlight.
|
|
218
|
+
* Identified by the axis id, and data index.
|
|
219
|
+
*/
|
|
220
|
+
highlightedAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
221
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
222
|
+
dataIndex: _propTypes.default.number.isRequired
|
|
223
|
+
})),
|
|
216
224
|
/**
|
|
217
225
|
* The highlighted item.
|
|
218
226
|
* Used when the highlight is controlled.
|
|
@@ -256,6 +264,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
256
264
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
257
265
|
*/
|
|
258
266
|
onHighlightChange: _propTypes.default.func,
|
|
267
|
+
/**
|
|
268
|
+
* The function called when the pointer position corresponds to a new axis data item.
|
|
269
|
+
* This update can either be caused by a pointer movement, or an axis update.
|
|
270
|
+
* In case of multiple axes, the function is called if at least one axis is updated.
|
|
271
|
+
* The argument contains the identifier for all axes with a `data` property.
|
|
272
|
+
* @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
|
|
273
|
+
*/
|
|
274
|
+
onHighlightedAxisChange: _propTypes.default.func,
|
|
259
275
|
/**
|
|
260
276
|
* Callback fired when clicking close to an item.
|
|
261
277
|
* This is only available for scatter plot for now.
|
|
@@ -15,12 +15,13 @@ import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "
|
|
|
15
15
|
import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
|
|
16
16
|
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
17
17
|
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
18
|
-
export
|
|
18
|
+
export type BarSeries = MakeOptional<BarSeriesType, 'type'>;
|
|
19
|
+
export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
19
20
|
/**
|
|
20
21
|
* The series to display in the bar chart.
|
|
21
|
-
* An array of [[
|
|
22
|
+
* An array of [[BarSeries]] objects.
|
|
22
23
|
*/
|
|
23
|
-
series: Readonly<
|
|
24
|
+
series: Readonly<BarSeries[]>;
|
|
24
25
|
/**
|
|
25
26
|
* Option to display a cartesian grid in the background.
|
|
26
27
|
*/
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -127,6 +127,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
127
127
|
* If `true`, the legend is not rendered.
|
|
128
128
|
*/
|
|
129
129
|
hideLegend: PropTypes.bool,
|
|
130
|
+
/**
|
|
131
|
+
* The controlled axis highlight.
|
|
132
|
+
* Identified by the axis id, and data index.
|
|
133
|
+
*/
|
|
134
|
+
highlightedAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
135
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
136
|
+
dataIndex: PropTypes.number.isRequired
|
|
137
|
+
})),
|
|
130
138
|
/**
|
|
131
139
|
* The highlighted item.
|
|
132
140
|
* Used when the highlight is controlled.
|
|
@@ -179,6 +187,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
179
187
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
180
188
|
*/
|
|
181
189
|
onHighlightChange: PropTypes.func,
|
|
190
|
+
/**
|
|
191
|
+
* The function called when the pointer position corresponds to a new axis data item.
|
|
192
|
+
* This update can either be caused by a pointer movement, or an axis update.
|
|
193
|
+
* In case of multiple axes, the function is called if at least one axis is updated.
|
|
194
|
+
* The argument contains the identifier for all axes with a `data` property.
|
|
195
|
+
* @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
|
|
196
|
+
*/
|
|
197
|
+
onHighlightedAxisChange: PropTypes.func,
|
|
182
198
|
/**
|
|
183
199
|
* Callback fired when a bar item is clicked.
|
|
184
200
|
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
@@ -187,7 +203,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
187
203
|
onItemClick: PropTypes.func,
|
|
188
204
|
/**
|
|
189
205
|
* The series to display in the bar chart.
|
|
190
|
-
* An array of [[
|
|
206
|
+
* An array of [[BarSeries]] objects.
|
|
191
207
|
*/
|
|
192
208
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
193
209
|
/**
|
|
@@ -9,4 +9,4 @@ export interface BarClasses {
|
|
|
9
9
|
export type BarClassKey = keyof BarClasses;
|
|
10
10
|
export declare function getBarUtilityClass(slot: string): string;
|
|
11
11
|
export declare const barClasses: BarClasses;
|
|
12
|
-
export declare const useUtilityClasses: (classes?: Partial<BarClasses>) => Record<"
|
|
12
|
+
export declare const useUtilityClasses: (classes?: Partial<BarClasses>) => Record<"series" | "root" | "seriesLabels", string>;
|