@mui/x-charts-pro 8.26.0 → 8.27.2
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.
- package/BarChartPro/BarChartPro.d.ts +1 -1
- package/CHANGELOG.md +225 -0
- package/ChartContainerPro/useChartContainerProProps.d.ts +2 -2
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/Heatmap/Heatmap.d.ts +10 -1
- package/Heatmap/Heatmap.js +11 -0
- package/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/Heatmap/seriesConfig/getItemAtPosition.js +41 -0
- package/Heatmap/seriesConfig/index.js +2 -0
- package/LineChartPro/LineChartPro.d.ts +1 -1
- package/PieChartPro/PieChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.d.ts +1 -1
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +2 -2
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/Heatmap/Heatmap.d.ts +10 -1
- package/esm/Heatmap/Heatmap.js +11 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/esm/Heatmap/Heatmap.plugins.js +2 -2
- package/esm/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/esm/Heatmap/seriesConfig/getItemAtPosition.js +35 -0
- package/esm/Heatmap/seriesConfig/index.js +2 -0
- package/esm/LineChartPro/LineChartPro.d.ts +1 -1
- package/esm/PieChartPro/PieChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/esm/RadarChartPro/RadarChartPro.plugins.js +2 -2
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +2 -1
- package/esm/internals/index.js +2 -1
- package/esm/internals/plugins/useChartProExport/exportImage.js +8 -0
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +8 -1
- package/internals/plugins/useChartProExport/exportImage.js +8 -0
- package/package.json +4 -4
|
@@ -6,7 +6,7 @@ import { type ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
6
6
|
import { type BarChartProPluginSignatures } from "./BarChartPro.plugins.js";
|
|
7
7
|
export interface BarChartProSlots extends Omit<BarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface BarChartProSlotProps extends Omit<BarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface BarChartProProps extends Omit<BarChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'bar', BarChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface BarChartProProps extends Omit<BarChartProps, 'apiRef' | 'slots' | 'slotProps' | 'seriesConfig' | 'plugins'>, Omit<ChartContainerProProps<'bar', BarChartProPluginSignatures>, 'series' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,231 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.27.2
|
|
9
|
+
|
|
10
|
+
_Feb 20, 2026_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 3 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
|
|
16
|
+
### Data Grid
|
|
17
|
+
|
|
18
|
+
#### `@mui/x-data-grid@8.27.2`
|
|
19
|
+
|
|
20
|
+
Internal changes.
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid-pro@8.27.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
23
|
+
|
|
24
|
+
Same changes as in `@mui/x-data-grid@8.27.2`, plus:
|
|
25
|
+
|
|
26
|
+
- [DataGridPro] Fix number input visibility in header filters (#21345) @michelengelen
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid-premium@8.27.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
29
|
+
|
|
30
|
+
Same changes as in `@mui/x-data-grid-pro@8.27.2`.
|
|
31
|
+
|
|
32
|
+
### Date and Time Pickers
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers@8.27.2`
|
|
35
|
+
|
|
36
|
+
- [DatePicker] Add keyboard support for selecting day, month, and year (#21399) @michelengelen
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-date-pickers-pro@8.27.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-date-pickers@8.27.2`, plus:
|
|
41
|
+
|
|
42
|
+
- [DateRangePicker] Fix timezone update issue leading to `invalidRange` error (#21382) @michelengelen
|
|
43
|
+
|
|
44
|
+
### Charts
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-charts@8.27.2`
|
|
47
|
+
|
|
48
|
+
Internal changes.
|
|
49
|
+
|
|
50
|
+
#### `@mui/x-charts-pro@8.27.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
51
|
+
|
|
52
|
+
Same changes as in `@mui/x-charts@8.27.2`, plus:
|
|
53
|
+
|
|
54
|
+
- [charts-pro] Handle edge case in export image (#21206) @bernardobelchior
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-charts-premium@8.27.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
57
|
+
|
|
58
|
+
Same changes as in `@mui/x-charts-pro@8.27.2`.
|
|
59
|
+
|
|
60
|
+
### Tree View
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-tree-view@8.27.2`
|
|
63
|
+
|
|
64
|
+
- [tree view] Focus item sibling on unmount instead of the 1st item (#21386) @flaviendelangle
|
|
65
|
+
|
|
66
|
+
#### `@mui/x-tree-view-pro@8.27.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
67
|
+
|
|
68
|
+
Same changes as in `@mui/x-tree-view@8.27.2`.
|
|
69
|
+
|
|
70
|
+
### Codemod
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-codemod@8.27.2`
|
|
73
|
+
|
|
74
|
+
Internal changes.
|
|
75
|
+
|
|
76
|
+
### Core
|
|
77
|
+
|
|
78
|
+
- [code-infra] Only ignore `renovate[bot]` in changelog generation script (#21188) @bernardobelchior
|
|
79
|
+
|
|
80
|
+
## v8.27.1
|
|
81
|
+
|
|
82
|
+
<!-- generated comparing v8.27.0..v8.x -->
|
|
83
|
+
|
|
84
|
+
_Feb 13, 2026_
|
|
85
|
+
|
|
86
|
+
We'd like to extend a big thank you to the 6 contributors who made this release possible. Here are some highlights ✨:
|
|
87
|
+
|
|
88
|
+
- 📝 CSS bundler support is no longer needed for the Data Grid
|
|
89
|
+
- 🐞 Bugfixes
|
|
90
|
+
|
|
91
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
92
|
+
@sai6855
|
|
93
|
+
|
|
94
|
+
The following team members contributed to this release:
|
|
95
|
+
@arminmeh, @cherniavskii, @flaviendelangle, @mj12albert, @MBilalShafi
|
|
96
|
+
|
|
97
|
+
### Data Grid
|
|
98
|
+
|
|
99
|
+
#### `@mui/x-data-grid@8.27.1`
|
|
100
|
+
|
|
101
|
+
- [DataGrid] Hide column menu icon when there are no items (#21303) @MBilalShafi
|
|
102
|
+
- [DataGrid] Migrate styled imports and remove `index.css` (#21176) @MBilalShafi
|
|
103
|
+
- [DataGrid] Optimize `GridRootStyles` overrides resolver (#21251) @sai6855
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-data-grid-pro@8.27.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
106
|
+
|
|
107
|
+
Same changes as in `@mui/x-data-grid@8.27.1`, plus:
|
|
108
|
+
|
|
109
|
+
- [DataGridPro] Fix column pinning issue with `restoreState` (#21305) @MBilalShafi
|
|
110
|
+
- [DataGridPro] Fix lazy loading params for page with one row (#21238) @MBilalShafi
|
|
111
|
+
- [DataGridPro] Properly extract parent path (#21301) @arminmeh
|
|
112
|
+
|
|
113
|
+
#### `@mui/x-data-grid-premium@8.27.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
114
|
+
|
|
115
|
+
Same changes as in `@mui/x-data-grid-pro@8.27.1`, plus:
|
|
116
|
+
|
|
117
|
+
- [DataGridPremium] Fix aggregation display when `initialState` has both `sortModel` and `pinnedColumns` (#21152) @mj12albert
|
|
118
|
+
|
|
119
|
+
### Tree View
|
|
120
|
+
|
|
121
|
+
#### `@mui/x-tree-view@8.27.1`
|
|
122
|
+
|
|
123
|
+
- [tree view] Fix `apiRef.current.setItemExpansion()` (#21095) @flaviendelangle
|
|
124
|
+
|
|
125
|
+
#### `@mui/x-tree-view-pro@8.27.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
126
|
+
|
|
127
|
+
Same changes as in `@mui/x-tree-view@8.27.1`.
|
|
128
|
+
|
|
129
|
+
### Core
|
|
130
|
+
|
|
131
|
+
- [internal] Add CLI for translation using LLM (#21299) @cherniavskii
|
|
132
|
+
|
|
133
|
+
## v8.27.0
|
|
134
|
+
|
|
135
|
+
_Feb 2, 2026_
|
|
136
|
+
|
|
137
|
+
We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
138
|
+
|
|
139
|
+
- 📝 Data Grid supports new `longText` [column type](https://mui.com/x/react-data-grid/column-definition/#column-types)
|
|
140
|
+
|
|
141
|
+
The following team members contributed to this release:
|
|
142
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @JCQuintas, @MBilalShafi, @siriwatknp
|
|
143
|
+
|
|
144
|
+
### Data Grid
|
|
145
|
+
|
|
146
|
+
#### `@mui/x-data-grid@8.27.0`
|
|
147
|
+
|
|
148
|
+
- [DataGrid] Fix virtualization crash by preventing out-of-bounds `focusedVirtualCell` indices (#21123) @cherniavskii
|
|
149
|
+
- [DataGrid] Fix focus steal issue with `<Dialog />` (#21106) @MBilalShafi
|
|
150
|
+
- [DataGrid] Add new `longText` column type (#21103) @siriwatknp
|
|
151
|
+
|
|
152
|
+
#### `@mui/x-data-grid-pro@8.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
153
|
+
|
|
154
|
+
Same changes as in `@mui/x-data-grid@8.27.0`.
|
|
155
|
+
|
|
156
|
+
#### `@mui/x-data-grid-premium@8.27.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
157
|
+
|
|
158
|
+
Same changes as in `@mui/x-data-grid-pro@8.27.0`, plus:
|
|
159
|
+
|
|
160
|
+
- [DataGridPremium] Fix focus retention when undo/redo operations are done on the same cell (#21110) @arminmeh
|
|
161
|
+
|
|
162
|
+
### Date and Time Pickers
|
|
163
|
+
|
|
164
|
+
#### `@mui/x-date-pickers@8.27.0`
|
|
165
|
+
|
|
166
|
+
Internal changes.
|
|
167
|
+
|
|
168
|
+
#### `@mui/x-date-pickers-pro@8.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
169
|
+
|
|
170
|
+
Same changes as in `@mui/x-date-pickers@8.27.0`.
|
|
171
|
+
|
|
172
|
+
### Charts
|
|
173
|
+
|
|
174
|
+
#### `@mui/x-charts@8.27.0`
|
|
175
|
+
|
|
176
|
+
- [charts] Deprecate `AxisId` class in favour of to `data-axis-id` attribute (#21048) @JCQuintas
|
|
177
|
+
|
|
178
|
+
#### `@mui/x-charts-pro@8.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
179
|
+
|
|
180
|
+
Same changes as in `@mui/x-charts@8.27.0`, plus:
|
|
181
|
+
|
|
182
|
+
- [charts-pro] Add `onItemClick` to the heatmap (#20817) (#21030) @alexfauquette
|
|
183
|
+
|
|
184
|
+
#### `@mui/x-charts-premium@8.27.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
185
|
+
|
|
186
|
+
Same changes as in `@mui/x-charts-pro@8.27.0`, plus:
|
|
187
|
+
|
|
188
|
+
- [charts-premium] Fix wrong `defaultSlots` in premium charts (#21052) @bernardobelchior
|
|
189
|
+
|
|
190
|
+
### Tree View
|
|
191
|
+
|
|
192
|
+
#### `@mui/x-tree-view@8.27.0`
|
|
193
|
+
|
|
194
|
+
Internal changes.
|
|
195
|
+
|
|
196
|
+
#### `@mui/x-tree-view-pro@8.27.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
197
|
+
|
|
198
|
+
Same changes as in `@mui/x-tree-view@8.27.0`, plus:
|
|
199
|
+
|
|
200
|
+
- [RichTreeViewPro] Do not export `useSimpleTreeViewApiRef()` and `useRichTreeViewApiRef()` from pro package (#21145) @flaviendelangle
|
|
201
|
+
|
|
202
|
+
### Codemod
|
|
203
|
+
|
|
204
|
+
#### `@mui/x-codemod@8.27.0`
|
|
205
|
+
|
|
206
|
+
Internal changes.
|
|
207
|
+
|
|
208
|
+
### Docs
|
|
209
|
+
|
|
210
|
+
- [docs] Fix DataGrid's cell edit renderers (@arminmeh) (#21041) @github-actions[bot]
|
|
211
|
+
|
|
212
|
+
### Core
|
|
213
|
+
|
|
214
|
+
- [code-infra] Add `consistent-type-imports` rule to the grid packages (#21119) @arminmeh
|
|
215
|
+
- [code-infra] Allow user to select target branch if it exists for current major (#21005) @JCQuintas
|
|
216
|
+
- [code-infra] Fix the target branch condition in the release script (#21051) @arminmeh
|
|
217
|
+
- [code-infra] Update docs deploy script to fetch from `v8.x` (#21013) @arminmeh
|
|
218
|
+
|
|
219
|
+
## 8.26.1
|
|
220
|
+
|
|
221
|
+
_Jan 23, 2026_
|
|
222
|
+
|
|
223
|
+
Release highlight ✨:
|
|
224
|
+
|
|
225
|
+
- 🐞 Hotfix for Data Grid Premium type imports
|
|
226
|
+
|
|
227
|
+
### Data Grid
|
|
228
|
+
|
|
229
|
+
#### `@mui/x-data-grid-premium@8.26.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
230
|
+
|
|
231
|
+
- [DataGridPremium] Fix type import (#21033) @arminmeh
|
|
232
|
+
|
|
8
233
|
## 8.26.0
|
|
9
234
|
|
|
10
235
|
_Jan 22, 2026_
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ChartAnyPluginSignature, type ChartSeriesType, type UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
2
|
import type * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import type { ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
4
4
|
import type { ChartContainerProProps } from "./ChartContainerPro.js";
|
|
5
5
|
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
6
|
export type UseChartContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
|
-
chartDataProviderProProps:
|
|
7
|
+
chartDataProviderProProps: ChartDataProviderProProps<TSeries, TSignatures>;
|
|
8
8
|
};
|
|
9
9
|
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue<TSeries, TSignatures>;
|
|
@@ -17,7 +17,7 @@ var _material = require("../internals/material");
|
|
|
17
17
|
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
18
18
|
var _useChartDataProviderProProps = require("./useChartDataProviderProProps");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const releaseInfo = "
|
|
20
|
+
const releaseInfo = "MTc3MTU0NTYwMDAwMA==";
|
|
21
21
|
const packageIdentifier = 'x-charts-pro';
|
|
22
22
|
const defaultSeriesConfigPro = exports.defaultSeriesConfigPro = _internals.defaultSeriesConfig;
|
|
23
23
|
|
package/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -28,7 +28,16 @@ export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlot
|
|
|
28
28
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
29
29
|
}
|
|
30
30
|
export type HeatmapSeries = MakeOptional<HeatmapSeriesType, 'type'>;
|
|
31
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
31
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange' | 'onAxisClick'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
32
|
+
/**
|
|
33
|
+
* The function called for onClick events.
|
|
34
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
35
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
36
|
+
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Use `onItemClick` instead to get access to both x- and y-axis values.
|
|
39
|
+
*/
|
|
40
|
+
onAxisClick?: ChartContainerProProps<'heatmap', HeatmapPluginSignatures>['onAxisClick'];
|
|
32
41
|
/**
|
|
33
42
|
* The configuration of the x-axes.
|
|
34
43
|
* If not provided, a default axis config is used.
|
package/Heatmap/Heatmap.js
CHANGED
|
@@ -68,6 +68,7 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
|
|
|
68
68
|
loading,
|
|
69
69
|
highlightedItem,
|
|
70
70
|
onHighlightChange,
|
|
71
|
+
onItemClick,
|
|
71
72
|
enableKeyboardNavigation,
|
|
72
73
|
hideLegend = true,
|
|
73
74
|
showToolbar = false
|
|
@@ -125,6 +126,7 @@ const Heatmap = exports.Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap
|
|
|
125
126
|
onHighlightChange: onHighlightChange,
|
|
126
127
|
enableKeyboardNavigation: enableKeyboardNavigation,
|
|
127
128
|
onAxisClick: onAxisClick,
|
|
129
|
+
onItemClick: onItemClick,
|
|
128
130
|
plugins: _Heatmap2.HEATMAP_PLUGINS,
|
|
129
131
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
130
132
|
children: [showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
@@ -261,6 +263,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
261
263
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
262
264
|
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
263
265
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
266
|
+
*
|
|
267
|
+
* @deprecated Use `onItemClick` instead to get access to both x- and y-axis values.
|
|
264
268
|
*/
|
|
265
269
|
onAxisClick: _propTypes.default.func,
|
|
266
270
|
/**
|
|
@@ -269,6 +273,13 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
269
273
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
270
274
|
*/
|
|
271
275
|
onHighlightChange: _propTypes.default.func,
|
|
276
|
+
/**
|
|
277
|
+
* The callback fired when an item is clicked.
|
|
278
|
+
*
|
|
279
|
+
* @param {React.MouseEvent<SVGSVGElement, MouseEvent>} event The click event.
|
|
280
|
+
* @param {SeriesItemIdentifier<SeriesType>} item The clicked item.
|
|
281
|
+
*/
|
|
282
|
+
onItemClick: _propTypes.default.func,
|
|
272
283
|
/**
|
|
273
284
|
* The callback fired when the tooltip item changes.
|
|
274
285
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type UseChartZAxisSignature, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartHighlightSignature, type
|
|
1
|
+
import { type UseChartZAxisSignature, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartHighlightSignature, type UseChartBrushSignature, type UseChartItemClickSignature, type UseChartKeyboardNavigationSignature, type ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { type UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartTooltipSignature<'heatmap'>, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature, UseChartBrushSignature, UseChartProZoomSignature, UseChartKeyboardNavigationSignature];
|
|
4
|
+
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartTooltipSignature<'heatmap'>, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature, UseChartBrushSignature, UseChartProZoomSignature, UseChartItemClickSignature<'heatmap'>, UseChartKeyboardNavigationSignature];
|
|
5
5
|
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginSignatures>;
|
|
@@ -7,4 +7,4 @@ exports.HEATMAP_PLUGINS = void 0;
|
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
9
|
var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
10
|
-
const HEATMAP_PLUGINS = exports.HEATMAP_PLUGINS = [_internals.useChartZAxis, _internals.useChartTooltip, _internals.useChartInteraction, _internals.useChartCartesianAxis, _internals.useChartHighlight, _useChartProExport.useChartProExport, _internals.useChartBrush, _useChartProZoom.useChartProZoom, _internals.useChartKeyboardNavigation];
|
|
10
|
+
const HEATMAP_PLUGINS = exports.HEATMAP_PLUGINS = [_internals.useChartZAxis, _internals.useChartTooltip, _internals.useChartInteraction, _internals.useChartCartesianAxis, _internals.useChartHighlight, _useChartProExport.useChartProExport, _internals.useChartBrush, _useChartProZoom.useChartProZoom, _internals.useChartItemClick, _internals.useChartKeyboardNavigation];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ChartState, UseChartCartesianAxisSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import type { SeriesItemIdentifier } from '@mui/x-charts/models';
|
|
3
|
+
export default function getItemAtPosition(state: ChartState<[UseChartCartesianAxisSignature]>, point: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}): SeriesItemIdentifier<'heatmap'> | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getItemAtPosition;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
function getItemAtPosition(state, point) {
|
|
9
|
+
const {
|
|
10
|
+
axis: xAxis,
|
|
11
|
+
axisIds: xAxisIds
|
|
12
|
+
} = (0, _internals.selectorChartXAxis)(state);
|
|
13
|
+
const {
|
|
14
|
+
axis: yAxis,
|
|
15
|
+
axisIds: yAxisIds
|
|
16
|
+
} = (0, _internals.selectorChartYAxis)(state);
|
|
17
|
+
const series = (0, _internals.selectorAllSeriesOfType)(state, 'heatmap');
|
|
18
|
+
const xAxisWithScale = xAxis[xAxisIds[0]];
|
|
19
|
+
const yAxisWithScale = yAxis[yAxisIds[0]];
|
|
20
|
+
const seriesId = series?.seriesOrder[0];
|
|
21
|
+
if (seriesId === undefined) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const xIndex = (0, _internals.getCartesianAxisIndex)(xAxisWithScale, point.x);
|
|
25
|
+
const yIndex = (0, _internals.getCartesianAxisIndex)(yAxisWithScale, point.y);
|
|
26
|
+
if (xIndex === -1 || yIndex === -1) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const dataIndex = series ? series.series[series.seriesOrder[0]].data.findIndex(d => d[0] === xIndex && d[1] === yIndex) : -1;
|
|
30
|
+
if (dataIndex === -1) {
|
|
31
|
+
return {
|
|
32
|
+
type: 'heatmap',
|
|
33
|
+
seriesId
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
type: 'heatmap',
|
|
38
|
+
seriesId,
|
|
39
|
+
dataIndex
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -12,6 +12,7 @@ var _getColor = _interopRequireDefault(require("./getColor"));
|
|
|
12
12
|
var _tooltip = _interopRequireDefault(require("./tooltip"));
|
|
13
13
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
14
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
15
|
+
var _getItemAtPosition = _interopRequireDefault(require("./getItemAtPosition"));
|
|
15
16
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
16
17
|
_internals.cartesianSeriesTypes.addType('heatmap');
|
|
17
18
|
const heatmapSeriesConfig = exports.heatmapSeriesConfig = {
|
|
@@ -24,5 +25,6 @@ const heatmapSeriesConfig = exports.heatmapSeriesConfig = {
|
|
|
24
25
|
yExtremumGetter: _extremums.getBaseExtremum,
|
|
25
26
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
26
27
|
identifierSerializer: _internals.identifierSerializerSeriesIdDataIndex,
|
|
28
|
+
getItemAtPosition: _getItemAtPosition.default,
|
|
27
29
|
keyboardFocusHandler: _keyboardFocusHandler.default
|
|
28
30
|
};
|
|
@@ -6,7 +6,7 @@ import { type ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
6
6
|
import { type LineChartProPluginSignatures } from "./LineChartPro.plugins.js";
|
|
7
7
|
export interface LineChartProSlots extends Omit<LineChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface LineChartProSlotProps extends Omit<LineChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'line', LineChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'line', LineChartProPluginSignatures>, 'series' | 'slots' | 'slotProps'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -6,7 +6,7 @@ import { type PieChartProPluginSignatures } from "./PieChartPro.plugins.js";
|
|
|
6
6
|
import { type ChartsToolbarProSlotProps, type ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
7
7
|
export interface PieChartProSlots extends Omit<PieChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface PieChartProSlotProps extends Omit<PieChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -5,7 +5,7 @@ import { type ChartsToolbarProSlotProps, type ChartsToolbarProSlots } from "../C
|
|
|
5
5
|
import { type ChartsSlotPropsPro, type ChartsSlotsPro } from "../internals/material/index.js";
|
|
6
6
|
export interface RadarChartProSlots extends Omit<RadarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
7
7
|
export interface RadarChartProSlotProps extends Omit<RadarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
|
-
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps'
|
|
8
|
+
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<RadarDataProviderProps<RadarChartProPluginSignatures>, 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
9
9
|
/**
|
|
10
10
|
* Overridable component slots.
|
|
11
11
|
* @default {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartVisibilityManagerSignature, UseChartKeyboardNavigationSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type RadarChartProPluginSignatures = [UseChartTooltipSignature<'radar'>, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'radar'>, UseChartProExportSignature];
|
|
3
|
+
export type RadarChartProPluginSignatures = [UseChartTooltipSignature<'radar'>, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartVisibilityManagerSignature<'radar'>, UseChartProExportSignature];
|
|
4
4
|
export declare const RADAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<RadarChartProPluginSignatures>;
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RADAR_CHART_PRO_PLUGINS = void 0;
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
|
-
const RADAR_CHART_PRO_PLUGINS = exports.RADAR_CHART_PRO_PLUGINS = [_internals.
|
|
9
|
+
const RADAR_CHART_PRO_PLUGINS = exports.RADAR_CHART_PRO_PLUGINS = [..._internals.RADAR_PLUGINS, _useChartProExport.useChartProExport];
|
|
@@ -13,7 +13,7 @@ export interface ScatterChartProSlotProps extends Omit<ScatterChartSlotProps, 't
|
|
|
13
13
|
*/
|
|
14
14
|
tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
|
|
15
15
|
}
|
|
16
|
-
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginSignatures>, 'series' | '
|
|
16
|
+
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginSignatures>, 'series' | 'onItemClick' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'> {
|
|
17
17
|
/**
|
|
18
18
|
* Overridable component slots.
|
|
19
19
|
* @default {}
|
|
@@ -6,7 +6,7 @@ import { type ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
6
6
|
import { type BarChartProPluginSignatures } from "./BarChartPro.plugins.js";
|
|
7
7
|
export interface BarChartProSlots extends Omit<BarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface BarChartProSlotProps extends Omit<BarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface BarChartProProps extends Omit<BarChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'bar', BarChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface BarChartProProps extends Omit<BarChartProps, 'apiRef' | 'slots' | 'slotProps' | 'seriesConfig' | 'plugins'>, Omit<ChartContainerProProps<'bar', BarChartProPluginSignatures>, 'series' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ChartAnyPluginSignature, type ChartSeriesType, type UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
2
|
import type * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import type { ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
4
4
|
import type { ChartContainerProProps } from "./ChartContainerPro.js";
|
|
5
5
|
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
6
|
export type UseChartContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
|
-
chartDataProviderProProps:
|
|
7
|
+
chartDataProviderProProps: ChartDataProviderProProps<TSeries, TSignatures>;
|
|
8
8
|
};
|
|
9
9
|
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue<TSeries, TSignatures>;
|
|
@@ -10,7 +10,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
|
10
10
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
11
11
|
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
const releaseInfo = "
|
|
13
|
+
const releaseInfo = "MTc3MTU0NTYwMDAwMA==";
|
|
14
14
|
const packageIdentifier = 'x-charts-pro';
|
|
15
15
|
export const defaultSeriesConfigPro = defaultSeriesConfig;
|
|
16
16
|
|
package/esm/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -28,7 +28,16 @@ export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlot
|
|
|
28
28
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
29
29
|
}
|
|
30
30
|
export type HeatmapSeries = MakeOptional<HeatmapSeriesType, 'type'>;
|
|
31
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
31
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange' | 'onAxisClick'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
32
|
+
/**
|
|
33
|
+
* The function called for onClick events.
|
|
34
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
35
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
36
|
+
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Use `onItemClick` instead to get access to both x- and y-axis values.
|
|
39
|
+
*/
|
|
40
|
+
onAxisClick?: ChartContainerProProps<'heatmap', HeatmapPluginSignatures>['onAxisClick'];
|
|
32
41
|
/**
|
|
33
42
|
* The configuration of the x-axes.
|
|
34
43
|
* If not provided, a default axis config is used.
|
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -61,6 +61,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
61
61
|
loading,
|
|
62
62
|
highlightedItem,
|
|
63
63
|
onHighlightChange,
|
|
64
|
+
onItemClick,
|
|
64
65
|
enableKeyboardNavigation,
|
|
65
66
|
hideLegend = true,
|
|
66
67
|
showToolbar = false
|
|
@@ -118,6 +119,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
118
119
|
onHighlightChange: onHighlightChange,
|
|
119
120
|
enableKeyboardNavigation: enableKeyboardNavigation,
|
|
120
121
|
onAxisClick: onAxisClick,
|
|
122
|
+
onItemClick: onItemClick,
|
|
121
123
|
plugins: HEATMAP_PLUGINS,
|
|
122
124
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
123
125
|
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
@@ -254,6 +256,8 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
254
256
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
255
257
|
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
256
258
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
259
|
+
*
|
|
260
|
+
* @deprecated Use `onItemClick` instead to get access to both x- and y-axis values.
|
|
257
261
|
*/
|
|
258
262
|
onAxisClick: PropTypes.func,
|
|
259
263
|
/**
|
|
@@ -262,6 +266,13 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
262
266
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
263
267
|
*/
|
|
264
268
|
onHighlightChange: PropTypes.func,
|
|
269
|
+
/**
|
|
270
|
+
* The callback fired when an item is clicked.
|
|
271
|
+
*
|
|
272
|
+
* @param {React.MouseEvent<SVGSVGElement, MouseEvent>} event The click event.
|
|
273
|
+
* @param {SeriesItemIdentifier<SeriesType>} item The clicked item.
|
|
274
|
+
*/
|
|
275
|
+
onItemClick: PropTypes.func,
|
|
265
276
|
/**
|
|
266
277
|
* The callback fired when the tooltip item changes.
|
|
267
278
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type UseChartZAxisSignature, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartHighlightSignature, type
|
|
1
|
+
import { type UseChartZAxisSignature, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartHighlightSignature, type UseChartBrushSignature, type UseChartItemClickSignature, type UseChartKeyboardNavigationSignature, type ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { type UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartTooltipSignature<'heatmap'>, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature, UseChartBrushSignature, UseChartProZoomSignature, UseChartKeyboardNavigationSignature];
|
|
4
|
+
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartTooltipSignature<'heatmap'>, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature, UseChartBrushSignature, UseChartProZoomSignature, UseChartItemClickSignature<'heatmap'>, UseChartKeyboardNavigationSignature];
|
|
5
5
|
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginSignatures>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useChartZAxis, useChartCartesianAxis, useChartTooltip, useChartInteraction, useChartHighlight, useChartBrush, useChartKeyboardNavigation } from '@mui/x-charts/internals';
|
|
1
|
+
import { useChartZAxis, useChartCartesianAxis, useChartTooltip, useChartInteraction, useChartHighlight, useChartBrush, useChartItemClick, useChartKeyboardNavigation } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export const HEATMAP_PLUGINS = [useChartZAxis, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartProExport, useChartBrush, useChartProZoom, useChartKeyboardNavigation];
|
|
4
|
+
export const HEATMAP_PLUGINS = [useChartZAxis, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartProExport, useChartBrush, useChartProZoom, useChartItemClick, useChartKeyboardNavigation];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ChartState, UseChartCartesianAxisSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import type { SeriesItemIdentifier } from '@mui/x-charts/models';
|
|
3
|
+
export default function getItemAtPosition(state: ChartState<[UseChartCartesianAxisSignature]>, point: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}): SeriesItemIdentifier<'heatmap'> | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { selectorAllSeriesOfType, selectorChartXAxis, selectorChartYAxis, getCartesianAxisIndex } from '@mui/x-charts/internals';
|
|
2
|
+
export default function getItemAtPosition(state, point) {
|
|
3
|
+
const {
|
|
4
|
+
axis: xAxis,
|
|
5
|
+
axisIds: xAxisIds
|
|
6
|
+
} = selectorChartXAxis(state);
|
|
7
|
+
const {
|
|
8
|
+
axis: yAxis,
|
|
9
|
+
axisIds: yAxisIds
|
|
10
|
+
} = selectorChartYAxis(state);
|
|
11
|
+
const series = selectorAllSeriesOfType(state, 'heatmap');
|
|
12
|
+
const xAxisWithScale = xAxis[xAxisIds[0]];
|
|
13
|
+
const yAxisWithScale = yAxis[yAxisIds[0]];
|
|
14
|
+
const seriesId = series?.seriesOrder[0];
|
|
15
|
+
if (seriesId === undefined) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const xIndex = getCartesianAxisIndex(xAxisWithScale, point.x);
|
|
19
|
+
const yIndex = getCartesianAxisIndex(yAxisWithScale, point.y);
|
|
20
|
+
if (xIndex === -1 || yIndex === -1) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const dataIndex = series ? series.series[series.seriesOrder[0]].data.findIndex(d => d[0] === xIndex && d[1] === yIndex) : -1;
|
|
24
|
+
if (dataIndex === -1) {
|
|
25
|
+
return {
|
|
26
|
+
type: 'heatmap',
|
|
27
|
+
seriesId
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
type: 'heatmap',
|
|
32
|
+
seriesId,
|
|
33
|
+
dataIndex
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -5,6 +5,7 @@ import getColor from "./getColor.js";
|
|
|
5
5
|
import tooltipGetter from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
8
|
+
import getItemAtPosition from "./getItemAtPosition.js";
|
|
8
9
|
import keyboardFocusHandler from "./keyboardFocusHandler.js";
|
|
9
10
|
cartesianSeriesTypes.addType('heatmap');
|
|
10
11
|
export const heatmapSeriesConfig = {
|
|
@@ -17,5 +18,6 @@ export const heatmapSeriesConfig = {
|
|
|
17
18
|
yExtremumGetter: getBaseExtremum,
|
|
18
19
|
getSeriesWithDefaultValues,
|
|
19
20
|
identifierSerializer: identifierSerializerSeriesIdDataIndex,
|
|
21
|
+
getItemAtPosition,
|
|
20
22
|
keyboardFocusHandler
|
|
21
23
|
};
|
|
@@ -6,7 +6,7 @@ import { type ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
6
6
|
import { type LineChartProPluginSignatures } from "./LineChartPro.plugins.js";
|
|
7
7
|
export interface LineChartProSlots extends Omit<LineChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface LineChartProSlotProps extends Omit<LineChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'line', LineChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'line', LineChartProPluginSignatures>, 'series' | 'slots' | 'slotProps'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -6,7 +6,7 @@ import { type PieChartProPluginSignatures } from "./PieChartPro.plugins.js";
|
|
|
6
6
|
import { type ChartsToolbarProSlotProps, type ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
7
7
|
export interface PieChartProSlots extends Omit<PieChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface PieChartProSlotProps extends Omit<PieChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -5,7 +5,7 @@ import { type ChartsToolbarProSlotProps, type ChartsToolbarProSlots } from "../C
|
|
|
5
5
|
import { type ChartsSlotPropsPro, type ChartsSlotsPro } from "../internals/material/index.js";
|
|
6
6
|
export interface RadarChartProSlots extends Omit<RadarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
7
7
|
export interface RadarChartProSlotProps extends Omit<RadarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
|
-
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps'
|
|
8
|
+
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<RadarDataProviderProps<RadarChartProPluginSignatures>, 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
9
9
|
/**
|
|
10
10
|
* Overridable component slots.
|
|
11
11
|
* @default {}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartVisibilityManagerSignature, UseChartKeyboardNavigationSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type RadarChartProPluginSignatures = [UseChartTooltipSignature<'radar'>, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'radar'>, UseChartProExportSignature];
|
|
3
|
+
export type RadarChartProPluginSignatures = [UseChartTooltipSignature<'radar'>, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartVisibilityManagerSignature<'radar'>, UseChartProExportSignature];
|
|
4
4
|
export declare const RADAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<RadarChartProPluginSignatures>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RADAR_PLUGINS } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export const RADAR_CHART_PRO_PLUGINS = [
|
|
3
|
+
export const RADAR_CHART_PRO_PLUGINS = [...RADAR_PLUGINS, useChartProExport];
|
|
@@ -13,7 +13,7 @@ export interface ScatterChartProSlotProps extends Omit<ScatterChartSlotProps, 't
|
|
|
13
13
|
*/
|
|
14
14
|
tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
|
|
15
15
|
}
|
|
16
|
-
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginSignatures>, 'series' | '
|
|
16
|
+
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginSignatures>, 'series' | 'onItemClick' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'> {
|
|
17
17
|
/**
|
|
18
18
|
* Overridable component slots.
|
|
19
19
|
* @default {}
|
package/esm/index.js
CHANGED
package/esm/internals/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { ChartsSlotsPro, ChartsSlotPropsPro } from "./material/index.js";
|
|
|
3
3
|
export { seriesPreviewPlotMap } from "../ChartZoomSlider/internals/seriesPreviewPlotMap.js";
|
|
4
4
|
export type { PreviewPlotProps } from "../ChartZoomSlider/internals/previews/PreviewPlot.types.js";
|
|
5
5
|
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
6
|
-
export type { ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
6
|
+
export type { ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
7
|
+
export { defaultSlotsMaterial } from "./material/index.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
2
2
|
export { seriesPreviewPlotMap } from "../ChartZoomSlider/internals/seriesPreviewPlotMap.js";
|
|
3
|
-
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
3
|
+
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
4
|
+
export { defaultSlotsMaterial } from "./material/index.js";
|
|
@@ -40,6 +40,10 @@ export async function exportImage(element, svg, params) {
|
|
|
40
40
|
applyStyles(svg, previousStyles);
|
|
41
41
|
exportDoc.body.replaceChildren(elementClone);
|
|
42
42
|
exportDoc.body.style.margin = '0px';
|
|
43
|
+
/* Set display block through styles to ensure that CSS rules that target `body` don't accidentally target this
|
|
44
|
+
* iframe's body, which might cause the body to have no intrinsic width or height, leading to the canvas having a
|
|
45
|
+
* size of 0px, which causes the `toBlob` call to return null. */
|
|
46
|
+
exportDoc.body.style.display = 'block';
|
|
43
47
|
/* The body's parent has a width of 0, so we use fit-content to ensure that the body adjusts its width to the width
|
|
44
48
|
* of its children. */
|
|
45
49
|
exportDoc.body.style.width = 'fit-content';
|
|
@@ -63,6 +67,10 @@ export async function exportImage(element, svg, params) {
|
|
|
63
67
|
canvas.height = exportDocBodySize.height * ratio;
|
|
64
68
|
canvas.style.width = `${exportDocBodySize.width}px`;
|
|
65
69
|
canvas.style.height = `${exportDocBodySize.height}px`;
|
|
70
|
+
if (canvas.width === 0 || canvas.height === 0) {
|
|
71
|
+
doc.body.removeChild(iframe);
|
|
72
|
+
throw new Error(`MUI X Charts: Cannot export an image with zero width or height. Width: ${canvas.width}px. Height: ${canvas.height}px.`);
|
|
73
|
+
}
|
|
66
74
|
try {
|
|
67
75
|
await drawDocument(iframe.contentDocument, canvas, {
|
|
68
76
|
// Handle retina displays: https://github.com/cburgmer/rasterizeHTML.js/blob/262b3404d1c469ce4a7750a2976dec09b8ae2d6c/examples/retina.html#L71
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { ChartsSlotsPro, ChartsSlotPropsPro } from "./material/index.js";
|
|
|
3
3
|
export { seriesPreviewPlotMap } from "../ChartZoomSlider/internals/seriesPreviewPlotMap.js";
|
|
4
4
|
export type { PreviewPlotProps } from "../ChartZoomSlider/internals/previews/PreviewPlot.types.js";
|
|
5
5
|
export { defaultSeriesConfigPro } from "../ChartDataProviderPro/ChartDataProviderPro.js";
|
|
6
|
-
export type { ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
6
|
+
export type { ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
7
|
+
export { defaultSlotsMaterial } from "./material/index.js";
|
package/internals/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "defaultSeriesConfigPro", {
|
|
|
9
9
|
return _ChartDataProviderPro.defaultSeriesConfigPro;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "defaultSlotsMaterial", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _material.defaultSlotsMaterial;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "seriesPreviewPlotMap", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function () {
|
|
@@ -23,4 +29,5 @@ Object.defineProperty(exports, "useChartContainerProProps", {
|
|
|
23
29
|
});
|
|
24
30
|
var _useChartContainerProProps = require("../ChartContainerPro/useChartContainerProProps");
|
|
25
31
|
var _seriesPreviewPlotMap = require("../ChartZoomSlider/internals/seriesPreviewPlotMap");
|
|
26
|
-
var _ChartDataProviderPro = require("../ChartDataProviderPro/ChartDataProviderPro");
|
|
32
|
+
var _ChartDataProviderPro = require("../ChartDataProviderPro/ChartDataProviderPro");
|
|
33
|
+
var _material = require("./material");
|
|
@@ -50,6 +50,10 @@ async function exportImage(element, svg, params) {
|
|
|
50
50
|
(0, _common.applyStyles)(svg, previousStyles);
|
|
51
51
|
exportDoc.body.replaceChildren(elementClone);
|
|
52
52
|
exportDoc.body.style.margin = '0px';
|
|
53
|
+
/* Set display block through styles to ensure that CSS rules that target `body` don't accidentally target this
|
|
54
|
+
* iframe's body, which might cause the body to have no intrinsic width or height, leading to the canvas having a
|
|
55
|
+
* size of 0px, which causes the `toBlob` call to return null. */
|
|
56
|
+
exportDoc.body.style.display = 'block';
|
|
53
57
|
/* The body's parent has a width of 0, so we use fit-content to ensure that the body adjusts its width to the width
|
|
54
58
|
* of its children. */
|
|
55
59
|
exportDoc.body.style.width = 'fit-content';
|
|
@@ -73,6 +77,10 @@ async function exportImage(element, svg, params) {
|
|
|
73
77
|
canvas.height = exportDocBodySize.height * ratio;
|
|
74
78
|
canvas.style.width = `${exportDocBodySize.width}px`;
|
|
75
79
|
canvas.style.height = `${exportDocBodySize.height}px`;
|
|
80
|
+
if (canvas.width === 0 || canvas.height === 0) {
|
|
81
|
+
doc.body.removeChild(iframe);
|
|
82
|
+
throw new Error(`MUI X Charts: Cannot export an image with zero width or height. Width: ${canvas.width}px. Height: ${canvas.height}px.`);
|
|
83
|
+
}
|
|
76
84
|
try {
|
|
77
85
|
await drawDocument(iframe.contentDocument, canvas, {
|
|
78
86
|
// Handle retina displays: https://github.com/cburgmer/rasterizeHTML.js/blob/262b3404d1c469ce4a7750a2976dec09b8ae2d6c/examples/retina.html#L71
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-pro",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.27.2",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Charts components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"@mui/utils": "^7.3.5",
|
|
32
32
|
"clsx": "^2.1.1",
|
|
33
33
|
"prop-types": "^15.8.1",
|
|
34
|
-
"@mui/x-charts": "8.
|
|
34
|
+
"@mui/x-charts": "8.27.0",
|
|
35
35
|
"@mui/x-charts-vendor": "8.26.0",
|
|
36
36
|
"@mui/x-internal-gestures": "0.4.0",
|
|
37
|
-
"@mui/x-
|
|
38
|
-
"@mui/x-
|
|
37
|
+
"@mui/x-license": "8.26.0",
|
|
38
|
+
"@mui/x-internals": "8.26.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@emotion/react": "^11.9.0",
|