@mui/x-charts 8.9.2 → 8.10.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.
Files changed (68) hide show
  1. package/BarChart/BarChart.js +16 -0
  2. package/CHANGELOG.md +121 -6
  3. package/ChartContainer/ChartContainer.js +24 -0
  4. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +1 -3
  5. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +1 -3
  6. package/ChartsTooltip/ChartsTooltip.d.ts +2 -1
  7. package/ChartsTooltip/ChartsTooltip.js +3 -3
  8. package/ChartsTooltip/ChartsTooltipContainer.d.ts +5 -5
  9. package/ChartsTooltip/ChartsTooltipContainer.js +3 -3
  10. package/ChartsXAxis/ChartsGroupedXAxis.d.ts +7 -0
  11. package/ChartsXAxis/ChartsGroupedXAxis.js +142 -0
  12. package/ChartsXAxis/ChartsSingleXAxis.d.ts +7 -0
  13. package/ChartsXAxis/ChartsSingleXAxis.js +144 -0
  14. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  15. package/ChartsXAxis/ChartsXAxis.js +8 -210
  16. package/ChartsXAxis/getVisibleLabels.d.ts +2 -2
  17. package/ChartsXAxis/useAxisProps.d.ts +4526 -0
  18. package/ChartsXAxis/useAxisProps.js +105 -0
  19. package/ChartsXAxis/utilities.d.ts +11 -0
  20. package/ChartsXAxis/utilities.js +43 -0
  21. package/LineChart/LineChart.js +16 -0
  22. package/RadarChart/index.d.ts +9 -2
  23. package/RadarChart/index.js +13 -14
  24. package/ScatterChart/ScatterChart.d.ts +8 -1
  25. package/ScatterChart/ScatterChart.js +16 -0
  26. package/SparkLineChart/SparkLineChart.js +16 -0
  27. package/esm/BarChart/BarChart.js +16 -0
  28. package/esm/ChartContainer/ChartContainer.js +24 -0
  29. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +1 -3
  30. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +1 -3
  31. package/esm/ChartsTooltip/ChartsTooltip.d.ts +2 -1
  32. package/esm/ChartsTooltip/ChartsTooltip.js +3 -3
  33. package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +5 -5
  34. package/esm/ChartsTooltip/ChartsTooltipContainer.js +3 -3
  35. package/esm/ChartsXAxis/ChartsGroupedXAxis.d.ts +7 -0
  36. package/esm/ChartsXAxis/ChartsGroupedXAxis.js +136 -0
  37. package/esm/ChartsXAxis/ChartsSingleXAxis.d.ts +7 -0
  38. package/esm/ChartsXAxis/ChartsSingleXAxis.js +140 -0
  39. package/esm/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  40. package/esm/ChartsXAxis/ChartsXAxis.js +7 -207
  41. package/esm/ChartsXAxis/getVisibleLabels.d.ts +2 -2
  42. package/esm/ChartsXAxis/useAxisProps.d.ts +4526 -0
  43. package/esm/ChartsXAxis/useAxisProps.js +98 -0
  44. package/esm/ChartsXAxis/utilities.d.ts +11 -0
  45. package/esm/ChartsXAxis/utilities.js +35 -0
  46. package/esm/LineChart/LineChart.js +16 -0
  47. package/esm/RadarChart/index.d.ts +9 -2
  48. package/esm/RadarChart/index.js +12 -2
  49. package/esm/ScatterChart/ScatterChart.d.ts +8 -1
  50. package/esm/ScatterChart/ScatterChart.js +16 -0
  51. package/esm/SparkLineChart/SparkLineChart.js +16 -0
  52. package/esm/hooks/useTicksGrouped.d.ts +28 -0
  53. package/esm/hooks/useTicksGrouped.js +98 -0
  54. package/esm/index.js +1 -1
  55. package/esm/internals/getScale.d.ts +1 -1
  56. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -1
  57. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +32 -23
  58. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts +1 -1
  59. package/esm/models/axis.d.ts +61 -0
  60. package/hooks/useTicksGrouped.d.ts +28 -0
  61. package/hooks/useTicksGrouped.js +104 -0
  62. package/index.js +1 -1
  63. package/internals/getScale.d.ts +1 -1
  64. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -1
  65. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +34 -23
  66. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts +1 -1
  67. package/models/axis.d.ts +61 -0
  68. package/package.json +3 -4
@@ -271,6 +271,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
271
271
  disableTicks: _propTypes.default.bool,
272
272
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
273
273
  fill: _propTypes.default.string,
274
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
275
+ getValue: _propTypes.default.func.isRequired,
276
+ tickSize: _propTypes.default.number
277
+ })),
274
278
  height: _propTypes.default.number,
275
279
  hideTooltip: _propTypes.default.bool,
276
280
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
@@ -322,6 +326,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
322
326
  disableTicks: _propTypes.default.bool,
323
327
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
324
328
  fill: _propTypes.default.string,
329
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
330
+ getValue: _propTypes.default.func.isRequired,
331
+ tickSize: _propTypes.default.number
332
+ })),
325
333
  height: _propTypes.default.number,
326
334
  hideTooltip: _propTypes.default.bool,
327
335
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
@@ -704,6 +712,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
704
712
  disableTicks: _propTypes.default.bool,
705
713
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
706
714
  fill: _propTypes.default.string,
715
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
716
+ getValue: _propTypes.default.func.isRequired,
717
+ tickSize: _propTypes.default.number
718
+ })),
707
719
  hideTooltip: _propTypes.default.bool,
708
720
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
709
721
  ignoreTooltip: _propTypes.default.bool,
@@ -754,6 +766,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
754
766
  disableTicks: _propTypes.default.bool,
755
767
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
756
768
  fill: _propTypes.default.string,
769
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
770
+ getValue: _propTypes.default.func.isRequired,
771
+ tickSize: _propTypes.default.number
772
+ })),
757
773
  hideTooltip: _propTypes.default.bool,
758
774
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
759
775
  ignoreTooltip: _propTypes.default.bool,
package/CHANGELOG.md CHANGED
@@ -5,6 +5,121 @@
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.10.0
9
+
10
+ _Aug 8, 2025_
11
+
12
+ We'd like to extend a big thank you to the 17 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 📊 [`FunnelChart`](https://mui.com/x/react-charts/funnel/) marked as stable
15
+ - 📈 [Zoom slider](https://mui.com/x/react-charts/zoom-and-pan/#zoom-slider) and [Preview](https://mui.com/x/react-charts/zoom-and-pan/#preview) marked as stable
16
+ - 📈 Supporting [label groups](https://mui.com/x/react-charts/axis/#grouped-axes) in band and point axis
17
+ - 🌎 Improve Norwegian Nynorsk (nn-NO) locale on the Data Grid
18
+ - 🐞 Bugfixes
19
+ - 📚 Documentation improvements
20
+
21
+ Special thanks go out to the community members for their valuable contributions:
22
+ @AnderzL7, @aqeelat, @dwrth, @noobyogi0010, @nusr, @sai6855
23
+
24
+ The following are all team members who have contributed to this release:
25
+ @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mapache-salvaje, @MBilalShafi, @oliviertassinari, @rita-codes, @romgrk
26
+
27
+ ### Data Grid
28
+
29
+ #### `@mui/x-data-grid@8.10.0`
30
+
31
+ - [DataGrid] Move spread operator in `BaseSelect` to allow `variant` change (#19026) @dwrth
32
+ - [DataGrid] Use `use-sync-external-store` shim (#19063) @romgrk
33
+ - [DataGrid] Allow skipping cache in `dataSource.fetchRows()` API method (#18904) @MBilalShafi
34
+ - [DataGrid] Do not call `preProcessEditCellProps()` if cell is not editable based on `isCellEditable()` (#18405) @nusr
35
+ - [DataGrid] Fix `renderCountry` throwing an error when used in tree data (#19068) @cherniavskii
36
+ - [DataGrid] Fix performance issue for root level "select all" (#19015) @MBilalShafi
37
+ - [DataGrid] Fix pagination `slotProps` being ignored by the grid (#19095) @romgrk
38
+ - [l10n] Improve Norwegian Nynorsk (nn-NO) locale (#19076) @AnderzL7
39
+
40
+ #### `@mui/x-data-grid-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-data-grid@8.10.0`, plus:
43
+
44
+ - [DataGridPro] Fix row reorder not working with column reorder disabled (#19016) @MBilalShafi
45
+ - [DataGridPro] Fix header filters cache sharing issue (#19090) @MBilalShafi
46
+
47
+ #### `@mui/x-data-grid-premium@8.10.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
48
+
49
+ Same changes as in `@mui/x-data-grid-pro@8.10.0`, plus:
50
+
51
+ - [DataGridPremium] Allow additional derived columns customization via `valueFormatter` (#18982) @arminmeh
52
+ - [DataGridPremium] Fix complex `singleSelect` columns not working in pivot model (#18971) @cherniavskii
53
+
54
+ ### Date and Time Pickers
55
+
56
+ #### `@mui/x-date-pickers@8.10.0`
57
+
58
+ - [pickers] `MuiPickersLayout-toolbar` is overlapping the Calendar in RTL `MobileDatePicker` variant (#18981) @rita-codes
59
+
60
+ #### `@mui/x-date-pickers-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
61
+
62
+ Same changes as in `@mui/x-date-pickers@8.10.0`.
63
+
64
+ ### Charts
65
+
66
+ #### `@mui/x-charts@8.10.0`
67
+
68
+ - [charts] Add `groups` to `band` and `point` axis config (#18766) @JCQuintas
69
+ - [charts] Animation example using `motion` library (#18993) @JCQuintas
70
+ - [charts] Deprecate `Unstable_` radar exports (#19079) @JCQuintas
71
+ - [charts] Improve grouped axis logic (#19069) @JCQuintas
72
+ - [charts] Fix type assertion in axis highlight components (#19060) @sai6855
73
+ - [charts] Remove unnecessary type assertion in tooltip `valueFormatter` in heatmap (#19047) @sai6855
74
+
75
+ #### `@mui/x-charts-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
76
+
77
+ Same changes as in `@mui/x-charts@8.10.0`, plus:
78
+
79
+ - [charts-pro] Fix `slotProps.tooltip.trigger` not respected in `ScatterChartPro` and `FunnelChart` (#18902) @bernardobelchior
80
+ - [charts-pro] Fix zoom filtering adjusting axis too soon (#18992) @bernardobelchior
81
+ - [charts-pro] Mark `FunnelChart` as stable (#19048) @JCQuintas
82
+ - [charts-pro] Mark zoom slider and preview as stable (#19049) @JCQuintas
83
+ - [charts-pro] Refactor `createAxisFilterMapper` (#18998) @bernardobelchior
84
+
85
+ ### Tree View
86
+
87
+ #### `@mui/x-tree-view@8.10.0`
88
+
89
+ Internal changes.
90
+
91
+ #### `@mui/x-tree-view-pro@8.10.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
92
+
93
+ Same changes as in `@mui/x-tree-view@8.10.0`.
94
+
95
+ ### Codemod
96
+
97
+ #### `@mui/x-codemod@8.10.0`
98
+
99
+ Internal changes.
100
+
101
+ ### Docs
102
+
103
+ - [docs] Add CSS bundler breaking change to migration guide (#17436) @romgrk
104
+ - [docs] `RichTreeViewPro` demo for dragging via custom drag-handle is not working properly (#19008) @rita-codes
105
+ - [docs] Fix broken link to D3 in Charts (#19020) @oliviertassinari
106
+ - [docs] Revise the Charts Animation doc (#18990) @mapache-salvaje
107
+ - [docs] Fix incorrect code in line chart preview (#19023) @noobyogi0010
108
+ - [docs] Improve bundling instructions for the Data Grid (#19065) @romgrk
109
+ - [docs] Reduce image size in the inventory grid demo (#19004) @arminmeh
110
+
111
+ ### Core
112
+
113
+ - [core] Fix ESLint reference name @oliviertassinari
114
+
115
+ ### Miscellaneous
116
+
117
+ - [infra] Remove bundle size tracking for subpaths (#19072) @Janpot
118
+ - [infra] Accept `PORT` env on `docs:dev` script (#19014) @JCQuintas
119
+ - [infra] Skip codesandbox iframe demos in regressions tests (#18970) @cherniavskii
120
+ - [infra] Remove package.json `module` field (#18961) @Janpot
121
+ - [internal] Remove peer dependency on `@mui/system` (#19062) @aqeelat
122
+
8
123
  ## 8.9.2
9
124
 
10
125
  _Jul 31, 2025_
@@ -418,8 +533,8 @@ Same changes as in `@mui/x-tree-view@8.7.0`, plus:
418
533
 
419
534
  - [code-infra] Bump code-infra version and fix breaking changes (#18653) @brijeshb42
420
535
  - [code-infra] Ensure `material-ui/disallow-react-api-in-server-components` ESLint rule is applied (#18570) @LukasTy
421
- - [code-infra] Migrate to flat eslint config (#18562) @brijeshb42
422
- - [code-infra] Refactor eslint config (#18643) @LukasTy
536
+ - [code-infra] Migrate to flat ESLint config (#18562) @brijeshb42
537
+ - [code-infra] Refactor ESLint config (#18643) @LukasTy
423
538
  - [infra] Add renovatebot rule for latest infra packages (#18609) @Janpot
424
539
  - [infra] Move pushArgos script to code-infra (#18667) @Janpot
425
540
  - [infra] Updates release script to fetch latest major version from upstream (#18552) @michelengelen
@@ -1333,7 +1448,7 @@ Same changes as in `@mui/x-tree-view@8.2.0`.
1333
1448
  - [core] Fix all Vale errors @oliviertassinari
1334
1449
  - [core] Move `loadStyleSheets` to internals and use it in data grid and charts (#17548) @bernardobelchior
1335
1450
  - [core] Remove empty version (#17582) @oliviertassinari
1336
- - [core] Remove eslint from codemod spec files (#17443) @alexfauquette
1451
+ - [core] Remove ESLint from codemod spec files (#17443) @alexfauquette
1337
1452
  - [core] Remove unnecessary versions (#17597) @oliviertassinari
1338
1453
  - [code-infra] Allow postinstall scripts for packages requesting it (#17635) @LukasTy
1339
1454
  - [code-infra] Data Grid `vitest` changes (#17619) @JCQuintas
@@ -6827,7 +6942,7 @@ Same changes as in `@mui/x-date-pickers@7.8.0`.
6827
6942
 
6828
6943
  ### Core
6829
6944
 
6830
- - [core] Add eslint rule to restrict import from `../internals` root (#13633) @JCQuintas
6945
+ - [core] Add ESLint rule to restrict import from `../internals` root (#13633) @JCQuintas
6831
6946
  - [docs-infra] Sync `\_app` folder with monorepo (#13582) @Janpot
6832
6947
  - [license] Allow usage of Charts and Tree View Pro package for old premium licenses (#13619) @flaviendelangle
6833
6948
 
@@ -6965,7 +7080,7 @@ Same changes as in `@mui/x-date-pickers@7.7.0`.
6965
7080
 
6966
7081
  - [charts] Add watermark on the pro `ResponsiveChartContainer` (#13398) @alexfauquette
6967
7082
  - [charts] Allow to specify y-axis configuration (#13438) @alexfauquette
6968
- - [charts] Fix eslint for react compiler (#13444) @alexfauquette
7083
+ - [charts] Fix ESLint for react compiler (#13444) @alexfauquette
6969
7084
  - [charts] Improve themeAugmentation typing (#13433) @noraleonte
6970
7085
  - [charts] Move the `ZAxisContextProvider` by default in the `ChartContainer` (#13465) @alexfauquette
6971
7086
  - [charts] Use plugins to define series extremum and colors (#13397) @alexfauquette
@@ -7512,7 +7627,7 @@ Same changes as in `@mui/x-date-pickers@7.3.1`.
7512
7627
  - [core] Use `describeTreeView` for focus tests (#12698) @flaviendelangle
7513
7628
  - [core] Use `describeTreeView` for type-ahead tests (#12811) @flaviendelangle
7514
7629
  - [code-infra] Change package manager to `pnpm` (#11875) @LukasTy
7515
- - [code-infra] Closer sync with eslint config of codebase (#12864) @oliviertassinari
7630
+ - [code-infra] Closer sync with ESLint config of codebase (#12864) @oliviertassinari
7516
7631
  - [support-infra] Add release announcement to GitHub workflows (#11867) (#12843) @michelengelen
7517
7632
 
7518
7633
  ## 7.3.0
@@ -241,6 +241,10 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
241
241
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
242
242
  endAngle: _propTypes.default.number,
243
243
  fill: _propTypes.default.string,
244
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
245
+ getValue: _propTypes.default.func.isRequired,
246
+ tickSize: _propTypes.default.number
247
+ })),
244
248
  height: _propTypes.default.number,
245
249
  hideTooltip: _propTypes.default.bool,
246
250
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
@@ -293,6 +297,10 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
293
297
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
294
298
  endAngle: _propTypes.default.number,
295
299
  fill: _propTypes.default.string,
300
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
301
+ getValue: _propTypes.default.func.isRequired,
302
+ tickSize: _propTypes.default.number
303
+ })),
296
304
  height: _propTypes.default.number,
297
305
  hideTooltip: _propTypes.default.bool,
298
306
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
@@ -714,6 +722,10 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
714
722
  disableTicks: _propTypes.default.bool,
715
723
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
716
724
  fill: _propTypes.default.string,
725
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
726
+ getValue: _propTypes.default.func.isRequired,
727
+ tickSize: _propTypes.default.number
728
+ })),
717
729
  height: _propTypes.default.number,
718
730
  hideTooltip: _propTypes.default.bool,
719
731
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
@@ -765,6 +777,10 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
765
777
  disableTicks: _propTypes.default.bool,
766
778
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
767
779
  fill: _propTypes.default.string,
780
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
781
+ getValue: _propTypes.default.func.isRequired,
782
+ tickSize: _propTypes.default.number
783
+ })),
768
784
  height: _propTypes.default.number,
769
785
  hideTooltip: _propTypes.default.bool,
770
786
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
@@ -1147,6 +1163,10 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
1147
1163
  disableTicks: _propTypes.default.bool,
1148
1164
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
1149
1165
  fill: _propTypes.default.string,
1166
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
1167
+ getValue: _propTypes.default.func.isRequired,
1168
+ tickSize: _propTypes.default.number
1169
+ })),
1150
1170
  hideTooltip: _propTypes.default.bool,
1151
1171
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
1152
1172
  ignoreTooltip: _propTypes.default.bool,
@@ -1197,6 +1217,10 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
1197
1217
  disableTicks: _propTypes.default.bool,
1198
1218
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
1199
1219
  fill: _propTypes.default.string,
1220
+ groups: _propTypes.default.arrayOf(_propTypes.default.shape({
1221
+ getValue: _propTypes.default.func.isRequired,
1222
+ tickSize: _propTypes.default.number
1223
+ })),
1200
1224
  hideTooltip: _propTypes.default.bool,
1201
1225
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
1202
1226
  ignoreTooltip: _propTypes.default.bool,
@@ -47,9 +47,7 @@ var _jsxRuntime = require("react/jsx-runtime");
47
47
  }
48
48
  }
49
49
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
50
- children: [isBandScaleX && xScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath
51
- // @ts-expect-error, xScale value is checked in the statement above
52
- , {
50
+ children: [isBandScaleX && xScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
53
51
  d: `M ${xScale(value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
54
52
  className: classes.root,
55
53
  ownerState: {
@@ -48,9 +48,7 @@ var _jsxRuntime = require("react/jsx-runtime");
48
48
  }
49
49
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
50
50
  children: [isBandScaleY && yScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
51
- d: `M ${left} ${
52
- // @ts-expect-error, yScale value is checked in the statement above
53
- yScale(value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
51
+ d: `M ${left} ${yScale(value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
54
52
  className: classes.root,
55
53
  ownerState: {
56
54
  axisHighlight: 'band'
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { ChartsTooltipContainerProps } from "./ChartsTooltipContainer.js";
3
- export interface ChartsTooltipProps extends Omit<ChartsTooltipContainerProps, 'children'> {}
3
+ import { TriggerOptions } from "./utils.js";
4
+ export interface ChartsTooltipProps<T extends TriggerOptions = TriggerOptions> extends Omit<ChartsTooltipContainerProps<T>, 'children'> {}
4
5
  /**
5
6
  * Demos:
6
7
  *
@@ -196,9 +196,9 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
196
196
  transition: _propTypes.default.bool,
197
197
  /**
198
198
  * Select the kind of tooltip to display
199
- * - 'item': Shows data about the item below the mouse.
200
- * - 'axis': Shows values associated with the hovered x value
201
- * - 'none': Does not display tooltip
199
+ * - 'item': Shows data about the item below the mouse;
200
+ * - 'axis': Shows values associated with the hovered x value;
201
+ * - 'none': Does not display tooltip.
202
202
  * @default 'axis'
203
203
  */
204
204
  trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
@@ -2,15 +2,15 @@ import * as React from 'react';
2
2
  import { PopperProps } from '@mui/material/Popper';
3
3
  import { TriggerOptions } from "./utils.js";
4
4
  import { ChartsTooltipClasses } from "./chartsTooltipClasses.js";
5
- export interface ChartsTooltipContainerProps extends Partial<PopperProps> {
5
+ export interface ChartsTooltipContainerProps<T extends TriggerOptions = TriggerOptions> extends Partial<PopperProps> {
6
6
  /**
7
7
  * Select the kind of tooltip to display
8
- * - 'item': Shows data about the item below the mouse.
9
- * - 'axis': Shows values associated with the hovered x value
10
- * - 'none': Does not display tooltip
8
+ * - 'item': Shows data about the item below the mouse;
9
+ * - 'axis': Shows values associated with the hovered x value;
10
+ * - 'none': Does not display tooltip.
11
11
  * @default 'axis'
12
12
  */
13
- trigger?: TriggerOptions;
13
+ trigger?: T;
14
14
  /**
15
15
  * Override or extend the styles applied to the component.
16
16
  */
@@ -302,9 +302,9 @@ process.env.NODE_ENV !== "production" ? ChartsTooltipContainer.propTypes = {
302
302
  transition: _propTypes.default.bool,
303
303
  /**
304
304
  * Select the kind of tooltip to display
305
- * - 'item': Shows data about the item below the mouse.
306
- * - 'axis': Shows values associated with the hovered x value
307
- * - 'none': Does not display tooltip
305
+ * - 'item': Shows data about the item below the mouse;
306
+ * - 'axis': Shows values associated with the hovered x value;
307
+ * - 'none': Does not display tooltip.
308
308
  * @default 'axis'
309
309
  */
310
310
  trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { ChartsXAxisProps } from "../models/axis.js";
3
+ /**
4
+ * @ignore - internal component.
5
+ */
6
+ declare function ChartsGroupedXAxis(inProps: ChartsXAxisProps): React.JSX.Element | null;
7
+ export { ChartsGroupedXAxis };
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.ChartsGroupedXAxis = ChartsGroupedXAxis;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _useDrawingArea = require("../hooks/useDrawingArea");
13
+ var _isBandScale = require("../internals/isBandScale");
14
+ var _useChartContext = require("../context/ChartProvider/useChartContext");
15
+ var _utilities = require("./utilities");
16
+ var _useTicksGrouped = require("../hooks/useTicksGrouped");
17
+ var _useAxisProps = require("./useAxisProps");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ const DEFAULT_GROUPING_CONFIG = {
20
+ tickSize: 6
21
+ };
22
+ const getGroupingConfig = (groups, groupIndex, tickSize) => {
23
+ const config = groups[groupIndex] ?? {};
24
+ const defaultTickSize = tickSize ?? DEFAULT_GROUPING_CONFIG.tickSize;
25
+ const calculatedTickSize = defaultTickSize * groupIndex * 2 + defaultTickSize;
26
+ return (0, _extends2.default)({}, DEFAULT_GROUPING_CONFIG, config, {
27
+ tickSize: config.tickSize ?? calculatedTickSize
28
+ });
29
+ };
30
+
31
+ /**
32
+ * @ignore - internal component.
33
+ */
34
+ function ChartsGroupedXAxis(inProps) {
35
+ const {
36
+ xScale,
37
+ defaultizedProps,
38
+ tickNumber,
39
+ positionSign,
40
+ skipAxisRendering,
41
+ classes,
42
+ Line,
43
+ Tick,
44
+ TickLabel,
45
+ Label,
46
+ axisTickLabelProps,
47
+ axisLabelProps
48
+ } = (0, _useAxisProps.useAxisProps)(inProps);
49
+ if (!(0, _isBandScale.isBandScale)(xScale)) {
50
+ throw new Error('MUI X Charts: ChartsGroupedXAxis only supports the `band` and `point` scale types.');
51
+ }
52
+ const {
53
+ position,
54
+ disableLine,
55
+ disableTicks,
56
+ label,
57
+ tickSize,
58
+ valueFormatter,
59
+ slotProps,
60
+ tickInterval,
61
+ tickPlacement,
62
+ tickLabelPlacement,
63
+ sx,
64
+ offset,
65
+ height: axisHeight
66
+ } = defaultizedProps;
67
+ const groups = defaultizedProps.groups;
68
+ const drawingArea = (0, _useDrawingArea.useDrawingArea)();
69
+ const {
70
+ left,
71
+ top,
72
+ width,
73
+ height
74
+ } = drawingArea;
75
+ const {
76
+ instance
77
+ } = (0, _useChartContext.useChartContext)();
78
+ const labelRefPoint = {
79
+ x: left + width / 2,
80
+ y: positionSign * axisHeight
81
+ };
82
+ const xTicks = (0, _useTicksGrouped.useTicksGrouped)({
83
+ scale: xScale,
84
+ tickNumber,
85
+ valueFormatter,
86
+ tickInterval,
87
+ tickPlacement,
88
+ tickLabelPlacement,
89
+ direction: 'x',
90
+ groups
91
+ });
92
+
93
+ // Skip axis rendering if no data is available
94
+ // - The domain is an empty array for band/point scales.
95
+ // - The domains contains Infinity for continuous scales.
96
+ // - The position is set to 'none'.
97
+ if (skipAxisRendering) {
98
+ return null;
99
+ }
100
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_utilities.XAxisRoot, {
101
+ transform: `translate(0, ${position === 'bottom' ? top + height + offset : top - offset})`,
102
+ className: classes.root,
103
+ sx: sx,
104
+ children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)(Line, (0, _extends2.default)({
105
+ x1: left,
106
+ x2: left + width,
107
+ className: classes.line
108
+ }, slotProps?.axisLine)), xTicks.map((item, index) => {
109
+ const {
110
+ offset: tickOffset,
111
+ labelOffset
112
+ } = item;
113
+ const xTickLabel = labelOffset ?? 0;
114
+ const showTick = instance.isXInside(tickOffset);
115
+ const tickLabel = item.formattedValue;
116
+ const ignoreTick = item.ignoreTick ?? false;
117
+ const groupIndex = item.groupIndex ?? 0;
118
+ const groupConfig = getGroupingConfig(groups, groupIndex, tickSize);
119
+ const tickYSize = positionSign * groupConfig.tickSize;
120
+ const labelPositionY = positionSign * (groupConfig.tickSize + _utilities.TICK_LABEL_GAP);
121
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
122
+ transform: `translate(${tickOffset}, 0)`,
123
+ className: classes.tickContainer,
124
+ "data-group-index": groupIndex,
125
+ children: [!disableTicks && !ignoreTick && showTick && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
126
+ y2: tickYSize,
127
+ className: classes.tick
128
+ }, slotProps?.axisTick)), tickLabel !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
129
+ x: xTickLabel,
130
+ y: labelPositionY
131
+ }, axisTickLabelProps, {
132
+ text: tickLabel
133
+ }))]
134
+ }, index);
135
+ }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
136
+ className: classes.label,
137
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, axisLabelProps, {
138
+ text: label
139
+ }))
140
+ })]
141
+ });
142
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { ChartsXAxisProps } from "../models/axis.js";
3
+ /**
4
+ * @ignore - internal component.
5
+ */
6
+ declare function ChartsSingleXAxis(inProps: ChartsXAxisProps): React.JSX.Element | null;
7
+ export { ChartsSingleXAxis };
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.ChartsSingleXAxis = ChartsSingleXAxis;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _useIsHydrated = require("../hooks/useIsHydrated");
13
+ var _domUtils = require("../internals/domUtils");
14
+ var _useTicks = require("../hooks/useTicks");
15
+ var _useMounted = require("../hooks/useMounted");
16
+ var _useDrawingArea = require("../hooks/useDrawingArea");
17
+ var _useChartContext = require("../context/ChartProvider/useChartContext");
18
+ var _shortenLabels = require("./shortenLabels");
19
+ var _getVisibleLabels = require("./getVisibleLabels");
20
+ var _utilities = require("./utilities");
21
+ var _useAxisProps = require("./useAxisProps");
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
+ /**
24
+ * @ignore - internal component.
25
+ */function ChartsSingleXAxis(inProps) {
26
+ const {
27
+ xScale,
28
+ defaultizedProps,
29
+ tickNumber,
30
+ positionSign,
31
+ skipAxisRendering,
32
+ classes,
33
+ Line,
34
+ Tick,
35
+ TickLabel,
36
+ Label,
37
+ axisTickLabelProps,
38
+ axisLabelProps,
39
+ reverse,
40
+ isRtl
41
+ } = (0, _useAxisProps.useAxisProps)(inProps);
42
+ const isMounted = (0, _useMounted.useMounted)();
43
+ const {
44
+ position,
45
+ disableLine,
46
+ disableTicks,
47
+ label,
48
+ tickSize: tickSizeProp,
49
+ valueFormatter,
50
+ slotProps,
51
+ tickInterval,
52
+ tickLabelInterval,
53
+ tickPlacement,
54
+ tickLabelPlacement,
55
+ tickLabelMinGap,
56
+ sx,
57
+ offset,
58
+ height: axisHeight
59
+ } = defaultizedProps;
60
+ const drawingArea = (0, _useDrawingArea.useDrawingArea)();
61
+ const {
62
+ left,
63
+ top,
64
+ width,
65
+ height
66
+ } = drawingArea;
67
+ const {
68
+ instance
69
+ } = (0, _useChartContext.useChartContext)();
70
+ const isHydrated = (0, _useIsHydrated.useIsHydrated)();
71
+ const tickSize = disableTicks ? 4 : tickSizeProp;
72
+ const xTicks = (0, _useTicks.useTicks)({
73
+ scale: xScale,
74
+ tickNumber,
75
+ valueFormatter,
76
+ tickInterval,
77
+ tickPlacement,
78
+ tickLabelPlacement,
79
+ direction: 'x'
80
+ });
81
+ const visibleLabels = (0, _getVisibleLabels.getVisibleLabels)(xTicks, {
82
+ tickLabelStyle: axisTickLabelProps.style,
83
+ tickLabelInterval,
84
+ tickLabelMinGap,
85
+ reverse,
86
+ isMounted,
87
+ isXInside: instance.isXInside
88
+ });
89
+
90
+ // Skip axis rendering if no data is available
91
+ // - The domain is an empty array for band/point scales.
92
+ // - The domains contains Infinity for continuous scales.
93
+ // - The position is set to 'none'.
94
+ if (skipAxisRendering) {
95
+ return null;
96
+ }
97
+ const labelHeight = label ? (0, _domUtils.getStringSize)(label, axisLabelProps.style).height : 0;
98
+ const labelRefPoint = {
99
+ x: left + width / 2,
100
+ y: positionSign * axisHeight
101
+ };
102
+
103
+ /* If there's an axis title, the tick labels have less space to render */
104
+ const tickLabelsMaxHeight = Math.max(0, axisHeight - (label ? labelHeight + _utilities.AXIS_LABEL_TICK_LABEL_GAP : 0) - tickSize - _utilities.TICK_LABEL_GAP);
105
+ const tickLabels = isHydrated ? (0, _shortenLabels.shortenLabels)(visibleLabels, drawingArea, tickLabelsMaxHeight, isRtl, axisTickLabelProps.style) : new Map(Array.from(visibleLabels).map(item => [item, item.formattedValue]));
106
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_utilities.XAxisRoot, {
107
+ transform: `translate(0, ${position === 'bottom' ? top + height + offset : top - offset})`,
108
+ className: classes.root,
109
+ sx: sx,
110
+ children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)(Line, (0, _extends2.default)({
111
+ x1: left,
112
+ x2: left + width,
113
+ className: classes.line
114
+ }, slotProps?.axisLine)), xTicks.map((item, index) => {
115
+ const {
116
+ offset: tickOffset,
117
+ labelOffset
118
+ } = item;
119
+ const xTickLabel = labelOffset ?? 0;
120
+ const yTickLabel = positionSign * (tickSize + _utilities.TICK_LABEL_GAP);
121
+ const showTick = instance.isXInside(tickOffset);
122
+ const tickLabel = tickLabels.get(item);
123
+ const showTickLabel = visibleLabels.has(item);
124
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
125
+ transform: `translate(${tickOffset}, 0)`,
126
+ className: classes.tickContainer,
127
+ children: [!disableTicks && showTick && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
128
+ y2: positionSign * tickSize,
129
+ className: classes.tick
130
+ }, slotProps?.axisTick)), tickLabel !== undefined && showTickLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
131
+ x: xTickLabel,
132
+ y: yTickLabel
133
+ }, axisTickLabelProps, {
134
+ text: tickLabel
135
+ }))]
136
+ }, index);
137
+ }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
138
+ className: classes.label,
139
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, axisLabelProps, {
140
+ text: label
141
+ }))
142
+ })]
143
+ });
144
+ }