@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
@@ -1,3 +1,4 @@
1
1
  import { AxisDefaultized } from '../models/axis';
2
+ import { ZAxisDefaultized } from '../models/z-axis';
2
3
  import { DefaultizedScatterSeriesType } from '../models/seriesType/scatter';
3
- export default function getColor(series: DefaultizedScatterSeriesType, xAxis: AxisDefaultized, yAxis: AxisDefaultized): (dataIndex: number) => string;
4
+ export default function getColor(series: DefaultizedScatterSeriesType, xAxis: AxisDefaultized, yAxis: AxisDefaultized, zAxis?: ZAxisDefaultized): (dataIndex: number) => string;
@@ -4,9 +4,26 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getColor;
7
- function getColor(series, xAxis, yAxis) {
7
+ function getColor(series, xAxis, yAxis, zAxis) {
8
+ const zColorScale = zAxis?.colorScale;
8
9
  const yColorScale = yAxis.colorScale;
9
10
  const xColorScale = xAxis.colorScale;
11
+ if (zColorScale) {
12
+ return dataIndex => {
13
+ if (zAxis?.data?.[dataIndex] !== undefined) {
14
+ const color = zColorScale(zAxis?.data?.[dataIndex]);
15
+ if (color !== null) {
16
+ return color;
17
+ }
18
+ }
19
+ const value = series.data[dataIndex];
20
+ const color = value === null ? series.color : zColorScale(value.z);
21
+ if (color === null) {
22
+ return series.color;
23
+ }
24
+ return color;
25
+ };
26
+ }
10
27
  if (yColorScale) {
11
28
  return dataIndex => {
12
29
  const value = series.data[dataIndex];
@@ -16,7 +16,7 @@ var _ChartsTooltip = require("../ChartsTooltip");
16
16
  var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  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); }
19
- 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 && Object.prototype.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; }
19
+ 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; }
20
20
  const SPARKLINE_DEFAULT_MARGIN = {
21
21
  top: 5,
22
22
  bottom: 5,
@@ -1,17 +1,18 @@
1
1
  import * as React from 'react';
2
2
  import { AxisConfig, AxisDefaultized } from '../models/axis';
3
- import { DEFAULT_X_AXIS_KEY } from '../constants';
4
3
  import { DatasetType } from '../models/seriesType/config';
5
4
  import { MakeOptional } from '../models/helpers';
6
5
  export type CartesianContextProviderProps = {
7
6
  /**
8
7
  * The configuration of the x-axes.
9
8
  * If not provided, a default axis config is used.
9
+ * An array of [[AxisConfig]] objects.
10
10
  */
11
11
  xAxis?: MakeOptional<AxisConfig, 'id'>[];
12
12
  /**
13
13
  * The configuration of the y-axes.
14
14
  * If not provided, a default axis config is used.
15
+ * An array of [[AxisConfig]] objects.
15
16
  */
16
17
  yAxis?: MakeOptional<AxisConfig, 'id'>[];
17
18
  /**
@@ -21,7 +21,7 @@ var _useDrawingArea = require("../hooks/useDrawingArea");
21
21
  var _colorScale = require("../internals/colorScale");
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
  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
- 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 && Object.prototype.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; }
24
+ 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; }
25
25
  const DEFAULT_CATEGORY_GAP_RATIO = 0.2;
26
26
  const DEFAULT_BAR_GAP_RATIO = 0.1;
27
27
 
@@ -13,7 +13,7 @@ var _useId = _interopRequireDefault(require("@mui/utils/useId"));
13
13
  var _useChartDimensions = _interopRequireDefault(require("../hooks/useChartDimensions"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
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 && Object.prototype.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; }
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
17
  /**
18
18
  * Defines the area in which it is possible to draw the charts.
19
19
  */
@@ -10,7 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  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); }
13
- 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 && Object.prototype.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; }
13
+ 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; }
14
14
  const defaultScope = {
15
15
  highlighted: 'none',
16
16
  faded: 'none'
@@ -10,7 +10,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  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); }
13
- 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 && Object.prototype.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; }
13
+ 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; }
14
14
  const InteractionContext = exports.InteractionContext = /*#__PURE__*/React.createContext({
15
15
  item: null,
16
16
  axis: {
@@ -17,7 +17,7 @@ var _defaultizeColor = require("../internals/defaultizeColor");
17
17
  var _colorPalettes = require("../colorPalettes");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  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); }
20
- 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 && Object.prototype.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; }
20
+ 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; }
21
21
  const SeriesContext = exports.SeriesContext = /*#__PURE__*/React.createContext({});
22
22
  if (process.env.NODE_ENV !== 'production') {
23
23
  SeriesContext.displayName = 'SeriesContext';
@@ -60,7 +60,7 @@ const formatSeries = (series, colors, dataset) => {
60
60
  seriesGroups[type].seriesOrder.push(id);
61
61
  });
62
62
  const formattedSeries = {};
63
- // Apply formater on a type group
63
+ // Apply formatter on a type group
64
64
  Object.keys(seriesTypeFormatter).forEach(type => {
65
65
  if (seriesGroups[type] !== undefined) {
66
66
  formattedSeries[type] = seriesTypeFormatter[type]?.(seriesGroups[type], dataset) ?? seriesGroups[type];
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import { DatasetType } from '../models/seriesType/config';
3
+ import { MakeOptional } from '../models/helpers';
4
+ import { ZAxisConfig, ZAxisDefaultized } from '../models/z-axis';
5
+ export type ZAxisContextProviderProps = {
6
+ /**
7
+ * The configuration of the z-axes.
8
+ */
9
+ zAxis?: MakeOptional<ZAxisConfig, 'id'>[];
10
+ /**
11
+ * An array of objects that can be used to populate series and axes data using their `dataKey` property.
12
+ */
13
+ dataset?: DatasetType;
14
+ children: React.ReactNode;
15
+ };
16
+ type DefaultizedZAxisConfig = {
17
+ [axisKey: string]: ZAxisDefaultized;
18
+ };
19
+ export declare const ZAxisContext: React.Context<{
20
+ /**
21
+ * Mapping from z-axis key to scaling configuration.
22
+ */
23
+ zAxis: DefaultizedZAxisConfig;
24
+ /**
25
+ * The z-axes IDs sorted by order they got provided.
26
+ */
27
+ zAxisIds: string[];
28
+ }>;
29
+ declare function ZAxisContextProvider(props: ZAxisContextProviderProps): React.JSX.Element;
30
+ declare namespace ZAxisContextProvider {
31
+ var propTypes: any;
32
+ }
33
+ export { ZAxisContextProvider };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ZAxisContext = void 0;
8
+ exports.ZAxisContextProvider = ZAxisContextProvider;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _colorScale = require("../internals/colorScale");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ 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); }
15
+ 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; }
16
+ const ZAxisContext = exports.ZAxisContext = /*#__PURE__*/React.createContext({
17
+ zAxis: {},
18
+ zAxisIds: []
19
+ });
20
+ if (process.env.NODE_ENV !== 'production') {
21
+ ZAxisContext.displayName = 'ZAxisContext';
22
+ }
23
+ function ZAxisContextProvider(props) {
24
+ const {
25
+ zAxis: inZAxis,
26
+ dataset,
27
+ children
28
+ } = props;
29
+ const zAxis = React.useMemo(() => inZAxis?.map(axisConfig => {
30
+ const dataKey = axisConfig.dataKey;
31
+ if (dataKey === undefined || axisConfig.data !== undefined) {
32
+ return axisConfig;
33
+ }
34
+ if (dataset === undefined) {
35
+ throw Error('MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.');
36
+ }
37
+ return (0, _extends2.default)({}, axisConfig, {
38
+ data: dataset.map(d => d[dataKey])
39
+ });
40
+ }), [inZAxis, dataset]);
41
+ const value = React.useMemo(() => {
42
+ const allZAxis = zAxis?.map((axis, index) => (0, _extends2.default)({
43
+ id: `defaultized-z-axis-${index}`
44
+ }, axis)) ?? [];
45
+ const completedZAxis = {};
46
+ allZAxis.forEach(axis => {
47
+ completedZAxis[axis.id] = (0, _extends2.default)({}, axis, {
48
+ colorScale: axis.colorMap && (axis.colorMap.type === 'ordinal' && axis.data ? (0, _colorScale.getOrdinalColorScale)((0, _extends2.default)({
49
+ values: axis.data
50
+ }, axis.colorMap)) : (0, _colorScale.getColorScale)(axis.colorMap))
51
+ });
52
+ });
53
+ return {
54
+ zAxis: completedZAxis,
55
+ zAxisIds: allZAxis.map(({
56
+ id
57
+ }) => id)
58
+ };
59
+ }, [zAxis]);
60
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ZAxisContext.Provider, {
61
+ value: value,
62
+ children: children
63
+ });
64
+ }
65
+ process.env.NODE_ENV !== "production" ? ZAxisContextProvider.propTypes = {
66
+ // ----------------------------- Warning --------------------------------
67
+ // | These PropTypes are generated from the TypeScript type definitions |
68
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
69
+ // ----------------------------------------------------------------------
70
+ children: _propTypes.default.node,
71
+ /**
72
+ * An array of objects that can be used to populate series and axes data using their `dataKey` property.
73
+ */
74
+ dataset: _propTypes.default.arrayOf(_propTypes.default.object),
75
+ /**
76
+ * The configuration of the z-axes.
77
+ */
78
+ zAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
79
+ colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
80
+ color: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func]).isRequired,
81
+ max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
82
+ min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
83
+ type: _propTypes.default.oneOf(['continuous']).isRequired
84
+ }), _propTypes.default.shape({
85
+ colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
86
+ thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
87
+ type: _propTypes.default.oneOf(['piecewise']).isRequired
88
+ }), _propTypes.default.shape({
89
+ colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
90
+ type: _propTypes.default.oneOf(['ordinal']).isRequired,
91
+ unknownColor: _propTypes.default.string,
92
+ values: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired)
93
+ })]),
94
+ data: _propTypes.default.array,
95
+ dataKey: _propTypes.default.string,
96
+ id: _propTypes.default.string
97
+ }))
98
+ } : void 0;
@@ -1 +1,3 @@
1
1
  export type { HighlightOptions, FadeOptions, HighlightScope } from './HighlightProvider';
2
+ export { ZAxisContextProvider } from './ZAxisContextProvider';
3
+ export type { ZAxisContextProviderProps } from './ZAxisContextProvider';
package/context/index.js CHANGED
@@ -2,4 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+ Object.defineProperty(exports, "ZAxisContextProvider", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _ZAxisContextProvider.ZAxisContextProvider;
10
+ }
11
+ });
12
+ var _ZAxisContextProvider = require("./ZAxisContextProvider");
@@ -12,8 +12,8 @@ import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
12
12
  import { ChartsClipPath } from '../ChartsClipPath';
13
13
  import { ChartsGrid } from '../ChartsGrid';
14
14
  import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ import { ChartsOverlay } from '../ChartsOverlay/ChartsOverlay';
16
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  /**
18
18
  * Demos:
19
19
  *
@@ -50,7 +50,8 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
50
50
  onAxisClick,
51
51
  children,
52
52
  slots,
53
- slotProps
53
+ slotProps,
54
+ loading
54
55
  } = props;
55
56
  const id = useId();
56
57
  const clipPathId = `${id}-clip-path`;
@@ -91,14 +92,18 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
91
92
  }), grid && /*#__PURE__*/_jsx(ChartsGrid, {
92
93
  vertical: grid.vertical,
93
94
  horizontal: grid.horizontal
94
- }), /*#__PURE__*/_jsx("g", {
95
+ }), /*#__PURE__*/_jsxs("g", {
95
96
  clipPath: `url(#${clipPathId})`,
96
- children: /*#__PURE__*/_jsx(BarPlot, {
97
+ children: [/*#__PURE__*/_jsx(BarPlot, {
97
98
  slots: slots,
98
99
  slotProps: slotProps,
99
100
  skipAnimation: skipAnimation,
100
101
  onItemClick: onItemClick
101
- })
102
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
103
+ loading: loading,
104
+ slots: slots,
105
+ slotProps: slotProps
106
+ })]
102
107
  }), /*#__PURE__*/_jsx(ChartsAxis, {
103
108
  topAxis: topAxis,
104
109
  leftAxis: leftAxis,
@@ -109,7 +114,7 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
109
114
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
110
115
  slots: slots,
111
116
  slotProps: slotProps
112
- })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, defaultizedAxisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
117
+ })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, defaultizedAxisHighlight)), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
113
118
  slots: slots,
114
119
  slotProps: slotProps
115
120
  })), /*#__PURE__*/_jsx(ChartsClipPath, {
@@ -137,30 +142,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
137
142
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
138
143
  * @default xAxisIds[0] The id of the first provided axis
139
144
  */
140
- bottomAxis: PropTypes.oneOfType([PropTypes.shape({
141
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
142
- classes: PropTypes.object,
143
- disableLine: PropTypes.bool,
144
- disableTicks: PropTypes.bool,
145
- fill: PropTypes.string,
146
- label: PropTypes.string,
147
- labelFontSize: PropTypes.number,
148
- labelStyle: PropTypes.object,
149
- position: PropTypes.oneOf(['bottom', 'top']),
150
- slotProps: PropTypes.object,
151
- slots: PropTypes.object,
152
- stroke: PropTypes.string,
153
- tickFontSize: PropTypes.number,
154
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
155
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
156
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
157
- tickLabelStyle: PropTypes.object,
158
- tickMaxStep: PropTypes.number,
159
- tickMinStep: PropTypes.number,
160
- tickNumber: PropTypes.number,
161
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
162
- tickSize: PropTypes.number
163
- }), PropTypes.string]),
145
+ bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
164
146
  children: PropTypes.node,
165
147
  className: PropTypes.string,
166
148
  /**
@@ -200,30 +182,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
200
182
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
201
183
  * @default yAxisIds[0] The id of the first provided axis
202
184
  */
203
- leftAxis: PropTypes.oneOfType([PropTypes.shape({
204
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
205
- classes: PropTypes.object,
206
- disableLine: PropTypes.bool,
207
- disableTicks: PropTypes.bool,
208
- fill: PropTypes.string,
209
- label: PropTypes.string,
210
- labelFontSize: PropTypes.number,
211
- labelStyle: PropTypes.object,
212
- position: PropTypes.oneOf(['left', 'right']),
213
- slotProps: PropTypes.object,
214
- slots: PropTypes.object,
215
- stroke: PropTypes.string,
216
- tickFontSize: PropTypes.number,
217
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
218
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
219
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
220
- tickLabelStyle: PropTypes.object,
221
- tickMaxStep: PropTypes.number,
222
- tickMinStep: PropTypes.number,
223
- tickNumber: PropTypes.number,
224
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
225
- tickSize: PropTypes.number
226
- }), PropTypes.string]),
185
+ leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
227
186
  /**
228
187
  * @deprecated Consider using `slotProps.legend` instead.
229
188
  */
@@ -238,6 +197,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
238
197
  slotProps: PropTypes.object,
239
198
  slots: PropTypes.object
240
199
  }),
200
+ /**
201
+ * If `true`, a loading overlay is displayed.
202
+ */
203
+ loading: PropTypes.bool,
241
204
  /**
242
205
  * The margin between the SVG and the drawing area.
243
206
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
@@ -268,32 +231,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
268
231
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
269
232
  * @default null
270
233
  */
271
- rightAxis: PropTypes.oneOfType([PropTypes.shape({
272
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
273
- classes: PropTypes.object,
274
- disableLine: PropTypes.bool,
275
- disableTicks: PropTypes.bool,
276
- fill: PropTypes.string,
277
- label: PropTypes.string,
278
- labelFontSize: PropTypes.number,
279
- labelStyle: PropTypes.object,
280
- position: PropTypes.oneOf(['left', 'right']),
281
- slotProps: PropTypes.object,
282
- slots: PropTypes.object,
283
- stroke: PropTypes.string,
284
- tickFontSize: PropTypes.number,
285
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
286
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
287
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
288
- tickLabelStyle: PropTypes.object,
289
- tickMaxStep: PropTypes.number,
290
- tickMinStep: PropTypes.number,
291
- tickNumber: PropTypes.number,
292
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
293
- tickSize: PropTypes.number
294
- }), PropTypes.string]),
234
+ rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
295
235
  /**
296
236
  * The series to display in the bar chart.
237
+ * An array of [[BarSeriesType]] objects.
297
238
  */
298
239
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
299
240
  /**
@@ -330,30 +271,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
330
271
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
331
272
  * @default null
332
273
  */
333
- topAxis: PropTypes.oneOfType([PropTypes.shape({
334
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
335
- classes: PropTypes.object,
336
- disableLine: PropTypes.bool,
337
- disableTicks: PropTypes.bool,
338
- fill: PropTypes.string,
339
- label: PropTypes.string,
340
- labelFontSize: PropTypes.number,
341
- labelStyle: PropTypes.object,
342
- position: PropTypes.oneOf(['bottom', 'top']),
343
- slotProps: PropTypes.object,
344
- slots: PropTypes.object,
345
- stroke: PropTypes.string,
346
- tickFontSize: PropTypes.number,
347
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
348
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
349
- tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
350
- tickLabelStyle: PropTypes.object,
351
- tickMaxStep: PropTypes.number,
352
- tickMinStep: PropTypes.number,
353
- tickNumber: PropTypes.number,
354
- tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
355
- tickSize: PropTypes.number
356
- }), PropTypes.string]),
274
+ topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
357
275
  viewBox: PropTypes.shape({
358
276
  height: PropTypes.number,
359
277
  width: PropTypes.number,
@@ -367,6 +285,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
367
285
  /**
368
286
  * The configuration of the x-axes.
369
287
  * If not provided, a default axis config is used.
288
+ * An array of [[AxisConfig]] objects.
370
289
  */
371
290
  xAxis: PropTypes.arrayOf(PropTypes.shape({
372
291
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -419,6 +338,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
419
338
  /**
420
339
  * The configuration of the y-axes.
421
340
  * If not provided, a default axis config is used.
341
+ * An array of [[AxisConfig]] objects.
422
342
  */
423
343
  yAxis: PropTypes.arrayOf(PropTypes.shape({
424
344
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -35,7 +35,6 @@ export const BarElementPath = styled(animated.rect, {
35
35
  ownerState
36
36
  }) => ({
37
37
  stroke: 'none',
38
- shapeRendering: 'crispEdges',
39
38
  fill: ownerState.isHighlighted ? d3Color(ownerState.color).brighter(0.5).formatHex() : ownerState.color,
40
39
  transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
41
40
  opacity: ownerState.isFaded && 0.3 || 1
@@ -70,25 +70,25 @@ const useAggregatedData = () => {
70
70
  let baseScaleConfig;
71
71
  if (verticalLayout) {
72
72
  if (!isBandScaleConfig(xAxisConfig)) {
73
- throw new Error(`MUI X Charts: ${xAxisKey === 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}".`);
73
+ throw new Error(`MUI X Charts: ${xAxisKey === 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}".`);
74
74
  }
75
75
  if (xAxis[xAxisKey].data === undefined) {
76
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} shoud have data property.`);
76
+ throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property.`);
77
77
  }
78
78
  baseScaleConfig = xAxisConfig;
79
79
  if (isBandScaleConfig(yAxisConfig) || isPointScaleConfig(yAxisConfig)) {
80
- throw new Error(`MUI X Charts: ${yAxisKey === 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}".`);
80
+ throw new Error(`MUI X Charts: ${yAxisKey === 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}".`);
81
81
  }
82
82
  } else {
83
83
  if (!isBandScaleConfig(yAxisConfig)) {
84
- throw new Error(`MUI X Charts: ${yAxisKey === 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}".`);
84
+ throw new Error(`MUI X Charts: ${yAxisKey === 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}".`);
85
85
  }
86
86
  if (yAxis[yAxisKey].data === undefined) {
87
- throw new Error(`MUI X Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} shoud have data property.`);
87
+ throw new Error(`MUI X Charts: ${yAxisKey === DEFAULT_Y_AXIS_KEY ? 'The first `yAxis`' : `The y-axis with id "${yAxisKey}"`} should have data property.`);
88
88
  }
89
89
  baseScaleConfig = yAxisConfig;
90
90
  if (isBandScaleConfig(xAxisConfig) || isPointScaleConfig(xAxisConfig)) {
91
- throw new Error(`MUI X Charts: ${xAxisKey === 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}".`);
91
+ throw new Error(`MUI X Charts: ${xAxisKey === 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}".`);
92
92
  }
93
93
  }
94
94
  const xScale = xAxisConfig.scale;
@@ -109,8 +109,8 @@ const useAggregatedData = () => {
109
109
  } = series[seriesId];
110
110
  return stackedData.map((values, dataIndex) => {
111
111
  const valueCoordinates = values.map(v => verticalLayout ? yScale(v) : xScale(v));
112
- const minValueCoord = Math.min(...valueCoordinates);
113
- const maxValueCoord = Math.max(...valueCoordinates);
112
+ const minValueCoord = Math.round(Math.min(...valueCoordinates));
113
+ const maxValueCoord = Math.round(Math.max(...valueCoordinates));
114
114
  return {
115
115
  seriesId,
116
116
  dataIndex,
@@ -9,8 +9,7 @@ import { ChartsSurface } from '../ChartsSurface';
9
9
  import { CartesianContextProvider } from '../context/CartesianContextProvider';
10
10
  import { HighlightProvider } from '../context/HighlightProvider';
11
11
  import { ChartsAxesGradients } from '../internals/components/ChartsAxesGradients';
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 ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
15
14
  const {
16
15
  width,
@@ -122,6 +121,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
122
121
  /**
123
122
  * The configuration of the x-axes.
124
123
  * If not provided, a default axis config is used.
124
+ * An array of [[AxisConfig]] objects.
125
125
  */
126
126
  xAxis: PropTypes.arrayOf(PropTypes.shape({
127
127
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
@@ -174,6 +174,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
174
174
  /**
175
175
  * The configuration of the y-axes.
176
176
  * If not provided, a default axis config is used.
177
+ * An array of [[AxisConfig]] objects.
177
178
  */
178
179
  yAxis: PropTypes.arrayOf(PropTypes.shape({
179
180
  axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),