@mui/x-charts 7.3.1 → 7.3.2

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 (128) hide show
  1. package/BarChart/BarChart.d.ts +4 -3
  2. package/BarChart/BarChart.js +15 -5
  3. package/BarChart/BarPlot.js +6 -6
  4. package/CHANGELOG.md +76 -5
  5. package/ChartsAxis/axisClasses.d.ts +1 -1
  6. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +3 -0
  7. package/ChartsOverlay/ChartsLoadingOverlay.js +43 -0
  8. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +3 -0
  9. package/ChartsOverlay/ChartsNoDataOverlay.js +43 -0
  10. package/ChartsOverlay/ChartsOverlay.d.ts +35 -0
  11. package/ChartsOverlay/ChartsOverlay.js +41 -0
  12. package/ChartsOverlay/index.d.ts +3 -0
  13. package/ChartsOverlay/index.js +26 -0
  14. package/ChartsOverlay/package.json +6 -0
  15. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  16. package/ChartsReferenceLine/common.d.ts +1 -1
  17. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  18. package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  19. package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
  20. package/ChartsTooltip/ChartsTooltip.js +2 -2
  21. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  22. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  23. package/ChartsXAxis/ChartsXAxis.js +7 -0
  24. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  25. package/ChartsYAxis/ChartsYAxis.js +7 -0
  26. package/Gauge/Gauge.js +1 -1
  27. package/Gauge/GaugeContainer.js +1 -1
  28. package/Gauge/GaugeProvider.d.ts +2 -2
  29. package/Gauge/GaugeProvider.js +1 -1
  30. package/Gauge/gaugeClasses.d.ts +2 -2
  31. package/Gauge/utils.d.ts +1 -1
  32. package/Gauge/utils.js +4 -4
  33. package/LineChart/AreaElement.d.ts +1 -1
  34. package/LineChart/LineChart.d.ts +4 -3
  35. package/LineChart/LineChart.js +12 -2
  36. package/LineChart/LineElement.d.ts +1 -1
  37. package/LineChart/MarkElement.d.ts +1 -1
  38. package/PieChart/PieArc.d.ts +1 -1
  39. package/PieChart/PieArcLabel.d.ts +1 -1
  40. package/PieChart/PieArcLabel.js +1 -1
  41. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  42. package/PieChart/PieArcLabelPlot.js +3 -3
  43. package/PieChart/PieArcPlot.d.ts +1 -1
  44. package/PieChart/PieArcPlot.js +3 -3
  45. package/PieChart/PieChart.d.ts +4 -3
  46. package/PieChart/PieChart.js +15 -2
  47. package/ScatterChart/ScatterChart.d.ts +4 -3
  48. package/ScatterChart/ScatterChart.js +12 -2
  49. package/context/SeriesContextProvider.js +1 -1
  50. package/esm/BarChart/BarChart.js +15 -5
  51. package/esm/BarChart/BarPlot.js +6 -6
  52. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  53. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  54. package/esm/ChartsOverlay/ChartsOverlay.js +31 -0
  55. package/esm/ChartsOverlay/index.js +3 -0
  56. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  57. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  58. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  59. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  60. package/esm/ChartsXAxis/ChartsXAxis.js +7 -0
  61. package/esm/ChartsYAxis/ChartsYAxis.js +7 -0
  62. package/esm/Gauge/Gauge.js +1 -1
  63. package/esm/Gauge/GaugeContainer.js +1 -1
  64. package/esm/Gauge/GaugeProvider.js +1 -1
  65. package/esm/Gauge/utils.js +4 -4
  66. package/esm/LineChart/LineChart.js +12 -2
  67. package/esm/PieChart/PieArcLabel.js +1 -1
  68. package/esm/PieChart/PieArcLabelPlot.js +3 -3
  69. package/esm/PieChart/PieArcPlot.js +3 -3
  70. package/esm/PieChart/PieChart.js +15 -2
  71. package/esm/ScatterChart/ScatterChart.js +12 -2
  72. package/esm/context/SeriesContextProvider.js +1 -1
  73. package/esm/hooks/useReducedMotion.js +1 -1
  74. package/esm/hooks/useScale.js +1 -1
  75. package/esm/hooks/useTicks.js +4 -0
  76. package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
  77. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  78. package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -3
  79. package/esm/internals/utils.js +1 -1
  80. package/hooks/useReducedMotion.d.ts +1 -1
  81. package/hooks/useReducedMotion.js +1 -1
  82. package/hooks/useScale.d.ts +4 -4
  83. package/hooks/useScale.js +1 -1
  84. package/hooks/useTicks.js +4 -0
  85. package/index.js +1 -1
  86. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
  87. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
  88. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  89. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
  90. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -3
  91. package/internals/utils.d.ts +1 -1
  92. package/internals/utils.js +1 -1
  93. package/models/axis.d.ts +1 -1
  94. package/models/seriesType/bar.d.ts +1 -1
  95. package/models/seriesType/line.d.ts +1 -1
  96. package/models/seriesType/pie.d.ts +4 -4
  97. package/modern/BarChart/BarChart.js +15 -5
  98. package/modern/BarChart/BarPlot.js +6 -6
  99. package/modern/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  100. package/modern/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  101. package/modern/ChartsOverlay/ChartsOverlay.js +31 -0
  102. package/modern/ChartsOverlay/index.js +3 -0
  103. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  104. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  105. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  106. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
  107. package/modern/ChartsXAxis/ChartsXAxis.js +7 -0
  108. package/modern/ChartsYAxis/ChartsYAxis.js +7 -0
  109. package/modern/Gauge/Gauge.js +1 -1
  110. package/modern/Gauge/GaugeContainer.js +1 -1
  111. package/modern/Gauge/GaugeProvider.js +1 -1
  112. package/modern/Gauge/utils.js +4 -4
  113. package/modern/LineChart/LineChart.js +12 -2
  114. package/modern/PieChart/PieArcLabel.js +1 -1
  115. package/modern/PieChart/PieArcLabelPlot.js +3 -3
  116. package/modern/PieChart/PieArcPlot.js +3 -3
  117. package/modern/PieChart/PieChart.js +15 -2
  118. package/modern/ScatterChart/ScatterChart.js +12 -2
  119. package/modern/context/SeriesContextProvider.js +1 -1
  120. package/modern/hooks/useReducedMotion.js +1 -1
  121. package/modern/hooks/useScale.js +1 -1
  122. package/modern/hooks/useTicks.js +4 -0
  123. package/modern/index.js +1 -1
  124. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +5 -5
  125. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  126. package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -3
  127. package/modern/internals/utils.js +1 -1
  128. package/package.json +1 -1
@@ -10,11 +10,12 @@ import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
10
10
  import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
11
11
  import { ChartsGridProps } from '../ChartsGrid';
12
12
  import { ChartsOnAxisClickHandlerProps } from '../ChartsOnAxisClickHandler';
13
- export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
13
+ import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '../ChartsOverlay/ChartsOverlay';
14
+ export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots {
14
15
  }
15
- export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
16
+ export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps {
16
17
  }
17
- export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
18
+ export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
18
19
  /**
19
20
  * The series to display in the bar chart.
20
21
  * An array of [[BarSeriesType]] objects.
@@ -19,6 +19,7 @@ var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
19
19
  var _ChartsClipPath = require("../ChartsClipPath");
20
20
  var _ChartsGrid = require("../ChartsGrid");
21
21
  var _ChartsOnAxisClickHandler = require("../ChartsOnAxisClickHandler");
22
+ var _ChartsOverlay = require("../ChartsOverlay/ChartsOverlay");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
24
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -58,7 +59,8 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
58
59
  onAxisClick,
59
60
  children,
60
61
  slots,
61
- slotProps
62
+ slotProps,
63
+ loading
62
64
  } = props;
63
65
  const id = (0, _useId.default)();
64
66
  const clipPathId = `${id}-clip-path`;
@@ -99,14 +101,18 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
99
101
  }), grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, {
100
102
  vertical: grid.vertical,
101
103
  horizontal: grid.horizontal
102
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
104
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
103
105
  clipPath: `url(#${clipPathId})`,
104
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, {
106
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, {
105
107
  slots: slots,
106
108
  slotProps: slotProps,
107
109
  skipAnimation: skipAnimation,
108
110
  onItemClick: onItemClick
109
- })
111
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, {
112
+ loading: loading,
113
+ slots: slots,
114
+ slotProps: slotProps
115
+ })]
110
116
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, {
111
117
  topAxis: topAxis,
112
118
  leftAxis: leftAxis,
@@ -117,7 +123,7 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
117
123
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
118
124
  slots: slots,
119
125
  slotProps: slotProps
120
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, defaultizedAxisHighlight)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
126
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, defaultizedAxisHighlight)), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
121
127
  slots: slots,
122
128
  slotProps: slotProps
123
129
  })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
@@ -200,6 +206,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
200
206
  slotProps: _propTypes.default.object,
201
207
  slots: _propTypes.default.object
202
208
  }),
209
+ /**
210
+ * If `true`, a loading overlay is displayed.
211
+ */
212
+ loading: _propTypes.default.bool,
203
213
  /**
204
214
  * The margin between the SVG and the drawing area.
205
215
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -78,25 +78,25 @@ const useAggregatedData = () => {
78
78
  let baseScaleConfig;
79
79
  if (verticalLayout) {
80
80
  if (!(0, _axis.isBandScaleConfig)(xAxisConfig)) {
81
- throw new Error(`MUI X Charts: ${xAxisKey === _constants.DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} shoud be of type "band" to display the bar series of id "${seriesId}".`);
81
+ throw new Error(`MUI X Charts: ${xAxisKey === _constants.DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should be of type "band" to display the bar series of id "${seriesId}".`);
82
82
  }
83
83
  if (xAxis[xAxisKey].data === undefined) {
84
- throw new Error(`MUI X Charts: ${xAxisKey === _constants.DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} shoud have data property.`);
84
+ throw new Error(`MUI X Charts: ${xAxisKey === _constants.DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property.`);
85
85
  }
86
86
  baseScaleConfig = xAxisConfig;
87
87
  if ((0, _axis.isBandScaleConfig)(yAxisConfig) || (0, _axis.isPointScaleConfig)(yAxisConfig)) {
88
- throw new Error(`MUI X Charts: ${yAxisKey === _constants.DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} shoud be a continuous type to display the bar series of id "${seriesId}".`);
88
+ throw new Error(`MUI X Charts: ${yAxisKey === _constants.DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should be a continuous type to display the bar series of id "${seriesId}".`);
89
89
  }
90
90
  } else {
91
91
  if (!(0, _axis.isBandScaleConfig)(yAxisConfig)) {
92
- throw new Error(`MUI X Charts: ${yAxisKey === _constants.DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} shoud be of type "band" to display the bar series of id "${seriesId}".`);
92
+ throw new Error(`MUI X Charts: ${yAxisKey === _constants.DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should be of type "band" to display the bar series of id "${seriesId}".`);
93
93
  }
94
94
  if (yAxis[yAxisKey].data === undefined) {
95
- throw new Error(`MUI X Charts: ${yAxisKey === _constants.DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} shoud have data property.`);
95
+ throw new Error(`MUI X Charts: ${yAxisKey === _constants.DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should have data property.`);
96
96
  }
97
97
  baseScaleConfig = yAxisConfig;
98
98
  if ((0, _axis.isBandScaleConfig)(xAxisConfig) || (0, _axis.isPointScaleConfig)(xAxisConfig)) {
99
- throw new Error(`MUI X Charts: ${xAxisKey === _constants.DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} shoud be a continuous type to display the bar series of id "${seriesId}".`);
99
+ throw new Error(`MUI X Charts: ${xAxisKey === _constants.DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should be a continuous type to display the bar series of id "${seriesId}".`);
100
100
  }
101
101
  }
102
102
  const xScale = xAxisConfig.scale;
package/CHANGELOG.md CHANGED
@@ -3,6 +3,77 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.3.2
7
+
8
+ _May 2, 2024_
9
+
10
+ We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🎁 Add "no data" and "loading" states to charts, allowing users to create [custom visualizations for each state](https://mui.com/x/react-charts/styling/#overlay)
13
+ - 🌍 Improve Hebrew (he-IL) and Hungarian (hu-HU) locales on the Date and Time Pickers
14
+ - 🌍 Improve Danish (da-DK) and Slovak (sk-SK) locales on the Data Grid
15
+ - 📝 Fix a [typo](https://github.com/mui/mui-x/pull/12941/files/4bf4bffbc2799a01a96bc7458a17318cf41c1722#diff-26c31cc69d6f51110f89e339578ef9b3d4a3551f79077fff73f7babb81c5099f) in the auto-generated Charts gradient `id` attribute.
16
+ It should not affect you, but if you were relying on the gradient `id` attribute, please update your usage.
17
+ - 🐞 Bugfixes
18
+ - 📚 Documentation improvements
19
+
20
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
21
+
22
+ ### Data Grid
23
+
24
+ #### `@mui/x-data-grid@7.3.2`
25
+
26
+ - [DataGrid] Allow to change reset text in the columns management panel (#12972) @MBilalShafi
27
+ - [DataGrid] Derive `formattedValue` from the edit value when passing to `renderEditCell` (#12870) @cherniavskii
28
+ - [DataGrid] Fix rows not being recomputed on `props.rowCount` change (#12833) @MBilalShafi
29
+ - [l10n] Improve Danish (da-DK) locale (#12844) @fosterbuster
30
+ - [l10n] Improve Slovak (sk-SK) locale (#12949) @stefikp
31
+
32
+ #### `@mui/x-data-grid-pro@7.3.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
33
+
34
+ Same changes as in `@mui/x-data-grid@7.3.2`.
35
+
36
+ #### `@mui/x-data-grid-premium@7.3.2` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
37
+
38
+ Same changes as in `@mui/x-data-grid-pro@7.3.2`, plus:
39
+
40
+ - [DataGridPremium] Fix print export not working with row grouping (#12957) @MBilalShafi
41
+
42
+ ### Date and Time Pickers
43
+
44
+ #### `@mui/x-date-pickers@7.3.2`
45
+
46
+ - [l10n] Improve Hebrew (he-IL) locale (#12910) @michaelNXT1
47
+ - [l10n] Improve Hungarian (hu-HU) locale (#12930) @noherczeg
48
+ - [pickers] Fix typo on the `viewRenderers` prop description (#12915) @flaviendelangle
49
+ - [pickers] Improve TypeScript performance in `PickersDay` (#12920) @flaviendelangle
50
+
51
+ #### `@mui/x-date-pickers-pro@7.3.2` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
52
+
53
+ Same changes as in `@mui/x-date-pickers@7.3.2`.
54
+
55
+ ### Charts
56
+
57
+ #### `@mui/x-charts@7.3.2`
58
+
59
+ - [charts] Add an overlay for "no data" or "loading" states (#12817) @alexfauquette
60
+ - [charts] Fix typos in documentation, translations and errors (#12941) @JCQuintas
61
+ - [charts] Fix `prop.slots` and `prop.slotProps` not passed to `<ChartsTooltip />` (#12939) @JCQuintas
62
+
63
+ ### Docs
64
+
65
+ - [docs] Improve Data Grid migration guide (#12969) @MBilalShafi
66
+ - [docs] Polish references to the plans (#12922) @oliviertassinari
67
+
68
+ ### Core
69
+
70
+ - [core] Fix dependencies (#12951) @LukasTy
71
+ - [core] Remove inconsistent blank lines (#12966) @oliviertassinari
72
+ - [code-infra] Bump node image used by CI in docker (#12961) @LukasTy
73
+ - [docs-infra] Remove no longer needed `next.config` settings (#12861) @oliviertassinari
74
+ - [docs-infra] Use the `@mui/docs/HighlightedCode` (#12848) @alexfauquette
75
+ - [test] Restore `t` command (#12948) @LukasTy
76
+
6
77
  ## 7.3.1
7
78
 
8
79
  _Apr 26, 2024_
@@ -305,7 +376,7 @@ Same changes as in `@mui/x-date-pickers@7.1.1`, plus:
305
376
 
306
377
  - [TreeView] Add JSDoc to all `publicAPI` methods (#12649) @flaviendelangle
307
378
  - [TreeView] Create `RichTreeViewPro` component (not released yet) (#12610) @flaviendelangle
308
- - [TreeView] Create pro package (not released yet) (#12240) @flaviendelangle
379
+ - [TreeView] Create Pro package (not released yet) (#12240) @flaviendelangle
309
380
  - [TreeView] Fix typo in errors (#12623) @alissa-tung
310
381
  - [TreeView] New API method: `setItemExpansion` (#12595) @flaviendelangle
311
382
 
@@ -2517,7 +2588,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
2517
2588
  - [core] Make `@mui/system` a direct dependency (#11128) @LukasTy
2518
2589
  - [core] Remove blank lines, coding style @oliviertassinari
2519
2590
  - [core] Remove outdated `ENABLE_AD` env variable (#11181) @oliviertassinari
2520
- - [github] Do not add `plan: Pro` and `plan: Premium` labels on pro / premium issue templates (#10183) @flaviendelangle
2591
+ - [github] Do not add `plan: Pro` and `plan: Premium` labels on Pro / Premium issue templates (#10183) @flaviendelangle
2521
2592
 
2522
2593
  ## 7.0.0-alpha.2
2523
2594
 
@@ -3440,10 +3511,10 @@ Same changes as in `@mui/x-date-pickers@6.19.5`.
3440
3511
  - [docs] Fix the Treemap illustration (#12189) @danilo-leal
3441
3512
  - [docs] Fix typo for `AdapterDateFnsV3` (#12037) @flaviendelangle
3442
3513
  - [docs] Improve performance on Charts entry point @oliviertassinari
3443
- - [docs] Move Heatmap to pro (#12170) @alexfauquette
3514
+ - [docs] Move Heatmap to Pro (#12170) @alexfauquette
3444
3515
  - [docs] Remove Charts installation next tag call-out (#12133) @LukasTy
3445
3516
  - [docs] Removed `focused` prop from demo (#12126) @michelengelen
3446
- - [docs] Add missing Heatmap pro icon @oliviertassinari
3517
+ - [docs] Add missing Heatmap Pro icon @oliviertassinari
3447
3518
  - [docs] Add more illustrations to the Overview page (#12041) @danilo-leal
3448
3519
  - [docs] Avoid use of shorthand (#12009) @oliviertassinari
3449
3520
 
@@ -6170,7 +6241,7 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
6170
6241
  - [docs] Create examples of pickers with custom fields (#8034) @flaviendelangle
6171
6242
  - [docs] Fix 301 redirections @oliviertassinari
6172
6243
  - [docs] Fix link to React's docs @oliviertassinari
6173
- - [docs] Fix pro license links to point to the same page (#8303) @LukasTy
6244
+ - [docs] Fix Pro license links to point to the same page (#8303) @LukasTy
6174
6245
  - [docs] Give an incentive to upgrade (#8269) @oliviertassinari
6175
6246
  - [docs] Improve contrast on data grid navigation (#8239) @oliviertassinari
6176
6247
  - [docs] Update shortcuts page to use slotProps (#8288) @dcorb
@@ -3,7 +3,7 @@ export interface ChartsAxisClasses {
3
3
  root: string;
4
4
  /** Styles applied to the main line element. */
5
5
  line: string;
6
- /** Styles applied to group ingruding the tick and its label. */
6
+ /** Styles applied to group including the tick and its label. */
7
7
  tickContainer: string;
8
8
  /** Styles applied to ticks. */
9
9
  tick: string;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { CommonOverlayProps } from './ChartsOverlay';
3
+ export declare function ChartsLoadingOverlay(props: CommonOverlayProps): React.JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ChartsLoadingOverlay = ChartsLoadingOverlay;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _styles = require("@mui/material/styles");
12
+ var _useDrawingArea = require("../hooks/useDrawingArea");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ const _excluded = ["message"];
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ const StyledText = (0, _styles.styled)('text')(({
18
+ theme
19
+ }) => ({
20
+ stroke: 'none',
21
+ fill: theme.palette.text.primary,
22
+ shapeRendering: 'crispEdges',
23
+ textAnchor: 'middle',
24
+ dominantBaseline: 'middle'
25
+ }));
26
+ function ChartsLoadingOverlay(props) {
27
+ const {
28
+ message
29
+ } = props,
30
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
31
+ const {
32
+ top,
33
+ left,
34
+ height,
35
+ width
36
+ } = (0, _useDrawingArea.useDrawingArea)();
37
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, (0, _extends2.default)({
38
+ x: left + width / 2,
39
+ y: top + height / 2
40
+ }, other, {
41
+ children: message ?? 'Loading data ...'
42
+ }));
43
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { CommonOverlayProps } from './ChartsOverlay';
3
+ export declare function ChartsNoDataOverlay(props: CommonOverlayProps): React.JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ChartsNoDataOverlay = ChartsNoDataOverlay;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _styles = require("@mui/material/styles");
12
+ var _useDrawingArea = require("../hooks/useDrawingArea");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ const _excluded = ["message"];
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ const StyledText = (0, _styles.styled)('text')(({
18
+ theme
19
+ }) => ({
20
+ stroke: 'none',
21
+ fill: theme.palette.text.primary,
22
+ shapeRendering: 'crispEdges',
23
+ textAnchor: 'middle',
24
+ dominantBaseline: 'middle'
25
+ }));
26
+ function ChartsNoDataOverlay(props) {
27
+ const {
28
+ message
29
+ } = props,
30
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
31
+ const {
32
+ top,
33
+ left,
34
+ height,
35
+ width
36
+ } = (0, _useDrawingArea.useDrawingArea)();
37
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, (0, _extends2.default)({
38
+ x: left + width / 2,
39
+ y: top + height / 2
40
+ }, other, {
41
+ children: message ?? 'No data to display'
42
+ }));
43
+ }
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ export declare function useNoData(): boolean;
4
+ export type CommonOverlayProps = React.SVGAttributes<SVGTextElement> & {
5
+ /**
6
+ * The message displayed by the overlay.
7
+ */
8
+ message?: string;
9
+ sx?: SxProps<Theme>;
10
+ };
11
+ export interface ChartsOverlaySlots {
12
+ /**
13
+ * Overlay component rendered when the chart is in a loading state.
14
+ * @default ChartsLoadingOverlay
15
+ */
16
+ loadingOverlay?: React.ElementType<CommonOverlayProps>;
17
+ /**
18
+ * Overlay component rendered when the chart has no data to display.
19
+ * @default ChartsNoDataOverlay
20
+ */
21
+ noDataOverlay?: React.ElementType<CommonOverlayProps>;
22
+ }
23
+ export interface ChartsOverlaySlotProps {
24
+ loadingOverlay?: Partial<CommonOverlayProps>;
25
+ noDataOverlay?: Partial<CommonOverlayProps>;
26
+ }
27
+ export interface ChartsOverlayProps {
28
+ /**
29
+ * If `true`, a loading overlay is displayed.
30
+ */
31
+ loading?: boolean;
32
+ slots?: ChartsOverlaySlots;
33
+ slotProps?: ChartsOverlaySlotProps;
34
+ }
35
+ export declare function ChartsOverlay(props: ChartsOverlayProps): React.JSX.Element | null;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ChartsOverlay = ChartsOverlay;
8
+ exports.useNoData = useNoData;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _ChartsLoadingOverlay = require("./ChartsLoadingOverlay");
12
+ var _useSeries = require("../hooks/useSeries");
13
+ var _ChartsNoDataOverlay = require("./ChartsNoDataOverlay");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ function useNoData() {
18
+ const seriesPerType = (0, _useSeries.useSeries)();
19
+ return Object.values(seriesPerType).every(seriesOfGivenType => {
20
+ if (!seriesOfGivenType) {
21
+ return true;
22
+ }
23
+ const {
24
+ series,
25
+ seriesOrder
26
+ } = seriesOfGivenType;
27
+ return seriesOrder.every(seriesId => series[seriesId].data.length === 0);
28
+ });
29
+ }
30
+ function ChartsOverlay(props) {
31
+ const noData = useNoData();
32
+ if (props.loading) {
33
+ const LoadingOverlay = props.slots?.loadingOverlay ?? _ChartsLoadingOverlay.ChartsLoadingOverlay;
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingOverlay, (0, _extends2.default)({}, props.slotProps?.loadingOverlay));
35
+ }
36
+ if (noData) {
37
+ const NoDataOverlay = props.slots?.noDataOverlay ?? _ChartsNoDataOverlay.ChartsNoDataOverlay;
38
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(NoDataOverlay, (0, _extends2.default)({}, props.slotProps?.noDataOverlay));
39
+ }
40
+ return null;
41
+ }
@@ -0,0 +1,3 @@
1
+ export { ChartsOverlay } from './ChartsOverlay';
2
+ export { ChartsLoadingOverlay } from './ChartsLoadingOverlay';
3
+ export { ChartsNoDataOverlay } from './ChartsNoDataOverlay';
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ChartsLoadingOverlay", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ChartsLoadingOverlay.ChartsLoadingOverlay;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ChartsNoDataOverlay", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _ChartsNoDataOverlay.ChartsNoDataOverlay;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "ChartsOverlay", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _ChartsOverlay.ChartsOverlay;
22
+ }
23
+ });
24
+ var _ChartsOverlay = require("./ChartsOverlay");
25
+ var _ChartsLoadingOverlay = require("./ChartsLoadingOverlay");
26
+ var _ChartsNoDataOverlay = require("./ChartsNoDataOverlay");
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../esm/ChartsOverlay/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -61,7 +61,7 @@ process.env.NODE_ENV !== "production" ? ChartsReferenceLine.propTypes = {
61
61
  */
62
62
  lineStyle: _propTypes.default.object,
63
63
  /**
64
- * Additional space arround the label in px.
64
+ * Additional space around the label in px.
65
65
  * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
66
66
  * @default 5
67
67
  */
@@ -13,7 +13,7 @@ export type CommonChartsReferenceLineProps = {
13
13
  */
14
14
  label?: string;
15
15
  /**
16
- * Additional space arround the label in px.
16
+ * Additional space around the label in px.
17
17
  * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
18
18
  * @default 5
19
19
  */
@@ -27,7 +27,7 @@ export type ChartsAxisContentProps = {
27
27
  /**
28
28
  * The value associated to the current mouse position.
29
29
  */
30
- axisValue: any;
30
+ axisValue: string | number | Date | null;
31
31
  /**
32
32
  * Override or extend the styles applied to the component.
33
33
  */
@@ -115,7 +115,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
115
115
  value: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
116
116
  })
117
117
  }),
118
- axisValue: _propTypes.default.any,
118
+ axisValue: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]),
119
119
  classes: _propTypes.default.object,
120
120
  dataIndex: _propTypes.default.number,
121
121
  series: _propTypes.default.arrayOf(_propTypes.default.object),
@@ -43,12 +43,12 @@ export type ChartsTooltipProps = {
43
43
  */
44
44
  trigger?: TriggerOptions;
45
45
  /**
46
- * Component to override the tooltip content when triger is set to 'item'.
46
+ * Component to override the tooltip content when trigger is set to 'item'.
47
47
  * @deprecated Use slots.itemContent instead
48
48
  */
49
49
  itemContent?: React.ElementType<ChartsItemContentProps<any>>;
50
50
  /**
51
- * Component to override the tooltip content when triger is set to 'axis'.
51
+ * Component to override the tooltip content when trigger is set to 'axis'.
52
52
  * @deprecated Use slots.axisContent instead
53
53
  */
54
54
  axisContent?: React.ElementType<ChartsAxisContentProps>;
@@ -122,7 +122,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
122
122
  // | To update them edit the TypeScript types and run "yarn proptypes" |
123
123
  // ----------------------------------------------------------------------
124
124
  /**
125
- * Component to override the tooltip content when triger is set to 'axis'.
125
+ * Component to override the tooltip content when trigger is set to 'axis'.
126
126
  * @deprecated Use slots.axisContent instead
127
127
  */
128
128
  axisContent: _propTypes.default.elementType,
@@ -131,7 +131,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
131
131
  */
132
132
  classes: _propTypes.default.object,
133
133
  /**
134
- * Component to override the tooltip content when triger is set to 'item'.
134
+ * Component to override the tooltip content when trigger is set to 'item'.
135
135
  * @deprecated Use slots.itemContent instead
136
136
  */
137
137
  itemContent: _propTypes.default.elementType,
@@ -109,7 +109,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
109
109
  /**
110
110
  * The value associated to the current mouse position.
111
111
  */
112
- axisValue: _propTypes.default.any.isRequired,
112
+ axisValue: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]),
113
113
  /**
114
114
  * Override or extend the styles applied to the component.
115
115
  */
@@ -9,7 +9,7 @@ import { ChartsXAxisProps } from '../models/axis';
9
9
  *
10
10
  * - [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/)
11
11
  */
12
- declare function ChartsXAxis(inProps: ChartsXAxisProps): React.JSX.Element;
12
+ declare function ChartsXAxis(inProps: ChartsXAxisProps): React.JSX.Element | null;
13
13
  declare namespace ChartsXAxis {
14
14
  var propTypes: any;
15
15
  }
@@ -212,6 +212,13 @@ function ChartsXAxis(inProps) {
212
212
  },
213
213
  ownerState: {}
214
214
  });
215
+ const domain = xScale.domain();
216
+ if (domain.length === 0 || domain[0] === domain[1]) {
217
+ // Skip axis rendering if
218
+ // - the data is empty (for band and point axis)
219
+ // - No data is associated to the axis (other scale types)
220
+ return null;
221
+ }
215
222
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
216
223
  transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
217
224
  className: classes.root,
@@ -9,7 +9,7 @@ import { ChartsYAxisProps } from '../models/axis';
9
9
  *
10
10
  * - [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/)
11
11
  */
12
- declare function ChartsYAxis(inProps: ChartsYAxisProps): React.JSX.Element;
12
+ declare function ChartsYAxis(inProps: ChartsYAxisProps): React.JSX.Element | null;
13
13
  declare namespace ChartsYAxis {
14
14
  var propTypes: any;
15
15
  }
@@ -147,6 +147,13 @@ function ChartsYAxis(inProps) {
147
147
  },
148
148
  ownerState: {}
149
149
  });
150
+ const domain = yScale.domain();
151
+ if (domain.length === 0 || domain[0] === domain[1]) {
152
+ // Skip axis rendering if
153
+ // - the data is empty (for band and point axis)
154
+ // - No data is associated to the axis (other scale types)
155
+ return null;
156
+ }
150
157
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
151
158
  transform: `translate(${position === 'right' ? left + width : left}, 0)`,
152
159
  className: classes.root,
package/Gauge/Gauge.js CHANGED
@@ -93,7 +93,7 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
93
93
  */
94
94
  height: _propTypes.default.number,
95
95
  /**
96
- * The radius between circle center and the begining of the arc.
96
+ * The radius between circle center and the beginning of the arc.
97
97
  * Can be a number (in px) or a string with a percentage such as '50%'.
98
98
  * The '100%' is the maximal radius that fit into the drawing area.
99
99
  * @default '80%'
@@ -154,7 +154,7 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
154
154
  */
155
155
  height: _propTypes.default.number,
156
156
  /**
157
- * The radius between circle center and the begining of the arc.
157
+ * The radius between circle center and the beginning of the arc.
158
158
  * Can be a number (in px) or a string with a percentage such as '50%'.
159
159
  * The '100%' is the maximal radius that fit into the drawing area.
160
160
  * @default '80%'
@@ -11,7 +11,7 @@ interface CircularConfig {
11
11
  */
12
12
  endAngle?: number;
13
13
  /**
14
- * The radius between circle center and the begining of the arc.
14
+ * The radius between circle center and the beginning of the arc.
15
15
  * Can be a number (in px) or a string with a percentage such as '50%'.
16
16
  * The '100%' is the maximal radius that fit into the drawing area.
17
17
  * @default '80%'
@@ -53,7 +53,7 @@ interface ProcessedCircularConfig {
53
53
  */
54
54
  endAngle: number;
55
55
  /**
56
- * The radius between circle center and the begining of the arc.
56
+ * The radius between circle center and the beginning of the arc.
57
57
  */
58
58
  innerRadius: number;
59
59
  /**
@@ -59,7 +59,7 @@ function GaugeProvider(props) {
59
59
  let cy = top + innerCy;
60
60
  const maxRadius = (0, _utils2.getAvailableRadius)(innerCx, innerCy, width, height, ratios);
61
61
 
62
- // If the center is not defined, after computation of the available radius, udpate the center to use the remaining space.
62
+ // If the center is not defined, after computation of the available radius, update the center to use the remaining space.
63
63
  if (cxParam === undefined) {
64
64
  const usedWidth = maxRadius * (ratios.maxX - ratios.minX);
65
65
  cx = left + (width - usedWidth) / 2 + ratios.cx * usedWidth;