@mui/x-charts-pro 8.3.1 → 8.5.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 (206) hide show
  1. package/BarChartPro/BarChartPro.d.ts +13 -5
  2. package/BarChartPro/BarChartPro.js +56 -21
  3. package/CHANGELOG.md +213 -0
  4. package/ChartContainerPro/ChartContainerPro.d.ts +0 -1
  5. package/ChartContainerPro/ChartContainerPro.js +1 -0
  6. package/ChartContainerPro/ChartProApi.d.ts +26 -0
  7. package/ChartContainerPro/ChartProApi.js +5 -0
  8. package/ChartContainerPro/index.d.ts +2 -1
  9. package/ChartContainerPro/index.js +11 -0
  10. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +11 -1
  11. package/ChartDataProviderPro/ChartDataProviderPro.js +19 -3
  12. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -0
  13. package/ChartDataProviderPro/useChartDataProviderProProps.js +5 -1
  14. package/ChartZoomSlider/index.d.ts +1 -1
  15. package/ChartZoomSlider/index.js +4 -4
  16. package/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
  17. package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +31 -287
  18. package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
  19. package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +251 -0
  20. package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +12 -0
  21. package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +92 -0
  22. package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
  23. package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +160 -0
  24. package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +11 -0
  25. package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.js +58 -0
  26. package/ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts +17 -0
  27. package/ChartZoomSlider/internals/{chartAxisZoomSliderHandleClasses.js → chartAxisZoomSliderThumbClasses.js} +6 -6
  28. package/ChartZoomSlider/internals/constants.d.ts +5 -0
  29. package/ChartZoomSlider/internals/constants.js +11 -0
  30. package/ChartZoomSlider/internals/zoom-utils.d.ts +4 -0
  31. package/ChartZoomSlider/internals/zoom-utils.js +48 -0
  32. package/ChartsToolbarPro/ChartsToolbarPro.d.ts +8 -1
  33. package/ChartsToolbarPro/ChartsToolbarPro.js +42 -8
  34. package/ChartsToolbarPro/ChartsToolbarZoomInButton.d.ts +16 -0
  35. package/ChartsToolbarPro/ChartsToolbarZoomInButton.js +56 -0
  36. package/ChartsToolbarPro/ChartsToolbarZoomOutButton.d.ts +16 -0
  37. package/ChartsToolbarPro/ChartsToolbarZoomOutButton.js +56 -0
  38. package/ChartsToolbarPro/index.d.ts +3 -1
  39. package/ChartsToolbarPro/index.js +22 -0
  40. package/FunnelChart/FunnelChart.d.ts +2 -1
  41. package/FunnelChart/FunnelChart.js +6 -23
  42. package/FunnelChart/FunnelChart.plugins.d.ts +4 -0
  43. package/FunnelChart/FunnelChart.plugins.js +9 -0
  44. package/FunnelChart/FunnelPlot.js +2 -0
  45. package/FunnelChart/FunnelSection.js +2 -1
  46. package/FunnelChart/curves/curve.types.d.ts +4 -0
  47. package/FunnelChart/curves/pyramid.d.ts +3 -1
  48. package/FunnelChart/curves/pyramid.js +37 -10
  49. package/FunnelChart/curves/step-pyramid.d.ts +10 -2
  50. package/FunnelChart/curves/step-pyramid.js +96 -20
  51. package/FunnelChart/curves/step.d.ts +5 -1
  52. package/FunnelChart/curves/step.js +20 -2
  53. package/FunnelChart/funnel.types.d.ts +7 -0
  54. package/FunnelChart/funnelSlots.types.d.ts +4 -3
  55. package/FunnelChart/seriesConfig/seriesProcessor.js +47 -1
  56. package/FunnelChart/useFunnelChartProps.d.ts +2 -1
  57. package/FunnelChart/useFunnelChartProps.js +3 -1
  58. package/Heatmap/Heatmap.d.ts +18 -5
  59. package/Heatmap/Heatmap.js +64 -26
  60. package/Heatmap/Heatmap.plugins.d.ts +2 -1
  61. package/Heatmap/Heatmap.plugins.js +2 -1
  62. package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +2 -0
  63. package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +27 -0
  64. package/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -10
  65. package/Heatmap/HeatmapTooltip/HeatmapTooltip.js +4 -102
  66. package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +10 -0
  67. package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.js +5 -0
  68. package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +7 -0
  69. package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +96 -0
  70. package/Heatmap/HeatmapTooltip/index.d.ts +3 -1
  71. package/Heatmap/HeatmapTooltip/index.js +11 -0
  72. package/LineChartPro/LineChartPro.d.ts +13 -5
  73. package/LineChartPro/LineChartPro.js +56 -21
  74. package/RadarChartPro/RadarChartPro.d.ts +15 -0
  75. package/RadarChartPro/RadarChartPro.js +202 -0
  76. package/RadarChartPro/RadarChartPro.plugins.d.ts +4 -0
  77. package/RadarChartPro/RadarChartPro.plugins.js +9 -0
  78. package/RadarChartPro/index.d.ts +1 -0
  79. package/RadarChartPro/index.js +16 -0
  80. package/ScatterChartPro/ScatterChartPro.d.ts +13 -5
  81. package/ScatterChartPro/ScatterChartPro.js +57 -22
  82. package/context/index.d.ts +1 -0
  83. package/context/index.js +16 -0
  84. package/context/useChartApiContext.d.ts +9 -0
  85. package/context/useChartApiContext.js +17 -0
  86. package/esm/BarChartPro/BarChartPro.d.ts +13 -5
  87. package/esm/BarChartPro/BarChartPro.js +54 -19
  88. package/esm/ChartContainerPro/ChartContainerPro.d.ts +0 -1
  89. package/esm/ChartContainerPro/ChartContainerPro.js +1 -0
  90. package/esm/ChartContainerPro/ChartProApi.d.ts +26 -0
  91. package/esm/ChartContainerPro/ChartProApi.js +1 -0
  92. package/esm/ChartContainerPro/index.d.ts +2 -1
  93. package/esm/ChartContainerPro/index.js +2 -1
  94. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +11 -1
  95. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +20 -4
  96. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -0
  97. package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +5 -1
  98. package/esm/ChartZoomSlider/index.d.ts +1 -1
  99. package/esm/ChartZoomSlider/index.js +1 -1
  100. package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
  101. package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +30 -283
  102. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
  103. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +243 -0
  104. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +12 -0
  105. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +85 -0
  106. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
  107. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +152 -0
  108. package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +11 -0
  109. package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.js +52 -0
  110. package/esm/ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts +17 -0
  111. package/esm/ChartZoomSlider/internals/{chartAxisZoomSliderHandleClasses.js → chartAxisZoomSliderThumbClasses.js} +4 -4
  112. package/esm/ChartZoomSlider/internals/constants.d.ts +5 -0
  113. package/esm/ChartZoomSlider/internals/constants.js +5 -0
  114. package/esm/ChartZoomSlider/internals/zoom-utils.d.ts +4 -0
  115. package/esm/ChartZoomSlider/internals/zoom-utils.js +40 -0
  116. package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +8 -1
  117. package/esm/ChartsToolbarPro/ChartsToolbarPro.js +42 -9
  118. package/esm/ChartsToolbarPro/ChartsToolbarZoomInButton.d.ts +16 -0
  119. package/esm/ChartsToolbarPro/ChartsToolbarZoomInButton.js +50 -0
  120. package/esm/ChartsToolbarPro/ChartsToolbarZoomOutButton.d.ts +16 -0
  121. package/esm/ChartsToolbarPro/ChartsToolbarZoomOutButton.js +50 -0
  122. package/esm/ChartsToolbarPro/index.d.ts +3 -1
  123. package/esm/ChartsToolbarPro/index.js +3 -1
  124. package/esm/FunnelChart/FunnelChart.d.ts +2 -1
  125. package/esm/FunnelChart/FunnelChart.js +6 -23
  126. package/esm/FunnelChart/FunnelChart.plugins.d.ts +4 -0
  127. package/esm/FunnelChart/FunnelChart.plugins.js +3 -0
  128. package/esm/FunnelChart/FunnelPlot.js +2 -0
  129. package/esm/FunnelChart/FunnelSection.js +1 -0
  130. package/esm/FunnelChart/curves/curve.types.d.ts +4 -0
  131. package/esm/FunnelChart/curves/pyramid.d.ts +3 -1
  132. package/esm/FunnelChart/curves/pyramid.js +37 -10
  133. package/esm/FunnelChart/curves/step-pyramid.d.ts +10 -2
  134. package/esm/FunnelChart/curves/step-pyramid.js +96 -20
  135. package/esm/FunnelChart/curves/step.d.ts +5 -1
  136. package/esm/FunnelChart/curves/step.js +20 -2
  137. package/esm/FunnelChart/funnel.types.d.ts +7 -0
  138. package/esm/FunnelChart/funnelSlots.types.d.ts +4 -3
  139. package/esm/FunnelChart/seriesConfig/seriesProcessor.js +47 -1
  140. package/esm/FunnelChart/useFunnelChartProps.d.ts +2 -1
  141. package/esm/FunnelChart/useFunnelChartProps.js +3 -1
  142. package/esm/Heatmap/Heatmap.d.ts +18 -5
  143. package/esm/Heatmap/Heatmap.js +62 -24
  144. package/esm/Heatmap/Heatmap.plugins.d.ts +2 -1
  145. package/esm/Heatmap/Heatmap.plugins.js +2 -1
  146. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +2 -0
  147. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +19 -0
  148. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -10
  149. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.js +5 -103
  150. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +10 -0
  151. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.js +1 -0
  152. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +7 -0
  153. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +89 -0
  154. package/esm/Heatmap/HeatmapTooltip/index.d.ts +3 -1
  155. package/esm/Heatmap/HeatmapTooltip/index.js +3 -1
  156. package/esm/LineChartPro/LineChartPro.d.ts +13 -5
  157. package/esm/LineChartPro/LineChartPro.js +54 -19
  158. package/esm/RadarChartPro/RadarChartPro.d.ts +15 -0
  159. package/esm/RadarChartPro/RadarChartPro.js +195 -0
  160. package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +4 -0
  161. package/esm/RadarChartPro/RadarChartPro.plugins.js +3 -0
  162. package/esm/RadarChartPro/index.d.ts +1 -0
  163. package/esm/RadarChartPro/index.js +1 -0
  164. package/esm/ScatterChartPro/ScatterChartPro.d.ts +13 -5
  165. package/esm/ScatterChartPro/ScatterChartPro.js +55 -20
  166. package/esm/context/index.d.ts +1 -0
  167. package/esm/context/index.js +1 -0
  168. package/esm/context/useChartApiContext.d.ts +9 -0
  169. package/esm/context/useChartApiContext.js +11 -0
  170. package/esm/hooks/index.d.ts +2 -1
  171. package/esm/hooks/index.js +2 -1
  172. package/esm/index.d.ts +2 -1
  173. package/esm/index.js +2 -1
  174. package/esm/internals/material/index.d.ts +1 -0
  175. package/esm/internals/plugins/useChartProExport/exportImage.js +1 -1
  176. package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +12 -2
  177. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +358 -0
  178. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +15 -1
  179. package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +7 -0
  180. package/esm/models/index.d.ts +1 -1
  181. package/hooks/index.d.ts +2 -1
  182. package/hooks/index.js +21 -10
  183. package/index.d.ts +2 -1
  184. package/index.js +12 -1
  185. package/internals/material/index.d.ts +1 -0
  186. package/internals/plugins/useChartProExport/exportImage.js +1 -1
  187. package/internals/plugins/useChartProZoom/useChartProZoom.js +12 -2
  188. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +358 -0
  189. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +16 -2
  190. package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +7 -0
  191. package/models/index.d.ts +1 -1
  192. package/package.json +5 -5
  193. package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +0 -12
  194. package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +0 -92
  195. package/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +0 -17
  196. package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +0 -13
  197. package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +0 -36
  198. package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +0 -13
  199. package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +0 -36
  200. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +0 -12
  201. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +0 -85
  202. package/esm/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +0 -17
  203. package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +0 -13
  204. package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +0 -29
  205. package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +0 -13
  206. package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +0 -29
@@ -7,14 +7,17 @@ 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 { ChartsSurface } from '@mui/x-charts/ChartsSurface';
11
+ import { ChartsWrapper } from '@mui/x-charts/internals';
10
12
  import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
11
13
  import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
12
14
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
13
- import { ChartContainerPro } from "../ChartContainerPro/index.js";
15
+ import { ChartsLegend, ContinuousColorLegend } from '@mui/x-charts/ChartsLegend';
14
16
  import { HeatmapPlot } from "./HeatmapPlot.js";
15
17
  import { seriesConfig as heatmapSeriesConfig } from "./seriesConfig/index.js";
16
- import { HeatmapTooltip } from "./HeatmapTooltip/HeatmapTooltip.js";
18
+ import { HeatmapTooltip } from "./HeatmapTooltip/index.js";
17
19
  import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
20
+ import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
18
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
22
  // The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
20
23
  const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
@@ -37,6 +40,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
37
40
  name: 'MuiHeatmap'
38
41
  });
39
42
  const {
43
+ apiRef,
40
44
  xAxis,
41
45
  yAxis,
42
46
  zAxis,
@@ -53,7 +57,8 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
53
57
  slotProps,
54
58
  loading,
55
59
  highlightedItem,
56
- onHighlightChange
60
+ onHighlightChange,
61
+ hideLegend = true
57
62
  } = props;
58
63
  const id = useId();
59
64
  const clipPathId = `${id}-clip-path`;
@@ -81,9 +86,14 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
81
86
  color: defaultColorMap
82
87
  }
83
88
  }], [zAxis]);
84
- const Tooltip = props.slots?.tooltip ?? HeatmapTooltip;
85
- return /*#__PURE__*/_jsxs(ChartContainerPro, {
86
- ref: ref,
89
+ const chartsWrapperProps = {
90
+ sx,
91
+ legendPosition: props.slotProps?.legend?.position,
92
+ legendDirection: props.slotProps?.legend?.direction
93
+ };
94
+ const Tooltip = slots?.tooltip ?? HeatmapTooltip;
95
+ return /*#__PURE__*/_jsx(ChartDataProviderPro, {
96
+ apiRef: apiRef,
87
97
  seriesConfig: seriesConfig,
88
98
  series: series.map(s => _extends({
89
99
  type: 'heatmap'
@@ -96,37 +106,60 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
96
106
  zAxis: zAxisWithDefault,
97
107
  colors: colors,
98
108
  dataset: dataset,
99
- sx: sx,
100
109
  disableAxisListener: true,
101
110
  highlightedItem: highlightedItem,
102
111
  onHighlightChange: onHighlightChange,
103
112
  onAxisClick: onAxisClick,
104
113
  plugins: HEATMAP_PLUGINS,
105
- children: [/*#__PURE__*/_jsxs("g", {
106
- clipPath: `url(#${clipPathId})`,
107
- children: [/*#__PURE__*/_jsx(HeatmapPlot, {
108
- slots: slots,
109
- slotProps: slotProps
110
- }), /*#__PURE__*/_jsx(ChartsOverlay, {
111
- loading: loading,
112
- slots: slots,
113
- slotProps: slotProps
114
- })]
115
- }), /*#__PURE__*/_jsx(ChartsAxis, {
116
- slots: slots,
117
- slotProps: slotProps
118
- }), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
119
- id: clipPathId
120
- }), children]
114
+ children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
115
+ children: [!hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
116
+ slots: _extends({}, slots, {
117
+ legend: slots?.legend ?? ContinuousColorLegend
118
+ }),
119
+ slotProps: {
120
+ legend: _extends({
121
+ labelPosition: 'extremes'
122
+ }, slotProps?.legend)
123
+ },
124
+ sx: slotProps?.legend?.direction === 'vertical' ? {
125
+ height: 150
126
+ } : {
127
+ width: '50%'
128
+ }
129
+ }), /*#__PURE__*/_jsxs(ChartsSurface, {
130
+ ref: ref,
131
+ sx: sx,
132
+ children: [/*#__PURE__*/_jsxs("g", {
133
+ clipPath: `url(#${clipPathId})`,
134
+ children: [/*#__PURE__*/_jsx(HeatmapPlot, {
135
+ slots: slots,
136
+ slotProps: slotProps
137
+ }), /*#__PURE__*/_jsx(ChartsOverlay, {
138
+ loading: loading,
139
+ slots: slots,
140
+ slotProps: slotProps
141
+ })]
142
+ }), /*#__PURE__*/_jsx(ChartsAxis, {
143
+ slots: slots,
144
+ slotProps: slotProps
145
+ }), /*#__PURE__*/_jsx(ChartsClipPath, {
146
+ id: clipPathId
147
+ }), children]
148
+ }), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip))]
149
+ }))
121
150
  });
122
151
  });
152
+ if (process.env.NODE_ENV !== "production") Heatmap.displayName = "Heatmap";
123
153
  process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
124
154
  // ----------------------------- Warning --------------------------------
125
155
  // | These PropTypes are generated from the TypeScript type definitions |
126
156
  // | To update them edit the TypeScript types and run "pnpm proptypes" |
127
157
  // ----------------------------------------------------------------------
128
158
  apiRef: PropTypes.shape({
129
- current: PropTypes.object
159
+ current: PropTypes.shape({
160
+ exportAsImage: PropTypes.func.isRequired,
161
+ exportAsPrint: PropTypes.func.isRequired
162
+ })
130
163
  }),
131
164
  className: PropTypes.string,
132
165
  /**
@@ -149,6 +182,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
149
182
  * The height of the chart in px. If not defined, it takes the height of the parent element.
150
183
  */
151
184
  height: PropTypes.number,
185
+ /**
186
+ * If `true`, the legend is not rendered.
187
+ * @default true
188
+ */
189
+ hideLegend: PropTypes.bool,
152
190
  /**
153
191
  * The highlighted item.
154
192
  * Used when the highlight is controlled.
@@ -1,3 +1,4 @@
1
1
  import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
- export type HeatmapPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartInteractionSignature, UseChartHighlightSignature];
2
+ import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
3
+ export type HeatmapPluginsSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
3
4
  export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginsSignatures>;
@@ -1,2 +1,3 @@
1
1
  import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
2
- export const HEATMAP_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight];
2
+ import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
3
+ export const HEATMAP_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProExport];
@@ -0,0 +1,2 @@
1
+ import { HeatmapTooltipProps } from "./HeatmapTooltip.types.js";
2
+ export declare const useUtilityClasses: (props: Pick<HeatmapTooltipProps, "classes">) => Record<"mark" | "table" | "cell" | "row" | "root" | "paper" | "markContainer" | "labelCell" | "valueCell", string>;
@@ -0,0 +1,19 @@
1
+ import composeClasses from '@mui/utils/composeClasses';
2
+ import { getChartsTooltipUtilityClass } from '@mui/x-charts/ChartsTooltip';
3
+ export const useUtilityClasses = props => {
4
+ const {
5
+ classes
6
+ } = props;
7
+ const slots = {
8
+ root: ['root'],
9
+ paper: ['paper'],
10
+ table: ['table'],
11
+ row: ['row'],
12
+ cell: ['cell'],
13
+ mark: ['mark'],
14
+ markContainer: ['markContainer'],
15
+ labelCell: ['labelCell'],
16
+ valueCell: ['valueCell']
17
+ };
18
+ return composeClasses(slots, getChartsTooltipUtilityClass, classes);
19
+ };
@@ -1,14 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
3
- export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
4
- /**
5
- * Select the kind of tooltip to display
6
- * - 'item': Shows data about the item below the mouse.
7
- * - 'none': Does not display tooltip
8
- * @default 'item'
9
- */
10
- trigger?: 'item' | 'none';
11
- }
2
+ import { HeatmapTooltipProps } from "./HeatmapTooltip.types.js";
12
3
  declare function HeatmapTooltip(props: HeatmapTooltipProps): React.JSX.Element;
13
4
  declare namespace HeatmapTooltip {
14
5
  var propTypes: any;
@@ -3,109 +3,11 @@
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 clsx from 'clsx';
7
6
  import HTMLElementType from '@mui/utils/HTMLElementType';
8
- import composeClasses from '@mui/utils/composeClasses';
9
- import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip, getChartsTooltipUtilityClass, ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
10
- import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
11
- import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
12
- import { useHeatmapSeriesContext } from "../../hooks/useHeatmapSeries.js";
13
- import { HeatmapTooltipAxesValue } from "./HeatmapTooltipAxesValue.js";
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- const useUtilityClasses = props => {
16
- const {
17
- classes
18
- } = props;
19
- const slots = {
20
- root: ['root'],
21
- paper: ['paper'],
22
- table: ['table'],
23
- row: ['row'],
24
- cell: ['cell'],
25
- mark: ['mark'],
26
- markContainer: ['markContainer'],
27
- labelCell: ['labelCell'],
28
- valueCell: ['valueCell']
29
- };
30
- return composeClasses(slots, getChartsTooltipUtilityClass, classes);
31
- };
32
- function DefaultHeatmapTooltipContent(props) {
33
- const classes = useUtilityClasses(props);
34
- const xAxis = useXAxis();
35
- const yAxis = useYAxis();
36
- const heatmapSeries = useHeatmapSeriesContext();
37
- const tooltipData = useItemTooltip();
38
- if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
39
- return null;
40
- }
41
- const {
42
- series,
43
- seriesOrder
44
- } = heatmapSeries;
45
- const seriesId = seriesOrder[0];
46
- const {
47
- color,
48
- value,
49
- identifier,
50
- markType
51
- } = tooltipData;
52
- const [xIndex, yIndex] = value;
53
- const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
54
- location: 'tooltip',
55
- scale: xAxis.scale
56
- }) ?? xAxis.data[xIndex].toLocaleString();
57
- const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
58
- location: 'tooltip',
59
- scale: yAxis.scale
60
- }) ?? yAxis.data[yIndex].toLocaleString();
61
- const formattedValue = series[seriesId].valueFormatter(value, {
62
- dataIndex: identifier.dataIndex
63
- });
64
- const seriesLabel = getLabel(series[seriesId].label, 'tooltip');
65
- return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
66
- className: classes.paper,
67
- children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
68
- className: classes.table,
69
- children: [/*#__PURE__*/_jsxs(HeatmapTooltipAxesValue, {
70
- children: [/*#__PURE__*/_jsx("span", {
71
- children: formattedX
72
- }), /*#__PURE__*/_jsx("span", {
73
- children: formattedY
74
- })]
75
- }), /*#__PURE__*/_jsx("tbody", {
76
- children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
77
- className: classes.row,
78
- children: [/*#__PURE__*/_jsxs(ChartsTooltipCell, {
79
- className: clsx(classes.labelCell, classes.cell),
80
- component: "th",
81
- children: [/*#__PURE__*/_jsx("div", {
82
- className: classes.markContainer,
83
- children: /*#__PURE__*/_jsx(ChartsLabelMark, {
84
- type: markType,
85
- color: color,
86
- className: classes.mark
87
- })
88
- }), seriesLabel]
89
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
90
- className: clsx(classes.valueCell, classes.cell),
91
- component: "td",
92
- children: formattedValue
93
- })]
94
- })
95
- })]
96
- })
97
- });
98
- }
99
- process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltipContent.propTypes = {
100
- // ----------------------------- Warning --------------------------------
101
- // | These PropTypes are generated from the TypeScript type definitions |
102
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
103
- // ----------------------------------------------------------------------
104
- /**
105
- * Override or extend the styles applied to the component.
106
- */
107
- classes: PropTypes.object
108
- } : void 0;
7
+ import { ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
8
+ import { HeatmapTooltipContent } from "./HeatmapTooltipContent.js";
9
+ import { useUtilityClasses } from "./HeatmapTooltip.classes.js";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
109
11
  function HeatmapTooltip(props) {
110
12
  const classes = useUtilityClasses({
111
13
  classes: props.classes
@@ -114,7 +16,7 @@ function HeatmapTooltip(props) {
114
16
  trigger: "item"
115
17
  }, props, {
116
18
  classes: classes,
117
- children: /*#__PURE__*/_jsx(DefaultHeatmapTooltipContent, {
19
+ children: /*#__PURE__*/_jsx(HeatmapTooltipContent, {
118
20
  classes: classes
119
21
  })
120
22
  }));
@@ -0,0 +1,10 @@
1
+ import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
2
+ export interface HeatmapTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
3
+ /**
4
+ * Select the kind of tooltip to display
5
+ * - 'item': Shows data about the item below the mouse.
6
+ * - 'none': Does not display tooltip
7
+ * @default 'item'
8
+ */
9
+ trigger?: 'item' | 'none';
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { HeatmapTooltipProps } from "./HeatmapTooltip.types.js";
3
+ export interface HeatmapTooltipContentProps extends Pick<HeatmapTooltipProps, 'classes'> {}
4
+ export declare function HeatmapTooltipContent(props: HeatmapTooltipContentProps): React.JSX.Element | null;
5
+ export declare namespace HeatmapTooltipContent {
6
+ var propTypes: any;
7
+ }
@@ -0,0 +1,89 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import clsx from 'clsx';
6
+ import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip } from '@mui/x-charts/ChartsTooltip';
7
+ import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
8
+ import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
9
+ import { useHeatmapSeriesContext } from "../../hooks/useHeatmapSeries.js";
10
+ import { HeatmapTooltipAxesValue } from "./HeatmapTooltipAxesValue.js";
11
+ import { useUtilityClasses } from "./HeatmapTooltip.classes.js";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ export function HeatmapTooltipContent(props) {
14
+ const classes = useUtilityClasses(props);
15
+ const xAxis = useXAxis();
16
+ const yAxis = useYAxis();
17
+ const heatmapSeries = useHeatmapSeriesContext();
18
+ const tooltipData = useItemTooltip();
19
+ if (!tooltipData || !heatmapSeries || heatmapSeries.seriesOrder.length === 0) {
20
+ return null;
21
+ }
22
+ const {
23
+ series,
24
+ seriesOrder
25
+ } = heatmapSeries;
26
+ const seriesId = seriesOrder[0];
27
+ const {
28
+ color,
29
+ value,
30
+ identifier,
31
+ markType
32
+ } = tooltipData;
33
+ const [xIndex, yIndex] = value;
34
+ const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
35
+ location: 'tooltip',
36
+ scale: xAxis.scale
37
+ }) ?? xAxis.data[xIndex].toLocaleString();
38
+ const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
39
+ location: 'tooltip',
40
+ scale: yAxis.scale
41
+ }) ?? yAxis.data[yIndex].toLocaleString();
42
+ const formattedValue = series[seriesId].valueFormatter(value, {
43
+ dataIndex: identifier.dataIndex
44
+ });
45
+ const seriesLabel = getLabel(series[seriesId].label, 'tooltip');
46
+ return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
47
+ className: classes.paper,
48
+ children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
49
+ className: classes.table,
50
+ children: [/*#__PURE__*/_jsxs(HeatmapTooltipAxesValue, {
51
+ children: [/*#__PURE__*/_jsx("span", {
52
+ children: formattedX
53
+ }), /*#__PURE__*/_jsx("span", {
54
+ children: formattedY
55
+ })]
56
+ }), /*#__PURE__*/_jsx("tbody", {
57
+ children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
58
+ className: classes.row,
59
+ children: [/*#__PURE__*/_jsxs(ChartsTooltipCell, {
60
+ className: clsx(classes.labelCell, classes.cell),
61
+ component: "th",
62
+ children: [/*#__PURE__*/_jsx("div", {
63
+ className: classes.markContainer,
64
+ children: /*#__PURE__*/_jsx(ChartsLabelMark, {
65
+ type: markType,
66
+ color: color,
67
+ className: classes.mark
68
+ })
69
+ }), seriesLabel]
70
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
71
+ className: clsx(classes.valueCell, classes.cell),
72
+ component: "td",
73
+ children: formattedValue
74
+ })]
75
+ })
76
+ })]
77
+ })
78
+ });
79
+ }
80
+ process.env.NODE_ENV !== "production" ? HeatmapTooltipContent.propTypes = {
81
+ // ----------------------------- Warning --------------------------------
82
+ // | These PropTypes are generated from the TypeScript type definitions |
83
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
84
+ // ----------------------------------------------------------------------
85
+ /**
86
+ * Override or extend the styles applied to the component.
87
+ */
88
+ classes: PropTypes.object
89
+ } : void 0;
@@ -1 +1,3 @@
1
- export * from "./HeatmapTooltip.js";
1
+ export * from "./HeatmapTooltip.js";
2
+ export * from "./HeatmapTooltipContent.js";
3
+ export type { HeatmapTooltipProps } from "./HeatmapTooltip.types.js";
@@ -1 +1,3 @@
1
- export * from "./HeatmapTooltip.js";
1
+ export * from "./HeatmapTooltip.js";
2
+ export * from "./HeatmapTooltipContent.js";
3
+ export {};
@@ -1,13 +1,21 @@
1
1
  import * as React from 'react';
2
- import { LineChartProps } from '@mui/x-charts/LineChart';
2
+ import { LineChartProps, LineChartSlots, LineChartSlotProps } from '@mui/x-charts/LineChart';
3
+ import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
3
4
  import { ChartContainerProProps } from "../ChartContainerPro/index.js";
4
5
  import { LineChartProPluginsSignatures } from "./LineChartPro.plugins.js";
5
- export interface LineChartProProps extends Omit<LineChartProps, 'apiRef'>, Omit<ChartContainerProProps<'line', LineChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig'> {
6
+ export interface LineChartProSlots extends LineChartSlots, Partial<ChartsSlotsPro> {}
7
+ export interface LineChartProSlotProps extends LineChartSlotProps, Partial<ChartsSlotPropsPro> {}
8
+ export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'line', LineChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
6
9
  /**
7
- * If true, shows the default chart toolbar.
8
- * @default false
10
+ * Overridable component slots.
11
+ * @default {}
9
12
  */
10
- showToolbar?: boolean;
13
+ slots?: LineChartProSlots;
14
+ /**
15
+ * The props used for each component slot.
16
+ * @default {}
17
+ */
18
+ slotProps?: LineChartProSlotProps;
11
19
  }
12
20
  /**
13
21
  * Demos: