@mui/x-charts-pro 8.0.0-alpha.0 → 8.0.0-alpha.10

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 (188) hide show
  1. package/BarChartPro/BarChartPro.d.ts +2 -2
  2. package/BarChartPro/BarChartPro.js +74 -61
  3. package/CHANGELOG.md +2215 -119
  4. package/ChartContainerPro/ChartContainerPro.d.ts +33 -4
  5. package/ChartContainerPro/ChartContainerPro.js +59 -51
  6. package/ChartContainerPro/useChartContainerProProps.d.ts +7 -43
  7. package/ChartContainerPro/useChartContainerProProps.js +15 -9
  8. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
  9. package/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
  10. package/{context → ChartDataProviderPro}/package.json +1 -1
  11. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
  12. package/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
  13. package/Heatmap/Heatmap.d.ts +11 -4
  14. package/Heatmap/Heatmap.js +35 -43
  15. package/Heatmap/HeatmapItem.js +1 -1
  16. package/Heatmap/HeatmapTooltip.d.ts +9 -0
  17. package/Heatmap/HeatmapTooltip.js +274 -0
  18. package/Heatmap/extremums.d.ts +2 -2
  19. package/Heatmap/formatter.d.ts +2 -2
  20. package/Heatmap/formatter.js +2 -1
  21. package/Heatmap/heatmapClasses.js +2 -1
  22. package/Heatmap/index.d.ts +1 -1
  23. package/Heatmap/index.js +1 -1
  24. package/Heatmap/plugin.d.ts +2 -2
  25. package/Heatmap/plugin.js +4 -2
  26. package/Heatmap/tooltip.d.ts +3 -0
  27. package/Heatmap/tooltip.js +25 -0
  28. package/LineChartPro/LineChartPro.d.ts +2 -2
  29. package/LineChartPro/LineChartPro.js +80 -82
  30. package/README.md +3 -3
  31. package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
  32. package/ScatterChartPro/ScatterChartPro.js +51 -64
  33. package/hooks/index.d.ts +1 -0
  34. package/hooks/index.js +2 -1
  35. package/hooks/useSeries.d.ts +2 -4
  36. package/hooks/zoom/index.d.ts +1 -0
  37. package/hooks/zoom/index.js +1 -0
  38. package/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
  39. package/hooks/zoom/useIsZoomInteracting.js +14 -0
  40. package/index.d.ts +3 -1
  41. package/index.js +5 -5
  42. package/internals/plugins/allPlugins.d.ts +11 -0
  43. package/internals/plugins/allPlugins.js +5 -0
  44. package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +3 -0
  45. package/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
  46. package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +2 -0
  47. package/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
  48. package/internals/plugins/useChartProZoom/index.d.ts +3 -0
  49. package/internals/plugins/useChartProZoom/index.js +3 -0
  50. package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
  51. package/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
  52. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +377 -0
  53. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
  54. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +50 -0
  55. package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
  56. package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
  57. package/internals/plugins/useChartProZoom/zoom.types.d.ts +53 -0
  58. package/internals/utils/releaseInfo.js +2 -2
  59. package/models/index.d.ts +1 -0
  60. package/models/index.js +2 -1
  61. package/modern/BarChartPro/BarChartPro.js +74 -61
  62. package/modern/ChartContainerPro/ChartContainerPro.js +59 -51
  63. package/modern/ChartContainerPro/useChartContainerProProps.js +15 -9
  64. package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
  65. package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
  66. package/modern/Heatmap/Heatmap.js +35 -43
  67. package/modern/Heatmap/HeatmapItem.js +1 -1
  68. package/modern/Heatmap/HeatmapTooltip.js +274 -0
  69. package/modern/Heatmap/formatter.js +2 -1
  70. package/modern/Heatmap/heatmapClasses.js +2 -1
  71. package/modern/Heatmap/index.js +1 -1
  72. package/modern/Heatmap/plugin.js +4 -2
  73. package/modern/Heatmap/tooltip.js +25 -0
  74. package/modern/LineChartPro/LineChartPro.js +80 -82
  75. package/modern/ScatterChartPro/ScatterChartPro.js +51 -64
  76. package/modern/hooks/index.js +2 -1
  77. package/modern/hooks/zoom/index.js +1 -0
  78. package/modern/hooks/zoom/useIsZoomInteracting.js +14 -0
  79. package/modern/index.js +5 -5
  80. package/modern/internals/plugins/allPlugins.js +5 -0
  81. package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
  82. package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
  83. package/modern/internals/plugins/useChartProZoom/index.js +3 -0
  84. package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
  85. package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
  86. package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
  87. package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
  88. package/modern/internals/plugins/useChartProZoom/zoom.types.js +1 -0
  89. package/modern/internals/utils/releaseInfo.js +2 -2
  90. package/modern/models/index.js +2 -1
  91. package/node/BarChartPro/BarChartPro.js +73 -60
  92. package/node/ChartContainerPro/ChartContainerPro.js +58 -50
  93. package/node/ChartContainerPro/useChartContainerProProps.js +15 -9
  94. package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +70 -79
  95. package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
  96. package/node/Heatmap/Heatmap.js +35 -43
  97. package/node/Heatmap/HeatmapItem.js +2 -2
  98. package/node/Heatmap/HeatmapTooltip.js +280 -0
  99. package/node/Heatmap/formatter.js +2 -1
  100. package/node/Heatmap/heatmapClasses.js +5 -4
  101. package/node/Heatmap/index.js +4 -4
  102. package/node/Heatmap/plugin.js +4 -2
  103. package/node/Heatmap/tooltip.js +31 -0
  104. package/node/LineChartPro/LineChartPro.js +79 -81
  105. package/node/ScatterChartPro/ScatterChartPro.js +50 -63
  106. package/node/hooks/index.js +16 -1
  107. package/node/{context/CartesianProviderPro → hooks/zoom}/index.js +4 -4
  108. package/node/hooks/zoom/useIsZoomInteracting.js +19 -0
  109. package/node/index.js +34 -12
  110. package/node/internals/plugins/allPlugins.js +11 -0
  111. package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +19 -0
  112. package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +33 -0
  113. package/node/internals/plugins/useChartProZoom/index.js +38 -0
  114. package/node/internals/plugins/useChartProZoom/useChartProZoom.js +310 -0
  115. package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +18 -0
  116. package/node/internals/plugins/useChartProZoom/useChartProZoom.utils.js +140 -0
  117. package/node/internals/plugins/useChartProZoom/zoom.types.js +5 -0
  118. package/node/internals/utils/releaseInfo.js +4 -3
  119. package/package.json +8 -8
  120. package/typeOverloads/modules.d.ts +8 -1
  121. package/Heatmap/DefaultHeatmapTooltip.d.ts +0 -7
  122. package/Heatmap/DefaultHeatmapTooltip.js +0 -99
  123. package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
  124. package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
  125. package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -12
  126. package/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
  127. package/context/CartesianProviderPro/index.d.ts +0 -1
  128. package/context/CartesianProviderPro/index.js +0 -1
  129. package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -7
  130. package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -16
  131. package/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
  132. package/context/ZoomProvider/Zoom.types.d.ts +0 -144
  133. package/context/ZoomProvider/ZoomContext.d.ts +0 -4
  134. package/context/ZoomProvider/ZoomContext.js +0 -16
  135. package/context/ZoomProvider/ZoomProvider.d.ts +0 -3
  136. package/context/ZoomProvider/ZoomProvider.js +0 -56
  137. package/context/ZoomProvider/ZoomSetup.d.ts +0 -9
  138. package/context/ZoomProvider/ZoomSetup.js +0 -16
  139. package/context/ZoomProvider/defaultizeZoom.d.ts +0 -2
  140. package/context/ZoomProvider/defaultizeZoom.js +0 -32
  141. package/context/ZoomProvider/index.d.ts +0 -3
  142. package/context/ZoomProvider/index.js +0 -3
  143. package/context/ZoomProvider/initializeZoomData.d.ts +0 -6
  144. package/context/ZoomProvider/initializeZoomData.js +0 -13
  145. package/context/ZoomProvider/useSetupPan.d.ts +0 -1
  146. package/context/ZoomProvider/useSetupPan.js +0 -106
  147. package/context/ZoomProvider/useSetupZoom.d.ts +0 -1
  148. package/context/ZoomProvider/useSetupZoom.js +0 -274
  149. package/context/ZoomProvider/useZoom.d.ts +0 -7
  150. package/context/ZoomProvider/useZoom.js +0 -19
  151. package/context/index.d.ts +0 -3
  152. package/context/index.js +0 -5
  153. package/modern/Heatmap/DefaultHeatmapTooltip.js +0 -99
  154. package/modern/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
  155. package/modern/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
  156. package/modern/context/CartesianProviderPro/index.js +0 -1
  157. package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
  158. package/modern/context/ZoomProvider/ZoomContext.js +0 -16
  159. package/modern/context/ZoomProvider/ZoomProvider.js +0 -56
  160. package/modern/context/ZoomProvider/ZoomSetup.js +0 -16
  161. package/modern/context/ZoomProvider/defaultizeZoom.js +0 -32
  162. package/modern/context/ZoomProvider/index.js +0 -3
  163. package/modern/context/ZoomProvider/initializeZoomData.js +0 -13
  164. package/modern/context/ZoomProvider/useSetupPan.js +0 -106
  165. package/modern/context/ZoomProvider/useSetupZoom.js +0 -274
  166. package/modern/context/ZoomProvider/useZoom.js +0 -19
  167. package/modern/context/index.js +0 -5
  168. package/node/Heatmap/DefaultHeatmapTooltip.js +0 -105
  169. package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
  170. package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
  171. package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -50
  172. package/node/context/ZoomProvider/ZoomContext.js +0 -23
  173. package/node/context/ZoomProvider/ZoomProvider.js +0 -63
  174. package/node/context/ZoomProvider/ZoomSetup.js +0 -20
  175. package/node/context/ZoomProvider/defaultizeZoom.js +0 -40
  176. package/node/context/ZoomProvider/index.js +0 -38
  177. package/node/context/ZoomProvider/initializeZoomData.js +0 -20
  178. package/node/context/ZoomProvider/useSetupPan.js +0 -114
  179. package/node/context/ZoomProvider/useSetupZoom.js +0 -281
  180. package/node/context/ZoomProvider/useZoom.js +0 -25
  181. package/node/context/index.js +0 -27
  182. /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.d.ts +0 -0
  183. /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
  184. /package/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
  185. /package/{modern/context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/zoom.types.js} +0 -0
  186. /package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
  187. /package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
  188. /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
@@ -3,59 +3,68 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { ChartsAxesGradients, DrawingProvider, InteractionProvider, PluginProvider, SeriesProvider, AnimationProvider } from '@mui/x-charts/internals';
7
- import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
8
- import { HighlightedProvider, ZAxisContextProvider } from '@mui/x-charts/context';
6
+ import { Watermark } from '@mui/x-license/Watermark';
7
+ import { ChartProvider, AnimationProvider } from '@mui/x-charts/internals';
9
8
  import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
10
- import { getReleaseInfo } from "../../internals/utils/releaseInfo.js";
11
- import { CartesianProviderPro } from "../CartesianProviderPro/index.js";
12
- import { ZoomProvider } from "../ZoomProvider/index.js";
13
- import { useChartContainerProProps } from "./useChartDataProviderProProps.js";
9
+ import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
10
+ import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
14
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
12
  const releaseInfo = getReleaseInfo();
16
- const ChartDataProviderPro = /*#__PURE__*/React.forwardRef(function ChartDataProviderPro(props, ref) {
13
+ const packageIdentifier = 'x-charts-pro';
14
+ /**
15
+ * Orchestrates the data providers for the chart components and hooks.
16
+ *
17
+ * Use this component if you have custom HTML components that need to access the chart data.
18
+ *
19
+ * Demos:
20
+ *
21
+ * - [Composition](https://mui.com/x/api/charts/composition/)
22
+ *
23
+ * API:
24
+ *
25
+ * - [ChartDataProviderPro API](https://mui.com/x/api/charts/chart-data-provider/)
26
+ *
27
+ * @example
28
+ * ```jsx
29
+ * <ChartDataProviderPro
30
+ * series={[{ label: "Label", type: "bar", data: [10, 20] }]}
31
+ * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
32
+ * >
33
+ * <ChartsSurface>
34
+ * <BarPlot />
35
+ * <ChartsXAxis position="bottom" axisId="x-axis" />
36
+ * </ChartsSurface>
37
+ * {'Custom Legend Component'}
38
+ * </ChartDataProviderPro>
39
+ * ```
40
+ */
41
+ function ChartDataProviderPro(props) {
17
42
  const {
18
- zoomProviderProps,
19
- drawingProviderProps,
20
- seriesProviderProps,
21
- zAxisContextProps,
22
- highlightedProviderProps,
23
- cartesianProviderProps,
24
- chartsSurfaceProps,
25
- pluginProviderProps,
43
+ children,
26
44
  animationProviderProps,
27
- children
28
- } = useChartContainerProProps(props, ref);
29
- useLicenseVerifier('x-charts-pro', releaseInfo);
30
- return /*#__PURE__*/_jsx(DrawingProvider, _extends({}, drawingProviderProps, {
31
- children: /*#__PURE__*/_jsx(AnimationProvider, _extends({}, animationProviderProps, {
32
- children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
33
- children: /*#__PURE__*/_jsx(ZoomProvider, _extends({}, zoomProviderProps, {
34
- children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
35
- children: /*#__PURE__*/_jsx(CartesianProviderPro, _extends({}, cartesianProviderProps, {
36
- children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
37
- children: /*#__PURE__*/_jsx(InteractionProvider, {
38
- children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
39
- children: /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
40
- children: [/*#__PURE__*/_jsx(ChartsAxesGradients, {}), children]
41
- }))
42
- }))
43
- })
44
- }))
45
- }))
46
- }))
47
- }))
48
- }))
45
+ chartProviderProps
46
+ } = useChartDataProviderProProps(props);
47
+ useLicenseVerifier(packageIdentifier, releaseInfo);
48
+ return /*#__PURE__*/_jsx(ChartProvider, _extends({}, chartProviderProps, {
49
+ children: /*#__PURE__*/_jsxs(AnimationProvider, _extends({}, animationProviderProps, {
50
+ children: [children, /*#__PURE__*/_jsx(Watermark, {
51
+ packageName: packageIdentifier,
52
+ releaseInfo: releaseInfo
53
+ })]
49
54
  }))
50
55
  }));
51
- });
56
+ }
52
57
  process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
53
58
  // ----------------------------- Warning --------------------------------
54
59
  // | These PropTypes are generated from the TypeScript type definitions |
55
60
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
56
61
  // ----------------------------------------------------------------------
62
+ apiRef: PropTypes.shape({
63
+ current: PropTypes.shape({
64
+ setZoomData: PropTypes.func.isRequired
65
+ })
66
+ }),
57
67
  children: PropTypes.node,
58
- className: PropTypes.string,
59
68
  /**
60
69
  * Color palette used to colorize multiple series.
61
70
  * @default blueberryTwilightPalette
@@ -65,29 +74,35 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
65
74
  * An array of objects that can be used to populate series and axes data using their `dataKey` property.
66
75
  */
67
76
  dataset: PropTypes.arrayOf(PropTypes.object),
68
- desc: PropTypes.string,
69
- /**
70
- * If `true`, the charts will not listen to the mouse move event.
71
- * It might break interactive features, but will improve performance.
72
- * @default false
73
- */
74
- disableAxisListener: PropTypes.bool,
75
77
  /**
76
- * The height of the chart in px.
78
+ * The height of the chart in px. If not defined, it takes the height of the parent element.
77
79
  */
78
- height: PropTypes.number.isRequired,
80
+ height: PropTypes.number,
79
81
  /**
80
- * The item currently highlighted. Turns highlighting into a controlled prop.
82
+ * The highlighted item.
83
+ * Used when the highlight is controlled.
81
84
  */
82
85
  highlightedItem: PropTypes.shape({
83
86
  dataIndex: PropTypes.number,
84
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
87
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
85
88
  }),
89
+ /**
90
+ * This prop is used to help implement the accessibility logic.
91
+ * If you don't provide this prop. It falls back to a randomly generated id.
92
+ */
93
+ id: PropTypes.string,
94
+ /**
95
+ * The list of zoom data related to each axis.
96
+ */
97
+ initialZoom: PropTypes.arrayOf(PropTypes.shape({
98
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
99
+ end: PropTypes.number.isRequired,
100
+ start: PropTypes.number.isRequired
101
+ })),
86
102
  /**
87
103
  * The margin between the SVG and the drawing area.
88
104
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
89
105
  * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
90
- * @default object Depends on the charts type.
91
106
  */
92
107
  margin: PropTypes.shape({
93
108
  bottom: PropTypes.number,
@@ -107,34 +122,22 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
107
122
  * @param {ZoomData[]} zoomData Updated zoom data.
108
123
  */
109
124
  onZoomChange: PropTypes.func,
110
- /**
111
- * An array of plugins defining how to preprocess data.
112
- * If not provided, the container supports line, bar, scatter and pie charts.
113
- */
114
- plugins: PropTypes.arrayOf(PropTypes.object),
115
125
  /**
116
126
  * The array of series to display.
117
127
  * Each type of series has its own specificity.
118
128
  * Please refer to the appropriate docs page to learn more about it.
119
129
  */
120
- series: PropTypes.arrayOf(PropTypes.object).isRequired,
130
+ series: PropTypes.arrayOf(PropTypes.object),
121
131
  /**
122
132
  * If `true`, animations are skipped.
123
133
  * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
124
134
  */
125
135
  skipAnimation: PropTypes.bool,
126
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
127
- title: PropTypes.string,
128
- viewBox: PropTypes.shape({
129
- height: PropTypes.number,
130
- width: PropTypes.number,
131
- x: PropTypes.number,
132
- y: PropTypes.number
133
- }),
136
+ theme: PropTypes.oneOf(['dark', 'light']),
134
137
  /**
135
- * The width of the chart in px.
138
+ * The width of the chart in px. If not defined, it takes the width of the parent element.
136
139
  */
137
- width: PropTypes.number.isRequired,
140
+ width: PropTypes.number,
138
141
  /**
139
142
  * The configuration of the x-axes.
140
143
  * If not provided, a default axis config is used.
@@ -166,7 +169,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
166
169
  hideTooltip: PropTypes.bool,
167
170
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
168
171
  label: PropTypes.string,
169
- labelFontSize: PropTypes.number,
170
172
  labelStyle: PropTypes.object,
171
173
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
172
174
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -177,7 +179,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
177
179
  slots: PropTypes.object,
178
180
  stroke: PropTypes.string,
179
181
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
180
- tickFontSize: PropTypes.number,
181
182
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
182
183
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
183
184
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
@@ -229,7 +230,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
229
230
  hideTooltip: PropTypes.bool,
230
231
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
231
232
  label: PropTypes.string,
232
- labelFontSize: PropTypes.number,
233
233
  labelStyle: PropTypes.object,
234
234
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
235
235
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -240,7 +240,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
240
240
  slots: PropTypes.object,
241
241
  stroke: PropTypes.string,
242
242
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
243
- tickFontSize: PropTypes.number,
244
243
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
245
244
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
246
245
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
@@ -285,14 +284,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
285
284
  id: PropTypes.string,
286
285
  max: PropTypes.number,
287
286
  min: PropTypes.number
288
- })),
289
- /**
290
- * The list of zoom data related to each axis.
291
- */
292
- zoom: PropTypes.arrayOf(PropTypes.shape({
293
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
294
- end: PropTypes.number.isRequired,
295
- start: PropTypes.number.isRequired
296
287
  }))
297
288
  } : void 0;
298
289
  export { ChartDataProviderPro };
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+
3
+ import { useChartDataProviderProps } from '@mui/x-charts/internals';
4
+ export const useChartDataProviderProProps = props => {
5
+ const {
6
+ animationProviderProps,
7
+ chartProviderProps,
8
+ children
9
+ } = useChartDataProviderProps(props);
10
+ return {
11
+ children,
12
+ animationProviderProps,
13
+ chartProviderProps
14
+ };
15
+ };
@@ -7,17 +7,19 @@ import { useThemeProps } from '@mui/material/styles';
7
7
  import useId from '@mui/utils/useId';
8
8
  import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
9
9
  import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
10
- import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
11
10
  import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
12
11
  import { ChartsOnAxisClickHandler } from '@mui/x-charts/ChartsOnAxisClickHandler';
13
12
  import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
14
13
  import { ChartContainerPro } from "../ChartContainerPro/index.js";
15
14
  import { HeatmapPlot } from "./HeatmapPlot.js";
16
15
  import { plugin as heatmapPlugin } from "./plugin.js";
17
- import { DefaultHeatmapTooltip } from "./DefaultHeatmapTooltip.js";
16
+ import { HeatmapTooltip } from "./HeatmapTooltip.js";
18
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
18
  // The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
20
19
  const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
20
+ const seriesConfig = {
21
+ heatmap: heatmapPlugin
22
+ };
21
23
  const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
22
24
  const props = useThemeProps({
23
25
  props: inProps,
@@ -34,7 +36,6 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
34
36
  colors,
35
37
  dataset,
36
38
  sx,
37
- tooltip,
38
39
  topAxis,
39
40
  leftAxis,
40
41
  rightAxis,
@@ -65,9 +66,10 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
65
66
  color: defaultColorMap
66
67
  }
67
68
  }], [zAxis]);
69
+ const Tooltip = props.slots?.tooltip ?? HeatmapTooltip;
68
70
  return /*#__PURE__*/_jsxs(ChartContainerPro, {
69
71
  ref: ref,
70
- plugins: [heatmapPlugin],
72
+ seriesConfig: seriesConfig,
71
73
  series: series.map(s => _extends({
72
74
  type: 'heatmap'
73
75
  }, s)),
@@ -102,14 +104,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
102
104
  bottomAxis: bottomAxis,
103
105
  slots: slots,
104
106
  slotProps: slotProps
105
- }), !loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({
106
- trigger: "item"
107
- }, tooltip, {
108
- slots: _extends({
109
- itemContent: DefaultHeatmapTooltip
110
- }, slots),
111
- slotProps: slotProps
112
- })), /*#__PURE__*/_jsx(ChartsClipPath, {
107
+ }), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
113
108
  id: clipPathId
114
109
  }), children]
115
110
  });
@@ -119,6 +114,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
119
114
  // | These PropTypes are generated from the TypeScript type definitions |
120
115
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
121
116
  // ----------------------------------------------------------------------
117
+ apiRef: PropTypes.shape({
118
+ current: PropTypes.shape({
119
+ setZoomData: PropTypes.func.isRequired
120
+ })
121
+ }),
122
122
  /**
123
123
  * Indicate which axis to display the bottom of the charts.
124
124
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
@@ -148,12 +148,26 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
148
148
  */
149
149
  height: PropTypes.number,
150
150
  /**
151
- * The item currently highlighted. Turns highlighting into a controlled prop.
151
+ * The highlighted item.
152
+ * Used when the highlight is controlled.
152
153
  */
153
154
  highlightedItem: PropTypes.shape({
154
155
  dataIndex: PropTypes.number,
155
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
156
+ seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
156
157
  }),
158
+ /**
159
+ * This prop is used to help implement the accessibility logic.
160
+ * If you don't provide this prop. It falls back to a randomly generated id.
161
+ */
162
+ id: PropTypes.string,
163
+ /**
164
+ * The list of zoom data related to each axis.
165
+ */
166
+ initialZoom: PropTypes.arrayOf(PropTypes.shape({
167
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
168
+ end: PropTypes.number.isRequired,
169
+ start: PropTypes.number.isRequired
170
+ })),
157
171
  /**
158
172
  * Indicate which axis to display the left of the charts.
159
173
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
@@ -169,7 +183,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
169
183
  * The margin between the SVG and the drawing area.
170
184
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
171
185
  * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
172
- * @default object Depends on the charts type.
173
186
  */
174
187
  margin: PropTypes.shape({
175
188
  bottom: PropTypes.number,
@@ -190,16 +203,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
190
203
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
191
204
  */
192
205
  onHighlightChange: PropTypes.func,
193
- /**
194
- * The chart will try to wait for the parent container to resolve its size
195
- * before it renders for the first time.
196
- *
197
- * This can be useful in some scenarios where the chart appear to grow after
198
- * the first render, like when used inside a grid.
199
- *
200
- * @default false
201
- */
202
- resolveSizeBeforeRender: PropTypes.bool,
203
206
  /**
204
207
  * Indicate which axis to display the right of the charts.
205
208
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
@@ -211,6 +214,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
211
214
  * An array of [[HeatmapSeriesType]] objects.
212
215
  */
213
216
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
217
+ /**
218
+ * The configuration helpers used to compute attributes according to the serries type.
219
+ * @ignore Unstable props for internal usage.
220
+ */
221
+ seriesConfig: PropTypes.object,
214
222
  /**
215
223
  * The props used for each component slot.
216
224
  * @default {}
@@ -222,31 +230,19 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
222
230
  */
223
231
  slots: PropTypes.object,
224
232
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
233
+ theme: PropTypes.oneOf(['dark', 'light']),
225
234
  title: PropTypes.string,
226
235
  /**
227
236
  * The configuration of the tooltip.
228
237
  * @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
229
238
  */
230
- tooltip: PropTypes.shape({
231
- axisContent: PropTypes.elementType,
232
- classes: PropTypes.object,
233
- itemContent: PropTypes.elementType,
234
- slotProps: PropTypes.object,
235
- slots: PropTypes.object,
236
- trigger: PropTypes.oneOf(['axis', 'item', 'none'])
237
- }),
239
+ tooltip: PropTypes.object,
238
240
  /**
239
241
  * Indicate which axis to display the top of the charts.
240
242
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
241
243
  * @default null
242
244
  */
243
245
  topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
244
- viewBox: PropTypes.shape({
245
- height: PropTypes.number,
246
- width: PropTypes.number,
247
- x: PropTypes.number,
248
- y: PropTypes.number
249
- }),
250
246
  /**
251
247
  * The width of the chart in px. If not defined, it takes the width of the parent element.
252
248
  */
@@ -284,7 +280,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
284
280
  hideTooltip: PropTypes.bool,
285
281
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
286
282
  label: PropTypes.string,
287
- labelFontSize: PropTypes.number,
288
283
  labelStyle: PropTypes.object,
289
284
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
290
285
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -295,7 +290,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
295
290
  slots: PropTypes.object,
296
291
  stroke: PropTypes.string,
297
292
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
298
- tickFontSize: PropTypes.number,
299
293
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
300
294
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
301
295
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
@@ -349,7 +343,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
349
343
  hideTooltip: PropTypes.bool,
350
344
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
351
345
  label: PropTypes.string,
352
- labelFontSize: PropTypes.number,
353
346
  labelStyle: PropTypes.object,
354
347
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
355
348
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -360,7 +353,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
360
353
  slots: PropTypes.object,
361
354
  stroke: PropTypes.string,
362
355
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
363
- tickFontSize: PropTypes.number,
364
356
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
365
357
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
366
358
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import { styled } from '@mui/material/styles';
7
7
  import useSlotProps from '@mui/utils/useSlotProps';
8
8
  import composeClasses from '@mui/utils/composeClasses';
9
- import { useItemHighlighted } from '@mui/x-charts/context';
9
+ import { useItemHighlighted } from '@mui/x-charts/hooks';
10
10
  import { useInteractionItemProps } from '@mui/x-charts/internals';
11
11
  import { getHeatmapUtilityClass } from "./heatmapClasses.js";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";