@mui/x-charts-pro 8.0.0-alpha.12 → 8.0.0-alpha.13

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 (51) hide show
  1. package/BarChartPro/BarChartPro.js +25 -30
  2. package/CHANGELOG.md +299 -0
  3. package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
  4. package/ChartContainerPro/ChartContainerPro.js +1 -1
  5. package/ChartContainerPro/useChartContainerProProps.js +3 -1
  6. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  7. package/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
  8. package/Heatmap/Heatmap.d.ts +5 -4
  9. package/Heatmap/Heatmap.js +37 -52
  10. package/LineChartPro/LineChartPro.js +25 -30
  11. package/ScatterChartPro/ScatterChartPro.js +25 -30
  12. package/esm/BarChartPro/BarChartPro.js +25 -30
  13. package/esm/ChartContainerPro/ChartContainerPro.d.ts +1 -1
  14. package/esm/ChartContainerPro/ChartContainerPro.js +1 -1
  15. package/esm/ChartContainerPro/useChartContainerProProps.js +3 -1
  16. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  17. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
  18. package/esm/Heatmap/Heatmap.d.ts +5 -4
  19. package/esm/Heatmap/Heatmap.js +37 -52
  20. package/esm/LineChartPro/LineChartPro.js +25 -30
  21. package/esm/ScatterChartPro/ScatterChartPro.js +25 -30
  22. package/esm/index.js +1 -1
  23. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
  24. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
  25. package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
  26. package/esm/internals/utils/releaseInfo.js +1 -1
  27. package/esm/models/seriesType/heatmap.d.ts +2 -2
  28. package/index.js +1 -1
  29. package/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
  30. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
  31. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
  32. package/internals/utils/releaseInfo.js +1 -1
  33. package/models/seriesType/heatmap.d.ts +2 -2
  34. package/modern/BarChartPro/BarChartPro.js +25 -30
  35. package/modern/ChartContainerPro/ChartContainerPro.d.ts +1 -1
  36. package/modern/ChartContainerPro/ChartContainerPro.js +1 -1
  37. package/modern/ChartContainerPro/useChartContainerProProps.js +3 -1
  38. package/modern/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  39. package/modern/ChartDataProviderPro/ChartDataProviderPro.js +3 -2
  40. package/modern/Heatmap/Heatmap.d.ts +5 -4
  41. package/modern/Heatmap/Heatmap.js +37 -52
  42. package/modern/LineChartPro/LineChartPro.js +25 -30
  43. package/modern/ScatterChartPro/ScatterChartPro.js +25 -30
  44. package/modern/index.js +1 -1
  45. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +63 -12
  46. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +26 -24
  47. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +12 -3
  48. package/modern/internals/utils/releaseInfo.js +1 -1
  49. package/modern/models/seriesType/heatmap.d.ts +2 -2
  50. package/package.json +5 -5
  51. package/tsconfig.build.tsbuildinfo +1 -1
@@ -16,6 +16,7 @@ var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
16
16
  var _ChartsAxis = require("@mui/x-charts/ChartsAxis");
17
17
  var _ChartsClipPath = require("@mui/x-charts/ChartsClipPath");
18
18
  var _ChartsOverlay = require("@mui/x-charts/ChartsOverlay");
19
+ var _constants = require("@mui/x-charts/constants");
19
20
  var _ChartContainerPro = require("../ChartContainerPro");
20
21
  var _HeatmapPlot = require("./HeatmapPlot");
21
22
  var _seriesConfig = require("./seriesConfig");
@@ -27,6 +28,16 @@ const defaultColorMap = (0, _d3Interpolate.interpolateRgbBasis)(['#f7fcf0', '#e0
27
28
  const seriesConfig = {
28
29
  heatmap: _seriesConfig.seriesConfig
29
30
  };
31
+ function getDefaultDataForAxis(series, dimension) {
32
+ if (series?.[0]?.data === undefined || series[0].data.length === 0) {
33
+ return [];
34
+ }
35
+ return Array.from({
36
+ length: Math.max(...series[0].data.map(dataPoint => dataPoint[dimension])) + 1
37
+ }, (_, index) => index);
38
+ }
39
+ const getDefaultDataForXAxis = series => getDefaultDataForAxis(series, 0);
40
+ const getDefaultDataForYAxis = series => getDefaultDataForAxis(series, 1);
30
41
  const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
31
42
  const props = (0, _styles.useThemeProps)({
32
43
  props: inProps,
@@ -43,10 +54,6 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
43
54
  colors,
44
55
  dataset,
45
56
  sx,
46
- topAxis,
47
- leftAxis,
48
- rightAxis,
49
- bottomAxis,
50
57
  onAxisClick,
51
58
  children,
52
59
  slots,
@@ -57,14 +64,22 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
57
64
  } = props;
58
65
  const id = (0, _useId.default)();
59
66
  const clipPathId = `${id}-clip-path`;
60
- const defaultizedXAxis = React.useMemo(() => xAxis.map(axis => (0, _extends2.default)({
67
+ const defaultizedXAxis = React.useMemo(() => (xAxis && xAxis.length > 0 ? xAxis : [{
68
+ id: _constants.DEFAULT_X_AXIS_KEY
69
+ }]).map(axis => (0, _extends2.default)({
61
70
  scaleType: 'band',
62
71
  categoryGapRatio: 0
63
- }, axis)), [xAxis]);
64
- const defaultizedYAxis = React.useMemo(() => yAxis.map(axis => (0, _extends2.default)({
72
+ }, axis, {
73
+ data: axis.data ?? getDefaultDataForXAxis(series)
74
+ })), [series, xAxis]);
75
+ const defaultizedYAxis = React.useMemo(() => (yAxis && yAxis.length > 0 ? yAxis : [{
76
+ id: _constants.DEFAULT_Y_AXIS_KEY
77
+ }]).map(axis => (0, _extends2.default)({
65
78
  scaleType: 'band',
66
79
  categoryGapRatio: 0
67
- }, axis)), [yAxis]);
80
+ }, axis, {
81
+ data: axis.data ?? getDefaultDataForYAxis(series)
82
+ })), [series, yAxis]);
68
83
  const defaultizedZAxis = React.useMemo(() => zAxis ?? [{
69
84
  colorMap: {
70
85
  type: 'continuous',
@@ -105,10 +120,6 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
105
120
  slotProps: slotProps
106
121
  })]
107
122
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, {
108
- topAxis: topAxis,
109
- leftAxis: leftAxis,
110
- rightAxis: rightAxis,
111
- bottomAxis: bottomAxis,
112
123
  slots: slots,
113
124
  slotProps: slotProps
114
125
  }), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, slotProps?.tooltip)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
@@ -122,16 +133,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
122
133
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
123
134
  // ----------------------------------------------------------------------
124
135
  apiRef: _propTypes.default.shape({
125
- current: _propTypes.default.shape({
126
- setZoomData: _propTypes.default.func.isRequired
127
- })
136
+ current: _propTypes.default.object
128
137
  }),
129
- /**
130
- * Indicate which axis to display the bottom of the charts.
131
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
132
- * @default xAxisIds[0] The id of the first provided axis
133
- */
134
- bottomAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
135
138
  children: _propTypes.default.node,
136
139
  className: _propTypes.default.string,
137
140
  /**
@@ -167,20 +170,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
167
170
  * If you don't provide this prop. It falls back to a randomly generated id.
168
171
  */
169
172
  id: _propTypes.default.string,
170
- /**
171
- * The list of zoom data related to each axis.
172
- */
173
- initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
174
- axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
175
- end: _propTypes.default.number.isRequired,
176
- start: _propTypes.default.number.isRequired
177
- })),
178
- /**
179
- * Indicate which axis to display the left of the charts.
180
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
181
- * @default yAxisIds[0] The id of the first provided axis
182
- */
183
- leftAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
184
173
  /**
185
174
  * If `true`, a loading overlay is displayed.
186
175
  * @default false
@@ -189,14 +178,15 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
189
178
  /**
190
179
  * The margin between the SVG and the drawing area.
191
180
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
192
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
181
+ *
182
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
193
183
  */
194
- margin: _propTypes.default.shape({
184
+ margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
195
185
  bottom: _propTypes.default.number,
196
186
  left: _propTypes.default.number,
197
187
  right: _propTypes.default.number,
198
188
  top: _propTypes.default.number
199
- }),
189
+ })]),
200
190
  /**
201
191
  * The function called for onClick events.
202
192
  * The second argument contains information about all line/bar elements at the current mouse position.
@@ -210,12 +200,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
210
200
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
211
201
  */
212
202
  onHighlightChange: _propTypes.default.func,
213
- /**
214
- * Indicate which axis to display the right of the charts.
215
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
216
- * @default null
217
- */
218
- rightAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
219
203
  /**
220
204
  * The series to display in the bar chart.
221
205
  * An array of [[HeatmapSeriesType]] objects.
@@ -244,12 +228,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
244
228
  * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
245
229
  */
246
230
  tooltip: _propTypes.default.object,
247
- /**
248
- * Indicate which axis to display the top of the charts.
249
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
250
- * @default null
251
- */
252
- topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
253
231
  /**
254
232
  * The width of the chart in px. If not defined, it takes the width of the parent element.
255
233
  */
@@ -260,6 +238,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
260
238
  * An array of [[AxisConfig]] objects.
261
239
  */
262
240
  xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
241
+ axis: _propTypes.default.oneOf(['x']),
263
242
  barGapRatio: _propTypes.default.number,
264
243
  categoryGapRatio: _propTypes.default.number,
265
244
  classes: _propTypes.default.object,
@@ -284,13 +263,15 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
284
263
  disableTicks: _propTypes.default.bool,
285
264
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
286
265
  fill: _propTypes.default.string,
266
+ height: _propTypes.default.number,
287
267
  hideTooltip: _propTypes.default.bool,
288
268
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
289
269
  label: _propTypes.default.string,
290
270
  labelStyle: _propTypes.default.object,
291
271
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
292
272
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
293
- position: _propTypes.default.oneOf(['bottom', 'top']),
273
+ offset: _propTypes.default.number,
274
+ position: _propTypes.default.oneOf(['bottom', 'none', 'top']),
294
275
  reverse: _propTypes.default.bool,
295
276
  scaleType: _propTypes.default.oneOf(['band']),
296
277
  slotProps: _propTypes.default.object,
@@ -299,6 +280,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
299
280
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
300
281
  tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
301
282
  tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
283
+ tickLabelMinGap: _propTypes.default.number,
302
284
  tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
303
285
  tickLabelStyle: _propTypes.default.object,
304
286
  tickMaxStep: _propTypes.default.number,
@@ -323,6 +305,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
323
305
  * An array of [[AxisConfig]] objects.
324
306
  */
325
307
  yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
308
+ axis: _propTypes.default.oneOf(['y']),
326
309
  barGapRatio: _propTypes.default.number,
327
310
  categoryGapRatio: _propTypes.default.number,
328
311
  classes: _propTypes.default.object,
@@ -353,7 +336,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
353
336
  labelStyle: _propTypes.default.object,
354
337
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
355
338
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
356
- position: _propTypes.default.oneOf(['left', 'right']),
339
+ offset: _propTypes.default.number,
340
+ position: _propTypes.default.oneOf(['left', 'none', 'right']),
357
341
  reverse: _propTypes.default.bool,
358
342
  scaleType: _propTypes.default.oneOf(['band']),
359
343
  slotProps: _propTypes.default.object,
@@ -370,6 +354,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
370
354
  tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
371
355
  tickSize: _propTypes.default.number,
372
356
  valueFormatter: _propTypes.default.func,
357
+ width: _propTypes.default.number,
373
358
  zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
374
359
  filterMode: _propTypes.default.oneOf(['discard', 'keep']),
375
360
  maxEnd: _propTypes.default.number,
@@ -27,7 +27,7 @@ var _useChartContainerProProps = require("../ChartContainerPro/useChartContainer
27
27
  var _ChartDataProviderPro = require("../ChartDataProviderPro");
28
28
  var _LineChartPro = require("./LineChartPro.plugins");
29
29
  var _jsxRuntime = require("react/jsx-runtime");
30
- const _excluded = ["initialZoom", "onZoomChange", "apiRef"];
30
+ const _excluded = ["initialZoom", "zoomData", "onZoomChange", "apiRef"];
31
31
  function AreaPlotZoom(props) {
32
32
  const isInteracting = (0, _zoom.useIsZoomInteracting)();
33
33
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.AreaPlot, (0, _extends2.default)({}, props, {
@@ -144,6 +144,7 @@ const LineChartPro = exports.LineChartPro = /*#__PURE__*/React.forwardRef(functi
144
144
  });
145
145
  const {
146
146
  initialZoom,
147
+ zoomData,
147
148
  onZoomChange,
148
149
  apiRef
149
150
  } = props,
@@ -169,6 +170,7 @@ const LineChartPro = exports.LineChartPro = /*#__PURE__*/React.forwardRef(functi
169
170
  chartsSurfaceProps
170
171
  } = (0, _useChartContainerProProps.useChartContainerProProps)((0, _extends2.default)({}, chartContainerProps, {
171
172
  initialZoom,
173
+ zoomData,
172
174
  onZoomChange,
173
175
  apiRef,
174
176
  plugins: _LineChartPro.LINE_CHART_PRO_PLUGINS
@@ -206,12 +208,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
206
208
  x: _propTypes.default.oneOf(['band', 'line', 'none']),
207
209
  y: _propTypes.default.oneOf(['band', 'line', 'none'])
208
210
  }),
209
- /**
210
- * Indicate which axis to display the bottom of the charts.
211
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
212
- * @default xAxisIds[0] The id of the first provided axis
213
- */
214
- bottomAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
215
211
  children: _propTypes.default.node,
216
212
  className: _propTypes.default.string,
217
213
  /**
@@ -264,18 +260,13 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
264
260
  id: _propTypes.default.string,
265
261
  /**
266
262
  * The list of zoom data related to each axis.
263
+ * Used to initialize the zoom in a specific configuration without controlling it.
267
264
  */
268
265
  initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
269
266
  axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
270
267
  end: _propTypes.default.number.isRequired,
271
268
  start: _propTypes.default.number.isRequired
272
269
  })),
273
- /**
274
- * Indicate which axis to display the left of the charts.
275
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
276
- * @default yAxisIds[0] The id of the first provided axis
277
- */
278
- leftAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
279
270
  /**
280
271
  * If `true`, a loading overlay is displayed.
281
272
  * @default false
@@ -284,14 +275,15 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
284
275
  /**
285
276
  * The margin between the SVG and the drawing area.
286
277
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
287
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
278
+ *
279
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
288
280
  */
289
- margin: _propTypes.default.shape({
281
+ margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
290
282
  bottom: _propTypes.default.number,
291
283
  left: _propTypes.default.number,
292
284
  right: _propTypes.default.number,
293
285
  top: _propTypes.default.number
294
- }),
286
+ })]),
295
287
  /**
296
288
  * Callback fired when an area element is clicked.
297
289
  */
@@ -323,12 +315,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
323
315
  * @param {ZoomData[]} zoomData Updated zoom data.
324
316
  */
325
317
  onZoomChange: _propTypes.default.func,
326
- /**
327
- * Indicate which axis to display the right of the charts.
328
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
329
- * @default null
330
- */
331
- rightAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
332
318
  /**
333
319
  * The series to display in the line chart.
334
320
  * An array of [[LineSeriesType]] objects.
@@ -352,12 +338,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
352
338
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
353
339
  theme: _propTypes.default.oneOf(['dark', 'light']),
354
340
  title: _propTypes.default.string,
355
- /**
356
- * Indicate which axis to display the top of the charts.
357
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
358
- * @default null
359
- */
360
- topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
361
341
  /**
362
342
  * The width of the chart in px. If not defined, it takes the width of the parent element.
363
343
  */
@@ -368,6 +348,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
368
348
  * An array of [[AxisConfig]] objects.
369
349
  */
370
350
  xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
351
+ axis: _propTypes.default.oneOf(['x']),
371
352
  classes: _propTypes.default.object,
372
353
  colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
373
354
  colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
@@ -390,13 +371,15 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
390
371
  disableTicks: _propTypes.default.bool,
391
372
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
392
373
  fill: _propTypes.default.string,
374
+ height: _propTypes.default.number,
393
375
  hideTooltip: _propTypes.default.bool,
394
376
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
395
377
  label: _propTypes.default.string,
396
378
  labelStyle: _propTypes.default.object,
397
379
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
398
380
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
399
- position: _propTypes.default.oneOf(['bottom', 'top']),
381
+ offset: _propTypes.default.number,
382
+ position: _propTypes.default.oneOf(['bottom', 'none', 'top']),
400
383
  reverse: _propTypes.default.bool,
401
384
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
402
385
  slotProps: _propTypes.default.object,
@@ -405,6 +388,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
405
388
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
406
389
  tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
407
390
  tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
391
+ tickLabelMinGap: _propTypes.default.number,
408
392
  tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
409
393
  tickLabelStyle: _propTypes.default.object,
410
394
  tickMaxStep: _propTypes.default.number,
@@ -429,6 +413,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
429
413
  * An array of [[AxisConfig]] objects.
430
414
  */
431
415
  yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
416
+ axis: _propTypes.default.oneOf(['y']),
432
417
  classes: _propTypes.default.object,
433
418
  colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
434
419
  colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
@@ -457,7 +442,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
457
442
  labelStyle: _propTypes.default.object,
458
443
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
459
444
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
460
- position: _propTypes.default.oneOf(['left', 'right']),
445
+ offset: _propTypes.default.number,
446
+ position: _propTypes.default.oneOf(['left', 'none', 'right']),
461
447
  reverse: _propTypes.default.bool,
462
448
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
463
449
  slotProps: _propTypes.default.object,
@@ -474,6 +460,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
474
460
  tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
475
461
  tickSize: _propTypes.default.number,
476
462
  valueFormatter: _propTypes.default.func,
463
+ width: _propTypes.default.number,
477
464
  zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
478
465
  filterMode: _propTypes.default.oneOf(['discard', 'keep']),
479
466
  maxEnd: _propTypes.default.number,
@@ -508,5 +495,13 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
508
495
  id: _propTypes.default.string,
509
496
  max: _propTypes.default.number,
510
497
  min: _propTypes.default.number
498
+ })),
499
+ /**
500
+ * The list of zoom data related to each axis.
501
+ */
502
+ zoomData: _propTypes.default.arrayOf(_propTypes.default.shape({
503
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
504
+ end: _propTypes.default.number.isRequired,
505
+ start: _propTypes.default.number.isRequired
511
506
  }))
512
507
  } : void 0;
@@ -25,7 +25,7 @@ var _useChartContainerProProps = require("../ChartContainerPro/useChartContainer
25
25
  var _ChartDataProviderPro = require("../ChartDataProviderPro");
26
26
  var _ScatterChartPro = require("./ScatterChartPro.plugins");
27
27
  var _jsxRuntime = require("react/jsx-runtime");
28
- const _excluded = ["initialZoom", "onZoomChange", "apiRef"];
28
+ const _excluded = ["initialZoom", "zoomData", "onZoomChange", "apiRef"];
29
29
  /**
30
30
  * Demos:
31
31
  *
@@ -43,6 +43,7 @@ const ScatterChartPro = exports.ScatterChartPro = /*#__PURE__*/React.forwardRef(
43
43
  });
44
44
  const {
45
45
  initialZoom,
46
+ zoomData,
46
47
  onZoomChange,
47
48
  apiRef
48
49
  } = props,
@@ -63,6 +64,7 @@ const ScatterChartPro = exports.ScatterChartPro = /*#__PURE__*/React.forwardRef(
63
64
  chartsSurfaceProps
64
65
  } = (0, _useChartContainerProProps.useChartContainerProProps)((0, _extends2.default)({}, chartContainerProps, {
65
66
  initialZoom,
67
+ zoomData,
66
68
  onZoomChange,
67
69
  apiRef,
68
70
  plugins: _ScatterChartPro.SCATTER_CHART_PRO_PLUGINS
@@ -100,12 +102,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
100
102
  x: _propTypes.default.oneOf(['band', 'line', 'none']),
101
103
  y: _propTypes.default.oneOf(['band', 'line', 'none'])
102
104
  }),
103
- /**
104
- * Indicate which axis to display the bottom of the charts.
105
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
106
- * @default xAxisIds[0] The id of the first provided axis
107
- */
108
- bottomAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
109
105
  children: _propTypes.default.node,
110
106
  className: _propTypes.default.string,
111
107
  /**
@@ -159,18 +155,13 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
159
155
  id: _propTypes.default.string,
160
156
  /**
161
157
  * The list of zoom data related to each axis.
158
+ * Used to initialize the zoom in a specific configuration without controlling it.
162
159
  */
163
160
  initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
164
161
  axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
165
162
  end: _propTypes.default.number.isRequired,
166
163
  start: _propTypes.default.number.isRequired
167
164
  })),
168
- /**
169
- * Indicate which axis to display the left of the charts.
170
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
171
- * @default yAxisIds[0] The id of the first provided axis
172
- */
173
- leftAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
174
165
  /**
175
166
  * If `true`, a loading overlay is displayed.
176
167
  * @default false
@@ -179,14 +170,15 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
179
170
  /**
180
171
  * The margin between the SVG and the drawing area.
181
172
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
182
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
173
+ *
174
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
183
175
  */
184
- margin: _propTypes.default.shape({
176
+ margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
185
177
  bottom: _propTypes.default.number,
186
178
  left: _propTypes.default.number,
187
179
  right: _propTypes.default.number,
188
180
  top: _propTypes.default.number
189
- }),
181
+ })]),
190
182
  /**
191
183
  * The function called for onClick events.
192
184
  * The second argument contains information about all line/bar elements at the current mouse position.
@@ -212,12 +204,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
212
204
  * @param {ZoomData[]} zoomData Updated zoom data.
213
205
  */
214
206
  onZoomChange: _propTypes.default.func,
215
- /**
216
- * Indicate which axis to display the right of the charts.
217
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
218
- * @default null
219
- */
220
- rightAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
221
207
  /**
222
208
  * The series to display in the scatter chart.
223
209
  * An array of [[ScatterSeriesType]] objects.
@@ -241,12 +227,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
241
227
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
242
228
  theme: _propTypes.default.oneOf(['dark', 'light']),
243
229
  title: _propTypes.default.string,
244
- /**
245
- * Indicate which axis to display the top of the charts.
246
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
247
- * @default null
248
- */
249
- topAxis: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.string]),
250
230
  /**
251
231
  * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
252
232
  * If `undefined`, the radius is assumed to be infinite.
@@ -262,6 +242,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
262
242
  * An array of [[AxisConfig]] objects.
263
243
  */
264
244
  xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
245
+ axis: _propTypes.default.oneOf(['x']),
265
246
  classes: _propTypes.default.object,
266
247
  colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
267
248
  colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
@@ -284,13 +265,15 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
284
265
  disableTicks: _propTypes.default.bool,
285
266
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
286
267
  fill: _propTypes.default.string,
268
+ height: _propTypes.default.number,
287
269
  hideTooltip: _propTypes.default.bool,
288
270
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
289
271
  label: _propTypes.default.string,
290
272
  labelStyle: _propTypes.default.object,
291
273
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
292
274
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
293
- position: _propTypes.default.oneOf(['bottom', 'top']),
275
+ offset: _propTypes.default.number,
276
+ position: _propTypes.default.oneOf(['bottom', 'none', 'top']),
294
277
  reverse: _propTypes.default.bool,
295
278
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
296
279
  slotProps: _propTypes.default.object,
@@ -299,6 +282,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
299
282
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
300
283
  tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
301
284
  tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
285
+ tickLabelMinGap: _propTypes.default.number,
302
286
  tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
303
287
  tickLabelStyle: _propTypes.default.object,
304
288
  tickMaxStep: _propTypes.default.number,
@@ -323,6 +307,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
323
307
  * An array of [[AxisConfig]] objects.
324
308
  */
325
309
  yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
310
+ axis: _propTypes.default.oneOf(['y']),
326
311
  classes: _propTypes.default.object,
327
312
  colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
328
313
  colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
@@ -351,7 +336,8 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
351
336
  labelStyle: _propTypes.default.object,
352
337
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
353
338
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
354
- position: _propTypes.default.oneOf(['left', 'right']),
339
+ offset: _propTypes.default.number,
340
+ position: _propTypes.default.oneOf(['left', 'none', 'right']),
355
341
  reverse: _propTypes.default.bool,
356
342
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
357
343
  slotProps: _propTypes.default.object,
@@ -368,6 +354,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
368
354
  tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
369
355
  tickSize: _propTypes.default.number,
370
356
  valueFormatter: _propTypes.default.func,
357
+ width: _propTypes.default.number,
371
358
  zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
372
359
  filterMode: _propTypes.default.oneOf(['discard', 'keep']),
373
360
  maxEnd: _propTypes.default.number,
@@ -402,5 +389,13 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
402
389
  id: _propTypes.default.string,
403
390
  max: _propTypes.default.number,
404
391
  min: _propTypes.default.number
392
+ })),
393
+ /**
394
+ * The list of zoom data related to each axis.
395
+ */
396
+ zoomData: _propTypes.default.arrayOf(_propTypes.default.shape({
397
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
398
+ end: _propTypes.default.number.isRequired,
399
+ start: _propTypes.default.number.isRequired
405
400
  }))
406
401
  } : void 0;