@mui/x-charts 8.18.0 → 8.20.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/seriesConfig/bar/seriesProcessor.js +15 -9
- package/CHANGELOG.md +175 -0
- package/ChartsGrid/ChartsHorizontalGrid.js +5 -1
- package/ChartsGrid/ChartsVerticalGrid.js +5 -1
- package/ChartsSurface/ChartsSurface.js +5 -2
- package/ChartsTooltip/ChartsTooltipContainer.js +1 -1
- package/LineChart/seriesConfig/seriesProcessor.js +15 -10
- package/PieChart/PieArcPlot.js +5 -3
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +2 -2
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.d.ts +7 -0
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.js +26 -0
- package/esm/BarChart/seriesConfig/bar/seriesProcessor.js +15 -9
- package/esm/ChartsGrid/ChartsHorizontalGrid.js +5 -1
- package/esm/ChartsGrid/ChartsVerticalGrid.js +5 -1
- package/esm/ChartsSurface/ChartsSurface.js +5 -2
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +1 -1
- package/esm/LineChart/seriesConfig/seriesProcessor.js +15 -10
- package/esm/PieChart/PieArcPlot.js +5 -3
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +1 -1
- package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -1
- package/esm/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.d.ts +7 -0
- package/esm/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.js +18 -0
- package/esm/hooks/useBarSeries.js +3 -5
- package/esm/hooks/useInteractionItemProps.d.ts +0 -5
- package/esm/hooks/useInteractionItemProps.js +0 -11
- package/esm/hooks/useLineSeries.js +3 -5
- package/esm/hooks/usePieSeries.js +3 -5
- package/esm/hooks/useRadarSeries.js +3 -5
- package/esm/hooks/useScatterSeries.js +3 -5
- package/esm/hooks/useTicks.js +12 -3
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/internals/domUtils.js +30 -14
- package/esm/internals/getScale.d.ts +2 -1
- package/esm/internals/index.d.ts +1 -1
- package/esm/internals/index.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.js +2 -2
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +5 -6
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +2 -2
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +2 -2
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -1
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +3 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +16 -10
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.js +20 -12
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +5 -7
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -4
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +14 -5
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -2
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +15 -15
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +5 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +11 -11
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +5 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +7 -8
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +16 -12
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +15 -16
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +8 -8
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +4 -4
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +15 -10
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +11 -11
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +7 -8
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +2 -2
- package/esm/internals/plugins/utils/selectors.d.ts +1 -14
- package/esm/internals/plugins/utils/selectors.js +1 -5
- package/esm/internals/seriesSelectorOfType.d.ts +20 -0
- package/esm/internals/seriesSelectorOfType.js +38 -0
- package/esm/models/seriesType/config.d.ts +2 -2
- package/esm/utils/index.d.ts +4 -0
- package/esm/utils/index.js +5 -0
- package/esm/utils/niceDomain.d.ts +20 -0
- package/esm/utils/niceDomain.js +24 -0
- package/hooks/useBarSeries.js +3 -6
- package/hooks/useInteractionItemProps.d.ts +0 -5
- package/hooks/useInteractionItemProps.js +1 -13
- package/hooks/useLineSeries.js +3 -6
- package/hooks/usePieSeries.js +3 -6
- package/hooks/useRadarSeries.js +3 -6
- package/hooks/useScatterSeries.js +3 -6
- package/hooks/useTicks.js +12 -3
- package/index.d.ts +2 -1
- package/index.js +13 -1
- package/internals/domUtils.js +30 -14
- package/internals/getScale.d.ts +2 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +4 -4
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.js +2 -2
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +4 -5
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +2 -2
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +2 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +3 -1
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +16 -10
- package/internals/plugins/corePlugins/useChartSeries/processSeries.js +23 -14
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +4 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -4
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +15 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -2
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +15 -15
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +11 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +4 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +6 -7
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +2 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +16 -12
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +14 -15
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.types.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +8 -8
- package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +4 -4
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +15 -10
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +11 -11
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +6 -7
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +2 -2
- package/internals/plugins/utils/selectors.d.ts +1 -14
- package/internals/plugins/utils/selectors.js +1 -8
- package/internals/seriesSelectorOfType.d.ts +20 -0
- package/internals/seriesSelectorOfType.js +46 -0
- package/models/seriesType/config.d.ts +2 -2
- package/package.json +4 -4
- package/utils/index.d.ts +4 -0
- package/utils/index.js +16 -0
- package/utils/niceDomain.d.ts +20 -0
- package/utils/niceDomain.js +29 -0
- package/esm/internals/createSeriesSelectorOfType.d.ts +0 -4
- package/esm/internals/createSeriesSelectorOfType.js +0 -45
- package/internals/createSeriesSelectorOfType.d.ts +0 -4
- package/internals/createSeriesSelectorOfType.js +0 -53
|
@@ -34,6 +34,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
34
34
|
} else if (dataset === undefined) {
|
|
35
35
|
throw new Error([`MUI X Charts: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
36
36
|
}
|
|
37
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
38
|
+
if (!data && dataset) {
|
|
39
|
+
const dataKey = series[id].dataKey;
|
|
40
|
+
if (!dataKey) {
|
|
41
|
+
throw new Error([`MUI X Charts: bar series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
42
|
+
}
|
|
43
|
+
dataset.forEach((entry, index) => {
|
|
44
|
+
const value = entry[dataKey];
|
|
45
|
+
if (value != null && typeof value !== 'number') {
|
|
46
|
+
(0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Bar plots only support numeric and null values.'].join('\n'));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
37
51
|
});
|
|
38
52
|
const completedSeries = {};
|
|
39
53
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -59,15 +73,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
59
73
|
}, series[id], {
|
|
60
74
|
data: dataKey ? dataset.map(data => {
|
|
61
75
|
const value = data[dataKey];
|
|
62
|
-
|
|
63
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
64
|
-
if (value !== null) {
|
|
65
|
-
(0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
return value;
|
|
76
|
+
return typeof value === 'number' ? value : null;
|
|
71
77
|
}) : series[id].data,
|
|
72
78
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
73
79
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,181 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.20.0
|
|
9
|
+
|
|
10
|
+
_Nov 26, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🔃 Data Grid tree data now supports row reordering. See the [Drag-and-drop tree data reordering](https://mui.com/x/react-data-grid/tree-data/#drag-and-drop-tree-data-reordering) section for more details.
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
|
|
17
|
+
The following team members contributed to this release:
|
|
18
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @siriwatknp, @JCQuintas, @MBilalShafi, @prakhargupta1
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@8.20.0`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Fix RTL virtualization to display columns when viewport width is larger than the grid (#20409) @siriwatknp
|
|
25
|
+
- [DataGrid] Fix row range selection (#20442) @arminmeh
|
|
26
|
+
- [DataGrid] Initialize data grid core packages (#20276) @cherniavskii
|
|
27
|
+
- [DataGrid] Improve accessibility of the sort icon (#20430) @arminmeh
|
|
28
|
+
- [DataGrid] Use `viewport` as a boundary for the `BasePopper` flip (#20311) @arminmeh
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-pro@8.20.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid@8.20.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPro] Avoid automatic scroll back to the focused header filter after it leaves the viewport (#20416) @arminmeh
|
|
35
|
+
- [DataGridPro] Tree data row reordering (#19401) @MBilalShafi
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid-premium@8.20.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
38
|
+
|
|
39
|
+
Same changes as in `@mui/x-data-grid-pro@8.20.0`.
|
|
40
|
+
|
|
41
|
+
### Charts
|
|
42
|
+
|
|
43
|
+
#### `@mui/x-charts@8.20.0`
|
|
44
|
+
|
|
45
|
+
- [charts] Fix item tooltip position with node anchor (#20421) @alexfauquette
|
|
46
|
+
- [charts] Fix radar item tooltip closing bug (#20429) @alexfauquette
|
|
47
|
+
- [charts] Move series processing to selector (#20388) @JCQuintas
|
|
48
|
+
- [charts] Prevent pointer out from removing controlled highlight (#20385) @alexfauquette
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-charts-pro@8.20.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-charts@8.20.0`, plus:
|
|
53
|
+
|
|
54
|
+
- [charts-pro] Fix Content-Security-Policy nonce not being correctly set on export (#20395) @bernardobelchior
|
|
55
|
+
- [charts-pro] Improve vertical zoom slider thumb on mobile (#20439) @bernardobelchior
|
|
56
|
+
- [charts-pro] Provide arguments to the `AreaPlotRoot` styled component (#20414) @arminmeh
|
|
57
|
+
- [charts-pro] Remove grid outside the drawing area (#20412) @alexfauquette
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-charts-premium@8.20.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
60
|
+
|
|
61
|
+
Same changes as in `@mui/x-charts-pro@8.20.0`, plus:
|
|
62
|
+
|
|
63
|
+
- [charts-premium] Add explicit return type to `ChartsRenderer` for better compatibility with React 18 (#20413) @arminmeh
|
|
64
|
+
|
|
65
|
+
### Docs
|
|
66
|
+
|
|
67
|
+
- [docs] Add `llms.txt` link to the sidebar (#20312) @siriwatknp
|
|
68
|
+
- [docs] Add a line chart demo for the Overview section (#20239) @prakhargupta1
|
|
69
|
+
|
|
70
|
+
## 8.19.0
|
|
71
|
+
|
|
72
|
+
_Nov 20, 2025_
|
|
73
|
+
|
|
74
|
+
We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
75
|
+
|
|
76
|
+
- 🔎 Add pan on `wheel` to the charts zoom
|
|
77
|
+
- ⌨️ Allow opt-in to [tab navigation](https://mui.com/x/react-data-grid/accessibility/#tab-navigation) inside the Data Grid.
|
|
78
|
+
- ⚙️ New way of defining [action columns](https://mui.com/x/react-data-grid/column-definition/#ActionsWithModalGrid.tsx) in the Data Grid that makes it easier to keep `columns` prop stable.
|
|
79
|
+
- 🐞 Bugfixes
|
|
80
|
+
- 📚 Documentation improvements
|
|
81
|
+
|
|
82
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
83
|
+
@lauri865, @noobyogi0010, @sai6855
|
|
84
|
+
|
|
85
|
+
The following team members contributed to this release:
|
|
86
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mj12albert, @noraleonte, @rita-codes, @siriwatknp, @ZeeshanTamboli
|
|
87
|
+
|
|
88
|
+
### Data Grid
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-data-grid@8.19.0`
|
|
91
|
+
|
|
92
|
+
- [DataGrid] Add `tabNavigation` prop to control tab navigation in the grid (#20286) @arminmeh
|
|
93
|
+
- [DataGrid] Allow to focus disabled checkbox cells (#19959) @mj12albert
|
|
94
|
+
- [DataGrid] Alternative actions column definition API (#15041) @cherniavskii
|
|
95
|
+
- [DataGrid] Fix failing tests (#20332) @cherniavskii
|
|
96
|
+
- [DataGrid] Prevent Safari 26 error in the event handler (#20369) @arminmeh
|
|
97
|
+
- [DataGrid] Undeprecate the `autoHeight` prop (#20363) @cherniavskii
|
|
98
|
+
- [DataGrid] Fix print export grid dimensions with dynamic row height and print styles (#19835) @cherniavskii
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-data-grid-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
101
|
+
|
|
102
|
+
Same changes as in `@mui/x-data-grid@8.19.0`.
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-data-grid-premium@8.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-data-grid-pro@8.19.0`, plus:
|
|
107
|
+
|
|
108
|
+
- [DataGridPremium] Fix aggregation with sorting (#19892) @lauri865
|
|
109
|
+
- [DataGridPremium] Lock `ExcelJS` version (#20329) @cherniavskii
|
|
110
|
+
|
|
111
|
+
### Date and Time Pickers
|
|
112
|
+
|
|
113
|
+
#### `@mui/x-date-pickers@8.19.0`
|
|
114
|
+
|
|
115
|
+
- [pickers] Do not loose `slotProps.field.slotProps` (#20322) @flaviendelangle
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-date-pickers-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
118
|
+
|
|
119
|
+
Same changes as in `@mui/x-date-pickers@8.19.0`.
|
|
120
|
+
|
|
121
|
+
### Charts
|
|
122
|
+
|
|
123
|
+
#### `@mui/x-charts@8.19.0`
|
|
124
|
+
|
|
125
|
+
- [charts] Expose `niceDomain` utility (#20250) @bernardobelchior
|
|
126
|
+
- [charts] Fix benchmark regression by downgrading to JSDOM v26 (#20405) @bernardobelchior
|
|
127
|
+
- [charts] Fix Pie Chart keyboard focus highlight (#20358) @JCQuintas
|
|
128
|
+
- [charts] Memoize series selectors (#20326) @JCQuintas
|
|
129
|
+
- [charts] Relax dataset type (#20294) @bernardobelchior
|
|
130
|
+
- [charts] Remove `touch-action: pan-y` when zoom is disabled (#20204) @bernardobelchior
|
|
131
|
+
- [charts] Use `getBBox()` for correct SVG sizes in firefox (#20309) @JCQuintas
|
|
132
|
+
- [charts] Use directly selector from `@mui/x-internals` (#20365) @alexfauquette
|
|
133
|
+
- [charts] Fix unnecessary errors in dev mode (#20380) @JCQuintas
|
|
134
|
+
|
|
135
|
+
#### `@mui/x-charts-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
136
|
+
|
|
137
|
+
Same changes as in `@mui/x-charts@8.19.0`, plus:
|
|
138
|
+
|
|
139
|
+
- [charts-pro] Add pan on `wheel` to zoom (#19998) @JCQuintas
|
|
140
|
+
- [charts-pro] Fix zoom slider preview having an opaque background in dark mode (#20367) @bernardobelchior
|
|
141
|
+
|
|
142
|
+
#### `@mui/x-charts-premium@8.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
143
|
+
|
|
144
|
+
Same changes as in `@mui/x-charts-pro@8.19.0`.
|
|
145
|
+
|
|
146
|
+
### Tree View
|
|
147
|
+
|
|
148
|
+
#### `@mui/x-tree-view@8.19.0`
|
|
149
|
+
|
|
150
|
+
- [tree view] Enable lazy load when children count is not know in tree view (#18680) @noobyogi0010
|
|
151
|
+
- [tree view] Fix unwanted behaviors on the item re-ordering (#20368) @flaviendelangle
|
|
152
|
+
|
|
153
|
+
#### `@mui/x-tree-view-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
154
|
+
|
|
155
|
+
Same changes as in `@mui/x-tree-view@8.19.0`.
|
|
156
|
+
|
|
157
|
+
### Codemod
|
|
158
|
+
|
|
159
|
+
#### `@mui/x-codemod@8.19.0`
|
|
160
|
+
|
|
161
|
+
Internal changes.
|
|
162
|
+
|
|
163
|
+
### Docs
|
|
164
|
+
|
|
165
|
+
- [docs] Add minimum Typescript version to migration guide (#20320) @siriwatknp
|
|
166
|
+
- [docs] Fix Autosizing documentation (#20348) @siriwatknp
|
|
167
|
+
- [docs] Fix separator opacity in demo (#20293) @sai6855
|
|
168
|
+
- [docs] Replace deprecated `LoadingButton` with `Button` component (#20208) @Janpot
|
|
169
|
+
|
|
170
|
+
### Core
|
|
171
|
+
|
|
172
|
+
- [code-infra] Add new broken links checker (#20120) @Janpot
|
|
173
|
+
- [code-infra] Disable Codspeed pipeline (#20370) @JCQuintas
|
|
174
|
+
- [code-infra] Optimize `checkMaterialVersion` (#20307) @Janpot
|
|
175
|
+
- [code-infra] Use utils from code-infra for changelog and PR creation (#20406) @brijeshb42
|
|
176
|
+
- [docs-infra] Revert `@docsearch/react` (#20313) @Janpot
|
|
177
|
+
|
|
178
|
+
### Miscellaneous
|
|
179
|
+
|
|
180
|
+
- [test] Fix browser tests skipping some projects (#20318) @cherniavskii
|
|
181
|
+
- [test] Update `use-react-version` pnpm script (#20319) @cherniavskii
|
|
182
|
+
|
|
8
183
|
## 8.18.0
|
|
9
184
|
|
|
10
185
|
<!-- generated comparing v8.17.0..master -->
|
|
@@ -8,11 +8,15 @@ exports.ChartsGridHorizontal = ChartsGridHorizontal;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _useTicks = require("../hooks/useTicks");
|
|
10
10
|
var _styledComponents = require("./styledComponents");
|
|
11
|
+
var _ChartProvider = require("../context/ChartProvider");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
/**
|
|
13
14
|
* @ignore - internal component.
|
|
14
15
|
*/
|
|
15
16
|
function ChartsGridHorizontal(props) {
|
|
17
|
+
const {
|
|
18
|
+
instance
|
|
19
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
16
20
|
const {
|
|
17
21
|
axis,
|
|
18
22
|
start,
|
|
@@ -34,7 +38,7 @@ function ChartsGridHorizontal(props) {
|
|
|
34
38
|
children: yTicks.map(({
|
|
35
39
|
value,
|
|
36
40
|
offset
|
|
37
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.GridLine, {
|
|
41
|
+
}) => !instance.isYInside(offset) ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.GridLine, {
|
|
38
42
|
y1: offset,
|
|
39
43
|
y2: offset,
|
|
40
44
|
x1: start,
|
|
@@ -8,11 +8,15 @@ exports.ChartsGridVertical = ChartsGridVertical;
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _useTicks = require("../hooks/useTicks");
|
|
10
10
|
var _styledComponents = require("./styledComponents");
|
|
11
|
+
var _ChartProvider = require("../context/ChartProvider");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
/**
|
|
13
14
|
* @ignore - internal component.
|
|
14
15
|
*/
|
|
15
16
|
function ChartsGridVertical(props) {
|
|
17
|
+
const {
|
|
18
|
+
instance
|
|
19
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
16
20
|
const {
|
|
17
21
|
axis,
|
|
18
22
|
start,
|
|
@@ -34,7 +38,7 @@ function ChartsGridVertical(props) {
|
|
|
34
38
|
children: xTicks.map(({
|
|
35
39
|
value,
|
|
36
40
|
offset
|
|
37
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.GridLine, {
|
|
41
|
+
}) => !instance.isXInside(offset) ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledComponents.GridLine, {
|
|
38
42
|
y1: start,
|
|
39
43
|
y2: end,
|
|
40
44
|
x1: offset,
|
|
@@ -21,6 +21,7 @@ var _useStore = require("../internals/store/useStore");
|
|
|
21
21
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
22
22
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
23
23
|
var _chartsSurfaceClasses = require("./chartsSurfaceClasses");
|
|
24
|
+
var _useChartCartesianAxisRendering = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["children", "className", "title", "desc"];
|
|
26
27
|
const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
@@ -40,7 +41,7 @@ const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
|
40
41
|
overflow: 'hidden',
|
|
41
42
|
// This prevents default touch actions when using the svg on mobile devices.
|
|
42
43
|
// For example, prevent page scroll & zoom.
|
|
43
|
-
touchAction: 'pan-y',
|
|
44
|
+
touchAction: ownerState.hasZoom ? 'pan-y' : undefined,
|
|
44
45
|
userSelect: 'none',
|
|
45
46
|
gridArea: 'chart',
|
|
46
47
|
'&:focus': {
|
|
@@ -81,6 +82,7 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
|
|
|
81
82
|
const propsHeight = (0, _useSelector.useSelector)(store, _useChartDimensions.selectorChartPropsHeight);
|
|
82
83
|
const isKeyboardNavigationEnabled = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsIsKeyboardNavigationEnabled);
|
|
83
84
|
const hasFocusedItem = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsHasFocusedItem);
|
|
85
|
+
const hasZoom = (0, _useSelector.useSelector)(store, _useChartCartesianAxisRendering.selectorChartHasZoom);
|
|
84
86
|
const svgRef = (0, _useSvgRef.useSvgRef)();
|
|
85
87
|
const handleRef = (0, _useForkRef.default)(svgRef, ref);
|
|
86
88
|
const themeProps = (0, _styles.useThemeProps)({
|
|
@@ -99,7 +101,8 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
|
|
|
99
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ChartsSurfaceStyles, (0, _extends2.default)({
|
|
100
102
|
ownerState: {
|
|
101
103
|
width: propsWidth,
|
|
102
|
-
height: propsHeight
|
|
104
|
+
height: propsHeight,
|
|
105
|
+
hasZoom
|
|
103
106
|
},
|
|
104
107
|
viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
|
|
105
108
|
className: (0, _clsx.default)(classes.root, className),
|
|
@@ -92,7 +92,7 @@ function ChartsTooltipContainer(inProps) {
|
|
|
92
92
|
const isOpen = (0, _useSelector.useSelector)(store, getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
|
|
93
93
|
const lastInteraction = (0, _useSelector.useSelector)(store, _useChartInteraction.selectorChartsLastInteraction);
|
|
94
94
|
const computedAnchor = lastInteraction === 'keyboard' ? 'node' : anchor;
|
|
95
|
-
const itemPosition = (0, _useSelector.useSelector)(store, trigger === 'item' && computedAnchor === 'node' ? _useChartInteraction.selectorChartsTooltipItemPosition : () => null,
|
|
95
|
+
const itemPosition = (0, _useSelector.useSelector)(store, trigger === 'item' && computedAnchor === 'node' ? _useChartInteraction.selectorChartsTooltipItemPosition : () => null, position);
|
|
96
96
|
React.useEffect(() => {
|
|
97
97
|
const svgElement = svgRef.current;
|
|
98
98
|
if (svgElement === null) {
|
|
@@ -10,7 +10,6 @@ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
11
11
|
var _stackSeries = require("../../internals/stackSeries");
|
|
12
12
|
var _defaultizeValueFormatter = require("../../internals/defaultizeValueFormatter");
|
|
13
|
-
// For now it's a copy past of bar charts formatter, but maybe will diverge later
|
|
14
13
|
const seriesProcessor = (params, dataset) => {
|
|
15
14
|
const {
|
|
16
15
|
seriesOrder,
|
|
@@ -39,6 +38,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
39
38
|
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
40
39
|
throw new Error([`MUI X Charts: line series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
41
40
|
}
|
|
41
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
42
|
+
if (!data && dataset) {
|
|
43
|
+
const dataKey = series[id].dataKey;
|
|
44
|
+
if (!dataKey) {
|
|
45
|
+
throw new Error([`MUI X Charts: line series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
46
|
+
}
|
|
47
|
+
dataset.forEach((entry, index) => {
|
|
48
|
+
const value = entry[dataKey];
|
|
49
|
+
if (value != null && typeof value !== 'number') {
|
|
50
|
+
(0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Line plots only support numeric and null values.'].join('\n'));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
42
55
|
});
|
|
43
56
|
const completedSeries = {};
|
|
44
57
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -61,15 +74,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
61
74
|
}, series[id], {
|
|
62
75
|
data: dataKey ? dataset.map(data => {
|
|
63
76
|
const value = data[dataKey];
|
|
64
|
-
|
|
65
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
-
if (value !== null) {
|
|
67
|
-
(0, _warning.warnOnce)([`MUI X Charts: Your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return value;
|
|
77
|
+
return typeof value === 'number' ? value : null;
|
|
73
78
|
}) : series[id].data,
|
|
74
79
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
75
80
|
});
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -47,9 +47,11 @@ function PieArcPlot(props) {
|
|
|
47
47
|
data
|
|
48
48
|
});
|
|
49
49
|
const {
|
|
50
|
-
dataIndex
|
|
50
|
+
dataIndex,
|
|
51
|
+
seriesId,
|
|
52
|
+
seriesType
|
|
51
53
|
} = (0, _useFocusedItem.useFocusedItem)() ?? {};
|
|
52
|
-
const focusedItem =
|
|
54
|
+
const focusedItem = dataIndex !== undefined && seriesId === id && seriesType === 'pie' ? transformedData[dataIndex] : null;
|
|
53
55
|
if (data.length === 0) {
|
|
54
56
|
return null;
|
|
55
57
|
}
|
|
@@ -90,7 +92,7 @@ function PieArcPlot(props) {
|
|
|
90
92
|
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
91
93
|
id: id,
|
|
92
94
|
className: _PieArc.pieArcClasses.focusIndicator,
|
|
93
|
-
dataIndex:
|
|
95
|
+
dataIndex: focusedItem.dataIndex,
|
|
94
96
|
isFaded: false,
|
|
95
97
|
isHighlighted: false,
|
|
96
98
|
isFocused: false,
|
|
@@ -16,7 +16,7 @@ var _useRadarSeriesData = require("./useRadarSeriesData");
|
|
|
16
16
|
var _getAreaPath = require("./getAreaPath");
|
|
17
17
|
var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
|
|
18
18
|
var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
|
|
19
|
-
var
|
|
19
|
+
var _useInteractionAllItemProps = require("./useInteractionAllItemProps");
|
|
20
20
|
var _useRadarRotationIndex = require("./useRadarRotationIndex");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
22
|
const _excluded = ["seriesId", "onItemClick"];
|
|
@@ -54,7 +54,7 @@ function RadarSeriesArea(props) {
|
|
|
54
54
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
55
55
|
const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(seriesId);
|
|
56
56
|
const getRotationIndex = (0, _useRadarRotationIndex.useRadarRotationIndex)();
|
|
57
|
-
const interactionProps = (0,
|
|
57
|
+
const interactionProps = (0, _useInteractionAllItemProps.useInteractionAllItemProps)(seriesCoordinates);
|
|
58
58
|
const {
|
|
59
59
|
isFaded,
|
|
60
60
|
isHighlighted
|
|
@@ -8,7 +8,7 @@ exports.RadarSeriesPlot = RadarSeriesPlot;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _useRadarSeriesData = require("./useRadarSeriesData");
|
|
11
|
-
var
|
|
11
|
+
var _useInteractionAllItemProps = require("./useInteractionAllItemProps");
|
|
12
12
|
var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
|
|
13
13
|
var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
|
|
14
14
|
var _RadarSeriesArea = require("./RadarSeriesArea");
|
|
@@ -24,7 +24,7 @@ function RadarSeriesPlot(props) {
|
|
|
24
24
|
} = props;
|
|
25
25
|
const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(inSeriesId);
|
|
26
26
|
const getRotationIndex = (0, _useRadarRotationIndex.useRadarRotationIndex)();
|
|
27
|
-
const interactionProps = (0,
|
|
27
|
+
const interactionProps = (0, _useInteractionAllItemProps.useInteractionAllItemProps)(seriesCoordinates);
|
|
28
28
|
const {
|
|
29
29
|
isFaded,
|
|
30
30
|
isHighlighted
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SeriesItemIdentifierWithData } from "../../models/seriesType/index.js";
|
|
3
|
+
export declare const useInteractionAllItemProps: (data: SeriesItemIdentifierWithData<"radar">[], skip?: boolean) => {
|
|
4
|
+
onPointerEnter?: () => void;
|
|
5
|
+
onPointerLeave?: () => void;
|
|
6
|
+
onPointerDown?: (event: React.PointerEvent) => void;
|
|
7
|
+
}[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useInteractionAllItemProps = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _useChartContext = require("../../context/ChartProvider/useChartContext");
|
|
10
|
+
var _useInteractionItemProps = require("../../hooks/useInteractionItemProps");
|
|
11
|
+
const useInteractionAllItemProps = (data, skip) => {
|
|
12
|
+
const {
|
|
13
|
+
instance
|
|
14
|
+
} = (0, _useChartContext.useChartContext)();
|
|
15
|
+
const results = React.useMemo(() => {
|
|
16
|
+
return data.map(item => {
|
|
17
|
+
return skip ? {} : (0, _useInteractionItemProps.getInteractionItemProps)(instance, {
|
|
18
|
+
type: 'radar',
|
|
19
|
+
seriesId: item.seriesId,
|
|
20
|
+
dataIndex: item.dataIndex
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}, [data, instance, skip]);
|
|
24
|
+
return results;
|
|
25
|
+
};
|
|
26
|
+
exports.useInteractionAllItemProps = useInteractionAllItemProps;
|
|
@@ -27,6 +27,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
27
27
|
} else if (dataset === undefined) {
|
|
28
28
|
throw new Error([`MUI X Charts: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
29
29
|
}
|
|
30
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
31
|
+
if (!data && dataset) {
|
|
32
|
+
const dataKey = series[id].dataKey;
|
|
33
|
+
if (!dataKey) {
|
|
34
|
+
throw new Error([`MUI X Charts: bar series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
35
|
+
}
|
|
36
|
+
dataset.forEach((entry, index) => {
|
|
37
|
+
const value = entry[dataKey];
|
|
38
|
+
if (value != null && typeof value !== 'number') {
|
|
39
|
+
warnOnce([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Bar plots only support numeric and null values.'].join('\n'));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
30
44
|
});
|
|
31
45
|
const completedSeries = {};
|
|
32
46
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -52,15 +66,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
52
66
|
}, series[id], {
|
|
53
67
|
data: dataKey ? dataset.map(data => {
|
|
54
68
|
const value = data[dataKey];
|
|
55
|
-
|
|
56
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
57
|
-
if (value !== null) {
|
|
58
|
-
warnOnce([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
return value;
|
|
69
|
+
return typeof value === 'number' ? value : null;
|
|
64
70
|
}) : series[id].data,
|
|
65
71
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
66
72
|
});
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTicks } from "../hooks/useTicks.js";
|
|
3
3
|
import { GridLine } from "./styledComponents.js";
|
|
4
|
+
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
/**
|
|
6
7
|
* @ignore - internal component.
|
|
7
8
|
*/
|
|
8
9
|
export function ChartsGridHorizontal(props) {
|
|
10
|
+
const {
|
|
11
|
+
instance
|
|
12
|
+
} = useChartContext();
|
|
9
13
|
const {
|
|
10
14
|
axis,
|
|
11
15
|
start,
|
|
@@ -27,7 +31,7 @@ export function ChartsGridHorizontal(props) {
|
|
|
27
31
|
children: yTicks.map(({
|
|
28
32
|
value,
|
|
29
33
|
offset
|
|
30
|
-
}) => /*#__PURE__*/_jsx(GridLine, {
|
|
34
|
+
}) => !instance.isYInside(offset) ? null : /*#__PURE__*/_jsx(GridLine, {
|
|
31
35
|
y1: offset,
|
|
32
36
|
y2: offset,
|
|
33
37
|
x1: start,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTicks } from "../hooks/useTicks.js";
|
|
3
3
|
import { GridLine } from "./styledComponents.js";
|
|
4
|
+
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
/**
|
|
6
7
|
* @ignore - internal component.
|
|
7
8
|
*/
|
|
8
9
|
export function ChartsGridVertical(props) {
|
|
10
|
+
const {
|
|
11
|
+
instance
|
|
12
|
+
} = useChartContext();
|
|
9
13
|
const {
|
|
10
14
|
axis,
|
|
11
15
|
start,
|
|
@@ -27,7 +31,7 @@ export function ChartsGridVertical(props) {
|
|
|
27
31
|
children: xTicks.map(({
|
|
28
32
|
value,
|
|
29
33
|
offset
|
|
30
|
-
}) => /*#__PURE__*/_jsx(GridLine, {
|
|
34
|
+
}) => !instance.isXInside(offset) ? null : /*#__PURE__*/_jsx(GridLine, {
|
|
31
35
|
y1: start,
|
|
32
36
|
y2: end,
|
|
33
37
|
x1: offset,
|
|
@@ -15,6 +15,7 @@ import { useStore } from "../internals/store/useStore.js";
|
|
|
15
15
|
import { selectorChartPropsHeight, selectorChartPropsWidth, selectorChartSvgWidth, selectorChartSvgHeight } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js";
|
|
16
16
|
import { selectorChartsHasFocusedItem, selectorChartsIsKeyboardNavigationEnabled } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
17
17
|
import { useUtilityClasses } from "./chartsSurfaceClasses.js";
|
|
18
|
+
import { selectorChartHasZoom } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const ChartsSurfaceStyles = styled('svg', {
|
|
20
21
|
name: 'MuiChartsSurface',
|
|
@@ -33,7 +34,7 @@ const ChartsSurfaceStyles = styled('svg', {
|
|
|
33
34
|
overflow: 'hidden',
|
|
34
35
|
// This prevents default touch actions when using the svg on mobile devices.
|
|
35
36
|
// For example, prevent page scroll & zoom.
|
|
36
|
-
touchAction: 'pan-y',
|
|
37
|
+
touchAction: ownerState.hasZoom ? 'pan-y' : undefined,
|
|
37
38
|
userSelect: 'none',
|
|
38
39
|
gridArea: 'chart',
|
|
39
40
|
'&:focus': {
|
|
@@ -74,6 +75,7 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
74
75
|
const propsHeight = useSelector(store, selectorChartPropsHeight);
|
|
75
76
|
const isKeyboardNavigationEnabled = useSelector(store, selectorChartsIsKeyboardNavigationEnabled);
|
|
76
77
|
const hasFocusedItem = useSelector(store, selectorChartsHasFocusedItem);
|
|
78
|
+
const hasZoom = useSelector(store, selectorChartHasZoom);
|
|
77
79
|
const svgRef = useSvgRef();
|
|
78
80
|
const handleRef = useForkRef(svgRef, ref);
|
|
79
81
|
const themeProps = useThemeProps({
|
|
@@ -92,7 +94,8 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
92
94
|
return /*#__PURE__*/_jsxs(ChartsSurfaceStyles, _extends({
|
|
93
95
|
ownerState: {
|
|
94
96
|
width: propsWidth,
|
|
95
|
-
height: propsHeight
|
|
97
|
+
height: propsHeight,
|
|
98
|
+
hasZoom
|
|
96
99
|
},
|
|
97
100
|
viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
|
|
98
101
|
className: clsx(classes.root, className),
|
|
@@ -85,7 +85,7 @@ function ChartsTooltipContainer(inProps) {
|
|
|
85
85
|
const isOpen = useSelector(store, getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
|
|
86
86
|
const lastInteraction = useSelector(store, selectorChartsLastInteraction);
|
|
87
87
|
const computedAnchor = lastInteraction === 'keyboard' ? 'node' : anchor;
|
|
88
|
-
const itemPosition = useSelector(store, trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : () => null,
|
|
88
|
+
const itemPosition = useSelector(store, trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : () => null, position);
|
|
89
89
|
React.useEffect(() => {
|
|
90
90
|
const svgElement = svgRef.current;
|
|
91
91
|
if (svgElement === null) {
|
|
@@ -3,7 +3,6 @@ import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
|
3
3
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
4
|
import { getStackingGroups } from "../../internals/stackSeries.js";
|
|
5
5
|
import { defaultizeValueFormatter } from "../../internals/defaultizeValueFormatter.js";
|
|
6
|
-
// For now it's a copy past of bar charts formatter, but maybe will diverge later
|
|
7
6
|
const seriesProcessor = (params, dataset) => {
|
|
8
7
|
const {
|
|
9
8
|
seriesOrder,
|
|
@@ -32,6 +31,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
32
31
|
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
33
32
|
throw new Error([`MUI X Charts: line series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
34
33
|
}
|
|
34
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
35
|
+
if (!data && dataset) {
|
|
36
|
+
const dataKey = series[id].dataKey;
|
|
37
|
+
if (!dataKey) {
|
|
38
|
+
throw new Error([`MUI X Charts: line series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
39
|
+
}
|
|
40
|
+
dataset.forEach((entry, index) => {
|
|
41
|
+
const value = entry[dataKey];
|
|
42
|
+
if (value != null && typeof value !== 'number') {
|
|
43
|
+
warnOnce([`MUI X Charts: your dataset key "${dataKey}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Line plots only support numeric and null values.'].join('\n'));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
35
48
|
});
|
|
36
49
|
const completedSeries = {};
|
|
37
50
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -54,15 +67,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
54
67
|
}, series[id], {
|
|
55
68
|
data: dataKey ? dataset.map(data => {
|
|
56
69
|
const value = data[dataKey];
|
|
57
|
-
|
|
58
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
59
|
-
if (value !== null) {
|
|
60
|
-
warnOnce([`MUI X Charts: Your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return value;
|
|
70
|
+
return typeof value === 'number' ? value : null;
|
|
66
71
|
}) : series[id].data,
|
|
67
72
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
68
73
|
});
|