@mui/x-charts-pro 8.13.1 → 8.14.1
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 +49 -37
- package/CHANGELOG.md +204 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.js +38 -36
- package/Heatmap/Heatmap.js +0 -4
- package/LineChartPro/LineChartPro.js +49 -37
- package/SankeyChart/SankeyChart.d.ts +1 -1
- package/SankeyChart/SankeyChart.js +30 -0
- package/SankeyChart/SankeyChart.plugins.d.ts +3 -2
- package/SankeyChart/SankeyChart.plugins.js +2 -1
- package/SankeyChart/SankeyLinkElement.d.ts +1 -1
- package/SankeyChart/SankeyLinkElement.js +15 -2
- package/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.js +16 -1
- package/SankeyChart/SankeyPlot.js +13 -1
- package/SankeyChart/plugins/index.d.ts +3 -0
- package/SankeyChart/plugins/index.js +49 -0
- package/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
- package/SankeyChart/plugins/useSankeyHighlight.js +76 -0
- package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
- package/SankeyChart/plugins/useSankeyHighlight.selectors.js +126 -0
- package/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
- package/SankeyChart/plugins/useSankeyHighlight.types.js +5 -0
- package/SankeyChart/sankey.highlight.types.d.ts +42 -0
- package/SankeyChart/sankey.highlight.types.js +6 -0
- package/SankeyChart/sankey.types.d.ts +3 -2
- package/SankeyChart/sankeyClasses.d.ts +1 -1
- package/SankeyChart/useSankeyChartProps.js +5 -5
- package/ScatterChartPro/ScatterChartPro.js +49 -37
- package/esm/BarChartPro/BarChartPro.js +49 -37
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.js +39 -37
- package/esm/Heatmap/Heatmap.js +0 -4
- package/esm/LineChartPro/LineChartPro.js +49 -37
- package/esm/SankeyChart/SankeyChart.d.ts +1 -1
- package/esm/SankeyChart/SankeyChart.js +30 -0
- package/esm/SankeyChart/SankeyChart.plugins.d.ts +3 -2
- package/esm/SankeyChart/SankeyChart.plugins.js +3 -4
- package/esm/SankeyChart/SankeyLinkElement.d.ts +1 -1
- package/esm/SankeyChart/SankeyLinkElement.js +16 -3
- package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/esm/SankeyChart/SankeyNodeElement.js +17 -2
- package/esm/SankeyChart/SankeyPlot.js +15 -3
- package/esm/SankeyChart/plugins/index.d.ts +3 -0
- package/esm/SankeyChart/plugins/index.js +3 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.js +68 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.js +120 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.types.js +1 -0
- package/esm/SankeyChart/sankey.highlight.types.d.ts +42 -0
- package/esm/SankeyChart/sankey.highlight.types.js +3 -0
- package/esm/SankeyChart/sankey.types.d.ts +3 -2
- package/esm/SankeyChart/sankeyClasses.d.ts +1 -1
- package/esm/SankeyChart/useSankeyChartProps.js +5 -5
- package/esm/ScatterChartPro/ScatterChartPro.js +49 -37
- package/esm/index.js +1 -1
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -6
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +5 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +73 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +2 -0
- package/index.js +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -6
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +5 -1
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +80 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +2 -0
- package/package.json +7 -7
|
@@ -314,8 +314,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
314
314
|
ignoreTooltip: PropTypes.bool,
|
|
315
315
|
label: PropTypes.string,
|
|
316
316
|
labelStyle: PropTypes.object,
|
|
317
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
318
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
319
317
|
offset: PropTypes.number,
|
|
320
318
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
321
319
|
reverse: PropTypes.bool,
|
|
@@ -383,8 +381,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
383
381
|
ignoreTooltip: PropTypes.bool,
|
|
384
382
|
label: PropTypes.string,
|
|
385
383
|
labelStyle: PropTypes.object,
|
|
386
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
387
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
388
384
|
offset: PropTypes.number,
|
|
389
385
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
390
386
|
reverse: PropTypes.bool,
|
|
@@ -442,8 +438,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
442
438
|
ignoreTooltip: PropTypes.bool,
|
|
443
439
|
label: PropTypes.string,
|
|
444
440
|
labelStyle: PropTypes.object,
|
|
445
|
-
max: PropTypes.
|
|
446
|
-
min: PropTypes.
|
|
441
|
+
max: PropTypes.number,
|
|
442
|
+
min: PropTypes.number,
|
|
447
443
|
offset: PropTypes.number,
|
|
448
444
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
449
445
|
reverse: PropTypes.bool,
|
|
@@ -502,8 +498,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
502
498
|
ignoreTooltip: PropTypes.bool,
|
|
503
499
|
label: PropTypes.string,
|
|
504
500
|
labelStyle: PropTypes.object,
|
|
505
|
-
max: PropTypes.
|
|
506
|
-
min: PropTypes.
|
|
501
|
+
max: PropTypes.number,
|
|
502
|
+
min: PropTypes.number,
|
|
507
503
|
offset: PropTypes.number,
|
|
508
504
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
509
505
|
reverse: PropTypes.bool,
|
|
@@ -561,8 +557,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
561
557
|
ignoreTooltip: PropTypes.bool,
|
|
562
558
|
label: PropTypes.string,
|
|
563
559
|
labelStyle: PropTypes.object,
|
|
564
|
-
max: PropTypes.
|
|
565
|
-
min: PropTypes.
|
|
560
|
+
max: PropTypes.number,
|
|
561
|
+
min: PropTypes.number,
|
|
566
562
|
offset: PropTypes.number,
|
|
567
563
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
568
564
|
reverse: PropTypes.bool,
|
|
@@ -620,8 +616,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
620
616
|
ignoreTooltip: PropTypes.bool,
|
|
621
617
|
label: PropTypes.string,
|
|
622
618
|
labelStyle: PropTypes.object,
|
|
623
|
-
max: PropTypes.
|
|
624
|
-
min: PropTypes.
|
|
619
|
+
max: PropTypes.number,
|
|
620
|
+
min: PropTypes.number,
|
|
625
621
|
offset: PropTypes.number,
|
|
626
622
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
627
623
|
reverse: PropTypes.bool,
|
|
@@ -679,8 +675,12 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
679
675
|
ignoreTooltip: PropTypes.bool,
|
|
680
676
|
label: PropTypes.string,
|
|
681
677
|
labelStyle: PropTypes.object,
|
|
682
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
683
|
-
|
|
678
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
679
|
+
valueOf: PropTypes.func.isRequired
|
|
680
|
+
})]),
|
|
681
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
682
|
+
valueOf: PropTypes.func.isRequired
|
|
683
|
+
})]),
|
|
684
684
|
offset: PropTypes.number,
|
|
685
685
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
686
686
|
reverse: PropTypes.bool,
|
|
@@ -738,8 +738,12 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
738
738
|
ignoreTooltip: PropTypes.bool,
|
|
739
739
|
label: PropTypes.string,
|
|
740
740
|
labelStyle: PropTypes.object,
|
|
741
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
742
|
-
|
|
741
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
742
|
+
valueOf: PropTypes.func.isRequired
|
|
743
|
+
})]),
|
|
744
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
745
|
+
valueOf: PropTypes.func.isRequired
|
|
746
|
+
})]),
|
|
743
747
|
offset: PropTypes.number,
|
|
744
748
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
745
749
|
reverse: PropTypes.bool,
|
|
@@ -797,8 +801,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
797
801
|
ignoreTooltip: PropTypes.bool,
|
|
798
802
|
label: PropTypes.string,
|
|
799
803
|
labelStyle: PropTypes.object,
|
|
800
|
-
max: PropTypes.
|
|
801
|
-
min: PropTypes.
|
|
804
|
+
max: PropTypes.number,
|
|
805
|
+
min: PropTypes.number,
|
|
802
806
|
offset: PropTypes.number,
|
|
803
807
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
804
808
|
reverse: PropTypes.bool,
|
|
@@ -873,8 +877,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
873
877
|
ignoreTooltip: PropTypes.bool,
|
|
874
878
|
label: PropTypes.string,
|
|
875
879
|
labelStyle: PropTypes.object,
|
|
876
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
877
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
878
880
|
offset: PropTypes.number,
|
|
879
881
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
880
882
|
reverse: PropTypes.bool,
|
|
@@ -941,8 +943,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
941
943
|
ignoreTooltip: PropTypes.bool,
|
|
942
944
|
label: PropTypes.string,
|
|
943
945
|
labelStyle: PropTypes.object,
|
|
944
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
945
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
946
946
|
offset: PropTypes.number,
|
|
947
947
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
948
948
|
reverse: PropTypes.bool,
|
|
@@ -999,8 +999,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
999
999
|
ignoreTooltip: PropTypes.bool,
|
|
1000
1000
|
label: PropTypes.string,
|
|
1001
1001
|
labelStyle: PropTypes.object,
|
|
1002
|
-
max: PropTypes.
|
|
1003
|
-
min: PropTypes.
|
|
1002
|
+
max: PropTypes.number,
|
|
1003
|
+
min: PropTypes.number,
|
|
1004
1004
|
offset: PropTypes.number,
|
|
1005
1005
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1006
1006
|
reverse: PropTypes.bool,
|
|
@@ -1058,8 +1058,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1058
1058
|
ignoreTooltip: PropTypes.bool,
|
|
1059
1059
|
label: PropTypes.string,
|
|
1060
1060
|
labelStyle: PropTypes.object,
|
|
1061
|
-
max: PropTypes.
|
|
1062
|
-
min: PropTypes.
|
|
1061
|
+
max: PropTypes.number,
|
|
1062
|
+
min: PropTypes.number,
|
|
1063
1063
|
offset: PropTypes.number,
|
|
1064
1064
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1065
1065
|
reverse: PropTypes.bool,
|
|
@@ -1116,8 +1116,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1116
1116
|
ignoreTooltip: PropTypes.bool,
|
|
1117
1117
|
label: PropTypes.string,
|
|
1118
1118
|
labelStyle: PropTypes.object,
|
|
1119
|
-
max: PropTypes.
|
|
1120
|
-
min: PropTypes.
|
|
1119
|
+
max: PropTypes.number,
|
|
1120
|
+
min: PropTypes.number,
|
|
1121
1121
|
offset: PropTypes.number,
|
|
1122
1122
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1123
1123
|
reverse: PropTypes.bool,
|
|
@@ -1174,8 +1174,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1174
1174
|
ignoreTooltip: PropTypes.bool,
|
|
1175
1175
|
label: PropTypes.string,
|
|
1176
1176
|
labelStyle: PropTypes.object,
|
|
1177
|
-
max: PropTypes.
|
|
1178
|
-
min: PropTypes.
|
|
1177
|
+
max: PropTypes.number,
|
|
1178
|
+
min: PropTypes.number,
|
|
1179
1179
|
offset: PropTypes.number,
|
|
1180
1180
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1181
1181
|
reverse: PropTypes.bool,
|
|
@@ -1232,8 +1232,12 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1232
1232
|
ignoreTooltip: PropTypes.bool,
|
|
1233
1233
|
label: PropTypes.string,
|
|
1234
1234
|
labelStyle: PropTypes.object,
|
|
1235
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
1236
|
-
|
|
1235
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1236
|
+
valueOf: PropTypes.func.isRequired
|
|
1237
|
+
})]),
|
|
1238
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1239
|
+
valueOf: PropTypes.func.isRequired
|
|
1240
|
+
})]),
|
|
1237
1241
|
offset: PropTypes.number,
|
|
1238
1242
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1239
1243
|
reverse: PropTypes.bool,
|
|
@@ -1290,8 +1294,12 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1290
1294
|
ignoreTooltip: PropTypes.bool,
|
|
1291
1295
|
label: PropTypes.string,
|
|
1292
1296
|
labelStyle: PropTypes.object,
|
|
1293
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
1294
|
-
|
|
1297
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1298
|
+
valueOf: PropTypes.func.isRequired
|
|
1299
|
+
})]),
|
|
1300
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1301
|
+
valueOf: PropTypes.func.isRequired
|
|
1302
|
+
})]),
|
|
1295
1303
|
offset: PropTypes.number,
|
|
1296
1304
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1297
1305
|
reverse: PropTypes.bool,
|
|
@@ -1348,8 +1356,8 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1348
1356
|
ignoreTooltip: PropTypes.bool,
|
|
1349
1357
|
label: PropTypes.string,
|
|
1350
1358
|
labelStyle: PropTypes.object,
|
|
1351
|
-
max: PropTypes.
|
|
1352
|
-
min: PropTypes.
|
|
1359
|
+
max: PropTypes.number,
|
|
1360
|
+
min: PropTypes.number,
|
|
1353
1361
|
offset: PropTypes.number,
|
|
1354
1362
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1355
1363
|
reverse: PropTypes.bool,
|
|
@@ -1421,10 +1429,14 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1421
1429
|
* Configuration for zoom interactions.
|
|
1422
1430
|
*/
|
|
1423
1431
|
zoomInteractionConfig: PropTypes.shape({
|
|
1424
|
-
pan: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['drag']), PropTypes.shape({
|
|
1432
|
+
pan: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['drag', 'pressAndDrag']), PropTypes.shape({
|
|
1425
1433
|
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1426
1434
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1427
1435
|
type: PropTypes.oneOf(['drag']).isRequired
|
|
1436
|
+
}), PropTypes.shape({
|
|
1437
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1438
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1439
|
+
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
1428
1440
|
})]).isRequired),
|
|
1429
1441
|
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1430
1442
|
pointerMode: PropTypes.any,
|
|
@@ -11,7 +11,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
|
11
11
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
12
12
|
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const releaseInfo = "
|
|
14
|
+
const releaseInfo = "MTc2MDU3MjgwMDAwMA==";
|
|
15
15
|
const packageIdentifier = 'x-charts-pro';
|
|
16
16
|
/**
|
|
17
17
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { scaleBand } from '@mui/x-charts-vendor/d3-scale';
|
|
3
|
-
import { getAxisExtrema, isBandScaleConfig, getScale, getColorScale, getOrdinalColorScale, getTickNumber, scaleTickNumberByRange, getCartesianAxisTriggerTooltip, isDateData, createDateFormatter, getDefaultTickNumber } from '@mui/x-charts/internals';
|
|
3
|
+
import { getAxisExtrema, isBandScaleConfig, isPointScaleConfig, isContinuousScaleConfig, getScale, getColorScale, getOrdinalColorScale, getTickNumber, scaleTickNumberByRange, getCartesianAxisTriggerTooltip, isDateData, createDateFormatter, getDefaultTickNumber } from '@mui/x-charts/internals';
|
|
4
4
|
export const xRangeGetter = (drawingArea, reverse, removedSpace = 0) => {
|
|
5
5
|
const range = [drawingArea.left, drawingArea.left + drawingArea.width - removedSpace];
|
|
6
6
|
return reverse ? [range[1], range[0]] : [range[0], range[1]];
|
|
@@ -60,47 +60,49 @@ export function computeAxisValue({
|
|
|
60
60
|
completeAxis[axis.id].valueFormatter = axis.valueFormatter ?? dateFormatter;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
if (axis
|
|
63
|
+
if (isBandScaleConfig(axis)) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
if (axis
|
|
66
|
+
if (isPointScaleConfig(axis)) {
|
|
67
67
|
throw new Error('Point scale is not supported in FunnelChart. Please use band scale instead.');
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
if (isContinuousScaleConfig(axis)) {
|
|
70
|
+
const isHorizontal = Object.values(formattedSeries.funnel?.series ?? {}).some(s => s.layout === 'horizontal');
|
|
71
|
+
if (isHorizontal ? axisDirection === 'x' : axisDirection === 'y') {
|
|
72
|
+
// For linear scale replacing the band scale, we remove the space needed for gap from the scale range.
|
|
73
|
+
const itemNumber = formattedSeries.funnel?.series[formattedSeries.funnel.seriesOrder[0]].data.length ?? 0;
|
|
74
|
+
const spaceToRemove = gap * (itemNumber - 1);
|
|
75
|
+
range = getRange(drawingArea, axisDirection, axis, spaceToRemove);
|
|
76
|
+
}
|
|
77
|
+
const scaleType = axis.scaleType ?? 'linear';
|
|
78
|
+
const domainLimit = axis.domainLimit ?? 'nice';
|
|
79
|
+
const axisExtremums = [axis.min ?? minData, axis.max ?? maxData];
|
|
80
|
+
if (typeof domainLimit === 'function') {
|
|
81
|
+
const {
|
|
82
|
+
min,
|
|
83
|
+
max
|
|
84
|
+
} = domainLimit(minData, maxData);
|
|
85
|
+
axisExtremums[0] = min;
|
|
86
|
+
axisExtremums[1] = max;
|
|
87
|
+
}
|
|
88
|
+
const rawTickNumber = getTickNumber(axis, axisExtremums, getDefaultTickNumber(Math.abs(range[1] - range[0])));
|
|
89
|
+
const tickNumber = scaleTickNumberByRange(rawTickNumber, range);
|
|
90
|
+
const scale = getScale(scaleType, axisExtremums, range);
|
|
91
|
+
const finalScale = domainLimit === 'nice' ? scale.nice(rawTickNumber) : scale;
|
|
92
|
+
const [minDomain, maxDomain] = finalScale.domain();
|
|
93
|
+
const domain = [axis.min ?? minDomain, axis.max ?? maxDomain];
|
|
94
|
+
completeAxis[axis.id] = _extends({
|
|
95
|
+
offset: 0,
|
|
96
|
+
height: 0,
|
|
97
|
+
triggerTooltip
|
|
98
|
+
}, axis, {
|
|
99
|
+
data,
|
|
100
|
+
scaleType: scaleType,
|
|
101
|
+
scale: finalScale.domain(domain),
|
|
102
|
+
tickNumber,
|
|
103
|
+
colorScale: axis.colorMap && getColorScale(axis.colorMap)
|
|
104
|
+
});
|
|
86
105
|
}
|
|
87
|
-
const rawTickNumber = getTickNumber(axis, axisExtremums, getDefaultTickNumber(Math.abs(range[1] - range[0])));
|
|
88
|
-
const tickNumber = scaleTickNumberByRange(rawTickNumber, range);
|
|
89
|
-
const scale = getScale(scaleType, axisExtremums, range);
|
|
90
|
-
const finalScale = domainLimit === 'nice' ? scale.nice(rawTickNumber) : scale;
|
|
91
|
-
const [minDomain, maxDomain] = finalScale.domain();
|
|
92
|
-
const domain = [axis.min ?? minDomain, axis.max ?? maxDomain];
|
|
93
|
-
completeAxis[axis.id] = _extends({
|
|
94
|
-
offset: 0,
|
|
95
|
-
height: 0,
|
|
96
|
-
triggerTooltip
|
|
97
|
-
}, axis, {
|
|
98
|
-
data,
|
|
99
|
-
scaleType: scaleType,
|
|
100
|
-
scale: finalScale.domain(domain),
|
|
101
|
-
tickNumber,
|
|
102
|
-
colorScale: axis.colorMap && getColorScale(axis.colorMap)
|
|
103
|
-
});
|
|
104
106
|
});
|
|
105
107
|
return {
|
|
106
108
|
axis: completeAxis,
|
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -316,8 +316,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
316
316
|
ignoreTooltip: PropTypes.bool,
|
|
317
317
|
label: PropTypes.string,
|
|
318
318
|
labelStyle: PropTypes.object,
|
|
319
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
320
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
321
319
|
offset: PropTypes.number,
|
|
322
320
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
323
321
|
reverse: PropTypes.bool,
|
|
@@ -377,8 +375,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
377
375
|
ignoreTooltip: PropTypes.bool,
|
|
378
376
|
label: PropTypes.string,
|
|
379
377
|
labelStyle: PropTypes.object,
|
|
380
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
381
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
382
378
|
offset: PropTypes.number,
|
|
383
379
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
384
380
|
reverse: PropTypes.bool,
|
|
@@ -317,8 +317,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
317
317
|
ignoreTooltip: PropTypes.bool,
|
|
318
318
|
label: PropTypes.string,
|
|
319
319
|
labelStyle: PropTypes.object,
|
|
320
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
321
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
322
320
|
offset: PropTypes.number,
|
|
323
321
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
324
322
|
reverse: PropTypes.bool,
|
|
@@ -386,8 +384,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
386
384
|
ignoreTooltip: PropTypes.bool,
|
|
387
385
|
label: PropTypes.string,
|
|
388
386
|
labelStyle: PropTypes.object,
|
|
389
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
390
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
391
387
|
offset: PropTypes.number,
|
|
392
388
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
393
389
|
reverse: PropTypes.bool,
|
|
@@ -445,8 +441,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
445
441
|
ignoreTooltip: PropTypes.bool,
|
|
446
442
|
label: PropTypes.string,
|
|
447
443
|
labelStyle: PropTypes.object,
|
|
448
|
-
max: PropTypes.
|
|
449
|
-
min: PropTypes.
|
|
444
|
+
max: PropTypes.number,
|
|
445
|
+
min: PropTypes.number,
|
|
450
446
|
offset: PropTypes.number,
|
|
451
447
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
452
448
|
reverse: PropTypes.bool,
|
|
@@ -505,8 +501,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
505
501
|
ignoreTooltip: PropTypes.bool,
|
|
506
502
|
label: PropTypes.string,
|
|
507
503
|
labelStyle: PropTypes.object,
|
|
508
|
-
max: PropTypes.
|
|
509
|
-
min: PropTypes.
|
|
504
|
+
max: PropTypes.number,
|
|
505
|
+
min: PropTypes.number,
|
|
510
506
|
offset: PropTypes.number,
|
|
511
507
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
512
508
|
reverse: PropTypes.bool,
|
|
@@ -564,8 +560,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
564
560
|
ignoreTooltip: PropTypes.bool,
|
|
565
561
|
label: PropTypes.string,
|
|
566
562
|
labelStyle: PropTypes.object,
|
|
567
|
-
max: PropTypes.
|
|
568
|
-
min: PropTypes.
|
|
563
|
+
max: PropTypes.number,
|
|
564
|
+
min: PropTypes.number,
|
|
569
565
|
offset: PropTypes.number,
|
|
570
566
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
571
567
|
reverse: PropTypes.bool,
|
|
@@ -623,8 +619,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
623
619
|
ignoreTooltip: PropTypes.bool,
|
|
624
620
|
label: PropTypes.string,
|
|
625
621
|
labelStyle: PropTypes.object,
|
|
626
|
-
max: PropTypes.
|
|
627
|
-
min: PropTypes.
|
|
622
|
+
max: PropTypes.number,
|
|
623
|
+
min: PropTypes.number,
|
|
628
624
|
offset: PropTypes.number,
|
|
629
625
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
630
626
|
reverse: PropTypes.bool,
|
|
@@ -682,8 +678,12 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
682
678
|
ignoreTooltip: PropTypes.bool,
|
|
683
679
|
label: PropTypes.string,
|
|
684
680
|
labelStyle: PropTypes.object,
|
|
685
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
686
|
-
|
|
681
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
682
|
+
valueOf: PropTypes.func.isRequired
|
|
683
|
+
})]),
|
|
684
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
685
|
+
valueOf: PropTypes.func.isRequired
|
|
686
|
+
})]),
|
|
687
687
|
offset: PropTypes.number,
|
|
688
688
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
689
689
|
reverse: PropTypes.bool,
|
|
@@ -741,8 +741,12 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
741
741
|
ignoreTooltip: PropTypes.bool,
|
|
742
742
|
label: PropTypes.string,
|
|
743
743
|
labelStyle: PropTypes.object,
|
|
744
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
745
|
-
|
|
744
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
745
|
+
valueOf: PropTypes.func.isRequired
|
|
746
|
+
})]),
|
|
747
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
748
|
+
valueOf: PropTypes.func.isRequired
|
|
749
|
+
})]),
|
|
746
750
|
offset: PropTypes.number,
|
|
747
751
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
748
752
|
reverse: PropTypes.bool,
|
|
@@ -800,8 +804,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
800
804
|
ignoreTooltip: PropTypes.bool,
|
|
801
805
|
label: PropTypes.string,
|
|
802
806
|
labelStyle: PropTypes.object,
|
|
803
|
-
max: PropTypes.
|
|
804
|
-
min: PropTypes.
|
|
807
|
+
max: PropTypes.number,
|
|
808
|
+
min: PropTypes.number,
|
|
805
809
|
offset: PropTypes.number,
|
|
806
810
|
position: PropTypes.oneOf(['bottom', 'none', 'top']),
|
|
807
811
|
reverse: PropTypes.bool,
|
|
@@ -876,8 +880,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
876
880
|
ignoreTooltip: PropTypes.bool,
|
|
877
881
|
label: PropTypes.string,
|
|
878
882
|
labelStyle: PropTypes.object,
|
|
879
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
880
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
881
883
|
offset: PropTypes.number,
|
|
882
884
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
883
885
|
reverse: PropTypes.bool,
|
|
@@ -944,8 +946,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
944
946
|
ignoreTooltip: PropTypes.bool,
|
|
945
947
|
label: PropTypes.string,
|
|
946
948
|
labelStyle: PropTypes.object,
|
|
947
|
-
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
948
|
-
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
949
949
|
offset: PropTypes.number,
|
|
950
950
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
951
951
|
reverse: PropTypes.bool,
|
|
@@ -1002,8 +1002,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1002
1002
|
ignoreTooltip: PropTypes.bool,
|
|
1003
1003
|
label: PropTypes.string,
|
|
1004
1004
|
labelStyle: PropTypes.object,
|
|
1005
|
-
max: PropTypes.
|
|
1006
|
-
min: PropTypes.
|
|
1005
|
+
max: PropTypes.number,
|
|
1006
|
+
min: PropTypes.number,
|
|
1007
1007
|
offset: PropTypes.number,
|
|
1008
1008
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1009
1009
|
reverse: PropTypes.bool,
|
|
@@ -1061,8 +1061,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1061
1061
|
ignoreTooltip: PropTypes.bool,
|
|
1062
1062
|
label: PropTypes.string,
|
|
1063
1063
|
labelStyle: PropTypes.object,
|
|
1064
|
-
max: PropTypes.
|
|
1065
|
-
min: PropTypes.
|
|
1064
|
+
max: PropTypes.number,
|
|
1065
|
+
min: PropTypes.number,
|
|
1066
1066
|
offset: PropTypes.number,
|
|
1067
1067
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1068
1068
|
reverse: PropTypes.bool,
|
|
@@ -1119,8 +1119,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1119
1119
|
ignoreTooltip: PropTypes.bool,
|
|
1120
1120
|
label: PropTypes.string,
|
|
1121
1121
|
labelStyle: PropTypes.object,
|
|
1122
|
-
max: PropTypes.
|
|
1123
|
-
min: PropTypes.
|
|
1122
|
+
max: PropTypes.number,
|
|
1123
|
+
min: PropTypes.number,
|
|
1124
1124
|
offset: PropTypes.number,
|
|
1125
1125
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1126
1126
|
reverse: PropTypes.bool,
|
|
@@ -1177,8 +1177,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1177
1177
|
ignoreTooltip: PropTypes.bool,
|
|
1178
1178
|
label: PropTypes.string,
|
|
1179
1179
|
labelStyle: PropTypes.object,
|
|
1180
|
-
max: PropTypes.
|
|
1181
|
-
min: PropTypes.
|
|
1180
|
+
max: PropTypes.number,
|
|
1181
|
+
min: PropTypes.number,
|
|
1182
1182
|
offset: PropTypes.number,
|
|
1183
1183
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1184
1184
|
reverse: PropTypes.bool,
|
|
@@ -1235,8 +1235,12 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1235
1235
|
ignoreTooltip: PropTypes.bool,
|
|
1236
1236
|
label: PropTypes.string,
|
|
1237
1237
|
labelStyle: PropTypes.object,
|
|
1238
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
1239
|
-
|
|
1238
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1239
|
+
valueOf: PropTypes.func.isRequired
|
|
1240
|
+
})]),
|
|
1241
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1242
|
+
valueOf: PropTypes.func.isRequired
|
|
1243
|
+
})]),
|
|
1240
1244
|
offset: PropTypes.number,
|
|
1241
1245
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1242
1246
|
reverse: PropTypes.bool,
|
|
@@ -1293,8 +1297,12 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1293
1297
|
ignoreTooltip: PropTypes.bool,
|
|
1294
1298
|
label: PropTypes.string,
|
|
1295
1299
|
labelStyle: PropTypes.object,
|
|
1296
|
-
max: PropTypes.oneOfType([PropTypes.
|
|
1297
|
-
|
|
1300
|
+
max: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1301
|
+
valueOf: PropTypes.func.isRequired
|
|
1302
|
+
})]),
|
|
1303
|
+
min: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
1304
|
+
valueOf: PropTypes.func.isRequired
|
|
1305
|
+
})]),
|
|
1298
1306
|
offset: PropTypes.number,
|
|
1299
1307
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1300
1308
|
reverse: PropTypes.bool,
|
|
@@ -1351,8 +1359,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1351
1359
|
ignoreTooltip: PropTypes.bool,
|
|
1352
1360
|
label: PropTypes.string,
|
|
1353
1361
|
labelStyle: PropTypes.object,
|
|
1354
|
-
max: PropTypes.
|
|
1355
|
-
min: PropTypes.
|
|
1362
|
+
max: PropTypes.number,
|
|
1363
|
+
min: PropTypes.number,
|
|
1356
1364
|
offset: PropTypes.number,
|
|
1357
1365
|
position: PropTypes.oneOf(['left', 'none', 'right']),
|
|
1358
1366
|
reverse: PropTypes.bool,
|
|
@@ -1424,10 +1432,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1424
1432
|
* Configuration for zoom interactions.
|
|
1425
1433
|
*/
|
|
1426
1434
|
zoomInteractionConfig: PropTypes.shape({
|
|
1427
|
-
pan: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['drag']), PropTypes.shape({
|
|
1435
|
+
pan: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['drag', 'pressAndDrag']), PropTypes.shape({
|
|
1428
1436
|
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1429
1437
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1430
1438
|
type: PropTypes.oneOf(['drag']).isRequired
|
|
1439
|
+
}), PropTypes.shape({
|
|
1440
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1441
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1442
|
+
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
1431
1443
|
})]).isRequired),
|
|
1432
1444
|
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1433
1445
|
pointerMode: PropTypes.any,
|
|
@@ -7,7 +7,7 @@ import { type SankeyChartPluginSignatures } from "./SankeyChart.plugins.js";
|
|
|
7
7
|
import type { SankeySeriesType } from "./sankey.types.js";
|
|
8
8
|
import type { SankeyChartSlotExtension } from "./sankeySlots.types.js";
|
|
9
9
|
export type SankeySeries = MakeOptional<SankeySeriesType, 'type'>;
|
|
10
|
-
export interface SankeyChartProps extends Omit<ChartContainerProProps<'sankey', SankeyChartPluginSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation'
|
|
10
|
+
export interface SankeyChartProps extends Omit<ChartContainerProProps<'sankey', SankeyChartPluginSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation'>, Omit<SankeyPlotProps, 'data'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, SankeyChartSlotExtension {
|
|
11
11
|
/**
|
|
12
12
|
* The series to display in the Sankey chart.
|
|
13
13
|
* A single object is expected.
|
|
@@ -94,6 +94,30 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
94
94
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
95
95
|
*/
|
|
96
96
|
height: PropTypes.number,
|
|
97
|
+
/**
|
|
98
|
+
* The highlighted item.
|
|
99
|
+
* Used when the highlight is controlled.
|
|
100
|
+
*/
|
|
101
|
+
highlightedItem: PropTypes.oneOfType([PropTypes.shape({
|
|
102
|
+
nodeId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
103
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
104
|
+
subType: PropTypes.oneOf([
|
|
105
|
+
/**
|
|
106
|
+
* Subtype to differentiate between node and link
|
|
107
|
+
*/
|
|
108
|
+
'node']).isRequired,
|
|
109
|
+
type: PropTypes.oneOf(['sankey']).isRequired
|
|
110
|
+
}), PropTypes.shape({
|
|
111
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
112
|
+
sourceId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
113
|
+
subType: PropTypes.oneOf([
|
|
114
|
+
/**
|
|
115
|
+
* Subtype to differentiate between node and link
|
|
116
|
+
*/
|
|
117
|
+
'link']).isRequired,
|
|
118
|
+
targetId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
119
|
+
type: PropTypes.oneOf(['sankey']).isRequired
|
|
120
|
+
})]),
|
|
97
121
|
/**
|
|
98
122
|
* This prop is used to help implement the accessibility logic.
|
|
99
123
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
@@ -120,6 +144,12 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
120
144
|
right: PropTypes.number,
|
|
121
145
|
top: PropTypes.number
|
|
122
146
|
})]),
|
|
147
|
+
/**
|
|
148
|
+
* The callback fired when the highlighted item changes.
|
|
149
|
+
*
|
|
150
|
+
* @param {SankeyHighlightItemData | null} highlightedItem The newly highlighted item.
|
|
151
|
+
*/
|
|
152
|
+
onHighlightChange: PropTypes.func,
|
|
123
153
|
/**
|
|
124
154
|
* Callback fired when a sankey item is clicked.
|
|
125
155
|
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConvertSignaturesIntoPlugins,
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
|
|
3
|
+
import { type UseSankeyHighlightSignature } from "./plugins/index.js";
|
|
4
|
+
export type SankeyChartPluginSignatures = [UseChartInteractionSignature, UseSankeyHighlightSignature, UseChartProExportSignature];
|
|
4
5
|
export declare const SANKEY_CHART_PLUGINS: ConvertSignaturesIntoPlugins<SankeyChartPluginSignatures>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
// useChartHighlight,
|
|
3
|
-
, useChartInteraction } from '@mui/x-charts/internals';
|
|
1
|
+
import { useChartInteraction } from '@mui/x-charts/internals';
|
|
4
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
5
|
-
|
|
3
|
+
import { useSankeyHighlight } from "./plugins/index.js";
|
|
4
|
+
export const SANKEY_CHART_PLUGINS = [useChartInteraction, useSankeyHighlight, useChartProExport];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
-
import { SankeyLayoutLink,
|
|
3
|
+
import type { SankeyLayoutLink, SankeyLinkIdentifierWithData } from "./sankey.types.js";
|
|
4
4
|
export interface SankeyLinkElementProps {
|
|
5
5
|
/**
|
|
6
6
|
* The series ID to which the link belongs
|