@mui/x-charts 6.0.0-alpha.15 → 6.0.0-alpha.16

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 (173) hide show
  1. package/BarChart/BarChart.d.ts +13 -2
  2. package/BarChart/BarChart.js +45 -3
  3. package/BarChart/BarElement.d.ts +1318 -3
  4. package/BarChart/BarElement.js +10 -8
  5. package/BarChart/BarPlot.d.ts +17 -1
  6. package/BarChart/BarPlot.js +152 -66
  7. package/CHANGELOG.md +65 -0
  8. package/ChartContainer/index.js +5 -2
  9. package/ChartsAxis/ChartsAxis.js +18 -2
  10. package/ChartsAxis/axisClasses.d.ts +1 -1
  11. package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
  12. package/ChartsClipPath/ChartsClipPath.js +2 -2
  13. package/ChartsLegend/ChartsLegend.d.ts +2 -1
  14. package/ChartsLegend/ChartsLegend.js +12 -8
  15. package/ChartsSurface.js +2 -2
  16. package/ChartsTooltip/ChartsAxisTooltipContent.js +2 -2
  17. package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  18. package/ChartsTooltip/ChartsTooltip.js +2 -2
  19. package/ChartsTooltip/utils.js +2 -2
  20. package/ChartsXAxis/ChartsXAxis.js +123 -35
  21. package/ChartsYAxis/ChartsYAxis.js +38 -16
  22. package/LineChart/AreaElement.d.ts +10 -0
  23. package/LineChart/AreaElement.js +12 -2
  24. package/LineChart/AreaPlot.d.ts +11 -0
  25. package/LineChart/AreaPlot.js +13 -2
  26. package/LineChart/LineChart.d.ts +10 -0
  27. package/LineChart/LineChart.js +36 -2
  28. package/LineChart/LineElement.d.ts +10 -0
  29. package/LineChart/LineElement.js +12 -2
  30. package/LineChart/LineHighlightElement.d.ts +10 -0
  31. package/LineChart/LineHighlightElement.js +12 -2
  32. package/LineChart/LineHighlightPlot.d.ts +10 -0
  33. package/LineChart/LineHighlightPlot.js +12 -2
  34. package/LineChart/LinePlot.d.ts +10 -0
  35. package/LineChart/LinePlot.js +12 -2
  36. package/LineChart/MarkElement.d.ts +10 -0
  37. package/LineChart/MarkElement.js +12 -2
  38. package/LineChart/MarkPlot.d.ts +10 -0
  39. package/LineChart/MarkPlot.js +12 -2
  40. package/PieChart/PieArc.js +2 -2
  41. package/PieChart/PieArcLabel.js +2 -2
  42. package/PieChart/PieChart.d.ts +10 -0
  43. package/PieChart/PieChart.js +37 -2
  44. package/PieChart/PiePlot.d.ts +10 -0
  45. package/PieChart/PiePlot.js +12 -2
  46. package/ResponsiveChartContainer/index.js +4 -4
  47. package/ScatterChart/Scatter.d.ts +10 -0
  48. package/ScatterChart/Scatter.js +12 -2
  49. package/ScatterChart/ScatterChart.d.ts +10 -0
  50. package/ScatterChart/ScatterChart.js +36 -2
  51. package/ScatterChart/ScatterPlot.d.ts +10 -0
  52. package/ScatterChart/ScatterPlot.js +12 -2
  53. package/SparkLineChart/SparkLineChart.d.ts +9 -0
  54. package/SparkLineChart/SparkLineChart.js +16 -2
  55. package/context/CartesianContextProvider.js +10 -2
  56. package/context/DrawingProvider.js +2 -2
  57. package/context/HighlightProvider.js +2 -2
  58. package/context/InteractionProvider.js +2 -2
  59. package/context/SeriesContextProvider.js +2 -2
  60. package/esm/BarChart/BarChart.js +43 -1
  61. package/esm/BarChart/BarElement.js +7 -4
  62. package/esm/BarChart/BarPlot.js +152 -67
  63. package/esm/ChartContainer/index.js +3 -0
  64. package/esm/ChartsAxis/ChartsAxis.js +16 -0
  65. package/esm/ChartsLegend/ChartsLegend.js +10 -6
  66. package/esm/ChartsXAxis/ChartsXAxis.js +122 -34
  67. package/esm/ChartsYAxis/ChartsYAxis.js +36 -14
  68. package/esm/LineChart/AreaElement.js +10 -0
  69. package/esm/LineChart/AreaPlot.js +11 -0
  70. package/esm/LineChart/LineChart.js +34 -0
  71. package/esm/LineChart/LineElement.js +10 -0
  72. package/esm/LineChart/LineHighlightElement.js +10 -0
  73. package/esm/LineChart/LineHighlightPlot.js +10 -0
  74. package/esm/LineChart/LinePlot.js +10 -0
  75. package/esm/LineChart/MarkElement.js +10 -0
  76. package/esm/LineChart/MarkPlot.js +10 -0
  77. package/esm/PieChart/PieChart.js +35 -0
  78. package/esm/PieChart/PiePlot.js +10 -0
  79. package/esm/ResponsiveChartContainer/index.js +2 -2
  80. package/esm/ScatterChart/Scatter.js +10 -0
  81. package/esm/ScatterChart/ScatterChart.js +34 -0
  82. package/esm/ScatterChart/ScatterPlot.js +10 -0
  83. package/esm/SparkLineChart/SparkLineChart.js +14 -0
  84. package/esm/context/CartesianContextProvider.js +8 -0
  85. package/esm/hooks/useMounted.js +16 -0
  86. package/esm/hooks/useReducedMotion.js +27 -0
  87. package/esm/hooks/useTicks.js +12 -6
  88. package/esm/internals/components/ChartsText.js +17 -13
  89. package/esm/internals/geometry.js +36 -0
  90. package/hooks/useAxisEvents.js +2 -2
  91. package/hooks/useChartDimensions.js +2 -2
  92. package/hooks/useDrawingArea.js +2 -2
  93. package/hooks/useInteractionItemProps.js +2 -2
  94. package/hooks/useMounted.d.ts +1 -0
  95. package/hooks/useMounted.js +25 -0
  96. package/hooks/useReducedMotion.d.ts +8 -0
  97. package/hooks/useReducedMotion.js +33 -0
  98. package/hooks/useScale.d.ts +2 -2
  99. package/hooks/useScale.js +2 -2
  100. package/hooks/useTicks.d.ts +18 -9
  101. package/hooks/useTicks.js +14 -8
  102. package/index.js +1 -1
  103. package/internals/components/ChartsText.d.ts +11 -8
  104. package/internals/components/ChartsText.js +19 -15
  105. package/internals/defaultizeColor.d.ts +1 -1
  106. package/internals/domUtils.d.ts +0 -1
  107. package/internals/geometry.d.ts +9 -0
  108. package/internals/geometry.js +42 -0
  109. package/legacy/BarChart/BarChart.js +43 -1
  110. package/legacy/BarChart/BarElement.js +6 -3
  111. package/legacy/BarChart/BarPlot.js +151 -63
  112. package/legacy/ChartContainer/index.js +3 -0
  113. package/legacy/ChartsAxis/ChartsAxis.js +16 -0
  114. package/legacy/ChartsLegend/ChartsLegend.js +14 -7
  115. package/legacy/ChartsXAxis/ChartsXAxis.js +126 -36
  116. package/legacy/ChartsYAxis/ChartsYAxis.js +36 -14
  117. package/legacy/LineChart/AreaElement.js +10 -0
  118. package/legacy/LineChart/AreaPlot.js +11 -0
  119. package/legacy/LineChart/LineChart.js +34 -0
  120. package/legacy/LineChart/LineElement.js +10 -0
  121. package/legacy/LineChart/LineHighlightElement.js +10 -0
  122. package/legacy/LineChart/LineHighlightPlot.js +10 -0
  123. package/legacy/LineChart/LinePlot.js +10 -0
  124. package/legacy/LineChart/MarkElement.js +10 -0
  125. package/legacy/LineChart/MarkPlot.js +10 -0
  126. package/legacy/PieChart/PieChart.js +35 -0
  127. package/legacy/PieChart/PiePlot.js +10 -0
  128. package/legacy/ResponsiveChartContainer/index.js +2 -2
  129. package/legacy/ScatterChart/Scatter.js +10 -0
  130. package/legacy/ScatterChart/ScatterChart.js +34 -0
  131. package/legacy/ScatterChart/ScatterPlot.js +10 -0
  132. package/legacy/SparkLineChart/SparkLineChart.js +14 -0
  133. package/legacy/context/CartesianContextProvider.js +8 -0
  134. package/legacy/hooks/useMounted.js +21 -0
  135. package/legacy/hooks/useReducedMotion.js +27 -0
  136. package/legacy/hooks/useTicks.js +13 -6
  137. package/legacy/index.js +1 -1
  138. package/legacy/internals/components/ChartsText.js +15 -15
  139. package/legacy/internals/geometry.js +37 -0
  140. package/models/axis.d.ts +19 -2
  141. package/models/seriesType/line.d.ts +2 -2
  142. package/modern/BarChart/BarChart.js +43 -1
  143. package/modern/BarChart/BarElement.js +7 -4
  144. package/modern/BarChart/BarPlot.js +149 -65
  145. package/modern/ChartContainer/index.js +3 -0
  146. package/modern/ChartsAxis/ChartsAxis.js +16 -0
  147. package/modern/ChartsLegend/ChartsLegend.js +10 -6
  148. package/modern/ChartsXAxis/ChartsXAxis.js +122 -34
  149. package/modern/ChartsYAxis/ChartsYAxis.js +36 -14
  150. package/modern/LineChart/AreaElement.js +10 -0
  151. package/modern/LineChart/AreaPlot.js +11 -0
  152. package/modern/LineChart/LineChart.js +34 -0
  153. package/modern/LineChart/LineElement.js +10 -0
  154. package/modern/LineChart/LineHighlightElement.js +10 -0
  155. package/modern/LineChart/LineHighlightPlot.js +10 -0
  156. package/modern/LineChart/LinePlot.js +10 -0
  157. package/modern/LineChart/MarkElement.js +10 -0
  158. package/modern/LineChart/MarkPlot.js +10 -0
  159. package/modern/PieChart/PieChart.js +35 -0
  160. package/modern/PieChart/PiePlot.js +10 -0
  161. package/modern/ResponsiveChartContainer/index.js +2 -2
  162. package/modern/ScatterChart/Scatter.js +10 -0
  163. package/modern/ScatterChart/ScatterChart.js +34 -0
  164. package/modern/ScatterChart/ScatterPlot.js +10 -0
  165. package/modern/SparkLineChart/SparkLineChart.js +14 -0
  166. package/modern/context/CartesianContextProvider.js +8 -0
  167. package/modern/hooks/useMounted.js +16 -0
  168. package/modern/hooks/useReducedMotion.js +27 -0
  169. package/modern/hooks/useTicks.js +12 -6
  170. package/modern/index.js +1 -1
  171. package/modern/internals/components/ChartsText.js +17 -13
  172. package/modern/internals/geometry.js +36 -0
  173. package/package.json +5 -3
@@ -72,9 +72,9 @@ function ChartsYAxis(inProps) {
72
72
  tickNumber: tickNumber,
73
73
  valueFormatter: valueFormatter
74
74
  });
75
- var positionSigne = position === 'right' ? 1 : -1;
75
+ var positionSign = position === 'right' ? 1 : -1;
76
76
  var labelRefPoint = {
77
- x: positionSigne * (tickFontSize + tickSize + 10),
77
+ x: positionSign * (tickFontSize + tickSize + 10),
78
78
  y: top + height / 2
79
79
  };
80
80
  var Line = (_slots$axisLine = slots == null ? void 0 : slots.axisLine) != null ? _slots$axisLine : 'line';
@@ -85,10 +85,10 @@ function ChartsYAxis(inProps) {
85
85
  elementType: TickLabel,
86
86
  externalSlotProps: slotProps == null ? void 0 : slotProps.axisTickLabel,
87
87
  additionalProps: {
88
- textAnchor: position === 'right' ? 'start' : 'end',
89
- dominantBaseline: 'central',
90
88
  style: {
91
- fontSize: tickFontSize
89
+ fontSize: tickFontSize,
90
+ textAnchor: position === 'right' ? 'start' : 'end',
91
+ dominantBaseline: 'central'
92
92
  },
93
93
  className: classes.tickLabel
94
94
  },
@@ -98,14 +98,12 @@ function ChartsYAxis(inProps) {
98
98
  elementType: Label,
99
99
  externalSlotProps: slotProps == null ? void 0 : slotProps.axisLabel,
100
100
  additionalProps: {
101
- textAnchor: 'middle',
102
- dominantBaseline: 'auto',
103
101
  style: {
104
102
  fontSize: labelFontSize,
105
- transform: "rotate(".concat(positionSigne * 90, "deg)"),
106
- transformOrigin: "".concat(labelRefPoint.x, "px ").concat(labelRefPoint.y, "px")
107
- },
108
- className: classes.label
103
+ angle: positionSign * 90,
104
+ textAnchor: 'middle',
105
+ dominantBaseline: 'auto'
106
+ }
109
107
  },
110
108
  ownerState: {}
111
109
  });
@@ -120,18 +118,17 @@ function ChartsYAxis(inProps) {
120
118
  var formattedValue = _ref.formattedValue,
121
119
  offset = _ref.offset,
122
120
  labelOffset = _ref.labelOffset;
123
- var xTickLabel = positionSigne * (tickSize + 2);
121
+ var xTickLabel = positionSign * (tickSize + 2);
124
122
  var yTickLabel = labelOffset;
125
123
  return /*#__PURE__*/_jsxs("g", {
126
124
  transform: "translate(0, ".concat(offset, ")"),
127
125
  className: classes.tickContainer,
128
126
  children: [!disableTicks && /*#__PURE__*/_jsx(Tick, _extends({
129
- x2: positionSigne * tickSize,
127
+ x2: positionSign * tickSize,
130
128
  className: classes.tick
131
129
  }, slotProps == null ? void 0 : slotProps.axisTick)), formattedValue !== undefined && /*#__PURE__*/_jsx(TickLabel, _extends({
132
130
  x: xTickLabel,
133
131
  y: yTickLabel,
134
- "transform-origin": "".concat(xTickLabel, "px ").concat(yTickLabel, "px"),
135
132
  text: formattedValue.toString()
136
133
  }, axisTickLabelProps))]
137
134
  }, index);
@@ -178,8 +175,13 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
178
175
  /**
179
176
  * The font size of the axis label.
180
177
  * @default 14
178
+ * @deprecated Consider using `labelStyle.fontSize` instead.
181
179
  */
182
180
  labelFontSize: PropTypes.number,
181
+ /**
182
+ * The style applied to the axis label.
183
+ */
184
+ labelStyle: PropTypes.object,
183
185
  /**
184
186
  * Position of the axis.
185
187
  */
@@ -202,8 +204,28 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
202
204
  /**
203
205
  * The font size of the axis ticks text.
204
206
  * @default 12
207
+ * @deprecated Consider using `tickLabelStyle.fontSize` instead.
205
208
  */
206
209
  tickFontSize: PropTypes.number,
210
+ /**
211
+ * Defines which ticks are displayed. Its value can be:
212
+ * - 'auto' In such case the ticks are computed based on axis scale and other parameters.
213
+ * - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
214
+ * - an array containing the values where ticks should be displayed.
215
+ * @default 'auto'
216
+ */
217
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
218
+ /**
219
+ * Defines which ticks get its label displayed. Its value can be:
220
+ * - 'auto' In such case, labels are displayed if they do not overlap with the previous one.
221
+ * - a filtering function of the form (value, index) => boolean. Warning: the index is tick index, not data ones.
222
+ * @default 'auto'
223
+ */
224
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
225
+ /**
226
+ * The style applied to ticks text.
227
+ */
228
+ tickLabelStyle: PropTypes.object,
207
229
  /**
208
230
  * Maximal step between two ticks.
209
231
  * When using time data, the value is assumed to be in ms.
@@ -56,6 +56,16 @@ AreaElementPath.propTypes = {
56
56
  }).isRequired,
57
57
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
58
58
  };
59
+ /**
60
+ * Demos:
61
+ *
62
+ * - [Lines](https://mui.com/x/react-charts/lines/)
63
+ * - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
64
+ *
65
+ * API:
66
+ *
67
+ * - [AreaElement API](https://mui.com/x/api/charts/area-element/)
68
+ */
59
69
  function AreaElement(props) {
60
70
  var _slots$area;
61
71
  var id = props.id,
@@ -10,6 +10,17 @@ import { AreaElement } from './AreaElement';
10
10
  import { getValueToPositionMapper } from '../hooks/useScale';
11
11
  import getCurveFactory from '../internals/getCurve';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * Demos:
15
+ *
16
+ * - [Lines](https://mui.com/x/react-charts/lines/)
17
+ * - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
18
+ * - [Stacking](https://mui.com/x/react-charts/stacking/)
19
+ *
20
+ * API:
21
+ *
22
+ * - [AreaPlot API](https://mui.com/x/api/charts/area-plot/)
23
+ */
13
24
  function AreaPlot(props) {
14
25
  var slots = props.slots,
15
26
  slotProps = props.slotProps,
@@ -16,6 +16,16 @@ import { ChartsClipPath } from '../ChartsClipPath';
16
16
  import { LineHighlightPlot } from './LineHighlightPlot';
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ /**
20
+ * Demos:
21
+ *
22
+ * - [Lines](https://mui.com/x/react-charts/lines/)
23
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
24
+ *
25
+ * API:
26
+ *
27
+ * - [LineChart API](https://mui.com/x/api/charts/line-chart/)
28
+ */
19
29
  var LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
20
30
  var xAxis = props.xAxis,
21
31
  yAxis = props.yAxis,
@@ -125,11 +135,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
125
135
  fill: PropTypes.string,
126
136
  label: PropTypes.string,
127
137
  labelFontSize: PropTypes.number,
138
+ labelStyle: PropTypes.object,
128
139
  position: PropTypes.oneOf(['bottom', 'top']),
129
140
  slotProps: PropTypes.object,
130
141
  slots: PropTypes.object,
131
142
  stroke: PropTypes.string,
132
143
  tickFontSize: PropTypes.number,
144
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
145
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
146
+ tickLabelStyle: PropTypes.object,
133
147
  tickMaxStep: PropTypes.number,
134
148
  tickMinStep: PropTypes.number,
135
149
  tickNumber: PropTypes.number,
@@ -162,11 +176,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
162
176
  fill: PropTypes.string,
163
177
  label: PropTypes.string,
164
178
  labelFontSize: PropTypes.number,
179
+ labelStyle: PropTypes.object,
165
180
  position: PropTypes.oneOf(['left', 'right']),
166
181
  slotProps: PropTypes.object,
167
182
  slots: PropTypes.object,
168
183
  stroke: PropTypes.string,
169
184
  tickFontSize: PropTypes.number,
185
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
186
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
187
+ tickLabelStyle: PropTypes.object,
170
188
  tickMaxStep: PropTypes.number,
171
189
  tickMinStep: PropTypes.number,
172
190
  tickNumber: PropTypes.number,
@@ -205,11 +223,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
205
223
  fill: PropTypes.string,
206
224
  label: PropTypes.string,
207
225
  labelFontSize: PropTypes.number,
226
+ labelStyle: PropTypes.object,
208
227
  position: PropTypes.oneOf(['left', 'right']),
209
228
  slotProps: PropTypes.object,
210
229
  slots: PropTypes.object,
211
230
  stroke: PropTypes.string,
212
231
  tickFontSize: PropTypes.number,
232
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
233
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
234
+ tickLabelStyle: PropTypes.object,
213
235
  tickMaxStep: PropTypes.number,
214
236
  tickMinStep: PropTypes.number,
215
237
  tickNumber: PropTypes.number,
@@ -270,11 +292,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
270
292
  fill: PropTypes.string,
271
293
  label: PropTypes.string,
272
294
  labelFontSize: PropTypes.number,
295
+ labelStyle: PropTypes.object,
273
296
  position: PropTypes.oneOf(['bottom', 'top']),
274
297
  slotProps: PropTypes.object,
275
298
  slots: PropTypes.object,
276
299
  stroke: PropTypes.string,
277
300
  tickFontSize: PropTypes.number,
301
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
302
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
303
+ tickLabelStyle: PropTypes.object,
278
304
  tickMaxStep: PropTypes.number,
279
305
  tickMinStep: PropTypes.number,
280
306
  tickNumber: PropTypes.number,
@@ -299,6 +325,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
299
325
  id: PropTypes.string,
300
326
  label: PropTypes.string,
301
327
  labelFontSize: PropTypes.number,
328
+ labelStyle: PropTypes.object,
302
329
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
303
330
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
304
331
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -307,6 +334,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
307
334
  slots: PropTypes.object,
308
335
  stroke: PropTypes.string,
309
336
  tickFontSize: PropTypes.number,
337
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
338
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
339
+ tickLabelStyle: PropTypes.object,
310
340
  tickMaxStep: PropTypes.number,
311
341
  tickMinStep: PropTypes.number,
312
342
  tickNumber: PropTypes.number,
@@ -325,6 +355,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
325
355
  id: PropTypes.string,
326
356
  label: PropTypes.string,
327
357
  labelFontSize: PropTypes.number,
358
+ labelStyle: PropTypes.object,
328
359
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
329
360
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
330
361
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -333,6 +364,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
333
364
  slots: PropTypes.object,
334
365
  stroke: PropTypes.string,
335
366
  tickFontSize: PropTypes.number,
367
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
368
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
369
+ tickLabelStyle: PropTypes.object,
336
370
  tickMaxStep: PropTypes.number,
337
371
  tickMinStep: PropTypes.number,
338
372
  tickNumber: PropTypes.number,
@@ -58,6 +58,16 @@ LineElementPath.propTypes = {
58
58
  }).isRequired,
59
59
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
60
60
  };
61
+ /**
62
+ * Demos:
63
+ *
64
+ * - [Lines](https://mui.com/x/react-charts/lines/)
65
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
66
+ *
67
+ * API:
68
+ *
69
+ * - [LineElement API](https://mui.com/x/api/charts/line-element/)
70
+ */
61
71
  function LineElement(props) {
62
72
  var _slots$line;
63
73
  var id = props.id,
@@ -34,6 +34,16 @@ var HighlightElement = styled('circle', {
34
34
  fill: ownerState.color
35
35
  };
36
36
  });
37
+ /**
38
+ * Demos:
39
+ *
40
+ * - [Lines](https://mui.com/x/react-charts/lines/)
41
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
42
+ *
43
+ * API:
44
+ *
45
+ * - [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/)
46
+ */
37
47
  function LineHighlightElement(props) {
38
48
  var x = props.x,
39
49
  y = props.y,
@@ -9,6 +9,16 @@ import { LineHighlightElement } from './LineHighlightElement';
9
9
  import { getValueToPositionMapper } from '../hooks/useScale';
10
10
  import { InteractionContext } from '../context/InteractionProvider';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
+ /**
13
+ * Demos:
14
+ *
15
+ * - [Lines](https://mui.com/x/react-charts/lines/)
16
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
17
+ *
18
+ * API:
19
+ *
20
+ * - [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/)
21
+ */
12
22
  function LineHighlightPlot(props) {
13
23
  var _axis$x, _slots$lineHighlight;
14
24
  var slots = props.slots,
@@ -10,6 +10,16 @@ import { LineElement } from './LineElement';
10
10
  import { getValueToPositionMapper } from '../hooks/useScale';
11
11
  import getCurveFactory from '../internals/getCurve';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * Demos:
15
+ *
16
+ * - [Lines](https://mui.com/x/react-charts/lines/)
17
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [LinePlot API](https://mui.com/x/api/charts/line-plot/)
22
+ */
13
23
  function LinePlot(props) {
14
24
  var slots = props.slots,
15
25
  slotProps = props.slotProps,
@@ -60,6 +60,16 @@ MarkElementPath.propTypes = {
60
60
  }).isRequired,
61
61
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
62
62
  };
63
+ /**
64
+ * Demos:
65
+ *
66
+ * - [Lines](https://mui.com/x/react-charts/lines/)
67
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
68
+ *
69
+ * API:
70
+ *
71
+ * - [MarkElement API](https://mui.com/x/api/charts/mark-element/)
72
+ */
63
73
  function MarkElement(props) {
64
74
  var _axis$x;
65
75
  var x = props.x,
@@ -9,6 +9,16 @@ import { CartesianContext } from '../context/CartesianContextProvider';
9
9
  import { MarkElement } from './MarkElement';
10
10
  import { getValueToPositionMapper } from '../hooks/useScale';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
+ /**
13
+ * Demos:
14
+ *
15
+ * - [Lines](https://mui.com/x/react-charts/lines/)
16
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
17
+ *
18
+ * API:
19
+ *
20
+ * - [MarkPlot API](https://mui.com/x/api/charts/mark-plot/)
21
+ */
12
22
  function MarkPlot(props) {
13
23
  var _slots$mark;
14
24
  var slots = props.slots,
@@ -17,6 +17,17 @@ var defaultMargin = {
17
17
  left: 5,
18
18
  right: 100
19
19
  };
20
+
21
+ /**
22
+ * Demos:
23
+ *
24
+ * - [Pie](https://mui.com/x/react-charts/pie/)
25
+ * - [Pie demonstration](https://mui.com/x/react-charts/pie-demo/)
26
+ *
27
+ * API:
28
+ *
29
+ * - [PieChart API](https://mui.com/x/api/charts/pie-chart/)
30
+ */
20
31
  function PieChart(props) {
21
32
  var xAxis = props.xAxis,
22
33
  yAxis = props.yAxis,
@@ -117,11 +128,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
117
128
  fill: PropTypes.string,
118
129
  label: PropTypes.string,
119
130
  labelFontSize: PropTypes.number,
131
+ labelStyle: PropTypes.object,
120
132
  position: PropTypes.oneOf(['bottom', 'top']),
121
133
  slotProps: PropTypes.object,
122
134
  slots: PropTypes.object,
123
135
  stroke: PropTypes.string,
124
136
  tickFontSize: PropTypes.number,
137
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
138
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
139
+ tickLabelStyle: PropTypes.object,
125
140
  tickMaxStep: PropTypes.number,
126
141
  tickMinStep: PropTypes.number,
127
142
  tickNumber: PropTypes.number,
@@ -150,11 +165,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
150
165
  fill: PropTypes.string,
151
166
  label: PropTypes.string,
152
167
  labelFontSize: PropTypes.number,
168
+ labelStyle: PropTypes.object,
153
169
  position: PropTypes.oneOf(['left', 'right']),
154
170
  slotProps: PropTypes.object,
155
171
  slots: PropTypes.object,
156
172
  stroke: PropTypes.string,
157
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
+ tickLabelStyle: PropTypes.object,
158
177
  tickMaxStep: PropTypes.number,
159
178
  tickMinStep: PropTypes.number,
160
179
  tickNumber: PropTypes.number,
@@ -194,11 +213,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
194
213
  fill: PropTypes.string,
195
214
  label: PropTypes.string,
196
215
  labelFontSize: PropTypes.number,
216
+ labelStyle: PropTypes.object,
197
217
  position: PropTypes.oneOf(['left', 'right']),
198
218
  slotProps: PropTypes.object,
199
219
  slots: PropTypes.object,
200
220
  stroke: PropTypes.string,
201
221
  tickFontSize: PropTypes.number,
222
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
223
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
224
+ tickLabelStyle: PropTypes.object,
202
225
  tickMaxStep: PropTypes.number,
203
226
  tickMinStep: PropTypes.number,
204
227
  tickNumber: PropTypes.number,
@@ -272,11 +295,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
272
295
  fill: PropTypes.string,
273
296
  label: PropTypes.string,
274
297
  labelFontSize: PropTypes.number,
298
+ labelStyle: PropTypes.object,
275
299
  position: PropTypes.oneOf(['bottom', 'top']),
276
300
  slotProps: PropTypes.object,
277
301
  slots: PropTypes.object,
278
302
  stroke: PropTypes.string,
279
303
  tickFontSize: PropTypes.number,
304
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
305
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
306
+ tickLabelStyle: PropTypes.object,
280
307
  tickMaxStep: PropTypes.number,
281
308
  tickMinStep: PropTypes.number,
282
309
  tickNumber: PropTypes.number,
@@ -301,6 +328,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
301
328
  id: PropTypes.string,
302
329
  label: PropTypes.string,
303
330
  labelFontSize: PropTypes.number,
331
+ labelStyle: PropTypes.object,
304
332
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
305
333
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
306
334
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -309,6 +337,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
309
337
  slots: PropTypes.object,
310
338
  stroke: PropTypes.string,
311
339
  tickFontSize: PropTypes.number,
340
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
341
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
342
+ tickLabelStyle: PropTypes.object,
312
343
  tickMaxStep: PropTypes.number,
313
344
  tickMinStep: PropTypes.number,
314
345
  tickNumber: PropTypes.number,
@@ -327,6 +358,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
327
358
  id: PropTypes.string,
328
359
  label: PropTypes.string,
329
360
  labelFontSize: PropTypes.number,
361
+ labelStyle: PropTypes.object,
330
362
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
331
363
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
332
364
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -335,6 +367,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
335
367
  slots: PropTypes.object,
336
368
  stroke: PropTypes.string,
337
369
  tickFontSize: PropTypes.number,
370
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
371
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
372
+ tickLabelStyle: PropTypes.object,
338
373
  tickMaxStep: PropTypes.number,
339
374
  tickMinStep: PropTypes.number,
340
375
  tickNumber: PropTypes.number,
@@ -23,6 +23,16 @@ function getItemLabel(arcLabel, arcLabelMinAngle, item) {
23
23
  }
24
24
  return arcLabel(item);
25
25
  }
26
+ /**
27
+ * Demos:
28
+ *
29
+ * - [Pie](https://mui.com/x/react-charts/pie/)
30
+ * - [Pie demonstration](https://mui.com/x/react-charts/pie-demo/)
31
+ *
32
+ * API:
33
+ *
34
+ * - [PiePlot API](https://mui.com/x/api/charts/pie-plot/)
35
+ */
26
36
  function PiePlot(props) {
27
37
  var _slots$pieArc, _slots$pieArcLabel;
28
38
  var slots = props.slots,
@@ -114,10 +114,10 @@ export var ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function Res
114
114
  width: inWidth,
115
115
  height: inHeight
116
116
  },
117
- children: /*#__PURE__*/_jsx(ChartContainer, _extends({}, other, {
117
+ children: width && height ? /*#__PURE__*/_jsx(ChartContainer, _extends({}, other, {
118
118
  width: width,
119
119
  height: height,
120
120
  ref: ref
121
- }))
121
+ })) : null
122
122
  });
123
123
  });
@@ -6,6 +6,16 @@ import { getValueToPositionMapper } from '../hooks/useScale';
6
6
  import { getIsFaded, getIsHighlighted, useInteractionItemProps } from '../hooks/useInteractionItemProps';
7
7
  import { InteractionContext } from '../context/InteractionProvider';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
+ /**
10
+ * Demos:
11
+ *
12
+ * - [Scatter](https://mui.com/x/react-charts/scatter/)
13
+ * - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
14
+ *
15
+ * API:
16
+ *
17
+ * - [Scatter API](https://mui.com/x/api/charts/scatter/)
18
+ */
9
19
  function Scatter(props) {
10
20
  var series = props.series,
11
21
  xScale = props.xScale,
@@ -9,6 +9,16 @@ import { ChartsLegend } from '../ChartsLegend';
9
9
  import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ /**
13
+ * Demos:
14
+ *
15
+ * - [Scatter](https://mui.com/x/react-charts/scatter/)
16
+ * - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
17
+ *
18
+ * API:
19
+ *
20
+ * - [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/)
21
+ */
12
22
  var ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props, ref) {
13
23
  var xAxis = props.xAxis,
14
24
  yAxis = props.yAxis,
@@ -85,11 +95,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
85
95
  fill: PropTypes.string,
86
96
  label: PropTypes.string,
87
97
  labelFontSize: PropTypes.number,
98
+ labelStyle: PropTypes.object,
88
99
  position: PropTypes.oneOf(['bottom', 'top']),
89
100
  slotProps: PropTypes.object,
90
101
  slots: PropTypes.object,
91
102
  stroke: PropTypes.string,
92
103
  tickFontSize: PropTypes.number,
104
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
105
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
106
+ tickLabelStyle: PropTypes.object,
93
107
  tickMaxStep: PropTypes.number,
94
108
  tickMinStep: PropTypes.number,
95
109
  tickNumber: PropTypes.number,
@@ -118,11 +132,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
118
132
  fill: PropTypes.string,
119
133
  label: PropTypes.string,
120
134
  labelFontSize: PropTypes.number,
135
+ labelStyle: PropTypes.object,
121
136
  position: PropTypes.oneOf(['left', 'right']),
122
137
  slotProps: PropTypes.object,
123
138
  slots: PropTypes.object,
124
139
  stroke: PropTypes.string,
125
140
  tickFontSize: PropTypes.number,
141
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
142
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
143
+ tickLabelStyle: PropTypes.object,
126
144
  tickMaxStep: PropTypes.number,
127
145
  tickMinStep: PropTypes.number,
128
146
  tickNumber: PropTypes.number,
@@ -161,11 +179,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
161
179
  fill: PropTypes.string,
162
180
  label: PropTypes.string,
163
181
  labelFontSize: PropTypes.number,
182
+ labelStyle: PropTypes.object,
164
183
  position: PropTypes.oneOf(['left', 'right']),
165
184
  slotProps: PropTypes.object,
166
185
  slots: PropTypes.object,
167
186
  stroke: PropTypes.string,
168
187
  tickFontSize: PropTypes.number,
188
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
189
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
190
+ tickLabelStyle: PropTypes.object,
169
191
  tickMaxStep: PropTypes.number,
170
192
  tickMinStep: PropTypes.number,
171
193
  tickNumber: PropTypes.number,
@@ -223,11 +245,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
223
245
  fill: PropTypes.string,
224
246
  label: PropTypes.string,
225
247
  labelFontSize: PropTypes.number,
248
+ labelStyle: PropTypes.object,
226
249
  position: PropTypes.oneOf(['bottom', 'top']),
227
250
  slotProps: PropTypes.object,
228
251
  slots: PropTypes.object,
229
252
  stroke: PropTypes.string,
230
253
  tickFontSize: PropTypes.number,
254
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
255
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
256
+ tickLabelStyle: PropTypes.object,
231
257
  tickMaxStep: PropTypes.number,
232
258
  tickMinStep: PropTypes.number,
233
259
  tickNumber: PropTypes.number,
@@ -252,6 +278,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
252
278
  id: PropTypes.string,
253
279
  label: PropTypes.string,
254
280
  labelFontSize: PropTypes.number,
281
+ labelStyle: PropTypes.object,
255
282
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
256
283
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
257
284
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -260,6 +287,9 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
260
287
  slots: PropTypes.object,
261
288
  stroke: PropTypes.string,
262
289
  tickFontSize: PropTypes.number,
290
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
291
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
292
+ tickLabelStyle: PropTypes.object,
263
293
  tickMaxStep: PropTypes.number,
264
294
  tickMinStep: PropTypes.number,
265
295
  tickNumber: PropTypes.number,
@@ -278,6 +308,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
278
308
  id: PropTypes.string,
279
309
  label: PropTypes.string,
280
310
  labelFontSize: PropTypes.number,
311
+ labelStyle: PropTypes.object,
281
312
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
282
313
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
283
314
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -286,6 +317,9 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
286
317
  slots: PropTypes.object,
287
318
  stroke: PropTypes.string,
288
319
  tickFontSize: PropTypes.number,
320
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
321
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
322
+ tickLabelStyle: PropTypes.object,
289
323
  tickMaxStep: PropTypes.number,
290
324
  tickMinStep: PropTypes.number,
291
325
  tickNumber: PropTypes.number,
@@ -5,6 +5,16 @@ import { Scatter } from './Scatter';
5
5
  import { SeriesContext } from '../context/SeriesContextProvider';
6
6
  import { CartesianContext } from '../context/CartesianContextProvider';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ /**
9
+ * Demos:
10
+ *
11
+ * - [Scatter](https://mui.com/x/react-charts/scatter/)
12
+ * - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
13
+ *
14
+ * API:
15
+ *
16
+ * - [ScatterPlot API](https://mui.com/x/api/charts/scatter-plot/)
17
+ */
8
18
  function ScatterPlot(props) {
9
19
  var _slots$scatter;
10
20
  var slots = props.slots,