@mui/x-charts-pro 8.0.0 → 8.2.0

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 (134) hide show
  1. package/BarChartPro/BarChartPro.js +7 -1
  2. package/BarChartPro/BarChartPro.plugins.d.ts +2 -1
  3. package/BarChartPro/BarChartPro.plugins.js +2 -1
  4. package/CHANGELOG.md +230 -5
  5. package/ChartContainerPro/ChartContainerPro.d.ts +1 -0
  6. package/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
  7. package/ChartDataProviderPro/ChartDataProviderPro.js +11 -2
  8. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -2
  9. package/ChartDataProviderPro/useChartDataProviderProProps.js +2 -0
  10. package/FunnelChart/FunnelChart.js +12 -1
  11. package/FunnelChart/FunnelPlot.d.ts +5 -0
  12. package/FunnelChart/FunnelPlot.js +13 -16
  13. package/FunnelChart/curves/bump.d.ts +24 -0
  14. package/FunnelChart/curves/bump.js +82 -0
  15. package/FunnelChart/curves/curve.types.d.ts +8 -0
  16. package/FunnelChart/curves/curve.types.js +5 -0
  17. package/FunnelChart/curves/funnelStep.d.ts +25 -0
  18. package/FunnelChart/{funnelStepCurve.js → curves/funnelStep.js} +32 -19
  19. package/FunnelChart/curves/getFunnelCurve.d.ts +3 -0
  20. package/FunnelChart/curves/getFunnelCurve.js +22 -0
  21. package/FunnelChart/curves/index.d.ts +2 -0
  22. package/FunnelChart/curves/index.js +27 -0
  23. package/FunnelChart/curves/linear.d.ts +24 -0
  24. package/FunnelChart/curves/linear.js +113 -0
  25. package/FunnelChart/funnel.types.d.ts +2 -2
  26. package/FunnelChart/funnelPlotSlots.types.d.ts +1 -1
  27. package/FunnelChart/funnelSectionClasses.d.ts +1 -1
  28. package/FunnelChart/index.d.ts +3 -2
  29. package/FunnelChart/useFunnelChartProps.d.ts +1 -1
  30. package/FunnelChart/useFunnelChartProps.js +7 -4
  31. package/Heatmap/Heatmap.js +5 -1
  32. package/Heatmap/HeatmapItem.js +1 -1
  33. package/LineChartPro/LineChartPro.js +7 -1
  34. package/LineChartPro/LineChartPro.plugins.d.ts +2 -1
  35. package/LineChartPro/LineChartPro.plugins.js +2 -1
  36. package/ScatterChartPro/ScatterChartPro.js +7 -1
  37. package/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -1
  38. package/ScatterChartPro/ScatterChartPro.plugins.js +2 -1
  39. package/esm/BarChartPro/BarChartPro.js +7 -1
  40. package/esm/BarChartPro/BarChartPro.plugins.d.ts +2 -1
  41. package/esm/BarChartPro/BarChartPro.plugins.js +2 -1
  42. package/esm/ChartContainerPro/ChartContainerPro.d.ts +1 -0
  43. package/esm/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
  44. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +11 -2
  45. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -2
  46. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +2 -0
  47. package/esm/FunnelChart/FunnelChart.js +12 -1
  48. package/esm/FunnelChart/FunnelPlot.d.ts +5 -0
  49. package/esm/FunnelChart/FunnelPlot.js +14 -17
  50. package/esm/FunnelChart/curves/bump.d.ts +24 -0
  51. package/esm/FunnelChart/curves/bump.js +75 -0
  52. package/esm/FunnelChart/curves/curve.types.d.ts +8 -0
  53. package/esm/FunnelChart/curves/curve.types.js +1 -0
  54. package/esm/FunnelChart/curves/funnelStep.d.ts +25 -0
  55. package/esm/FunnelChart/{funnelStepCurve.js → curves/funnelStep.js} +32 -19
  56. package/esm/FunnelChart/curves/getFunnelCurve.d.ts +3 -0
  57. package/esm/FunnelChart/curves/getFunnelCurve.js +15 -0
  58. package/esm/FunnelChart/curves/index.d.ts +2 -0
  59. package/esm/FunnelChart/curves/index.js +2 -0
  60. package/esm/FunnelChart/curves/linear.d.ts +24 -0
  61. package/esm/FunnelChart/curves/linear.js +106 -0
  62. package/esm/FunnelChart/funnel.types.d.ts +2 -2
  63. package/esm/FunnelChart/funnelPlotSlots.types.d.ts +1 -1
  64. package/esm/FunnelChart/funnelSectionClasses.d.ts +1 -1
  65. package/esm/FunnelChart/index.d.ts +3 -2
  66. package/esm/FunnelChart/useFunnelChartProps.d.ts +1 -1
  67. package/esm/FunnelChart/useFunnelChartProps.js +7 -4
  68. package/esm/Heatmap/Heatmap.js +5 -1
  69. package/esm/Heatmap/HeatmapItem.js +1 -1
  70. package/esm/LineChartPro/LineChartPro.js +7 -1
  71. package/esm/LineChartPro/LineChartPro.plugins.d.ts +2 -1
  72. package/esm/LineChartPro/LineChartPro.plugins.js +2 -1
  73. package/esm/ScatterChartPro/ScatterChartPro.js +7 -1
  74. package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -1
  75. package/esm/ScatterChartPro/ScatterChartPro.plugins.js +2 -1
  76. package/esm/index.d.ts +1 -0
  77. package/esm/index.js +2 -1
  78. package/esm/internals/plugins/allPlugins.d.ts +5 -4
  79. package/esm/internals/plugins/allPlugins.js +3 -2
  80. package/esm/internals/plugins/useChartProExport/common.d.ts +1 -0
  81. package/esm/internals/plugins/useChartProExport/common.js +8 -0
  82. package/esm/internals/plugins/useChartProExport/exportImage.d.ts +3 -0
  83. package/esm/internals/plugins/useChartProExport/exportImage.js +85 -0
  84. package/esm/internals/plugins/useChartProExport/index.d.ts +2 -0
  85. package/esm/internals/plugins/useChartProExport/index.js +2 -0
  86. package/esm/internals/plugins/useChartProExport/print.d.ts +4 -0
  87. package/esm/internals/plugins/useChartProExport/print.js +28 -0
  88. package/esm/internals/plugins/useChartProExport/useChartProExport.d.ts +3 -0
  89. package/esm/internals/plugins/useChartProExport/useChartProExport.js +65 -0
  90. package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +67 -0
  91. package/esm/internals/plugins/useChartProExport/useChartProExport.types.js +1 -0
  92. package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -1
  93. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +54 -30
  94. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +25 -25
  95. package/esm/locales/index.d.ts +1 -0
  96. package/esm/locales/index.js +1 -0
  97. package/esm/themeAugmentation/components.d.ts +0 -4
  98. package/esm/themeAugmentation/components.js +1 -0
  99. package/esm/themeAugmentation/index.d.ts +3 -3
  100. package/esm/themeAugmentation/overrides.d.ts +0 -3
  101. package/esm/themeAugmentation/overrides.js +2 -0
  102. package/esm/themeAugmentation/props.d.ts +0 -6
  103. package/esm/themeAugmentation/props.js +2 -0
  104. package/index.d.ts +1 -0
  105. package/index.js +12 -1
  106. package/internals/plugins/allPlugins.d.ts +5 -4
  107. package/internals/plugins/allPlugins.js +3 -2
  108. package/internals/plugins/useChartProExport/common.d.ts +1 -0
  109. package/internals/plugins/useChartProExport/common.js +14 -0
  110. package/internals/plugins/useChartProExport/exportImage.d.ts +3 -0
  111. package/internals/plugins/useChartProExport/exportImage.js +95 -0
  112. package/internals/plugins/useChartProExport/index.d.ts +2 -0
  113. package/internals/plugins/useChartProExport/index.js +27 -0
  114. package/internals/plugins/useChartProExport/print.d.ts +4 -0
  115. package/internals/plugins/useChartProExport/print.js +35 -0
  116. package/internals/plugins/useChartProExport/useChartProExport.d.ts +3 -0
  117. package/internals/plugins/useChartProExport/useChartProExport.js +73 -0
  118. package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +67 -0
  119. package/internals/plugins/useChartProExport/useChartProExport.types.js +5 -0
  120. package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -1
  121. package/internals/plugins/useChartProZoom/useChartProZoom.js +54 -30
  122. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +25 -25
  123. package/locales/index.d.ts +1 -0
  124. package/locales/index.js +16 -0
  125. package/package.json +7 -4
  126. package/themeAugmentation/components.d.ts +0 -4
  127. package/themeAugmentation/components.js +5 -0
  128. package/themeAugmentation/index.d.ts +3 -3
  129. package/themeAugmentation/overrides.d.ts +0 -3
  130. package/themeAugmentation/overrides.js +5 -0
  131. package/themeAugmentation/props.d.ts +0 -6
  132. package/themeAugmentation/props.js +5 -0
  133. package/FunnelChart/funnelStepCurve.d.ts +0 -4
  134. package/esm/FunnelChart/funnelStepCurve.d.ts +0 -4
@@ -6,6 +6,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
6
6
  Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
+ exports.initializeZoomData = initializeZoomData;
9
10
  exports.useChartProZoom = void 0;
10
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
12
  var React = _interopRequireWildcard(require("react"));
@@ -15,16 +16,28 @@ var _rafThrottle = require("@mui/x-internals/rafThrottle");
15
16
  var _debounce = _interopRequireDefault(require("@mui/utils/debounce"));
16
17
  var _useChartProZoom = require("./useChartProZoom.utils");
17
18
  // It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
18
- function initializeZoomData(options) {
19
+ function initializeZoomData(options, zoomData) {
20
+ const zoomDataMap = new Map();
21
+ zoomData?.forEach(zoom => {
22
+ const option = options[zoom.axisId];
23
+ if (option) {
24
+ zoomDataMap.set(zoom.axisId, zoom);
25
+ }
26
+ });
19
27
  return Object.values(options).map(({
20
28
  axisId,
21
29
  minStart: start,
22
30
  maxEnd: end
23
- }) => ({
24
- axisId,
25
- start,
26
- end
27
- }));
31
+ }) => {
32
+ if (zoomDataMap.has(axisId)) {
33
+ return zoomDataMap.get(axisId);
34
+ }
35
+ return {
36
+ axisId,
37
+ start,
38
+ end
39
+ };
40
+ });
28
41
  }
29
42
  const useChartProZoom = ({
30
43
  store,
@@ -48,7 +61,7 @@ const useChartProZoom = ({
48
61
  }
49
62
  store.update(prevState => {
50
63
  if (process.env.NODE_ENV !== 'production' && !prevState.zoom.isControlled) {
51
- console.error([`MUI X: A chart component is changing the \`zoomData\` from uncontrolled to controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', 'Decide between using a controlled or uncontrolled for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
64
+ console.error([`MUI X Charts: A chart component is changing the \`zoomData\` from uncontrolled to controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', 'Decide between using a controlled or uncontrolled for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n'));
52
65
  }
53
66
  return (0, _extends2.default)({}, prevState, {
54
67
  zoom: (0, _extends2.default)({}, prevState.zoom, {
@@ -79,10 +92,7 @@ const useChartProZoom = ({
79
92
  })
80
93
  });
81
94
  }), 166), [store]);
82
-
83
- // This is throttled. We want to run it at most once per frame.
84
- // By joining the two, we ensure that interacting and zooming are in sync.
85
- const setZoomDataCallback = React.useMemo(() => (0, _rafThrottle.rafThrottle)(zoomData => {
95
+ const setZoomDataCallback = React.useCallback(zoomData => {
86
96
  store.update(prevState => {
87
97
  const newZoomData = typeof zoomData === 'function' ? zoomData([...prevState.zoom.zoomData]) : zoomData;
88
98
  onZoomChange?.(newZoomData);
@@ -97,10 +107,9 @@ const useChartProZoom = ({
97
107
  })
98
108
  });
99
109
  });
100
- }), [onZoomChange, store, removeIsInteracting]);
110
+ }, [onZoomChange, store, removeIsInteracting]);
101
111
  React.useEffect(() => {
102
112
  return () => {
103
- setZoomDataCallback.clear();
104
113
  removeIsInteracting.clear();
105
114
  };
106
115
  }, [setZoomDataCallback, removeIsInteracting]);
@@ -119,17 +128,10 @@ const useChartProZoom = ({
119
128
  if (element === null || !isPanEnabled) {
120
129
  return () => {};
121
130
  }
122
- const handlePan = event => {
123
- if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
124
- return;
125
- }
126
- if (touchStartRef.current == null) {
127
- return;
128
- }
129
- const point = (0, _internals.getSVGPoint)(element, event);
130
- const movementX = point.x - touchStartRef.current.x;
131
- const movementY = (point.y - touchStartRef.current.y) * -1;
132
- const newZoomData = touchStartRef.current.zoomData.map(zoom => {
131
+ const throttledHandlePan = (0, _rafThrottle.rafThrottle)((touchStart, point) => {
132
+ const movementX = point.x - touchStart.x;
133
+ const movementY = (point.y - touchStart.y) * -1;
134
+ const newZoomData = touchStart.zoomData.map(zoom => {
133
135
  const options = optionsLookup[zoom.axisId];
134
136
  if (!options || !options.panning) {
135
137
  return zoom;
@@ -160,6 +162,17 @@ const useChartProZoom = ({
160
162
  });
161
163
  });
162
164
  setZoomDataCallback(newZoomData);
165
+ });
166
+ const handlePan = event => {
167
+ if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
168
+ return;
169
+ }
170
+ if (touchStartRef.current == null) {
171
+ return;
172
+ }
173
+ const touchStart = touchStartRef.current;
174
+ const point = (0, _internals.getSVGPoint)(element, event);
175
+ throttledHandlePan(touchStart, point);
163
176
  };
164
177
  const handleDown = event => {
165
178
  panningEventCacheRef.current.push(event);
@@ -194,6 +207,7 @@ const useChartProZoom = ({
194
207
  document.removeEventListener('pointerup', handleUp);
195
208
  document.removeEventListener('pointercancel', handleUp);
196
209
  document.removeEventListener('pointerleave', handleUp);
210
+ throttledHandlePan.clear();
197
211
  };
198
212
  }, [instance, svgRef, isDraggingRef, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
199
213
 
@@ -203,6 +217,7 @@ const useChartProZoom = ({
203
217
  if (element === null || !isZoomEnabled) {
204
218
  return () => {};
205
219
  }
220
+ const rafThrottledSetZoomData = (0, _rafThrottle.rafThrottle)(setZoomDataCallback);
206
221
  const wheelHandler = event => {
207
222
  if (element === null) {
208
223
  return;
@@ -212,7 +227,13 @@ const useChartProZoom = ({
212
227
  return;
213
228
  }
214
229
  event.preventDefault();
215
- setZoomDataCallback(prevZoomData => {
230
+
231
+ /*
232
+ * Need to throttle `setZoomDataCallback` instead of `wheelHandler` because we're calling `event.preventDefault()`.
233
+ * If we throttle the event, then some events' default behavior won't be prevented and the page will scroll while
234
+ * the user is trying to zoom in.
235
+ */
236
+ rafThrottledSetZoomData(prevZoomData => {
216
237
  return prevZoomData.map(zoom => {
217
238
  const option = optionsLookup[zoom.axisId];
218
239
  if (!option) {
@@ -238,7 +259,7 @@ const useChartProZoom = ({
238
259
  function pointerDownHandler(event) {
239
260
  zoomEventCacheRef.current.push(event);
240
261
  }
241
- function pointerMoveHandler(event) {
262
+ const pointerMoveHandler = (0, _rafThrottle.rafThrottle)(function pointerMoveHandler(event) {
242
263
  if (element === null) {
243
264
  return;
244
265
  }
@@ -281,7 +302,7 @@ const useChartProZoom = ({
281
302
  eventPrevDiff.current = curDiff;
282
303
  return newZoomData;
283
304
  });
284
- }
305
+ });
285
306
  function pointerUpHandler(event) {
286
307
  zoomEventCacheRef.current.splice(zoomEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
287
308
  if (zoomEventCacheRef.current.length < 2) {
@@ -309,6 +330,8 @@ const useChartProZoom = ({
309
330
  element.removeEventListener('pointerleave', pointerUpHandler);
310
331
  element.removeEventListener('touchstart', _useChartProZoom.preventDefault);
311
332
  element.removeEventListener('touchmove', _useChartProZoom.preventDefault);
333
+ pointerMoveHandler.clear();
334
+ rafThrottledSetZoomData.clear();
312
335
  };
313
336
  }, [svgRef, drawingArea, isZoomEnabled, optionsLookup, instance, setZoomDataCallback]);
314
337
  return {
@@ -339,11 +362,12 @@ useChartProZoom.getInitialState = params => {
339
362
  defaultizedYAxis
340
363
  } = params;
341
364
  const optionsLookup = (0, _extends2.default)({}, (0, _internals.createZoomLookup)('x')(defaultizedXAxis), (0, _internals.createZoomLookup)('y')(defaultizedYAxis));
365
+ const userZoomData =
366
+ // eslint-disable-next-line no-nested-ternary
367
+ zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : undefined;
342
368
  return {
343
369
  zoom: {
344
- zoomData:
345
- // eslint-disable-next-line no-nested-ternary
346
- zoomData !== undefined ? zoomData : initialZoom !== undefined ? initialZoom : initializeZoomData(optionsLookup),
370
+ zoomData: initializeZoomData(optionsLookup, userZoomData),
347
371
  isInteracting: false,
348
372
  isControlled: zoomData !== undefined
349
373
  }
@@ -1,7 +1,7 @@
1
1
  import { ChartRootSelector } from '@mui/x-charts/internals';
2
2
  import { UseChartProZoomSignature } from "./useChartProZoom.types.js";
3
3
  export declare const selectorChartZoomState: ChartRootSelector<UseChartProZoomSignature>;
4
- export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types").UseChartProZoomState & Partial<{}> & {
4
+ export declare const selectorChartZoomIsInteracting: ((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("./useChartProZoom.types.js").UseChartProZoomState & Partial<{}> & {
5
5
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
6
6
  }) => boolean) & {
7
7
  clearCache: () => void;
@@ -85,8 +85,8 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
85
85
  resultsCount: () => number;
86
86
  resetResultsCount: () => void;
87
87
  } & {
88
- resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
89
- memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
88
+ resultFunc: (resultFuncArgs_0: import("@mui/x-charts/internals").DefaultedXAxis[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
89
+ memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts/internals").DefaultedXAxis[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
90
90
  clearCache: () => void;
91
91
  resultsCount: () => number;
92
92
  resetResultsCount: () => void;
@@ -94,27 +94,27 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
94
94
  lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
95
95
  dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
96
96
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
97
- }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
97
+ }) => import("@mui/x-charts/internals").DefaultedXAxis[] | undefined) & {
98
98
  clearCache: () => void;
99
99
  resultsCount: () => number;
100
100
  resetResultsCount: () => void;
101
101
  } & {
102
102
  resultFunc: (resultFuncArgs_0: {
103
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
104
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
105
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
103
+ x: import("@mui/x-charts/internals").DefaultedXAxis[];
104
+ y: import("@mui/x-charts/internals").DefaultedYAxis[];
105
+ } | undefined) => import("@mui/x-charts/internals").DefaultedXAxis[] | undefined;
106
106
  memoizedResultFunc: ((resultFuncArgs_0: {
107
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
108
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
109
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined) & {
107
+ x: import("@mui/x-charts/internals").DefaultedXAxis[];
108
+ y: import("@mui/x-charts/internals").DefaultedYAxis[];
109
+ } | undefined) => import("@mui/x-charts/internals").DefaultedXAxis[] | undefined) & {
110
110
  clearCache: () => void;
111
111
  resultsCount: () => number;
112
112
  resetResultsCount: () => void;
113
113
  };
114
- lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsXAxisProps>[] | undefined;
114
+ lastResult: () => import("@mui/x-charts/internals").DefaultedXAxis[] | undefined;
115
115
  dependencies: [(state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
116
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
117
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
116
+ x: import("@mui/x-charts/internals").DefaultedXAxis[];
117
+ y: import("@mui/x-charts/internals").DefaultedYAxis[];
118
118
  } | undefined];
119
119
  recomputations: () => number;
120
120
  resetRecomputations: () => void;
@@ -138,8 +138,8 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
138
138
  resultsCount: () => number;
139
139
  resetResultsCount: () => void;
140
140
  } & {
141
- resultFunc: (resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
142
- memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
141
+ resultFunc: (resultFuncArgs_0: import("@mui/x-charts/internals").DefaultedYAxis[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
142
+ memoizedResultFunc: ((resultFuncArgs_0: import("@mui/x-charts/internals").DefaultedYAxis[] | undefined) => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>) & {
143
143
  clearCache: () => void;
144
144
  resultsCount: () => number;
145
145
  resetResultsCount: () => void;
@@ -147,27 +147,27 @@ export declare const selectorChartZoomIsEnabled: ((state: import("@mui/x-charts/
147
147
  lastResult: () => Record<import("@mui/x-charts/internals").AxisId, import("@mui/x-charts/internals").DefaultizedZoomOptions>;
148
148
  dependencies: [((state: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
149
149
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
150
- }) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
150
+ }) => import("@mui/x-charts/internals").DefaultedYAxis[] | undefined) & {
151
151
  clearCache: () => void;
152
152
  resultsCount: () => number;
153
153
  resetResultsCount: () => void;
154
154
  } & {
155
155
  resultFunc: (resultFuncArgs_0: {
156
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
157
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
158
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined;
156
+ x: import("@mui/x-charts/internals").DefaultedXAxis[];
157
+ y: import("@mui/x-charts/internals").DefaultedYAxis[];
158
+ } | undefined) => import("@mui/x-charts/internals").DefaultedYAxis[] | undefined;
159
159
  memoizedResultFunc: ((resultFuncArgs_0: {
160
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
161
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
162
- } | undefined) => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined) & {
160
+ x: import("@mui/x-charts/internals").DefaultedXAxis[];
161
+ y: import("@mui/x-charts/internals").DefaultedYAxis[];
162
+ } | undefined) => import("@mui/x-charts/internals").DefaultedYAxis[] | undefined) & {
163
163
  clearCache: () => void;
164
164
  resultsCount: () => number;
165
165
  resetResultsCount: () => void;
166
166
  };
167
- lastResult: () => import("@mui/x-charts").AxisConfig<keyof import("@mui/x-charts/internals").AxisScaleConfig, any, import("@mui/x-charts").ChartsYAxisProps>[] | undefined;
167
+ lastResult: () => import("@mui/x-charts/internals").DefaultedYAxis[] | undefined;
168
168
  dependencies: [(state: import("@mui/x-charts/internals").ChartState<[], [import("@mui/x-charts/internals").UseChartCartesianAxisSignature]>) => {
169
- x: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>[];
170
- y: import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>[];
169
+ x: import("@mui/x-charts/internals").DefaultedXAxis[];
170
+ y: import("@mui/x-charts/internals").DefaultedYAxis[];
171
171
  } | undefined];
172
172
  recomputations: () => number;
173
173
  resetRecomputations: () => void;
@@ -0,0 +1 @@
1
+ export * from '@mui/x-charts/locales';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _locales = require("@mui/x-charts/locales");
7
+ Object.keys(_locales).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _locales[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _locales[key];
14
+ }
15
+ });
16
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts-pro",
3
- "version": "8.0.0",
3
+ "version": "8.2.0",
4
4
  "description": "The Pro plan edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -33,10 +33,10 @@
33
33
  "@mui/utils": "^7.0.2",
34
34
  "clsx": "^2.1.1",
35
35
  "prop-types": "^15.8.1",
36
+ "@mui/x-charts": "8.2.0",
37
+ "@mui/x-internals": "8.2.0",
36
38
  "@mui/x-charts-vendor": "8.0.0",
37
- "@mui/x-license": "8.0.0",
38
- "@mui/x-charts": "8.0.0",
39
- "@mui/x-internals": "8.0.0"
39
+ "@mui/x-license": "8.2.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/react": "^11.9.0",
@@ -54,6 +54,9 @@
54
54
  "optional": true
55
55
  }
56
56
  },
57
+ "optionalDependencies": {
58
+ "rasterizehtml": "^1.3.1"
59
+ },
57
60
  "engines": {
58
61
  "node": ">=14.0.0"
59
62
  },
@@ -1,19 +1,15 @@
1
1
  import { ComponentsProps, ComponentsOverrides } from '@mui/material/styles';
2
2
  export interface ChartsProComponents<Theme = unknown> {
3
- // BarChartPro components
4
3
  MuiBarChartPro?: {
5
4
  defaultProps?: ComponentsProps['MuiBarChartPro'];
6
5
  };
7
- // LineChartPro components
8
6
  MuiLineChartPro?: {
9
7
  defaultProps?: ComponentsProps['MuiLineChartPro'];
10
8
  };
11
- // Heatmap components
12
9
  MuiHeatmap?: {
13
10
  defaultProps?: ComponentsProps['MuiHeatmap'];
14
11
  styleOverrides?: ComponentsOverrides<Theme>['MuiHeatmap'];
15
12
  };
16
- // ScatterChartPro components
17
13
  MuiScatterChartPro?: {
18
14
  defaultProps?: ComponentsProps['MuiScatterChartPro'];
19
15
  };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,4 +1,4 @@
1
1
  export type * from '@mui/x-charts/themeAugmentation';
2
- export type * from './overrides';
3
- export type * from './props';
4
- export type * from './components';
2
+ export type * from "./overrides.js";
3
+ export type * from "./props.js";
4
+ export type * from "./components.js";
@@ -1,11 +1,8 @@
1
1
  import { HeatmapClassKey } from "../Heatmap/index.js";
2
2
  export interface ChartsProComponentNameToClassKey {
3
- // Heatmap components
4
3
  MuiHeatmap: HeatmapClassKey;
5
4
  }
6
5
  declare module '@mui/material/styles' {
7
6
  interface ComponentNameToClassKey extends ChartsProComponentNameToClassKey {}
8
7
  }
9
-
10
- // disable automatic export
11
8
  export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -3,18 +3,12 @@ import { BarChartProProps } from "../BarChartPro/index.js";
3
3
  import { HeatmapProps } from "../Heatmap/Heatmap.js";
4
4
  import { LineChartProProps } from "../LineChartPro/index.js";
5
5
  export interface ChartsProComponentsPropsList {
6
- // BarChartPro components
7
6
  MuiBarChartPro: BarChartProProps;
8
- // LineChartPro components
9
7
  MuiLineChartPro: LineChartProProps;
10
- // Heatmap components
11
8
  MuiHeatmap: HeatmapProps;
12
- // ScatterChartPro components
13
9
  MuiScatterChartPro: ScatterChartProProps;
14
10
  }
15
11
  declare module '@mui/material/styles' {
16
12
  interface ComponentsPropsList extends ChartsProComponentsPropsList {}
17
13
  }
18
-
19
- // disable automatic export
20
14
  export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,4 +0,0 @@
1
- import { CurveFactory } from '@mui/x-charts-vendor/d3-shape';
2
- declare const funnelHorizontalStepCurve: CurveFactory;
3
- declare const funnelVerticalStepCurve: CurveFactory;
4
- export { funnelHorizontalStepCurve, funnelVerticalStepCurve };
@@ -1,4 +0,0 @@
1
- import { CurveFactory } from '@mui/x-charts-vendor/d3-shape';
2
- declare const funnelHorizontalStepCurve: CurveFactory;
3
- declare const funnelVerticalStepCurve: CurveFactory;
4
- export { funnelHorizontalStepCurve, funnelVerticalStepCurve };