@mui/x-charts 9.0.2 → 9.0.3

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 (118) hide show
  1. package/BarChart/BarChart.js +2 -1
  2. package/BarChart/BarChart.mjs +2 -1
  3. package/BarChart/BarPlot.js +2 -1
  4. package/BarChart/BarPlot.mjs +2 -1
  5. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +8 -8
  6. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +8 -8
  7. package/CHANGELOG.md +136 -0
  8. package/ChartsRadialGrid/ChartsRadialGrid.js +2 -0
  9. package/ChartsRadialGrid/ChartsRadialGrid.mjs +2 -0
  10. package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +1 -0
  11. package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +1 -0
  12. package/ChartsRadialGrid/ChartsRadiusGrid.js +1 -2
  13. package/ChartsRadialGrid/ChartsRadiusGrid.mjs +1 -2
  14. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +48 -0
  15. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +48 -0
  16. package/ChartsRadiusAxis/ChartsRadiusAxis.js +147 -0
  17. package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +141 -0
  18. package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.mts +6 -0
  19. package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.ts +6 -0
  20. package/ChartsRadiusAxis/chartsRadiusAxisClasses.js +30 -0
  21. package/ChartsRadiusAxis/chartsRadiusAxisClasses.mjs +17 -0
  22. package/ChartsRadiusAxis/createGetLabelTextAnchors.d.mts +10 -0
  23. package/ChartsRadiusAxis/createGetLabelTextAnchors.d.ts +10 -0
  24. package/ChartsRadiusAxis/createGetLabelTextAnchors.js +46 -0
  25. package/ChartsRadiusAxis/createGetLabelTextAnchors.mjs +39 -0
  26. package/ChartsRadiusAxis/getLabelTransform.d.mts +11 -0
  27. package/ChartsRadiusAxis/getLabelTransform.d.ts +11 -0
  28. package/ChartsRadiusAxis/getLabelTransform.js +37 -0
  29. package/ChartsRadiusAxis/getLabelTransform.mjs +31 -0
  30. package/ChartsRadiusAxis/index.d.mts +3 -0
  31. package/ChartsRadiusAxis/index.d.ts +3 -0
  32. package/ChartsRadiusAxis/index.js +19 -0
  33. package/ChartsRadiusAxis/index.mjs +2 -0
  34. package/ChartsRadiusAxis/sharedRadialAxisClasses.d.mts +21 -0
  35. package/ChartsRadiusAxis/sharedRadialAxisClasses.d.ts +21 -0
  36. package/ChartsRadiusAxis/sharedRadialAxisClasses.js +14 -0
  37. package/ChartsRadiusAxis/sharedRadialAxisClasses.mjs +6 -0
  38. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +48 -0
  39. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +48 -0
  40. package/ChartsRotationAxis/ChartsRotationAxis.js +141 -0
  41. package/ChartsRotationAxis/ChartsRotationAxis.mjs +135 -0
  42. package/ChartsRotationAxis/chartsRotationAxisClasses.d.mts +5 -0
  43. package/ChartsRotationAxis/chartsRotationAxisClasses.d.ts +5 -0
  44. package/ChartsRotationAxis/chartsRotationAxisClasses.js +29 -0
  45. package/ChartsRotationAxis/chartsRotationAxisClasses.mjs +16 -0
  46. package/ChartsRotationAxis/getLabelTransform.d.mts +11 -0
  47. package/ChartsRotationAxis/getLabelTransform.d.ts +11 -0
  48. package/ChartsRotationAxis/getLabelTransform.js +37 -0
  49. package/ChartsRotationAxis/getLabelTransform.mjs +31 -0
  50. package/ChartsRotationAxis/index.d.mts +2 -0
  51. package/ChartsRotationAxis/index.d.ts +2 -0
  52. package/ChartsRotationAxis/index.js +19 -0
  53. package/ChartsRotationAxis/index.mjs +2 -0
  54. package/ChartsTooltip/useAxesTooltip.js +7 -4
  55. package/ChartsTooltip/useAxesTooltip.mjs +8 -5
  56. package/ChartsTooltip/useItemTooltip.d.mts +1 -1
  57. package/ChartsTooltip/useItemTooltip.d.ts +1 -1
  58. package/ChartsTooltip/useItemTooltip.js +17 -2
  59. package/ChartsTooltip/useItemTooltip.mjs +18 -3
  60. package/ChartsXAxis/useAxisTicksProps.d.mts +245 -164
  61. package/ChartsXAxis/useAxisTicksProps.d.ts +245 -164
  62. package/ChartsYAxis/useAxisTicksProps.d.mts +245 -164
  63. package/ChartsYAxis/useAxisTicksProps.d.ts +245 -164
  64. package/LineChart/seriesConfig/curveEvaluation.js +24 -19
  65. package/LineChart/seriesConfig/curveEvaluation.mjs +24 -19
  66. package/LineChart/seriesConfig/getItemAtPosition.js +14 -3
  67. package/LineChart/seriesConfig/getItemAtPosition.mjs +14 -3
  68. package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +4 -6
  69. package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +4 -6
  70. package/LineChart/seriesConfig/seriesProcessor.d.mts +4 -2
  71. package/LineChart/seriesConfig/seriesProcessor.d.ts +4 -2
  72. package/LineChart/seriesConfig/seriesProcessor.js +2 -2
  73. package/LineChart/seriesConfig/seriesProcessor.mjs +2 -2
  74. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.mts +2 -2
  75. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
  76. package/hooks/useAxis.d.mts +2 -2
  77. package/hooks/useAxis.d.ts +2 -2
  78. package/index.d.mts +2 -0
  79. package/index.d.ts +2 -0
  80. package/index.js +22 -2
  81. package/index.mjs +3 -1
  82. package/internals/cubiqSolver.d.mts +5 -0
  83. package/internals/cubiqSolver.d.ts +5 -0
  84. package/internals/cubiqSolver.js +62 -0
  85. package/internals/cubiqSolver.mjs +56 -0
  86. package/internals/index.d.mts +5 -1
  87. package/internals/index.d.ts +5 -1
  88. package/internals/index.js +47 -2
  89. package/internals/index.mjs +5 -1
  90. package/internals/isPolar.d.mts +3 -2
  91. package/internals/isPolar.d.ts +3 -2
  92. package/internals/isPolar.js +4 -0
  93. package/internals/isPolar.mjs +3 -0
  94. package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +8 -9
  95. package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +8 -9
  96. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +3 -2
  97. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +3 -2
  98. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +23 -13
  99. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +23 -13
  100. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +2 -2
  101. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
  102. package/models/axis.d.mts +2 -0
  103. package/models/axis.d.ts +2 -0
  104. package/models/seriesType/bar.d.mts +12 -7
  105. package/models/seriesType/bar.d.ts +12 -7
  106. package/models/seriesType/common.d.mts +10 -0
  107. package/models/seriesType/common.d.ts +10 -0
  108. package/models/seriesType/composition.d.mts +3 -1
  109. package/models/seriesType/composition.d.ts +3 -1
  110. package/models/seriesType/composition.js +6 -2
  111. package/models/seriesType/composition.mjs +5 -1
  112. package/models/seriesType/index.d.mts +3 -3
  113. package/models/seriesType/index.d.ts +3 -3
  114. package/models/seriesType/index.js +0 -22
  115. package/models/seriesType/index.mjs +0 -2
  116. package/models/seriesType/line.d.mts +13 -8
  117. package/models/seriesType/line.d.ts +13 -8
  118. package/package.json +161 -133
@@ -291,7 +291,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
291
291
  onHighlightedAxisChange: _propTypes.default.func,
292
292
  /**
293
293
  * Callback fired when a bar item is clicked.
294
- * @param {MouseEvent} event The event source of the callback.
294
+ * @param {MouseEvent | React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
295
+ * It is a native MouseEvent for `svg-batch` renderer and a React MouseEvent for `svg-single` renderer.
295
296
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
296
297
  */
297
298
  onItemClick: _propTypes.default.func,
@@ -284,7 +284,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
284
284
  onHighlightedAxisChange: PropTypes.func,
285
285
  /**
286
286
  * Callback fired when a bar item is clicked.
287
- * @param {MouseEvent} event The event source of the callback.
287
+ * @param {MouseEvent | React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
288
+ * It is a native MouseEvent for `svg-batch` renderer and a React MouseEvent for `svg-single` renderer.
288
289
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
289
290
  */
290
291
  onItemClick: PropTypes.func,
@@ -102,7 +102,8 @@ process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
102
102
  className: _propTypes.default.string,
103
103
  /**
104
104
  * Callback fired when a bar item is clicked.
105
- * @param {MouseEvent} event The event source of the callback.
105
+ * @param {MouseEvent | React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
106
+ * It is a native MouseEvent for `svg-batch` renderer and a React MouseEvent for `svg-single` renderer.
106
107
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
107
108
  */
108
109
  onItemClick: _propTypes.default.func,
@@ -95,7 +95,8 @@ process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
95
95
  className: PropTypes.string,
96
96
  /**
97
97
  * Callback fired when a bar item is clicked.
98
- * @param {MouseEvent} event The event source of the callback.
98
+ * @param {MouseEvent | React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
99
+ * It is a native MouseEvent for `svg-batch` renderer and a React MouseEvent for `svg-single` renderer.
99
100
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
100
101
  */
101
102
  onItemClick: PropTypes.func,
@@ -3,15 +3,8 @@ export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'ba
3
3
  id: string;
4
4
  color: string;
5
5
  type: "bar";
6
- data?: ReadonlyArray<import("../../../index.mjs").BarValueType | null>;
7
- dataKey?: string;
8
- valueGetter?: (item: import("../../../internals/index.mjs").DatasetElementType<unknown>) => import("../../../index.mjs").BarValueType | null;
9
- label?: string | ((location: "tooltip" | "legend") => string);
10
- layout?: "horizontal" | "vertical";
11
- stackOffset?: import("../../../index.mjs").StackOffsetType;
12
- minBarSize?: number;
13
- barLabel?: "value" | ((item: import("@mui/x-charts/BarChart").BarItem, context: import("@mui/x-charts/BarChart").BarLabelContext) => string | null | undefined);
14
6
  barLabelPlacement?: "center" | "outside";
7
+ stackOffset?: import("../../../index.mjs").StackOffsetType;
15
8
  valueFormatter?: import("../../../internals/index.mjs").SeriesValueFormatter<number | null> | undefined;
16
9
  highlightScope?: import("../../../internals/index.mjs").CommonHighlightScope | undefined;
17
10
  labelMarkType?: import("../../../internals/index.mjs").ChartsLabelMarkType;
@@ -20,4 +13,11 @@ export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'ba
20
13
  yAxisId?: import("../../../internals/index.mjs").AxisId;
21
14
  stack?: string;
22
15
  stackOrder?: import("../../../index.mjs").StackOrderType;
16
+ data?: ReadonlyArray<import("../../../index.mjs").BarValueType | null>;
17
+ dataKey?: string;
18
+ valueGetter?: (item: import("../../../internals/index.mjs").DatasetElementType<unknown>) => import("../../../index.mjs").BarValueType | null;
19
+ label?: string | ((location: "tooltip" | "legend") => string);
20
+ layout?: "horizontal" | "vertical";
21
+ minBarSize?: number;
22
+ barLabel?: "value" | ((item: import("@mui/x-charts/BarChart").BarItem, context: import("@mui/x-charts/BarChart").BarLabelContext) => string | null | undefined);
23
23
  };
@@ -3,15 +3,8 @@ export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'ba
3
3
  id: string;
4
4
  color: string;
5
5
  type: "bar";
6
- data?: ReadonlyArray<import("../../../index.js").BarValueType | null>;
7
- dataKey?: string;
8
- valueGetter?: (item: import("../../../internals/index.js").DatasetElementType<unknown>) => import("../../../index.js").BarValueType | null;
9
- label?: string | ((location: "tooltip" | "legend") => string);
10
- layout?: "horizontal" | "vertical";
11
- stackOffset?: import("../../../index.js").StackOffsetType;
12
- minBarSize?: number;
13
- barLabel?: "value" | ((item: import("@mui/x-charts/BarChart").BarItem, context: import("@mui/x-charts/BarChart").BarLabelContext) => string | null | undefined);
14
6
  barLabelPlacement?: "center" | "outside";
7
+ stackOffset?: import("../../../index.js").StackOffsetType;
15
8
  valueFormatter?: import("../../../internals/index.js").SeriesValueFormatter<number | null> | undefined;
16
9
  highlightScope?: import("../../../internals/index.js").CommonHighlightScope | undefined;
17
10
  labelMarkType?: import("../../../internals/index.js").ChartsLabelMarkType;
@@ -20,4 +13,11 @@ export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'ba
20
13
  yAxisId?: import("../../../internals/index.js").AxisId;
21
14
  stack?: string;
22
15
  stackOrder?: import("../../../index.js").StackOrderType;
16
+ data?: ReadonlyArray<import("../../../index.js").BarValueType | null>;
17
+ dataKey?: string;
18
+ valueGetter?: (item: import("../../../internals/index.js").DatasetElementType<unknown>) => import("../../../index.js").BarValueType | null;
19
+ label?: string | ((location: "tooltip" | "legend") => string);
20
+ layout?: "horizontal" | "vertical";
21
+ minBarSize?: number;
22
+ barLabel?: "value" | ((item: import("@mui/x-charts/BarChart").BarItem, context: import("@mui/x-charts/BarChart").BarLabelContext) => string | null | undefined);
23
23
  };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,141 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.0.3
4
+
5
+ _Apr 27, 2026_
6
+
7
+ We'd like to extend a big thank you to the 16 contributors who made this release possible. Here are some highlights ✨:
8
+
9
+ - ⌨️ Keyboard support for creating events in the Scheduler
10
+
11
+ Special thanks go out to these community members for their valuable contributions:
12
+ @supunsathsara, @ZAKIURREHMAN
13
+
14
+ The following team members contributed to this release:
15
+ @aemartos, @alexfauquette, @arminmeh, @brijeshb42, @Janpot, @JCQuintas, @LukasTy, @MBilalShafi, @michelengelen, @oliviertassinari, @rita-codes, @romgrk, @sai6855, @siriwatknp
16
+
17
+ ### Data Grid
18
+
19
+ #### `@mui/x-data-grid@9.0.3`
20
+
21
+ - [DataGrid] Fix `:first-child` SSR warning when `MuiDataGrid.styleOverrides` is set (#22081) @siriwatknp
22
+ - [DataGrid] Fix row reordering when filter hides rows (#22096) @siriwatknp
23
+ - [DataGrid] Remove unused `LayoutDataGridLegacy` class (#22009) @romgrk
24
+ - [DataGrid] Remove unused code, clean up grid-related utilities and deprecate `GridPanelHeader` (#22112) @sai6855
25
+ - [DataGrid] Fix columns cutting off after resizing (#22088) @ZAKIURREHMAN
26
+
27
+ #### `@mui/x-data-grid-pro@9.0.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
28
+
29
+ Same changes as in `@mui/x-data-grid@9.0.3`.
30
+
31
+ #### `@mui/x-data-grid-premium@9.0.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
32
+
33
+ Same changes as in `@mui/x-data-grid-pro@9.0.3`, plus:
34
+
35
+ - [DataGridPremium] Fix row grouping model updates not being reflected (#22122) @MBilalShafi
36
+
37
+ ### Date and Time Pickers
38
+
39
+ #### `@mui/x-date-pickers@9.0.3`
40
+
41
+ - [pickers] Fix `DateRangeCalendar` drag with `AdapterDayjs` plain-constructor values (#22165) @LukasTy
42
+ - [pickers] Fix disabled state not overriding error border color (#21169) @supunsathsara
43
+ - [pickers] Forward `data-*` and `aria-*` attributes to the root (#22147) @LukasTy
44
+ - [pickers] Support `K` and `k` hour format tokens (#22108) @michelengelen
45
+
46
+ #### `@mui/x-date-pickers-pro@9.0.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
47
+
48
+ Same changes as in `@mui/x-date-pickers@9.0.3`, plus:
49
+
50
+ - [DateRangeCalendar] Ensure date dragging triggers regardless of trigger element (#21868) @michelengelen
51
+
52
+ ### Charts
53
+
54
+ #### `@mui/x-charts@9.0.3`
55
+
56
+ - [charts] Centralize WebGL clear/render cycle (context-based) (#22127) @JCQuintas
57
+ - [charts] Fix closest series detection for line charts (#22168) @alexfauquette
58
+ - [charts] Fix radius grid lines when axis uses point scale (#22134) @alexfauquette
59
+ - [charts] Use cubic solver for berzier intersection (#22152) @alexfauquette
60
+
61
+ #### `@mui/x-charts-pro@9.0.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
62
+
63
+ Same changes as in `@mui/x-charts@9.0.3`, plus:
64
+
65
+ - [charts-pro] Fix wheel zoom clamping with custom `minStart`/`maxEnd` (#22159) @JCQuintas
66
+
67
+ #### `@mui/x-charts-premium@9.0.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
68
+
69
+ Same changes as in `@mui/x-charts-pro@9.0.3`, plus:
70
+
71
+ - [charts] Create a `'radialLine'` series type (#22066) @alexfauquette
72
+ - [charts] Plot radial line (#22133) @alexfauquette
73
+ - [charts] Remove `HeatmapWebGLRenderer` indirection (#22169) @JCQuintas
74
+
75
+ ### Tree View
76
+
77
+ #### `@mui/x-tree-view@9.0.2`
78
+
79
+ Internal changes.
80
+
81
+ #### `@mui/x-tree-view-pro@9.0.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
82
+
83
+ Same changes as in `@mui/x-tree-view@9.0.2`.
84
+
85
+ ### Scheduler
86
+
87
+ #### Breaking changes
88
+
89
+ - The `views` of `EventTimelinePremium` have been renamed to `presets`, with names that describe the header layout. The props `view`/`defaultView`/`views`/`onViewChange` are now `preset`/`defaultPreset`/`presets`/`onPresetChange`, and the type `EventTimelinePremiumView` is now `EventTimelinePremiumPreset`.
90
+
91
+ | Old | New |
92
+ | :------- | :------------- |
93
+ | `time` | `dayAndHour` |
94
+ | `days` | `day` |
95
+ | `weeks` | `dayAndWeek` |
96
+ | `months` | `monthAndYear` |
97
+ | `years` | `year` |
98
+
99
+ CSS variables (`--time-cell-width`, etc.) and headless store state (`state.view`, `setView`) follow the same rename. The `presets` array is now sorted internally against a canonical zoom order.
100
+
101
+ #### `@mui/x-scheduler@9.0.0-alpha.3`
102
+
103
+ - [scheduler] Allow creating events via keyboard - EventCalendar (#21967) @rita-codes
104
+ - [scheduler] Prefix element IDs with a unique Scheduler instance ID (#22109) @rita-codes
105
+
106
+ #### `@mui/x-scheduler-premium@9.0.0-alpha.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
107
+
108
+ Same changes as in `@mui/x-scheduler@9.0.0-alpha.3`.
109
+
110
+ - [scheduler] Allow creating events via keyboard - `EventTimeline` (#22119) @rita-codes
111
+ - [scheduler] Rename `EventTimeline` `views` to ordered presets (#22130) @rita-codes
112
+
113
+ ### Docs
114
+
115
+ - [docs] Cleanup generated llm md files for chat (#22163) @brijeshb42
116
+ - [docs] Fix `highlightScope` description (#22154) @alexfauquette
117
+ - [docs] Remove obsolete v7 deprecation warning for `dayOfWeekFormatter` (#22111) @LukasTy
118
+ - [docs] Use mui.com for broken links checker known targets (#22129) @JCQuintas
119
+ - [docs] Document picker behavior inside MUI `Dialog` and provide recommended solutions (#22144) @michelengelen
120
+ - [docs] Improve v9 license key version mismatch error guidance (#22180) @aemartos
121
+
122
+ ### Core
123
+
124
+ - [code-infra] Reduce concurrency for package build to 5 (#22115) @Janpot
125
+ - [code-infra] Rename `docsx` alias to `docs` (#22155) @brijeshb42
126
+ - [docs-infra] Remove monorepo dependency (#22025) @brijeshb42
127
+ - [docs-infra] Use latest published packages (#22086) @brijeshb42
128
+ - [test] Refactor Pickers tests to async user-event (#22043) @LukasTy
129
+ - [test] Remove redundant explicit `unmount()` calls from Pickers tests (#22118) @LukasTy
130
+
131
+ ### Miscellaneous
132
+
133
+ - [infra] Update `.gitignore` to exclude `.claude/worktrees` (#22145) @michelengelen
134
+ - [infra] Enable branch tracking when creating release branch (#22177) @michelengelen
135
+ - [license] Add MIT license to `x-virtualizer` package (#22164) @michelengelen
136
+ - [website] Fix outdated MUI logos (#22117) @oliviertassinari
137
+ - [internal] Try avoiding store update when virtualization is disabled (#22093) @arminmeh
138
+
3
139
  ## 9.0.2
4
140
 
5
141
  <!-- generated comparing v9.0.1..master -->
@@ -64,6 +64,7 @@ function ChartsRadialGrid(inProps) {
64
64
  const outerRadius = radiusAxisConfig?.scale.range()[1] ?? 0;
65
65
  const startAngle = rotationAxisConfig?.scale.range()[0] ?? 0;
66
66
  const endAngle = rotationAxisConfig?.scale.range()[1] ?? 0;
67
+ const isFullCircle = rotationAxisConfig?.isFullCircle ?? false;
67
68
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledComponents.GridRoot, (0, _extends2.default)({}, other, {
68
69
  className: (0, _clsx.default)(classes.root, className),
69
70
  children: [rotation && rotationAxisConfig && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsRotationGrid.ChartsRotationGrid, {
@@ -75,6 +76,7 @@ function ChartsRadialGrid(inProps) {
75
76
  axis: radiusAxisConfig,
76
77
  startAngle: startAngle,
77
78
  endAngle: endAngle,
79
+ isFullCircle: isFullCircle,
78
80
  classes: classes
79
81
  })]
80
82
  }));
@@ -58,6 +58,7 @@ function ChartsRadialGrid(inProps) {
58
58
  const outerRadius = radiusAxisConfig?.scale.range()[1] ?? 0;
59
59
  const startAngle = rotationAxisConfig?.scale.range()[0] ?? 0;
60
60
  const endAngle = rotationAxisConfig?.scale.range()[1] ?? 0;
61
+ const isFullCircle = rotationAxisConfig?.isFullCircle ?? false;
61
62
  return /*#__PURE__*/_jsxs(GridRoot, _extends({}, other, {
62
63
  className: clsx(classes.root, className),
63
64
  children: [rotation && rotationAxisConfig && /*#__PURE__*/_jsx(ChartsRotationGrid, {
@@ -69,6 +70,7 @@ function ChartsRadialGrid(inProps) {
69
70
  axis: radiusAxisConfig,
70
71
  startAngle: startAngle,
71
72
  endAngle: endAngle,
73
+ isFullCircle: isFullCircle,
72
74
  classes: classes
73
75
  })]
74
76
  }));
@@ -4,6 +4,7 @@ interface ChartsRadiusGridProps {
4
4
  axis: PolarAxisDefaultized<any, any, any>;
5
5
  startAngle: number;
6
6
  endAngle: number;
7
+ isFullCircle: boolean;
7
8
  classes: Partial<ChartsRadialGridClasses>;
8
9
  }
9
10
  /**
@@ -4,6 +4,7 @@ interface ChartsRadiusGridProps {
4
4
  axis: PolarAxisDefaultized<any, any, any>;
5
5
  startAngle: number;
6
6
  endAngle: number;
7
+ isFullCircle: boolean;
7
8
  classes: Partial<ChartsRadialGridClasses>;
8
9
  }
9
10
  /**
@@ -10,7 +10,6 @@ var _useTicks = require("../hooks/useTicks");
10
10
  var _styledComponents = require("./styledComponents");
11
11
  var _ChartsProvider = require("../context/ChartsProvider");
12
12
  var _useChartPolarAxis = require("../internals/plugins/featurePlugins/useChartPolarAxis");
13
- var _epsilon = require("../utils/epsilon");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  /**
16
15
  * @ignore - internal component.
@@ -23,6 +22,7 @@ function ChartsRadiusGrid(props) {
23
22
  axis,
24
23
  startAngle,
25
24
  endAngle,
25
+ isFullCircle,
26
26
  classes
27
27
  } = props;
28
28
  const {
@@ -42,7 +42,6 @@ function ChartsRadiusGrid(props) {
42
42
  tickSpacing,
43
43
  direction: 'radius'
44
44
  });
45
- const isFullCircle = Math.abs(endAngle - startAngle) >= 2 * Math.PI - _epsilon.EPSILON;
46
45
  if (isFullCircle) {
47
46
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
48
47
  children: ticks.map(({
@@ -3,7 +3,6 @@ import { useTicks } from "../hooks/useTicks.mjs";
3
3
  import { GridCircle, GridPath } from "./styledComponents.mjs";
4
4
  import { useChartsContext } from "../context/ChartsProvider/index.mjs";
5
5
  import { selectorChartPolarCenter } from "../internals/plugins/featurePlugins/useChartPolarAxis/index.mjs";
6
- import { EPSILON } from "../utils/epsilon.mjs";
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
8
7
  /**
9
8
  * @ignore - internal component.
@@ -16,6 +15,7 @@ export function ChartsRadiusGrid(props) {
16
15
  axis,
17
16
  startAngle,
18
17
  endAngle,
18
+ isFullCircle,
19
19
  classes
20
20
  } = props;
21
21
  const {
@@ -35,7 +35,6 @@ export function ChartsRadiusGrid(props) {
35
35
  tickSpacing,
36
36
  direction: 'radius'
37
37
  });
38
- const isFullCircle = Math.abs(endAngle - startAngle) >= 2 * Math.PI - EPSILON;
39
38
  if (isFullCircle) {
40
39
  return /*#__PURE__*/_jsx(React.Fragment, {
41
40
  children: ticks.map(({
@@ -0,0 +1,48 @@
1
+ import type { AxisId } from "../models/axis.mjs";
2
+ import { type ChartsRadialAxisClasses } from "./chartsRadiusAxisClasses.mjs";
3
+ export interface ChartsRadiusAxisProps {
4
+ /**
5
+ * Id of the radius axis to render.
6
+ * If not provided, it will use the first defined radius axis.
7
+ */
8
+ axisId?: AxisId;
9
+ /**
10
+ * The position of the axis in polar coordinates.
11
+ * It can be 'start', 'end', or a specific angle in degrees.
12
+ * @default 'start'
13
+ */
14
+ position?: 'start' | 'end' | number;
15
+ /**
16
+ * If `true`, the axis line is not rendered.
17
+ * @default false
18
+ */
19
+ disableLine?: boolean;
20
+ /**
21
+ * If `true`, the ticks are not rendered.
22
+ * @default false
23
+ */
24
+ disableTicks?: boolean;
25
+ /**
26
+ * The size (in pixels) of the tick marks.
27
+ * @default 6
28
+ */
29
+ tickSize?: number;
30
+ /**
31
+ * Set the position of the tick labels relative to the axis line.
32
+ * The before/after is defined based on clockwise direction.
33
+ * @default 'after'
34
+ */
35
+ tickLabelPosition?: 'center' | 'after' | 'before';
36
+ /**
37
+ * Set the position of the tick relative to the axis line.
38
+ * The before/after is defined based on clockwise direction.
39
+ * @default 'after'
40
+ */
41
+ tickPosition?: 'after' | 'before';
42
+ /**
43
+ * A CSS class name applied to the root element.
44
+ */
45
+ className?: string;
46
+ classes?: Partial<ChartsRadialAxisClasses>;
47
+ }
48
+ export declare function ChartsRadiusAxis(props: ChartsRadiusAxisProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,48 @@
1
+ import type { AxisId } from "../models/axis.js";
2
+ import { type ChartsRadialAxisClasses } from "./chartsRadiusAxisClasses.js";
3
+ export interface ChartsRadiusAxisProps {
4
+ /**
5
+ * Id of the radius axis to render.
6
+ * If not provided, it will use the first defined radius axis.
7
+ */
8
+ axisId?: AxisId;
9
+ /**
10
+ * The position of the axis in polar coordinates.
11
+ * It can be 'start', 'end', or a specific angle in degrees.
12
+ * @default 'start'
13
+ */
14
+ position?: 'start' | 'end' | number;
15
+ /**
16
+ * If `true`, the axis line is not rendered.
17
+ * @default false
18
+ */
19
+ disableLine?: boolean;
20
+ /**
21
+ * If `true`, the ticks are not rendered.
22
+ * @default false
23
+ */
24
+ disableTicks?: boolean;
25
+ /**
26
+ * The size (in pixels) of the tick marks.
27
+ * @default 6
28
+ */
29
+ tickSize?: number;
30
+ /**
31
+ * Set the position of the tick labels relative to the axis line.
32
+ * The before/after is defined based on clockwise direction.
33
+ * @default 'after'
34
+ */
35
+ tickLabelPosition?: 'center' | 'after' | 'before';
36
+ /**
37
+ * Set the position of the tick relative to the axis line.
38
+ * The before/after is defined based on clockwise direction.
39
+ * @default 'after'
40
+ */
41
+ tickPosition?: 'after' | 'before';
42
+ /**
43
+ * A CSS class name applied to the root element.
44
+ */
45
+ className?: string;
46
+ classes?: Partial<ChartsRadialAxisClasses>;
47
+ }
48
+ export declare function ChartsRadiusAxis(props: ChartsRadiusAxisProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ChartsRadiusAxis = ChartsRadiusAxis;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
+ var _styles = require("@mui/material/styles");
12
+ var _useTicks = require("../hooks/useTicks");
13
+ var _useAxis = require("../hooks/useAxis");
14
+ var _ChartsProvider = require("../context/ChartsProvider");
15
+ var _useChartPolarAxis = require("../internals/plugins/featurePlugins/useChartPolarAxis");
16
+ var _chartsRadiusAxisClasses = require("./chartsRadiusAxisClasses");
17
+ var _createGetLabelTextAnchors = require("./createGetLabelTextAnchors");
18
+ var _getLabelTransform = require("./getLabelTransform");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
+ /* Gap between a tick and its label. */
21
+ const TICK_LABEL_GAP = 3;
22
+ const getLabelTextAnchors = (0, _createGetLabelTextAnchors.createGetLabelTextAnchors)(_getLabelTransform.getLabelTransform);
23
+
24
+ /**
25
+ * Get the angle to use to display the radius axis.
26
+ * @param position The position props
27
+ * @param rotationAxis The default rotation axis
28
+ * @returns the angle in radians to use.
29
+ */
30
+ function getAxisAngleInRadians(position, rotationAxis) {
31
+ if (position === 'start') {
32
+ return rotationAxis?.scale.range()[0] ?? 0;
33
+ }
34
+ if (position === 'end') {
35
+ return rotationAxis?.scale.range()[1] ?? 0;
36
+ }
37
+ if (typeof position === 'number') {
38
+ return position * Math.PI / 180;
39
+ }
40
+ return 0;
41
+ }
42
+ function ChartsRadiusAxis(props) {
43
+ const {
44
+ axisId,
45
+ position = 'start',
46
+ disableLine,
47
+ disableTicks,
48
+ tickLabelPosition = 'after',
49
+ tickPosition = 'after',
50
+ tickSize = 6,
51
+ className,
52
+ classes: classesProp
53
+ } = props;
54
+ const isCentered = tickLabelPosition === 'center';
55
+ const classes = (0, _chartsRadiusAxisClasses.useUtilityClasses)({
56
+ classes: classesProp,
57
+ isCentered
58
+ });
59
+ const theme = (0, _styles.useTheme)();
60
+ const {
61
+ store
62
+ } = (0, _ChartsProvider.useChartsContext)();
63
+ const {
64
+ cx,
65
+ cy
66
+ } = store.use(_useChartPolarAxis.selectorChartPolarCenter);
67
+ const radiusAxis = (0, _useAxis.useRadiusAxis)(axisId);
68
+ const rotationAxis = (0, _useAxis.useRotationAxis)();
69
+ const ticks = (0, _useTicks.useTicks)({
70
+ scale: radiusAxis.scale,
71
+ tickNumber: radiusAxis?.tickNumber ?? 5,
72
+ tickInterval: radiusAxis?.tickInterval,
73
+ tickSpacing: radiusAxis?.tickSpacing,
74
+ valueFormatter: radiusAxis?.valueFormatter,
75
+ direction: 'radius'
76
+ });
77
+ if (!radiusAxis) {
78
+ return null;
79
+ }
80
+ const angle = getAxisAngleInRadians(position, rotationAxis);
81
+ // Convert "0 = up" convention to SVG math angle (0 = right, clockwise y-down).
82
+ const dx = Math.sin(angle);
83
+ const dy = -Math.cos(angle);
84
+ // Perpendicular offset for tick marks (rotated 90° clockwise).
85
+ const px = -dy;
86
+ const py = dx;
87
+ const [innerRadius, outerRadius] = radiusAxis.scale.range();
88
+ const stroke = (theme.vars ?? theme).palette.text.primary;
89
+ const tickDx = (tickPosition === 'after' ? 1 : -1) * px * tickSize;
90
+ const tickDy = (tickPosition === 'after' ? 1 : -1) * py * tickSize;
91
+ const tickLabelGap = isCentered ? 0 : TICK_LABEL_GAP;
92
+ const tickLabelGapDx = (tickLabelPosition === 'after' ? 1 : -1) * px * tickLabelGap;
93
+ const tickLabelGapDy = (tickLabelPosition === 'after' ? 1 : -1) * py * tickLabelGap;
94
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
95
+ className: (0, _clsx.default)(classes.root, className),
96
+ children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
97
+ x1: cx + dx * innerRadius,
98
+ y1: cy + dy * innerRadius,
99
+ x2: cx + dx * outerRadius,
100
+ y2: cy + dy * outerRadius,
101
+ stroke: stroke,
102
+ className: classes.line
103
+ }), ticks.map(({
104
+ offset: radius,
105
+ formattedValue
106
+ }, index) => {
107
+ if (!formattedValue) {
108
+ return null;
109
+ }
110
+ const tx = cx + dx * radius;
111
+ const ty = cy + dy * radius;
112
+
113
+ // Compute the label position.
114
+ let labelX = tx;
115
+ let labelY = ty;
116
+ if (tickLabelGap !== 0) {
117
+ labelX += tickLabelGapDx;
118
+ labelY += tickLabelGapDy;
119
+ }
120
+ if (!isCentered && tickLabelPosition === tickPosition && !disableTicks) {
121
+ // Add the size of the tick if they are in the same direction.
122
+ labelX += tickDx;
123
+ labelY += tickDy;
124
+ }
125
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
126
+ className: classes.tickContainer,
127
+ children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)("line", {
128
+ x1: tx,
129
+ y1: ty,
130
+ x2: tx + tickDx,
131
+ y2: ty + tickDy,
132
+ stroke: stroke,
133
+ className: classes.tick
134
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("text", (0, _extends2.default)({
135
+ x: labelX,
136
+ y: labelY,
137
+ fill: stroke,
138
+ fontSize: 12,
139
+ className: classes.tickLabel,
140
+ pointerEvents: "none"
141
+ }, getLabelTextAnchors(dx, dy, tickLabelPosition), {
142
+ children: formattedValue
143
+ }))]
144
+ }, index);
145
+ })]
146
+ });
147
+ }