@mui/x-charts-pro 9.0.0-alpha.2 → 9.0.0-alpha.3
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.js +5 -2
- package/BarChartPro/BarChartPro.mjs +5 -2
- package/CHANGELOG.md +123 -1
- package/ChartContainerPro/ChartContainerPro.d.mts +2 -2
- package/ChartContainerPro/ChartContainerPro.d.ts +2 -2
- package/ChartContainerPro/useChartContainerProProps.d.mts +2 -2
- package/ChartContainerPro/useChartContainerProProps.d.ts +2 -2
- package/ChartDataProviderPro/ChartDataProviderPro.d.mts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.mts +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/ChartsContainerPro/ChartsContainerPro.d.mts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.d.ts +2 -2
- package/ChartsContainerPro/useChartsContainerProProps.d.mts +3 -3
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +3 -3
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.mts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +8 -5
- package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +8 -5
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.mts +1 -1
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +1 -1
- package/FunnelChart/FunnelChart.js +5 -2
- package/FunnelChart/FunnelChart.mjs +5 -2
- package/FunnelChart/FunnelSection.js +3 -4
- package/FunnelChart/FunnelSection.mjs +4 -5
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.mts +3 -3
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +3 -3
- package/Heatmap/Heatmap.js +5 -4
- package/Heatmap/Heatmap.mjs +5 -4
- package/Heatmap/HeatmapItem.js +0 -1
- package/Heatmap/HeatmapItem.mjs +0 -1
- package/Heatmap/HeatmapSVGPlot.js +4 -4
- package/Heatmap/HeatmapSVGPlot.mjs +5 -5
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +16 -13
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.mjs +16 -13
- package/Heatmap/internals/HeatmapCell.js +1 -1
- package/Heatmap/internals/HeatmapCell.mjs +1 -1
- package/Heatmap/seriesConfig/getColor.js +5 -3
- package/Heatmap/seriesConfig/getColor.mjs +5 -3
- package/Heatmap/seriesConfig/getItemAtPosition.d.mts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.js +3 -11
- package/Heatmap/seriesConfig/getItemAtPosition.mjs +3 -11
- package/Heatmap/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.js +15 -0
- package/Heatmap/seriesConfig/identifierCleaner.mjs +9 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.js +11 -0
- package/Heatmap/seriesConfig/identifierSerializer.mjs +5 -0
- package/Heatmap/seriesConfig/index.js +4 -2
- package/Heatmap/seriesConfig/index.mjs +5 -3
- package/Heatmap/seriesConfig/keyboardFocusHandler.js +6 -19
- package/Heatmap/seriesConfig/keyboardFocusHandler.mjs +6 -19
- package/Heatmap/seriesConfig/seriesProcessor.js +8 -3
- package/Heatmap/seriesConfig/seriesProcessor.mjs +8 -3
- package/Heatmap/seriesConfig/tooltip.js +7 -6
- package/Heatmap/seriesConfig/tooltip.mjs +7 -6
- package/Heatmap/seriesConfig/tooltipPosition.js +3 -4
- package/Heatmap/seriesConfig/tooltipPosition.mjs +3 -4
- package/Heatmap/useHeatmapProps.js +2 -2
- package/Heatmap/useHeatmapProps.mjs +2 -2
- package/LineChartPro/LineChartPro.js +5 -2
- package/LineChartPro/LineChartPro.mjs +5 -2
- package/PieChartPro/PieChartPro.js +5 -2
- package/PieChartPro/PieChartPro.mjs +5 -2
- package/RadarChartPro/RadarChartPro.js +5 -2
- package/RadarChartPro/RadarChartPro.mjs +5 -2
- package/SankeyChart/SankeyChart.js +5 -2
- package/SankeyChart/SankeyChart.mjs +5 -2
- package/SankeyChart/SankeyLinkElement.js +4 -3
- package/SankeyChart/SankeyLinkElement.mjs +5 -4
- package/SankeyChart/SankeyNodeElement.js +4 -3
- package/SankeyChart/SankeyNodeElement.mjs +5 -4
- package/SankeyChart/sankeyHighlightHooks.d.mts +2 -2
- package/SankeyChart/sankeyHighlightHooks.d.ts +2 -2
- package/SankeyChart/sankeyHighlightHooks.js +2 -10
- package/SankeyChart/sankeyHighlightHooks.mjs +3 -11
- package/ScatterChartPro/ScatterChartPro.js +5 -2
- package/ScatterChartPro/ScatterChartPro.mjs +5 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/ChartsWatermark.d.mts +2 -2
- package/internals/ChartsWatermark.d.ts +2 -2
- package/internals/ChartsWatermark.js +5 -8
- package/internals/ChartsWatermark.mjs +3 -6
- package/internals/plugins/allPlugins.d.mts +4 -4
- package/internals/plugins/allPlugins.d.ts +4 -4
- package/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/internals/plugins/useChartProExport/exportImage.mjs +1 -1
- package/models/seriesType/heatmap.d.mts +36 -9
- package/models/seriesType/heatmap.d.ts +36 -9
- package/models/seriesType/heatmap.js +28 -1
- package/models/seriesType/heatmap.mjs +25 -1
- package/package.json +128 -128
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.mts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +4 -4
- package/plugins/selectors/useChartHeatmapPosition.selectors.mjs +4 -4
- package/typeOverloads/modules.d.mts +2 -2
- package/typeOverloads/modules.d.ts +2 -2
|
@@ -11,19 +11,20 @@ const tooltipGetter = params => {
|
|
|
11
11
|
getColor,
|
|
12
12
|
identifier
|
|
13
13
|
} = params;
|
|
14
|
-
if (!identifier
|
|
14
|
+
if (!identifier) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
+
const cellValue = series.heatmapData.getValue(identifier.xIndex, identifier.yIndex);
|
|
17
18
|
const label = (0, _internals.getLabel)(series.label, 'tooltip');
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const formattedValue = series.valueFormatter(cellValue, {
|
|
20
|
+
xIndex: identifier.xIndex,
|
|
21
|
+
yIndex: identifier.yIndex
|
|
21
22
|
});
|
|
22
23
|
return {
|
|
23
24
|
identifier,
|
|
24
|
-
color: getColor(
|
|
25
|
+
color: getColor(cellValue),
|
|
25
26
|
label,
|
|
26
|
-
value,
|
|
27
|
+
value: cellValue,
|
|
27
28
|
formattedValue,
|
|
28
29
|
markType: series.labelMarkType
|
|
29
30
|
};
|
|
@@ -5,19 +5,20 @@ const tooltipGetter = params => {
|
|
|
5
5
|
getColor,
|
|
6
6
|
identifier
|
|
7
7
|
} = params;
|
|
8
|
-
if (!identifier
|
|
8
|
+
if (!identifier) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
+
const cellValue = series.heatmapData.getValue(identifier.xIndex, identifier.yIndex);
|
|
11
12
|
const label = getLabel(series.label, 'tooltip');
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const formattedValue = series.valueFormatter(cellValue, {
|
|
14
|
+
xIndex: identifier.xIndex,
|
|
15
|
+
yIndex: identifier.yIndex
|
|
15
16
|
});
|
|
16
17
|
return {
|
|
17
18
|
identifier,
|
|
18
|
-
color: getColor(
|
|
19
|
+
color: getColor(cellValue),
|
|
19
20
|
label,
|
|
20
|
-
value,
|
|
21
|
+
value: cellValue,
|
|
21
22
|
formattedValue,
|
|
22
23
|
markType: series.labelMarkType
|
|
23
24
|
};
|
|
@@ -12,7 +12,7 @@ const tooltipItemPositionGetter = params => {
|
|
|
12
12
|
axesConfig,
|
|
13
13
|
placement
|
|
14
14
|
} = params;
|
|
15
|
-
if (!identifier
|
|
15
|
+
if (!identifier) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
const itemSeries = series.heatmap?.series[identifier.seriesId];
|
|
@@ -22,9 +22,8 @@ const tooltipItemPositionGetter = params => {
|
|
|
22
22
|
if (axesConfig.x === undefined || axesConfig.y === undefined || !(0, _internals.isBandScaleConfig)(axesConfig.x) || !(0, _internals.isBandScaleConfig)(axesConfig.y)) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const y = axesConfig.y.scale(axesConfig.y.scale.domain()[yIndex]);
|
|
25
|
+
const x = axesConfig.x.scale(axesConfig.x.scale.domain()[identifier.xIndex]);
|
|
26
|
+
const y = axesConfig.y.scale(axesConfig.y.scale.domain()[identifier.yIndex]);
|
|
28
27
|
if (x === undefined || y === undefined) {
|
|
29
28
|
return null;
|
|
30
29
|
}
|
|
@@ -6,7 +6,7 @@ const tooltipItemPositionGetter = params => {
|
|
|
6
6
|
axesConfig,
|
|
7
7
|
placement
|
|
8
8
|
} = params;
|
|
9
|
-
if (!identifier
|
|
9
|
+
if (!identifier) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
12
|
const itemSeries = series.heatmap?.series[identifier.seriesId];
|
|
@@ -16,9 +16,8 @@ const tooltipItemPositionGetter = params => {
|
|
|
16
16
|
if (axesConfig.x === undefined || axesConfig.y === undefined || !isBandScaleConfig(axesConfig.x) || !isBandScaleConfig(axesConfig.y)) {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const y = axesConfig.y.scale(axesConfig.y.scale.domain()[yIndex]);
|
|
19
|
+
const x = axesConfig.x.scale(axesConfig.x.scale.domain()[identifier.xIndex]);
|
|
20
|
+
const y = axesConfig.y.scale(axesConfig.y.scale.domain()[identifier.yIndex]);
|
|
22
21
|
if (x === undefined || y === undefined) {
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
@@ -51,7 +51,7 @@ function useHeatmapProps(props) {
|
|
|
51
51
|
loading,
|
|
52
52
|
highlightedItem,
|
|
53
53
|
onHighlightChange,
|
|
54
|
-
|
|
54
|
+
disableKeyboardNavigation,
|
|
55
55
|
borderRadius,
|
|
56
56
|
hideLegend
|
|
57
57
|
} = props;
|
|
@@ -105,7 +105,7 @@ function useHeatmapProps(props) {
|
|
|
105
105
|
disableAxisListener: true,
|
|
106
106
|
highlightedItem,
|
|
107
107
|
onHighlightChange,
|
|
108
|
-
|
|
108
|
+
disableKeyboardNavigation,
|
|
109
109
|
onAxisClick,
|
|
110
110
|
onItemClick,
|
|
111
111
|
plugins: _Heatmap.HEATMAP_PLUGINS
|
|
@@ -43,7 +43,7 @@ export function useHeatmapProps(props) {
|
|
|
43
43
|
loading,
|
|
44
44
|
highlightedItem,
|
|
45
45
|
onHighlightChange,
|
|
46
|
-
|
|
46
|
+
disableKeyboardNavigation,
|
|
47
47
|
borderRadius,
|
|
48
48
|
hideLegend
|
|
49
49
|
} = props;
|
|
@@ -97,7 +97,7 @@ export function useHeatmapProps(props) {
|
|
|
97
97
|
disableAxisListener: true,
|
|
98
98
|
highlightedItem,
|
|
99
99
|
onHighlightChange,
|
|
100
|
-
|
|
100
|
+
disableKeyboardNavigation,
|
|
101
101
|
onAxisClick,
|
|
102
102
|
onItemClick,
|
|
103
103
|
plugins: HEATMAP_PLUGINS
|
|
@@ -150,11 +150,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
150
150
|
* @default false
|
|
151
151
|
*/
|
|
152
152
|
disableAxisListener: _propTypes.default.bool,
|
|
153
|
+
/**
|
|
154
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
155
|
+
*/
|
|
156
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
153
157
|
/**
|
|
154
158
|
* If `true`, render the line highlight item.
|
|
155
159
|
*/
|
|
156
160
|
disableLineItemHighlight: _propTypes.default.bool,
|
|
157
|
-
enableKeyboardNavigation: _propTypes.default.bool,
|
|
158
161
|
/**
|
|
159
162
|
* Options to enable features planned for the next major.
|
|
160
163
|
*/
|
|
@@ -339,7 +342,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
339
342
|
/**
|
|
340
343
|
* The callback fired when the tooltip item changes.
|
|
341
344
|
*
|
|
342
|
-
* @param {SeriesItemIdentifier<
|
|
345
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
343
346
|
*/
|
|
344
347
|
onTooltipItemChange: _propTypes.default.func,
|
|
345
348
|
/**
|
|
@@ -143,11 +143,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
143
143
|
* @default false
|
|
144
144
|
*/
|
|
145
145
|
disableAxisListener: PropTypes.bool,
|
|
146
|
+
/**
|
|
147
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
148
|
+
*/
|
|
149
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
146
150
|
/**
|
|
147
151
|
* If `true`, render the line highlight item.
|
|
148
152
|
*/
|
|
149
153
|
disableLineItemHighlight: PropTypes.bool,
|
|
150
|
-
enableKeyboardNavigation: PropTypes.bool,
|
|
151
154
|
/**
|
|
152
155
|
* Options to enable features planned for the next major.
|
|
153
156
|
*/
|
|
@@ -332,7 +335,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
332
335
|
/**
|
|
333
336
|
* The callback fired when the tooltip item changes.
|
|
334
337
|
*
|
|
335
|
-
* @param {SeriesItemIdentifier<
|
|
338
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
336
339
|
*/
|
|
337
340
|
onTooltipItemChange: PropTypes.func,
|
|
338
341
|
/**
|
|
@@ -120,7 +120,10 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
120
120
|
*/
|
|
121
121
|
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
122
122
|
desc: _propTypes.default.string,
|
|
123
|
-
|
|
123
|
+
/**
|
|
124
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
125
|
+
*/
|
|
126
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
124
127
|
/**
|
|
125
128
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
126
129
|
*/
|
|
@@ -244,7 +247,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
244
247
|
/**
|
|
245
248
|
* The callback fired when the tooltip item changes.
|
|
246
249
|
*
|
|
247
|
-
* @param {SeriesItemIdentifier<
|
|
250
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
248
251
|
*/
|
|
249
252
|
onTooltipItemChange: _propTypes.default.func,
|
|
250
253
|
/**
|
|
@@ -112,7 +112,10 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
112
112
|
*/
|
|
113
113
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
114
114
|
desc: PropTypes.string,
|
|
115
|
-
|
|
115
|
+
/**
|
|
116
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
117
|
+
*/
|
|
118
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
116
119
|
/**
|
|
117
120
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
118
121
|
*/
|
|
@@ -236,7 +239,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
236
239
|
/**
|
|
237
240
|
* The callback fired when the tooltip item changes.
|
|
238
241
|
*
|
|
239
|
-
* @param {SeriesItemIdentifier<
|
|
242
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
240
243
|
*/
|
|
241
244
|
onTooltipItemChange: PropTypes.func,
|
|
242
245
|
/**
|
|
@@ -85,12 +85,15 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
85
85
|
* @default false
|
|
86
86
|
*/
|
|
87
87
|
disableAxisListener: _propTypes.default.bool,
|
|
88
|
+
/**
|
|
89
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
90
|
+
*/
|
|
91
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
88
92
|
/**
|
|
89
93
|
* The number of divisions in the radar grid.
|
|
90
94
|
* @default 5
|
|
91
95
|
*/
|
|
92
96
|
divisions: _propTypes.default.number,
|
|
93
|
-
enableKeyboardNavigation: _propTypes.default.bool,
|
|
94
97
|
/**
|
|
95
98
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
96
99
|
*/
|
|
@@ -234,7 +237,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
234
237
|
/**
|
|
235
238
|
* The callback fired when the tooltip item changes.
|
|
236
239
|
*
|
|
237
|
-
* @param {SeriesItemIdentifier<
|
|
240
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
238
241
|
*/
|
|
239
242
|
onTooltipItemChange: _propTypes.default.func,
|
|
240
243
|
/**
|
|
@@ -78,12 +78,15 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
78
78
|
* @default false
|
|
79
79
|
*/
|
|
80
80
|
disableAxisListener: PropTypes.bool,
|
|
81
|
+
/**
|
|
82
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
83
|
+
*/
|
|
84
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
81
85
|
/**
|
|
82
86
|
* The number of divisions in the radar grid.
|
|
83
87
|
* @default 5
|
|
84
88
|
*/
|
|
85
89
|
divisions: PropTypes.number,
|
|
86
|
-
enableKeyboardNavigation: PropTypes.bool,
|
|
87
90
|
/**
|
|
88
91
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
89
92
|
*/
|
|
@@ -227,7 +230,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
227
230
|
/**
|
|
228
231
|
* The callback fired when the tooltip item changes.
|
|
229
232
|
*
|
|
230
|
-
* @param {SeriesItemIdentifier<
|
|
233
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
231
234
|
*/
|
|
232
235
|
onTooltipItemChange: PropTypes.func,
|
|
233
236
|
/**
|
|
@@ -95,7 +95,10 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
95
95
|
*/
|
|
96
96
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
97
97
|
desc: _propTypes.default.string,
|
|
98
|
-
|
|
98
|
+
/**
|
|
99
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
100
|
+
*/
|
|
101
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
99
102
|
/**
|
|
100
103
|
* Options to enable features planned for the next major.
|
|
101
104
|
*/
|
|
@@ -194,7 +197,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
194
197
|
/**
|
|
195
198
|
* The callback fired when the tooltip item changes.
|
|
196
199
|
*
|
|
197
|
-
* @param {SeriesItemIdentifier<
|
|
200
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
198
201
|
*/
|
|
199
202
|
onTooltipItemChange: _propTypes.default.func,
|
|
200
203
|
/**
|
|
@@ -88,7 +88,10 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
88
88
|
*/
|
|
89
89
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
90
90
|
desc: PropTypes.string,
|
|
91
|
-
|
|
91
|
+
/**
|
|
92
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
93
|
+
*/
|
|
94
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
92
95
|
/**
|
|
93
96
|
* Options to enable features planned for the next major.
|
|
94
97
|
*/
|
|
@@ -187,7 +190,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
187
190
|
/**
|
|
188
191
|
* The callback fired when the tooltip item changes.
|
|
189
192
|
*
|
|
190
|
-
* @param {SeriesItemIdentifier<
|
|
193
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
191
194
|
*/
|
|
192
195
|
onTooltipItemChange: PropTypes.func,
|
|
193
196
|
/**
|
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _sankeyHighlightHooks = require("./sankeyHighlightHooks");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
/**
|
|
16
17
|
* @ignore - internal component.
|
|
@@ -22,7 +23,6 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
|
|
|
22
23
|
onClick,
|
|
23
24
|
seriesId
|
|
24
25
|
} = props;
|
|
25
|
-
const store = (0, _internals.useStore)();
|
|
26
26
|
const identifier = {
|
|
27
27
|
type: 'sankey',
|
|
28
28
|
seriesId,
|
|
@@ -31,8 +31,9 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
|
|
|
31
31
|
sourceId: link.source.id,
|
|
32
32
|
link
|
|
33
33
|
};
|
|
34
|
-
const
|
|
35
|
-
const isFaded =
|
|
34
|
+
const highlightState = (0, _sankeyHighlightHooks.useSankeyLinkHighlightState)(identifier);
|
|
35
|
+
const isFaded = highlightState === 'faded';
|
|
36
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
36
37
|
|
|
37
38
|
// Add interaction props for tooltips
|
|
38
39
|
const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import {
|
|
6
|
+
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { useSankeyLinkHighlightState } from "./sankeyHighlightHooks.mjs";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
/**
|
|
9
10
|
* @ignore - internal component.
|
|
@@ -15,7 +16,6 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
15
16
|
onClick,
|
|
16
17
|
seriesId
|
|
17
18
|
} = props;
|
|
18
|
-
const store = useStore();
|
|
19
19
|
const identifier = {
|
|
20
20
|
type: 'sankey',
|
|
21
21
|
seriesId,
|
|
@@ -24,8 +24,9 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
24
24
|
sourceId: link.source.id,
|
|
25
25
|
link
|
|
26
26
|
};
|
|
27
|
-
const
|
|
28
|
-
const isFaded =
|
|
27
|
+
const highlightState = useSankeyLinkHighlightState(identifier);
|
|
28
|
+
const isFaded = highlightState === 'faded';
|
|
29
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
29
30
|
|
|
30
31
|
// Add interaction props for tooltips
|
|
31
32
|
const interactionProps = useInteractionItemProps(identifier);
|
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _sankeyHighlightHooks = require("./sankeyHighlightHooks");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
/**
|
|
16
17
|
* @ignore - internal component.
|
|
@@ -21,7 +22,6 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
|
|
|
21
22
|
onClick,
|
|
22
23
|
seriesId
|
|
23
24
|
} = props;
|
|
24
|
-
const store = (0, _internals.useStore)();
|
|
25
25
|
const x0 = node.x0 ?? 0;
|
|
26
26
|
const y0 = node.y0 ?? 0;
|
|
27
27
|
const x1 = node.x1 ?? 0;
|
|
@@ -35,8 +35,9 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
|
|
|
35
35
|
nodeId: node.id,
|
|
36
36
|
node
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
const isFaded =
|
|
38
|
+
const highlightState = (0, _sankeyHighlightHooks.useSankeyNodeHighlightState)(identifier);
|
|
39
|
+
const isFaded = highlightState === 'faded';
|
|
40
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
40
41
|
|
|
41
42
|
// Add interaction props for tooltips
|
|
42
43
|
const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import {
|
|
6
|
+
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { useSankeyNodeHighlightState } from "./sankeyHighlightHooks.mjs";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
/**
|
|
9
10
|
* @ignore - internal component.
|
|
@@ -14,7 +15,6 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
14
15
|
onClick,
|
|
15
16
|
seriesId
|
|
16
17
|
} = props;
|
|
17
|
-
const store = useStore();
|
|
18
18
|
const x0 = node.x0 ?? 0;
|
|
19
19
|
const y0 = node.y0 ?? 0;
|
|
20
20
|
const x1 = node.x1 ?? 0;
|
|
@@ -28,8 +28,9 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
28
28
|
nodeId: node.id,
|
|
29
29
|
node
|
|
30
30
|
};
|
|
31
|
-
const
|
|
32
|
-
const isFaded =
|
|
31
|
+
const highlightState = useSankeyNodeHighlightState(identifier);
|
|
32
|
+
const isFaded = highlightState === 'faded';
|
|
33
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
33
34
|
|
|
34
35
|
// Add interaction props for tooltips
|
|
35
36
|
const interactionProps = useInteractionItemProps(identifier);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SankeyLinkIdentifier, SankeyNodeIdentifier } from "./sankey.types.mjs";
|
|
2
|
-
export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): "
|
|
3
|
-
export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): "
|
|
2
|
+
export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): import("@mui/x-charts").HighlightState;
|
|
3
|
+
export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): import("@mui/x-charts").HighlightState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SankeyLinkIdentifier, SankeyNodeIdentifier } from "./sankey.types.js";
|
|
2
|
-
export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): "
|
|
3
|
-
export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): "
|
|
2
|
+
export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): import("@mui/x-charts").HighlightState;
|
|
3
|
+
export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): import("@mui/x-charts").HighlightState;
|
|
@@ -8,17 +8,9 @@ exports.useSankeyNodeHighlightState = useSankeyNodeHighlightState;
|
|
|
8
8
|
var _internals = require("@mui/x-charts/internals");
|
|
9
9
|
function useSankeyNodeHighlightState(nodeIdentifier) {
|
|
10
10
|
const store = (0, _internals.useStore)();
|
|
11
|
-
|
|
12
|
-
const isFaded = store.use(_internals.selectorChartsIsFaded, nodeIdentifier);
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line no-nested-ternary
|
|
15
|
-
return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
|
|
11
|
+
return store.use(_internals.selectorChartsHighlightState, nodeIdentifier);
|
|
16
12
|
}
|
|
17
13
|
function useSankeyLinkHighlightState(linkIdentifier) {
|
|
18
14
|
const store = (0, _internals.useStore)();
|
|
19
|
-
|
|
20
|
-
const isFaded = store.use(_internals.selectorChartsIsFaded, linkIdentifier);
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line no-nested-ternary
|
|
23
|
-
return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
|
|
15
|
+
return store.use(_internals.selectorChartsHighlightState, linkIdentifier);
|
|
24
16
|
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { selectorChartsHighlightState, useStore } from '@mui/x-charts/internals';
|
|
2
2
|
export function useSankeyNodeHighlightState(nodeIdentifier) {
|
|
3
3
|
const store = useStore();
|
|
4
|
-
|
|
5
|
-
const isFaded = store.use(selectorChartsIsFaded, nodeIdentifier);
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line no-nested-ternary
|
|
8
|
-
return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
|
|
4
|
+
return store.use(selectorChartsHighlightState, nodeIdentifier);
|
|
9
5
|
}
|
|
10
6
|
export function useSankeyLinkHighlightState(linkIdentifier) {
|
|
11
7
|
const store = useStore();
|
|
12
|
-
|
|
13
|
-
const isFaded = store.use(selectorChartsIsFaded, linkIdentifier);
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line no-nested-ternary
|
|
16
|
-
return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
|
|
8
|
+
return store.use(selectorChartsHighlightState, linkIdentifier);
|
|
17
9
|
}
|
|
@@ -144,12 +144,15 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
144
144
|
* @default false
|
|
145
145
|
*/
|
|
146
146
|
disableAxisListener: _propTypes.default.bool,
|
|
147
|
+
/**
|
|
148
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
149
|
+
*/
|
|
150
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
147
151
|
/**
|
|
148
152
|
* If true, the interaction will not use the Voronoi cell and fall back to hover events.
|
|
149
153
|
* @default false
|
|
150
154
|
*/
|
|
151
155
|
disableVoronoi: _propTypes.default.bool,
|
|
152
|
-
enableKeyboardNavigation: _propTypes.default.bool,
|
|
153
156
|
/**
|
|
154
157
|
* Option to display a cartesian grid in the background.
|
|
155
158
|
*/
|
|
@@ -306,7 +309,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
306
309
|
/**
|
|
307
310
|
* The callback fired when the tooltip item changes.
|
|
308
311
|
*
|
|
309
|
-
* @param {SeriesItemIdentifier<
|
|
312
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
310
313
|
*/
|
|
311
314
|
onTooltipItemChange: _propTypes.default.func,
|
|
312
315
|
/**
|
|
@@ -137,12 +137,15 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
137
137
|
* @default false
|
|
138
138
|
*/
|
|
139
139
|
disableAxisListener: PropTypes.bool,
|
|
140
|
+
/**
|
|
141
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
142
|
+
*/
|
|
143
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
140
144
|
/**
|
|
141
145
|
* If true, the interaction will not use the Voronoi cell and fall back to hover events.
|
|
142
146
|
* @default false
|
|
143
147
|
*/
|
|
144
148
|
disableVoronoi: PropTypes.bool,
|
|
145
|
-
enableKeyboardNavigation: PropTypes.bool,
|
|
146
149
|
/**
|
|
147
150
|
* Option to display a cartesian grid in the background.
|
|
148
151
|
*/
|
|
@@ -299,7 +302,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
299
302
|
/**
|
|
300
303
|
* The callback fired when the tooltip item changes.
|
|
301
304
|
*
|
|
302
|
-
* @param {SeriesItemIdentifier<
|
|
305
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
303
306
|
*/
|
|
304
307
|
onTooltipItemChange: PropTypes.func,
|
|
305
308
|
/**
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CommercialPackageInfo } from '@mui/x-license/internals';
|
|
2
2
|
interface ChartsWatermarkProps {
|
|
3
|
-
|
|
3
|
+
packageInfo: CommercialPackageInfo;
|
|
4
4
|
}
|
|
5
5
|
export declare function ChartsWatermark(props: ChartsWatermarkProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CommercialPackageInfo } from '@mui/x-license/internals';
|
|
2
2
|
interface ChartsWatermarkProps {
|
|
3
|
-
|
|
3
|
+
packageInfo: CommercialPackageInfo;
|
|
4
4
|
}
|
|
5
5
|
export declare function ChartsWatermark(props: ChartsWatermarkProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -8,20 +8,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.ChartsWatermark = ChartsWatermark;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
11
|
-
var
|
|
11
|
+
var _internals = require("@mui/x-license/internals");
|
|
12
12
|
var _hooks = require("../hooks");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
const releaseInfo = "MTc3MjY2ODgwMDAwMA==";
|
|
15
14
|
function ChartsWatermark(props) {
|
|
16
15
|
const layerContainerRef = (0, _hooks.useChartsLayerContainerRef)();
|
|
17
16
|
if (!layerContainerRef.current) {
|
|
18
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
19
|
-
|
|
20
|
-
releaseInfo: releaseInfo
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.Watermark, {
|
|
18
|
+
packageInfo: props.packageInfo
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
|
-
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
24
|
-
|
|
25
|
-
releaseInfo: releaseInfo
|
|
21
|
+
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.Watermark, {
|
|
22
|
+
packageInfo: props.packageInfo
|
|
26
23
|
}), layerContainerRef.current);
|
|
27
24
|
}
|
|
@@ -2,20 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
|
-
import { Watermark } from '@mui/x-license/
|
|
5
|
+
import { Watermark } from '@mui/x-license/internals';
|
|
6
6
|
import { useChartsLayerContainerRef } from "../hooks/index.mjs";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const releaseInfo = "MTc3MjY2ODgwMDAwMA==";
|
|
9
8
|
export function ChartsWatermark(props) {
|
|
10
9
|
const layerContainerRef = useChartsLayerContainerRef();
|
|
11
10
|
if (!layerContainerRef.current) {
|
|
12
11
|
return /*#__PURE__*/_jsx(Watermark, {
|
|
13
|
-
|
|
14
|
-
releaseInfo: releaseInfo
|
|
12
|
+
packageInfo: props.packageInfo
|
|
15
13
|
});
|
|
16
14
|
}
|
|
17
15
|
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/_jsx(Watermark, {
|
|
18
|
-
|
|
19
|
-
releaseInfo: releaseInfo
|
|
16
|
+
packageInfo: props.packageInfo
|
|
20
17
|
}), layerContainerRef.current);
|
|
21
18
|
}
|