@mui/x-charts 7.3.0 → 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 (246) hide show
  1. package/BarChart/BarChart.d.ts +5 -3
  2. package/BarChart/BarChart.js +23 -102
  3. package/BarChart/BarElement.d.ts +63 -62
  4. package/BarChart/BarElement.js +1 -2
  5. package/BarChart/BarPlot.js +9 -9
  6. package/CHANGELOG.md +155 -7
  7. package/ChartContainer/ChartContainer.js +3 -1
  8. package/ChartsAxis/ChartsAxis.js +7 -99
  9. package/ChartsAxis/axisClasses.d.ts +1 -1
  10. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  11. package/ChartsClipPath/ChartsClipPath.js +1 -1
  12. package/ChartsGrid/ChartsGrid.js +1 -1
  13. package/ChartsLegend/ChartsLegend.js +1 -1
  14. package/ChartsLegend/DefaultChartsLegend.js +1 -1
  15. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
  16. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +3 -0
  17. package/ChartsOverlay/ChartsLoadingOverlay.js +43 -0
  18. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +3 -0
  19. package/ChartsOverlay/ChartsNoDataOverlay.js +43 -0
  20. package/ChartsOverlay/ChartsOverlay.d.ts +35 -0
  21. package/ChartsOverlay/ChartsOverlay.js +41 -0
  22. package/ChartsOverlay/index.d.ts +3 -0
  23. package/ChartsOverlay/index.js +26 -0
  24. package/ChartsOverlay/package.json +6 -0
  25. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  26. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  27. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  28. package/ChartsReferenceLine/common.d.ts +1 -1
  29. package/ChartsSurface.js +1 -1
  30. package/ChartsText/ChartsText.js +1 -1
  31. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  32. package/ChartsTooltip/ChartsAxisTooltipContent.js +18 -5
  33. package/ChartsTooltip/ChartsItemTooltipContent.js +20 -4
  34. package/ChartsTooltip/ChartsTooltip.d.ts +2 -2
  35. package/ChartsTooltip/ChartsTooltip.js +3 -3
  36. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -7
  37. package/ChartsTooltip/ChartsTooltipTable.js +8 -9
  38. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -6
  39. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -4
  40. package/ChartsTooltip/utils.js +1 -1
  41. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -1
  42. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  43. package/ChartsXAxis/ChartsXAxis.js +8 -1
  44. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  45. package/ChartsYAxis/ChartsYAxis.js +8 -1
  46. package/Gauge/Gauge.js +2 -2
  47. package/Gauge/GaugeContainer.js +2 -2
  48. package/Gauge/GaugeProvider.d.ts +2 -2
  49. package/Gauge/GaugeProvider.js +2 -2
  50. package/Gauge/GaugeReferenceArc.js +1 -1
  51. package/Gauge/GaugeValueArc.js +1 -1
  52. package/Gauge/GaugeValueText.js +1 -1
  53. package/Gauge/gaugeClasses.d.ts +2 -2
  54. package/Gauge/utils.d.ts +1 -1
  55. package/Gauge/utils.js +4 -4
  56. package/LineChart/AnimatedArea.d.ts +63 -62
  57. package/LineChart/AnimatedArea.js +1 -1
  58. package/LineChart/AnimatedLine.d.ts +63 -62
  59. package/LineChart/AnimatedLine.js +1 -1
  60. package/LineChart/AreaElement.d.ts +1 -1
  61. package/LineChart/AreaElement.js +1 -1
  62. package/LineChart/AreaPlot.js +1 -1
  63. package/LineChart/LineChart.d.ts +5 -3
  64. package/LineChart/LineChart.js +20 -99
  65. package/LineChart/LineElement.d.ts +1 -1
  66. package/LineChart/LineElement.js +1 -1
  67. package/LineChart/LineHighlightElement.js +1 -1
  68. package/LineChart/LineHighlightPlot.js +1 -1
  69. package/LineChart/LinePlot.js +1 -1
  70. package/LineChart/MarkElement.d.ts +1 -1
  71. package/LineChart/MarkElement.js +1 -1
  72. package/LineChart/MarkPlot.js +1 -1
  73. package/PieChart/PieArc.d.ts +2 -1
  74. package/PieChart/PieArc.js +1 -1
  75. package/PieChart/PieArcLabel.d.ts +2 -1
  76. package/PieChart/PieArcLabel.js +2 -2
  77. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  78. package/PieChart/PieArcLabelPlot.js +4 -4
  79. package/PieChart/PieArcPlot.d.ts +1 -1
  80. package/PieChart/PieArcPlot.js +4 -4
  81. package/PieChart/PieChart.d.ts +5 -3
  82. package/PieChart/PieChart.js +23 -99
  83. package/PieChart/PiePlot.js +1 -1
  84. package/PieChart/dataTransform/transition.d.ts +1 -0
  85. package/PieChart/dataTransform/useTransformData.js +1 -1
  86. package/ResponsiveChartContainer/ResponsiveChartContainer.js +3 -1
  87. package/ResponsiveChartContainer/useChartContainerDimensions.js +1 -1
  88. package/ScatterChart/Scatter.js +1 -1
  89. package/ScatterChart/ScatterChart.d.ts +6 -3
  90. package/ScatterChart/ScatterChart.js +74 -125
  91. package/ScatterChart/ScatterPlot.js +9 -2
  92. package/ScatterChart/getColor.d.ts +2 -1
  93. package/ScatterChart/getColor.js +18 -1
  94. package/SparkLineChart/SparkLineChart.js +1 -1
  95. package/context/CartesianContextProvider.d.ts +2 -1
  96. package/context/CartesianContextProvider.js +1 -1
  97. package/context/DrawingProvider.js +1 -1
  98. package/context/HighlightProvider.js +1 -1
  99. package/context/InteractionProvider.js +1 -1
  100. package/context/SeriesContextProvider.js +2 -2
  101. package/context/ZAxisContextProvider.d.ts +33 -0
  102. package/context/ZAxisContextProvider.js +98 -0
  103. package/context/index.d.ts +2 -0
  104. package/context/index.js +8 -1
  105. package/esm/BarChart/BarChart.js +23 -103
  106. package/esm/BarChart/BarElement.js +0 -1
  107. package/esm/BarChart/BarPlot.js +8 -8
  108. package/esm/ChartContainer/ChartContainer.js +3 -2
  109. package/esm/ChartsAxis/ChartsAxis.js +7 -100
  110. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
  111. package/esm/ChartsGrid/ChartsGrid.js +1 -2
  112. package/esm/ChartsLegend/DefaultChartsLegend.js +1 -2
  113. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  114. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  115. package/esm/ChartsOverlay/ChartsOverlay.js +31 -0
  116. package/esm/ChartsOverlay/index.js +3 -0
  117. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  118. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  119. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  120. package/esm/ChartsSurface.js +1 -2
  121. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
  122. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
  123. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  124. package/esm/ChartsTooltip/ChartsTooltipTable.js +8 -8
  125. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
  126. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
  127. package/esm/ChartsXAxis/ChartsXAxis.js +8 -2
  128. package/esm/ChartsYAxis/ChartsYAxis.js +8 -2
  129. package/esm/Gauge/Gauge.js +2 -3
  130. package/esm/Gauge/GaugeContainer.js +1 -1
  131. package/esm/Gauge/GaugeProvider.js +1 -1
  132. package/esm/Gauge/utils.js +4 -4
  133. package/esm/LineChart/AnimatedArea.js +1 -2
  134. package/esm/LineChart/AnimatedLine.js +1 -2
  135. package/esm/LineChart/LineChart.js +20 -100
  136. package/esm/PieChart/PieArcLabel.js +1 -1
  137. package/esm/PieChart/PieArcLabelPlot.js +3 -3
  138. package/esm/PieChart/PieArcPlot.js +3 -3
  139. package/esm/PieChart/PieChart.js +23 -100
  140. package/esm/PieChart/PiePlot.js +1 -2
  141. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  142. package/esm/ScatterChart/ScatterChart.js +74 -126
  143. package/esm/ScatterChart/ScatterPlot.js +8 -1
  144. package/esm/ScatterChart/getColor.js +18 -1
  145. package/esm/SparkLineChart/SparkLineChart.js +1 -2
  146. package/esm/context/SeriesContextProvider.js +1 -1
  147. package/esm/context/ZAxisContextProvider.js +89 -0
  148. package/esm/context/index.js +1 -1
  149. package/esm/hooks/useReducedMotion.js +1 -1
  150. package/esm/hooks/useScale.js +1 -1
  151. package/esm/hooks/useTicks.js +4 -0
  152. package/esm/internals/colorGetter.js +2 -2
  153. package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
  154. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  155. package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
  156. package/esm/internals/utils.js +1 -1
  157. package/esm/models/z-axis.js +1 -0
  158. package/hooks/useAxisEvents.js +1 -1
  159. package/hooks/useChartDimensions.js +1 -1
  160. package/hooks/useChartId.js +1 -1
  161. package/hooks/useDrawingArea.js +1 -1
  162. package/hooks/useInteractionItemProps.js +1 -1
  163. package/hooks/useMounted.js +1 -1
  164. package/hooks/useReducedMotion.d.ts +1 -1
  165. package/hooks/useReducedMotion.js +1 -1
  166. package/hooks/useScale.d.ts +4 -4
  167. package/hooks/useScale.js +2 -2
  168. package/hooks/useSeries.js +1 -1
  169. package/hooks/useSvgRef.js +1 -1
  170. package/hooks/useTicks.js +5 -1
  171. package/index.js +1 -1
  172. package/internals/colorGetter.d.ts +3 -1
  173. package/internals/colorGetter.js +2 -2
  174. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -6
  175. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
  176. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +4 -4
  177. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -1
  178. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -4
  179. package/internals/defaultizeColor.d.ts +1 -0
  180. package/internals/useAnimatedPath.d.ts +1 -0
  181. package/internals/useAnimatedPath.js +1 -1
  182. package/internals/utils.d.ts +1 -1
  183. package/internals/utils.js +1 -1
  184. package/models/axis.d.ts +1 -1
  185. package/models/colorMapping.d.ts +3 -2
  186. package/models/seriesType/bar.d.ts +1 -1
  187. package/models/seriesType/line.d.ts +1 -1
  188. package/models/seriesType/pie.d.ts +9 -4
  189. package/models/seriesType/scatter.d.ts +5 -0
  190. package/models/z-axis.d.ts +14 -0
  191. package/models/z-axis.js +5 -0
  192. package/modern/BarChart/BarChart.js +23 -103
  193. package/modern/BarChart/BarElement.js +0 -1
  194. package/modern/BarChart/BarPlot.js +8 -8
  195. package/modern/ChartContainer/ChartContainer.js +3 -2
  196. package/modern/ChartsAxis/ChartsAxis.js +7 -100
  197. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -2
  198. package/modern/ChartsGrid/ChartsGrid.js +1 -2
  199. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -2
  200. package/modern/ChartsOverlay/ChartsLoadingOverlay.js +34 -0
  201. package/modern/ChartsOverlay/ChartsNoDataOverlay.js +34 -0
  202. package/modern/ChartsOverlay/ChartsOverlay.js +31 -0
  203. package/modern/ChartsOverlay/index.js +3 -0
  204. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  205. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  206. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  207. package/modern/ChartsSurface.js +1 -2
  208. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -4
  209. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +19 -3
  210. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  211. package/modern/ChartsTooltip/ChartsTooltipTable.js +8 -8
  212. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +3 -7
  213. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -5
  214. package/modern/ChartsXAxis/ChartsXAxis.js +8 -2
  215. package/modern/ChartsYAxis/ChartsYAxis.js +8 -2
  216. package/modern/Gauge/Gauge.js +2 -3
  217. package/modern/Gauge/GaugeContainer.js +1 -1
  218. package/modern/Gauge/GaugeProvider.js +1 -1
  219. package/modern/Gauge/utils.js +4 -4
  220. package/modern/LineChart/AnimatedArea.js +1 -2
  221. package/modern/LineChart/AnimatedLine.js +1 -2
  222. package/modern/LineChart/LineChart.js +20 -100
  223. package/modern/PieChart/PieArcLabel.js +1 -1
  224. package/modern/PieChart/PieArcLabelPlot.js +3 -3
  225. package/modern/PieChart/PieArcPlot.js +3 -3
  226. package/modern/PieChart/PieChart.js +23 -100
  227. package/modern/PieChart/PiePlot.js +1 -2
  228. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  229. package/modern/ScatterChart/ScatterChart.js +74 -126
  230. package/modern/ScatterChart/ScatterPlot.js +8 -1
  231. package/modern/ScatterChart/getColor.js +18 -1
  232. package/modern/SparkLineChart/SparkLineChart.js +1 -2
  233. package/modern/context/SeriesContextProvider.js +1 -1
  234. package/modern/context/ZAxisContextProvider.js +89 -0
  235. package/modern/context/index.js +1 -1
  236. package/modern/hooks/useReducedMotion.js +1 -1
  237. package/modern/hooks/useScale.js +1 -1
  238. package/modern/hooks/useTicks.js +4 -0
  239. package/modern/index.js +1 -1
  240. package/modern/internals/colorGetter.js +2 -2
  241. package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +6 -7
  242. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +3 -3
  243. package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +4 -5
  244. package/modern/internals/utils.js +1 -1
  245. package/modern/models/z-axis.js +1 -0
  246. package/package.json +3 -5
@@ -4,8 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { CartesianContext } from '../context/CartesianContextProvider';
5
5
  import { ChartsXAxis } from '../ChartsXAxis';
6
6
  import { ChartsYAxis } from '../ChartsYAxis';
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
8
  const getAxisId = (propsValue, defaultAxisId) => {
10
9
  if (propsValue == null) {
11
10
  return null;
@@ -53,8 +52,8 @@ function ChartsAxis(props) {
53
52
  // TODO: use for plotting line without ticks or any thing
54
53
  // const drawingArea = React.useContext(DrawingContext);
55
54
 
56
- const leftId = getAxisId(leftAxis === undefined ? yAxisIds[0] : leftAxis);
57
- const bottomId = getAxisId(bottomAxis === undefined ? xAxisIds[0] : bottomAxis);
55
+ const leftId = getAxisId(leftAxis === undefined ? yAxisIds[0] : leftAxis, yAxisIds[0]);
56
+ const bottomId = getAxisId(bottomAxis === undefined ? xAxisIds[0] : bottomAxis, xAxisIds[0]);
58
57
  const topId = getAxisId(topAxis, xAxisIds[0]);
59
58
  const rightId = getAxisId(rightAxis, yAxisIds[0]);
60
59
  if (topId !== null && !xAxis[topId]) {
@@ -99,88 +98,19 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
99
98
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
100
99
  * @default xAxisIds[0] The id of the first provided axis
101
100
  */
102
- bottomAxis: PropTypes.oneOfType([PropTypes.shape({
103
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
104
- classes: PropTypes.object,
105
- disableLine: PropTypes.bool,
106
- disableTicks: PropTypes.bool,
107
- fill: PropTypes.string,
108
- label: PropTypes.string,
109
- labelFontSize: PropTypes.number,
110
- labelStyle: PropTypes.object,
111
- position: PropTypes.oneOf(['bottom', 'top']),
112
- slotProps: PropTypes.object,
113
- slots: PropTypes.object,
114
- stroke: PropTypes.string,
115
- tickFontSize: PropTypes.number,
116
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
117
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
118
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
119
- tickLabelStyle: PropTypes.object,
120
- tickMaxStep: PropTypes.number,
121
- tickMinStep: PropTypes.number,
122
- tickNumber: PropTypes.number,
123
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
124
- tickSize: PropTypes.number
125
- }), PropTypes.string]),
101
+ bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
126
102
  /**
127
103
  * Indicate which axis to display the left of the charts.
128
104
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
129
105
  * @default yAxisIds[0] The id of the first provided axis
130
106
  */
131
- leftAxis: PropTypes.oneOfType([PropTypes.shape({
132
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
133
- classes: PropTypes.object,
134
- disableLine: PropTypes.bool,
135
- disableTicks: PropTypes.bool,
136
- fill: PropTypes.string,
137
- label: PropTypes.string,
138
- labelFontSize: PropTypes.number,
139
- labelStyle: PropTypes.object,
140
- position: PropTypes.oneOf(['left', 'right']),
141
- slotProps: PropTypes.object,
142
- slots: PropTypes.object,
143
- stroke: PropTypes.string,
144
- tickFontSize: PropTypes.number,
145
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
146
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
147
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
148
- tickLabelStyle: PropTypes.object,
149
- tickMaxStep: PropTypes.number,
150
- tickMinStep: PropTypes.number,
151
- tickNumber: PropTypes.number,
152
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
153
- tickSize: PropTypes.number
154
- }), PropTypes.string]),
107
+ leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
155
108
  /**
156
109
  * Indicate which axis to display the right of the charts.
157
110
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
158
111
  * @default null
159
112
  */
160
- rightAxis: PropTypes.oneOfType([PropTypes.shape({
161
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
162
- classes: PropTypes.object,
163
- disableLine: PropTypes.bool,
164
- disableTicks: PropTypes.bool,
165
- fill: PropTypes.string,
166
- label: PropTypes.string,
167
- labelFontSize: PropTypes.number,
168
- labelStyle: PropTypes.object,
169
- position: PropTypes.oneOf(['left', 'right']),
170
- slotProps: PropTypes.object,
171
- slots: PropTypes.object,
172
- stroke: PropTypes.string,
173
- tickFontSize: PropTypes.number,
174
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
175
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
176
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
177
- tickLabelStyle: PropTypes.object,
178
- tickMaxStep: PropTypes.number,
179
- tickMinStep: PropTypes.number,
180
- tickNumber: PropTypes.number,
181
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
182
- tickSize: PropTypes.number
183
- }), PropTypes.string]),
113
+ rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
184
114
  /**
185
115
  * The props used for each component slot.
186
116
  * @default {}
@@ -196,29 +126,6 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
196
126
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
197
127
  * @default null
198
128
  */
199
- topAxis: PropTypes.oneOfType([PropTypes.shape({
200
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
201
- classes: PropTypes.object,
202
- disableLine: PropTypes.bool,
203
- disableTicks: PropTypes.bool,
204
- fill: PropTypes.string,
205
- label: PropTypes.string,
206
- labelFontSize: PropTypes.number,
207
- labelStyle: PropTypes.object,
208
- position: PropTypes.oneOf(['bottom', 'top']),
209
- slotProps: PropTypes.object,
210
- slots: PropTypes.object,
211
- stroke: PropTypes.string,
212
- tickFontSize: PropTypes.number,
213
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
214
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
215
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
216
- tickLabelStyle: PropTypes.object,
217
- tickMaxStep: PropTypes.number,
218
- tickMinStep: PropTypes.number,
219
- tickNumber: PropTypes.number,
220
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
221
- tickSize: PropTypes.number
222
- }), PropTypes.string])
129
+ topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
223
130
  } : void 0;
224
131
  export { ChartsAxis };
@@ -9,8 +9,7 @@ import { InteractionContext } from '../context/InteractionProvider';
9
9
  import { CartesianContext } from '../context/CartesianContextProvider';
10
10
  import { getValueToPositionMapper } from '../hooks/useScale';
11
11
  import { isBandScale } from '../internals/isBandScale';
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
13
  export function getAxisHighlightUtilityClass(slot) {
15
14
  return generateUtilityClass('MuiChartsAxisHighlight', slot);
16
15
  }
@@ -8,8 +8,7 @@ import { styled } from '@mui/material/styles';
8
8
  import { CartesianContext } from '../context/CartesianContextProvider';
9
9
  import { useTicks } from '../hooks/useTicks';
10
10
  import { getChartsGridUtilityClass, chartsGridClasses } from './chartsGridClasses';
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
12
  const GridRoot = styled('g', {
14
13
  name: 'MuiChartsGrid',
15
14
  slot: 'Root',
@@ -8,8 +8,7 @@ import { NoSsr } from '@mui/base/NoSsr';
8
8
  import { useTheme, styled } from '@mui/material/styles';
9
9
  import { ChartsText } from '../ChartsText';
10
10
  import { getWordsByLines } from '../internals/getWordsByLines';
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
12
  export const ChartsLegendRoot = styled('g', {
14
13
  name: 'MuiChartsLegend',
15
14
  slot: 'Root',
@@ -0,0 +1,34 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["message"];
4
+ import * as React from 'react';
5
+ import { styled } from '@mui/material/styles';
6
+ import { useDrawingArea } from '../hooks/useDrawingArea';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const StyledText = styled('text')(({
9
+ theme
10
+ }) => ({
11
+ stroke: 'none',
12
+ fill: theme.palette.text.primary,
13
+ shapeRendering: 'crispEdges',
14
+ textAnchor: 'middle',
15
+ dominantBaseline: 'middle'
16
+ }));
17
+ export function ChartsLoadingOverlay(props) {
18
+ const {
19
+ message
20
+ } = props,
21
+ other = _objectWithoutPropertiesLoose(props, _excluded);
22
+ const {
23
+ top,
24
+ left,
25
+ height,
26
+ width
27
+ } = useDrawingArea();
28
+ return /*#__PURE__*/_jsx(StyledText, _extends({
29
+ x: left + width / 2,
30
+ y: top + height / 2
31
+ }, other, {
32
+ children: message ?? 'Loading data ...'
33
+ }));
34
+ }
@@ -0,0 +1,34 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["message"];
4
+ import * as React from 'react';
5
+ import { styled } from '@mui/material/styles';
6
+ import { useDrawingArea } from '../hooks/useDrawingArea';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const StyledText = styled('text')(({
9
+ theme
10
+ }) => ({
11
+ stroke: 'none',
12
+ fill: theme.palette.text.primary,
13
+ shapeRendering: 'crispEdges',
14
+ textAnchor: 'middle',
15
+ dominantBaseline: 'middle'
16
+ }));
17
+ export function ChartsNoDataOverlay(props) {
18
+ const {
19
+ message
20
+ } = props,
21
+ other = _objectWithoutPropertiesLoose(props, _excluded);
22
+ const {
23
+ top,
24
+ left,
25
+ height,
26
+ width
27
+ } = useDrawingArea();
28
+ return /*#__PURE__*/_jsx(StyledText, _extends({
29
+ x: left + width / 2,
30
+ y: top + height / 2
31
+ }, other, {
32
+ children: message ?? 'No data to display'
33
+ }));
34
+ }
@@ -0,0 +1,31 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import { ChartsLoadingOverlay } from './ChartsLoadingOverlay';
4
+ import { useSeries } from '../hooks/useSeries';
5
+ import { ChartsNoDataOverlay } from './ChartsNoDataOverlay';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export function useNoData() {
8
+ const seriesPerType = useSeries();
9
+ return Object.values(seriesPerType).every(seriesOfGivenType => {
10
+ if (!seriesOfGivenType) {
11
+ return true;
12
+ }
13
+ const {
14
+ series,
15
+ seriesOrder
16
+ } = seriesOfGivenType;
17
+ return seriesOrder.every(seriesId => series[seriesId].data.length === 0);
18
+ });
19
+ }
20
+ export function ChartsOverlay(props) {
21
+ const noData = useNoData();
22
+ if (props.loading) {
23
+ const LoadingOverlay = props.slots?.loadingOverlay ?? ChartsLoadingOverlay;
24
+ return /*#__PURE__*/_jsx(LoadingOverlay, _extends({}, props.slotProps?.loadingOverlay));
25
+ }
26
+ if (noData) {
27
+ const NoDataOverlay = props.slots?.noDataOverlay ?? ChartsNoDataOverlay;
28
+ return /*#__PURE__*/_jsx(NoDataOverlay, _extends({}, props.slotProps?.noDataOverlay));
29
+ }
30
+ return null;
31
+ }
@@ -0,0 +1,3 @@
1
+ export { ChartsOverlay } from './ChartsOverlay';
2
+ export { ChartsLoadingOverlay } from './ChartsLoadingOverlay';
3
+ export { ChartsNoDataOverlay } from './ChartsNoDataOverlay';
@@ -52,7 +52,7 @@ process.env.NODE_ENV !== "production" ? ChartsReferenceLine.propTypes = {
52
52
  */
53
53
  lineStyle: PropTypes.object,
54
54
  /**
55
- * Additional space arround the label in px.
55
+ * Additional space around the label in px.
56
56
  * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
57
57
  * @default 5
58
58
  */
@@ -5,8 +5,7 @@ import { useDrawingArea, useXScale } from '../hooks';
5
5
  import { ReferenceLineRoot } from './common';
6
6
  import { ChartsText } from '../ChartsText';
7
7
  import { getReferenceLineUtilityClass } from './chartsReferenceLineClasses';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const getTextParams = ({
11
10
  top,
12
11
  height,
@@ -5,8 +5,7 @@ import { useDrawingArea, useYScale } from '../hooks';
5
5
  import { ReferenceLineRoot } from './common';
6
6
  import { ChartsText } from '../ChartsText';
7
7
  import { getReferenceLineUtilityClass } from './chartsReferenceLineClasses';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const getTextParams = ({
11
10
  left,
12
11
  width,
@@ -5,8 +5,7 @@ import { styled } from '@mui/material/styles';
5
5
  import PropTypes from 'prop-types';
6
6
  import * as React from 'react';
7
7
  import { useAxisEvents } from './hooks/useAxisEvents';
8
- import { jsx as _jsx } from "react/jsx-runtime";
9
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
9
  const ChartChartsSurfaceStyles = styled('svg', {
11
10
  name: 'MuiChartsSurface',
12
11
  slot: 'Root'
@@ -7,6 +7,7 @@ import { CartesianContext } from '../context/CartesianContextProvider';
7
7
  import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
8
8
  import { isCartesianSeriesType } from './utils';
9
9
  import colorGetter from '../internals/colorGetter';
10
+ import { ZAxisContext } from '../context/ZAxisContextProvider';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  function ChartsAxisTooltipContent(props) {
12
13
  const {
@@ -25,6 +26,10 @@ function ChartsAxisTooltipContent(props) {
25
26
  yAxisIds,
26
27
  yAxis
27
28
  } = React.useContext(CartesianContext);
29
+ const {
30
+ zAxisIds,
31
+ zAxis
32
+ } = React.useContext(ZAxisContext);
28
33
  const series = React.useContext(SeriesContext);
29
34
  const USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
30
35
  const relevantSeries = React.useMemo(() => {
@@ -35,15 +40,23 @@ function ChartsAxisTooltipContent(props) {
35
40
  const axisKey = isXaxis ? item.xAxisKey : item.yAxisKey;
36
41
  if (axisKey === undefined || axisKey === USED_AXIS_ID) {
37
42
  const seriesToAdd = series[seriesType].series[seriesId];
38
- const color = colorGetter(seriesToAdd, xAxis[seriesToAdd.xAxisKey ?? xAxisIds[0]], yAxis[seriesToAdd.yAxisKey ?? yAxisIds[0]]);
43
+ let getColor;
44
+ switch (seriesToAdd.type) {
45
+ case 'scatter':
46
+ getColor = colorGetter(seriesToAdd, xAxis[seriesToAdd.xAxisKey ?? xAxisIds[0]], yAxis[seriesToAdd.yAxisKey ?? yAxisIds[0]], zAxis[seriesToAdd.zAxisKey ?? zAxisIds[0]]);
47
+ break;
48
+ default:
49
+ getColor = colorGetter(seriesToAdd, xAxis[seriesToAdd.xAxisKey ?? xAxisIds[0]], yAxis[seriesToAdd.yAxisKey ?? yAxisIds[0]]);
50
+ break;
51
+ }
39
52
  rep.push(_extends({}, seriesToAdd, {
40
- getColor: color
53
+ getColor
41
54
  }));
42
55
  }
43
56
  });
44
57
  });
45
58
  return rep;
46
- }, [USED_AXIS_ID, isXaxis, series, xAxis, xAxisIds, yAxis, yAxisIds]);
59
+ }, [USED_AXIS_ID, isXaxis, series, xAxis, xAxisIds, yAxis, yAxisIds, zAxis, zAxisIds]);
47
60
  const relevantAxis = React.useMemo(() => {
48
61
  return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
49
62
  }, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
@@ -93,7 +106,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxisTooltipContent.propTypes = {
93
106
  value: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired
94
107
  })
95
108
  }),
96
- axisValue: PropTypes.any,
109
+ axisValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
97
110
  classes: PropTypes.object,
98
111
  dataIndex: PropTypes.number,
99
112
  series: PropTypes.arrayOf(PropTypes.object),
@@ -6,6 +6,7 @@ import { SeriesContext } from '../context/SeriesContextProvider';
6
6
  import { DefaultChartsItemTooltipContent } from './DefaultChartsItemTooltipContent';
7
7
  import { CartesianContext } from '../context/CartesianContextProvider';
8
8
  import colorGetter from '../internals/colorGetter';
9
+ import { ZAxisContext } from '../context/ZAxisContextProvider';
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  function ChartsItemTooltipContent(props) {
11
12
  const {
@@ -16,16 +17,31 @@ function ChartsItemTooltipContent(props) {
16
17
  contentProps
17
18
  } = props;
18
19
  const series = React.useContext(SeriesContext)[itemData.type].series[itemData.seriesId];
19
- const axisData = React.useContext(CartesianContext);
20
20
  const {
21
21
  xAxis,
22
22
  yAxis,
23
23
  xAxisIds,
24
24
  yAxisIds
25
- } = axisData;
25
+ } = React.useContext(CartesianContext);
26
+ const {
27
+ zAxis,
28
+ zAxisIds
29
+ } = React.useContext(ZAxisContext);
26
30
  const defaultXAxisId = xAxisIds[0];
27
31
  const defaultYAxisId = yAxisIds[0];
28
- const getColor = series.type === 'pie' ? colorGetter(series) : colorGetter(series, xAxis[series.xAxisKey ?? defaultXAxisId], yAxis[series.yAxisKey ?? defaultYAxisId]);
32
+ const defaultZAxisId = zAxisIds[0];
33
+ let getColor;
34
+ switch (series.type) {
35
+ case 'pie':
36
+ getColor = colorGetter(series);
37
+ break;
38
+ case 'scatter':
39
+ getColor = colorGetter(series, xAxis[series.xAxisKey ?? defaultXAxisId], yAxis[series.yAxisKey ?? defaultYAxisId], zAxis[series.zAxisKey ?? defaultZAxisId]);
40
+ break;
41
+ default:
42
+ getColor = colorGetter(series, xAxis[series.xAxisKey ?? defaultXAxisId], yAxis[series.yAxisKey ?? defaultYAxisId]);
43
+ break;
44
+ }
29
45
  const Content = content ?? DefaultChartsItemTooltipContent;
30
46
  const chartTooltipContentProps = useSlotProps({
31
47
  elementType: Content,
@@ -113,7 +113,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
113
113
  // | To update them edit the TypeScript types and run "yarn proptypes" |
114
114
  // ----------------------------------------------------------------------
115
115
  /**
116
- * Component to override the tooltip content when triger is set to 'axis'.
116
+ * Component to override the tooltip content when trigger is set to 'axis'.
117
117
  * @deprecated Use slots.axisContent instead
118
118
  */
119
119
  axisContent: PropTypes.elementType,
@@ -122,7 +122,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
122
122
  */
123
123
  classes: PropTypes.object,
124
124
  /**
125
- * Component to override the tooltip content when triger is set to 'item'.
125
+ * Component to override the tooltip content when trigger is set to 'item'.
126
126
  * @deprecated Use slots.itemContent instead
127
127
  */
128
128
  itemContent: PropTypes.elementType,
@@ -1,5 +1,5 @@
1
- import Box from '@mui/system/Box';
2
1
  import { styled } from '@mui/material/styles';
2
+ import { shouldForwardProp } from '@mui/system';
3
3
  import { chartsTooltipClasses } from './chartsTooltipClasses';
4
4
  export const ChartsTooltipPaper = styled('div', {
5
5
  name: 'MuiChartsTooltip',
@@ -7,10 +7,10 @@ export const ChartsTooltipPaper = styled('div', {
7
7
  })(({
8
8
  theme
9
9
  }) => ({
10
+ boxShadow: theme.shadows[1],
10
11
  backgroundColor: (theme.vars || theme).palette.background.paper,
11
12
  color: (theme.vars || theme).palette.text.primary,
12
13
  transition: theme.transitions.create('box-shadow'),
13
- border: `1px solid ${(theme.vars || theme).palette.divider}`,
14
14
  borderRadius: theme.shape.borderRadius
15
15
  }));
16
16
  export const ChartsTooltipTable = styled('table', {
@@ -59,19 +59,19 @@ export const ChartsTooltipCell = styled('td', {
59
59
  paddingRight: theme.spacing(2)
60
60
  }
61
61
  }));
62
-
63
- // eslint-disable-next-line material-ui/no-styled-box
64
- export const ChartsTooltipMark = styled(Box, {
62
+ export const ChartsTooltipMark = styled('div', {
65
63
  name: 'MuiChartsTooltip',
66
- slot: 'Mark'
64
+ slot: 'Mark',
65
+ shouldForwardProp: prop => shouldForwardProp(prop) && prop !== 'color'
67
66
  })(({
68
67
  theme,
69
- ownerState
68
+ color
70
69
  }) => ({
71
70
  width: theme.spacing(1),
72
71
  height: theme.spacing(1),
73
72
  borderRadius: '50%',
74
- backgroundColor: ownerState.color,
73
+ boxShadow: theme.shadows[1],
74
+ backgroundColor: color,
75
75
  borderColor: (theme.vars || theme).palette.background.paper,
76
76
  border: `solid ${(theme.vars || theme).palette.background.paper} ${theme.spacing(0.25)}`,
77
77
  boxSizing: 'content-box'
@@ -4,8 +4,7 @@ import clsx from 'clsx';
4
4
  import Typography from '@mui/material/Typography';
5
5
  import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from './ChartsTooltipTable';
6
6
  import { isCartesianSeries, utcFormatter } from './utils';
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
8
  function DefaultChartsAxisTooltipContent(props) {
10
9
  const {
11
10
  series,
@@ -56,10 +55,7 @@ function DefaultChartsAxisTooltipContent(props) {
56
55
  children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
57
56
  className: clsx(classes.markCell, classes.cell),
58
57
  children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
59
- ownerState: {
60
- color: getColor(dataIndex) ?? color
61
- },
62
- boxShadow: 1,
58
+ color: getColor(dataIndex) ?? color,
63
59
  className: classes.mark
64
60
  })
65
61
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
@@ -104,7 +100,7 @@ process.env.NODE_ENV !== "production" ? DefaultChartsAxisTooltipContent.propType
104
100
  /**
105
101
  * The value associated to the current mouse position.
106
102
  */
107
- axisValue: PropTypes.any.isRequired,
103
+ axisValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
108
104
  /**
109
105
  * Override or extend the styles applied to the component.
110
106
  */
@@ -2,8 +2,7 @@ import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import clsx from 'clsx';
4
4
  import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
6
  function DefaultChartsItemTooltipContent(props) {
8
7
  const {
9
8
  series,
@@ -40,9 +39,7 @@ function DefaultChartsItemTooltipContent(props) {
40
39
  children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
41
40
  className: clsx(classes.markCell, classes.cell),
42
41
  children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
43
- ownerState: {
44
- color
45
- },
42
+ color: color,
46
43
  className: classes.mark
47
44
  })
48
45
  }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
@@ -15,8 +15,7 @@ import { getMinXTranslation } from '../internals/geometry';
15
15
  import { useMounted } from '../hooks/useMounted';
16
16
  import { useDrawingArea } from '../hooks/useDrawingArea';
17
17
  import { getWordsByLines } from '../internals/getWordsByLines';
18
- import { jsx as _jsx } from "react/jsx-runtime";
19
- import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
19
  const useUtilityClasses = ownerState => {
21
20
  const {
22
21
  classes,
@@ -204,6 +203,13 @@ function ChartsXAxis(inProps) {
204
203
  },
205
204
  ownerState: {}
206
205
  });
206
+ const domain = xScale.domain();
207
+ if (domain.length === 0 || domain[0] === domain[1]) {
208
+ // Skip axis rendering if
209
+ // - the data is empty (for band and point axis)
210
+ // - No data is associated to the axis (other scale types)
211
+ return null;
212
+ }
207
213
  return /*#__PURE__*/_jsxs(AxisRoot, {
208
214
  transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
209
215
  className: classes.root,
@@ -12,8 +12,7 @@ import { useDrawingArea } from '../hooks/useDrawingArea';
12
12
  import { AxisRoot } from '../internals/components/AxisSharedComponents';
13
13
  import { ChartsText } from '../ChartsText';
14
14
  import { getAxisUtilityClass } from '../ChartsAxis/axisClasses';
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
16
  const useUtilityClasses = ownerState => {
18
17
  const {
19
18
  classes,
@@ -139,6 +138,13 @@ function ChartsYAxis(inProps) {
139
138
  },
140
139
  ownerState: {}
141
140
  });
141
+ const domain = yScale.domain();
142
+ if (domain.length === 0 || domain[0] === domain[1]) {
143
+ // Skip axis rendering if
144
+ // - the data is empty (for band and point axis)
145
+ // - No data is associated to the axis (other scale types)
146
+ return null;
147
+ }
142
148
  return /*#__PURE__*/_jsxs(AxisRoot, {
143
149
  transform: `translate(${position === 'right' ? left + width : left}, 0)`,
144
150
  className: classes.root,
@@ -9,8 +9,7 @@ import { GaugeValueArc } from './GaugeValueArc';
9
9
  import { GaugeReferenceArc } from './GaugeReferenceArc';
10
10
  import { getGaugeUtilityClass } from './gaugeClasses';
11
11
  import { GaugeValueText } from './GaugeValueText';
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
13
  const useUtilityClasses = props => {
15
14
  const {
16
15
  classes
@@ -85,7 +84,7 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
85
84
  */
86
85
  height: PropTypes.number,
87
86
  /**
88
- * The radius between circle center and the begining of the arc.
87
+ * The radius between circle center and the beginning of the arc.
89
88
  * Can be a number (in px) or a string with a percentage such as '50%'.
90
89
  * The '100%' is the maximal radius that fit into the drawing area.
91
90
  * @default '80%'
@@ -145,7 +145,7 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
145
145
  */
146
146
  height: PropTypes.number,
147
147
  /**
148
- * The radius between circle center and the begining of the arc.
148
+ * The radius between circle center and the beginning of the arc.
149
149
  * Can be a number (in px) or a string with a percentage such as '50%'.
150
150
  * The '100%' is the maximal radius that fit into the drawing area.
151
151
  * @default '80%'
@@ -48,7 +48,7 @@ export function GaugeProvider(props) {
48
48
  let cy = top + innerCy;
49
49
  const maxRadius = getAvailableRadius(innerCx, innerCy, width, height, ratios);
50
50
 
51
- // If the center is not defined, after computation of the available radius, udpate the center to use the remaining space.
51
+ // If the center is not defined, after computation of the available radius, update the center to use the remaining space.
52
52
  if (cxParam === undefined) {
53
53
  const usedWidth = maxRadius * (ratios.maxX - ratios.minX);
54
54
  cx = left + (width - usedWidth) / 2 + ratios.cx * usedWidth;
@@ -7,7 +7,7 @@ function getPoint(angle) {
7
7
  }
8
8
 
9
9
  /**
10
- * Retruns the ratio of the arc bounding box and its center.
10
+ * Returns the ratio of the arc bounding box and its center.
11
11
  * @param startAngle The start angle (in deg)
12
12
  * @param endAngle The end angle (in deg)
13
13
  */
@@ -20,9 +20,9 @@ export function getArcRatios(startAngle, endAngle) {
20
20
  const maxAngle = Math.max(startAngle, endAngle);
21
21
  const initialAngle = Math.floor(minAngle / 90) * 90;
22
22
  for (let step = 1; step <= 4; step += 1) {
23
- const cartinalAngle = initialAngle + step * 90;
24
- if (cartinalAngle < maxAngle) {
25
- points.push(getPoint(cartinalAngle));
23
+ const cardinalAngle = initialAngle + step * 90;
24
+ if (cardinalAngle < maxAngle) {
25
+ points.push(getPoint(cardinalAngle));
26
26
  }
27
27
  }
28
28
  const minX = Math.min(...points.map(([x]) => x));