@mui/x-charts-pro 8.19.0 → 8.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.js +18 -0
- package/CHANGELOG.md +174 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +20 -6
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +1 -1
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +3 -3
- package/Heatmap/Heatmap.js +2 -0
- package/LineChartPro/LineChartPro.js +18 -0
- package/SankeyChart/SankeyPlot.js +12 -16
- package/SankeyChart/calculateSankeyLayout.d.ts +2 -3
- package/SankeyChart/calculateSankeyLayout.js +3 -2
- package/SankeyChart/d3Sankey/align.d.ts +33 -0
- package/SankeyChart/d3Sankey/align.js +63 -0
- package/SankeyChart/d3Sankey/index.d.ts +4 -0
- package/SankeyChart/d3Sankey/index.js +49 -0
- package/SankeyChart/d3Sankey/sankey.d.ts +42 -0
- package/SankeyChart/d3Sankey/sankey.js +454 -0
- package/SankeyChart/d3Sankey/sankey.types.d.ts +344 -0
- package/SankeyChart/d3Sankey/sankey.types.js +5 -0
- package/SankeyChart/d3Sankey/sankeyLinkHorizontal.d.ts +22 -0
- package/SankeyChart/d3Sankey/sankeyLinkHorizontal.js +37 -0
- package/SankeyChart/plugins/useSankeyHighlight.selectors.js +2 -2
- package/SankeyChart/sankey.types.d.ts +1 -1
- package/SankeyChart/seriesConfig/index.js +15 -0
- package/SankeyChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/SankeyChart/seriesConfig/tooltipPosition.js +96 -0
- package/SankeyChart/utils.d.ts +2 -2
- package/SankeyChart/utils.js +1 -1
- package/ScatterChartPro/ScatterChartPro.js +18 -0
- package/esm/BarChartPro/BarChartPro.js +18 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +20 -6
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +1 -1
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +3 -3
- package/esm/Heatmap/Heatmap.js +2 -0
- package/esm/LineChartPro/LineChartPro.js +18 -0
- package/esm/SankeyChart/SankeyPlot.js +14 -18
- package/esm/SankeyChart/calculateSankeyLayout.d.ts +2 -3
- package/esm/SankeyChart/calculateSankeyLayout.js +3 -2
- package/esm/SankeyChart/d3Sankey/align.d.ts +33 -0
- package/esm/SankeyChart/d3Sankey/align.js +54 -0
- package/esm/SankeyChart/d3Sankey/index.d.ts +4 -0
- package/esm/SankeyChart/d3Sankey/index.js +4 -0
- package/esm/SankeyChart/d3Sankey/sankey.d.ts +42 -0
- package/esm/SankeyChart/d3Sankey/sankey.js +448 -0
- package/esm/SankeyChart/d3Sankey/sankey.types.d.ts +344 -0
- package/esm/SankeyChart/d3Sankey/sankey.types.js +1 -0
- package/esm/SankeyChart/d3Sankey/sankeyLinkHorizontal.d.ts +22 -0
- package/esm/SankeyChart/d3Sankey/sankeyLinkHorizontal.js +31 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.js +2 -2
- package/esm/SankeyChart/sankey.types.d.ts +1 -1
- package/esm/SankeyChart/seriesConfig/index.js +14 -0
- package/esm/SankeyChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/SankeyChart/seriesConfig/tooltipPosition.js +90 -0
- package/esm/SankeyChart/utils.d.ts +2 -2
- package/esm/SankeyChart/utils.js +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +18 -0
- package/esm/hooks/useSankeySeries.d.ts +9 -2
- package/esm/hooks/useSankeySeries.js +15 -1
- package/esm/index.js +1 -1
- package/esm/typeOverloads/modules.d.ts +6 -1
- package/hooks/useSankeySeries.d.ts +9 -2
- package/hooks/useSankeySeries.js +15 -0
- package/index.js +1 -1
- package/package.json +5 -5
- package/typeOverloads/modules.d.ts +6 -1
|
@@ -332,6 +332,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
332
332
|
tickNumber: _propTypes.default.number,
|
|
333
333
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
334
334
|
tickSize: _propTypes.default.number,
|
|
335
|
+
tickSpacing: _propTypes.default.number,
|
|
335
336
|
valueFormatter: _propTypes.default.func,
|
|
336
337
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
337
338
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -399,6 +400,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
399
400
|
tickNumber: _propTypes.default.number,
|
|
400
401
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
401
402
|
tickSize: _propTypes.default.number,
|
|
403
|
+
tickSpacing: _propTypes.default.number,
|
|
402
404
|
valueFormatter: _propTypes.default.func,
|
|
403
405
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
404
406
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -458,6 +460,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
458
460
|
tickNumber: _propTypes.default.number,
|
|
459
461
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
460
462
|
tickSize: _propTypes.default.number,
|
|
463
|
+
tickSpacing: _propTypes.default.number,
|
|
461
464
|
valueFormatter: _propTypes.default.func,
|
|
462
465
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
463
466
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -518,6 +521,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
518
521
|
tickNumber: _propTypes.default.number,
|
|
519
522
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
520
523
|
tickSize: _propTypes.default.number,
|
|
524
|
+
tickSpacing: _propTypes.default.number,
|
|
521
525
|
valueFormatter: _propTypes.default.func,
|
|
522
526
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
523
527
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -577,6 +581,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
577
581
|
tickNumber: _propTypes.default.number,
|
|
578
582
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
579
583
|
tickSize: _propTypes.default.number,
|
|
584
|
+
tickSpacing: _propTypes.default.number,
|
|
580
585
|
valueFormatter: _propTypes.default.func,
|
|
581
586
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
582
587
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -636,6 +641,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
636
641
|
tickNumber: _propTypes.default.number,
|
|
637
642
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
638
643
|
tickSize: _propTypes.default.number,
|
|
644
|
+
tickSpacing: _propTypes.default.number,
|
|
639
645
|
valueFormatter: _propTypes.default.func,
|
|
640
646
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
641
647
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -699,6 +705,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
699
705
|
tickNumber: _propTypes.default.number,
|
|
700
706
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
701
707
|
tickSize: _propTypes.default.number,
|
|
708
|
+
tickSpacing: _propTypes.default.number,
|
|
702
709
|
valueFormatter: _propTypes.default.func,
|
|
703
710
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
704
711
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -762,6 +769,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
762
769
|
tickNumber: _propTypes.default.number,
|
|
763
770
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
764
771
|
tickSize: _propTypes.default.number,
|
|
772
|
+
tickSpacing: _propTypes.default.number,
|
|
765
773
|
valueFormatter: _propTypes.default.func,
|
|
766
774
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
767
775
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -821,6 +829,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
821
829
|
tickNumber: _propTypes.default.number,
|
|
822
830
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
823
831
|
tickSize: _propTypes.default.number,
|
|
832
|
+
tickSpacing: _propTypes.default.number,
|
|
824
833
|
valueFormatter: _propTypes.default.func,
|
|
825
834
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
826
835
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -894,6 +903,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
894
903
|
tickNumber: _propTypes.default.number,
|
|
895
904
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
896
905
|
tickSize: _propTypes.default.number,
|
|
906
|
+
tickSpacing: _propTypes.default.number,
|
|
897
907
|
valueFormatter: _propTypes.default.func,
|
|
898
908
|
width: _propTypes.default.number,
|
|
899
909
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -960,6 +970,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
960
970
|
tickNumber: _propTypes.default.number,
|
|
961
971
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
962
972
|
tickSize: _propTypes.default.number,
|
|
973
|
+
tickSpacing: _propTypes.default.number,
|
|
963
974
|
valueFormatter: _propTypes.default.func,
|
|
964
975
|
width: _propTypes.default.number,
|
|
965
976
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1018,6 +1029,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1018
1029
|
tickNumber: _propTypes.default.number,
|
|
1019
1030
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1020
1031
|
tickSize: _propTypes.default.number,
|
|
1032
|
+
tickSpacing: _propTypes.default.number,
|
|
1021
1033
|
valueFormatter: _propTypes.default.func,
|
|
1022
1034
|
width: _propTypes.default.number,
|
|
1023
1035
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1077,6 +1089,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1077
1089
|
tickNumber: _propTypes.default.number,
|
|
1078
1090
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1079
1091
|
tickSize: _propTypes.default.number,
|
|
1092
|
+
tickSpacing: _propTypes.default.number,
|
|
1080
1093
|
valueFormatter: _propTypes.default.func,
|
|
1081
1094
|
width: _propTypes.default.number,
|
|
1082
1095
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1135,6 +1148,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1135
1148
|
tickNumber: _propTypes.default.number,
|
|
1136
1149
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1137
1150
|
tickSize: _propTypes.default.number,
|
|
1151
|
+
tickSpacing: _propTypes.default.number,
|
|
1138
1152
|
valueFormatter: _propTypes.default.func,
|
|
1139
1153
|
width: _propTypes.default.number,
|
|
1140
1154
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1193,6 +1207,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1193
1207
|
tickNumber: _propTypes.default.number,
|
|
1194
1208
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1195
1209
|
tickSize: _propTypes.default.number,
|
|
1210
|
+
tickSpacing: _propTypes.default.number,
|
|
1196
1211
|
valueFormatter: _propTypes.default.func,
|
|
1197
1212
|
width: _propTypes.default.number,
|
|
1198
1213
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1255,6 +1270,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1255
1270
|
tickNumber: _propTypes.default.number,
|
|
1256
1271
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1257
1272
|
tickSize: _propTypes.default.number,
|
|
1273
|
+
tickSpacing: _propTypes.default.number,
|
|
1258
1274
|
valueFormatter: _propTypes.default.func,
|
|
1259
1275
|
width: _propTypes.default.number,
|
|
1260
1276
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1317,6 +1333,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1317
1333
|
tickNumber: _propTypes.default.number,
|
|
1318
1334
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1319
1335
|
tickSize: _propTypes.default.number,
|
|
1336
|
+
tickSpacing: _propTypes.default.number,
|
|
1320
1337
|
valueFormatter: _propTypes.default.func,
|
|
1321
1338
|
width: _propTypes.default.number,
|
|
1322
1339
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1375,6 +1392,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1375
1392
|
tickNumber: _propTypes.default.number,
|
|
1376
1393
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1377
1394
|
tickSize: _propTypes.default.number,
|
|
1395
|
+
tickSpacing: _propTypes.default.number,
|
|
1378
1396
|
valueFormatter: _propTypes.default.func,
|
|
1379
1397
|
width: _propTypes.default.number,
|
|
1380
1398
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -341,6 +341,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
341
341
|
tickNumber: PropTypes.number,
|
|
342
342
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
343
343
|
tickSize: PropTypes.number,
|
|
344
|
+
tickSpacing: PropTypes.number,
|
|
344
345
|
valueFormatter: PropTypes.func,
|
|
345
346
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
346
347
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -408,6 +409,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
408
409
|
tickNumber: PropTypes.number,
|
|
409
410
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
410
411
|
tickSize: PropTypes.number,
|
|
412
|
+
tickSpacing: PropTypes.number,
|
|
411
413
|
valueFormatter: PropTypes.func,
|
|
412
414
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
413
415
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -467,6 +469,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
467
469
|
tickNumber: PropTypes.number,
|
|
468
470
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
469
471
|
tickSize: PropTypes.number,
|
|
472
|
+
tickSpacing: PropTypes.number,
|
|
470
473
|
valueFormatter: PropTypes.func,
|
|
471
474
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
472
475
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -527,6 +530,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
527
530
|
tickNumber: PropTypes.number,
|
|
528
531
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
529
532
|
tickSize: PropTypes.number,
|
|
533
|
+
tickSpacing: PropTypes.number,
|
|
530
534
|
valueFormatter: PropTypes.func,
|
|
531
535
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
532
536
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -586,6 +590,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
586
590
|
tickNumber: PropTypes.number,
|
|
587
591
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
588
592
|
tickSize: PropTypes.number,
|
|
593
|
+
tickSpacing: PropTypes.number,
|
|
589
594
|
valueFormatter: PropTypes.func,
|
|
590
595
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
591
596
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -645,6 +650,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
645
650
|
tickNumber: PropTypes.number,
|
|
646
651
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
647
652
|
tickSize: PropTypes.number,
|
|
653
|
+
tickSpacing: PropTypes.number,
|
|
648
654
|
valueFormatter: PropTypes.func,
|
|
649
655
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
650
656
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -708,6 +714,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
708
714
|
tickNumber: PropTypes.number,
|
|
709
715
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
710
716
|
tickSize: PropTypes.number,
|
|
717
|
+
tickSpacing: PropTypes.number,
|
|
711
718
|
valueFormatter: PropTypes.func,
|
|
712
719
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
713
720
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -771,6 +778,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
771
778
|
tickNumber: PropTypes.number,
|
|
772
779
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
773
780
|
tickSize: PropTypes.number,
|
|
781
|
+
tickSpacing: PropTypes.number,
|
|
774
782
|
valueFormatter: PropTypes.func,
|
|
775
783
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
776
784
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -830,6 +838,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
830
838
|
tickNumber: PropTypes.number,
|
|
831
839
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
832
840
|
tickSize: PropTypes.number,
|
|
841
|
+
tickSpacing: PropTypes.number,
|
|
833
842
|
valueFormatter: PropTypes.func,
|
|
834
843
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
835
844
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -903,6 +912,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
903
912
|
tickNumber: PropTypes.number,
|
|
904
913
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
905
914
|
tickSize: PropTypes.number,
|
|
915
|
+
tickSpacing: PropTypes.number,
|
|
906
916
|
valueFormatter: PropTypes.func,
|
|
907
917
|
width: PropTypes.number,
|
|
908
918
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -969,6 +979,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
969
979
|
tickNumber: PropTypes.number,
|
|
970
980
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
971
981
|
tickSize: PropTypes.number,
|
|
982
|
+
tickSpacing: PropTypes.number,
|
|
972
983
|
valueFormatter: PropTypes.func,
|
|
973
984
|
width: PropTypes.number,
|
|
974
985
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1027,6 +1038,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1027
1038
|
tickNumber: PropTypes.number,
|
|
1028
1039
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1029
1040
|
tickSize: PropTypes.number,
|
|
1041
|
+
tickSpacing: PropTypes.number,
|
|
1030
1042
|
valueFormatter: PropTypes.func,
|
|
1031
1043
|
width: PropTypes.number,
|
|
1032
1044
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1086,6 +1098,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1086
1098
|
tickNumber: PropTypes.number,
|
|
1087
1099
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1088
1100
|
tickSize: PropTypes.number,
|
|
1101
|
+
tickSpacing: PropTypes.number,
|
|
1089
1102
|
valueFormatter: PropTypes.func,
|
|
1090
1103
|
width: PropTypes.number,
|
|
1091
1104
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1144,6 +1157,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1144
1157
|
tickNumber: PropTypes.number,
|
|
1145
1158
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1146
1159
|
tickSize: PropTypes.number,
|
|
1160
|
+
tickSpacing: PropTypes.number,
|
|
1147
1161
|
valueFormatter: PropTypes.func,
|
|
1148
1162
|
width: PropTypes.number,
|
|
1149
1163
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1202,6 +1216,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1202
1216
|
tickNumber: PropTypes.number,
|
|
1203
1217
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1204
1218
|
tickSize: PropTypes.number,
|
|
1219
|
+
tickSpacing: PropTypes.number,
|
|
1205
1220
|
valueFormatter: PropTypes.func,
|
|
1206
1221
|
width: PropTypes.number,
|
|
1207
1222
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1264,6 +1279,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1264
1279
|
tickNumber: PropTypes.number,
|
|
1265
1280
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1266
1281
|
tickSize: PropTypes.number,
|
|
1282
|
+
tickSpacing: PropTypes.number,
|
|
1267
1283
|
valueFormatter: PropTypes.func,
|
|
1268
1284
|
width: PropTypes.number,
|
|
1269
1285
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1326,6 +1342,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1326
1342
|
tickNumber: PropTypes.number,
|
|
1327
1343
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1328
1344
|
tickSize: PropTypes.number,
|
|
1345
|
+
tickSpacing: PropTypes.number,
|
|
1329
1346
|
valueFormatter: PropTypes.func,
|
|
1330
1347
|
width: PropTypes.number,
|
|
1331
1348
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1384,6 +1401,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1384
1401
|
tickNumber: PropTypes.number,
|
|
1385
1402
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1386
1403
|
tickSize: PropTypes.number,
|
|
1404
|
+
tickSpacing: PropTypes.number,
|
|
1387
1405
|
valueFormatter: PropTypes.func,
|
|
1388
1406
|
width: PropTypes.number,
|
|
1389
1407
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -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 = "MTc2NDgwNjQwMDAwMA==";
|
|
14
14
|
const packageIdentifier = 'x-charts-pro';
|
|
15
15
|
/**
|
|
16
16
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -28,6 +28,10 @@ const Rect = styled('rect')(({
|
|
|
28
28
|
cursor: 'ns-resize'
|
|
29
29
|
}
|
|
30
30
|
}));
|
|
31
|
+
function preventDefault(event) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
/**
|
|
32
36
|
* Renders the zoom slider thumb, which is responsible for resizing the zoom range.
|
|
33
37
|
* @internal
|
|
@@ -53,28 +57,38 @@ export const ChartAxisZoomSliderThumb = /*#__PURE__*/React.forwardRef(function C
|
|
|
53
57
|
React.useEffect(() => {
|
|
54
58
|
const thumb = thumbRef.current;
|
|
55
59
|
if (!thumb) {
|
|
56
|
-
return;
|
|
60
|
+
return () => {};
|
|
57
61
|
}
|
|
62
|
+
|
|
63
|
+
// Prevent scrolling on touch devices when dragging the thumb
|
|
64
|
+
thumb.addEventListener('touchmove', preventDefault, {
|
|
65
|
+
passive: false
|
|
66
|
+
});
|
|
58
67
|
const onPointerMove = rafThrottle(event => {
|
|
59
68
|
onMoveEvent(event);
|
|
60
69
|
});
|
|
61
|
-
const
|
|
70
|
+
const onPointerEnd = event => {
|
|
62
71
|
thumb.removeEventListener('pointermove', onPointerMove);
|
|
63
|
-
thumb.removeEventListener('pointerup',
|
|
72
|
+
thumb.removeEventListener('pointerup', onPointerEnd);
|
|
73
|
+
thumb.removeEventListener('pointercancel', onPointerEnd);
|
|
74
|
+
thumb.releasePointerCapture(event.pointerId);
|
|
64
75
|
};
|
|
65
76
|
const onPointerDown = event => {
|
|
66
77
|
// Prevent text selection when dragging the thumb
|
|
67
78
|
event.preventDefault();
|
|
68
79
|
event.stopPropagation();
|
|
69
80
|
thumb.setPointerCapture(event.pointerId);
|
|
70
|
-
thumb.addEventListener('pointerup', onPointerUp);
|
|
71
81
|
thumb.addEventListener('pointermove', onPointerMove);
|
|
82
|
+
thumb.addEventListener('pointercancel', onPointerEnd);
|
|
83
|
+
thumb.addEventListener('pointerup', onPointerEnd);
|
|
72
84
|
};
|
|
73
85
|
thumb.addEventListener('pointerdown', onPointerDown);
|
|
74
|
-
|
|
75
|
-
// eslint-disable-next-line consistent-return
|
|
76
86
|
return () => {
|
|
77
87
|
thumb.removeEventListener('pointerdown', onPointerDown);
|
|
88
|
+
thumb.removeEventListener('pointermove', onPointerMove);
|
|
89
|
+
thumb.removeEventListener('pointercancel', onPointerEnd);
|
|
90
|
+
thumb.removeEventListener('pointerup', onPointerEnd);
|
|
91
|
+
thumb.removeEventListener('touchmove', preventDefault);
|
|
78
92
|
onPointerMove.clear();
|
|
79
93
|
};
|
|
80
94
|
}, [onMoveEvent, orientation]);
|
|
@@ -16,16 +16,16 @@ export function BarPreviewPlot(props) {
|
|
|
16
16
|
return /*#__PURE__*/_jsx("g", {
|
|
17
17
|
children: completedData.map(({
|
|
18
18
|
seriesId,
|
|
19
|
+
layout,
|
|
20
|
+
xOrigin,
|
|
21
|
+
yOrigin,
|
|
19
22
|
data
|
|
20
23
|
}) => /*#__PURE__*/_jsx("g", {
|
|
21
24
|
children: data.map(({
|
|
22
25
|
dataIndex,
|
|
23
26
|
color,
|
|
24
|
-
layout,
|
|
25
27
|
x,
|
|
26
|
-
xOrigin,
|
|
27
28
|
y,
|
|
28
|
-
yOrigin,
|
|
29
29
|
width,
|
|
30
30
|
height
|
|
31
31
|
}) => {
|
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -333,6 +333,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
333
333
|
tickNumber: PropTypes.number,
|
|
334
334
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
335
335
|
tickSize: PropTypes.number,
|
|
336
|
+
tickSpacing: PropTypes.number,
|
|
336
337
|
valueFormatter: PropTypes.func
|
|
337
338
|
})).isRequired,
|
|
338
339
|
/**
|
|
@@ -391,6 +392,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
391
392
|
tickNumber: PropTypes.number,
|
|
392
393
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
393
394
|
tickSize: PropTypes.number,
|
|
395
|
+
tickSpacing: PropTypes.number,
|
|
394
396
|
valueFormatter: PropTypes.func,
|
|
395
397
|
width: PropTypes.number
|
|
396
398
|
})).isRequired,
|
|
@@ -343,6 +343,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
343
343
|
tickNumber: PropTypes.number,
|
|
344
344
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
345
345
|
tickSize: PropTypes.number,
|
|
346
|
+
tickSpacing: PropTypes.number,
|
|
346
347
|
valueFormatter: PropTypes.func,
|
|
347
348
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
348
349
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -410,6 +411,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
410
411
|
tickNumber: PropTypes.number,
|
|
411
412
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
412
413
|
tickSize: PropTypes.number,
|
|
414
|
+
tickSpacing: PropTypes.number,
|
|
413
415
|
valueFormatter: PropTypes.func,
|
|
414
416
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
415
417
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -469,6 +471,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
469
471
|
tickNumber: PropTypes.number,
|
|
470
472
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
471
473
|
tickSize: PropTypes.number,
|
|
474
|
+
tickSpacing: PropTypes.number,
|
|
472
475
|
valueFormatter: PropTypes.func,
|
|
473
476
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
474
477
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -529,6 +532,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
529
532
|
tickNumber: PropTypes.number,
|
|
530
533
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
531
534
|
tickSize: PropTypes.number,
|
|
535
|
+
tickSpacing: PropTypes.number,
|
|
532
536
|
valueFormatter: PropTypes.func,
|
|
533
537
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
534
538
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -588,6 +592,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
588
592
|
tickNumber: PropTypes.number,
|
|
589
593
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
590
594
|
tickSize: PropTypes.number,
|
|
595
|
+
tickSpacing: PropTypes.number,
|
|
591
596
|
valueFormatter: PropTypes.func,
|
|
592
597
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
593
598
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -647,6 +652,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
647
652
|
tickNumber: PropTypes.number,
|
|
648
653
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
649
654
|
tickSize: PropTypes.number,
|
|
655
|
+
tickSpacing: PropTypes.number,
|
|
650
656
|
valueFormatter: PropTypes.func,
|
|
651
657
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
652
658
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -710,6 +716,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
710
716
|
tickNumber: PropTypes.number,
|
|
711
717
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
712
718
|
tickSize: PropTypes.number,
|
|
719
|
+
tickSpacing: PropTypes.number,
|
|
713
720
|
valueFormatter: PropTypes.func,
|
|
714
721
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
715
722
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -773,6 +780,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
773
780
|
tickNumber: PropTypes.number,
|
|
774
781
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
775
782
|
tickSize: PropTypes.number,
|
|
783
|
+
tickSpacing: PropTypes.number,
|
|
776
784
|
valueFormatter: PropTypes.func,
|
|
777
785
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
778
786
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -832,6 +840,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
832
840
|
tickNumber: PropTypes.number,
|
|
833
841
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
834
842
|
tickSize: PropTypes.number,
|
|
843
|
+
tickSpacing: PropTypes.number,
|
|
835
844
|
valueFormatter: PropTypes.func,
|
|
836
845
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
837
846
|
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
@@ -905,6 +914,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
905
914
|
tickNumber: PropTypes.number,
|
|
906
915
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
907
916
|
tickSize: PropTypes.number,
|
|
917
|
+
tickSpacing: PropTypes.number,
|
|
908
918
|
valueFormatter: PropTypes.func,
|
|
909
919
|
width: PropTypes.number,
|
|
910
920
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -971,6 +981,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
971
981
|
tickNumber: PropTypes.number,
|
|
972
982
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
973
983
|
tickSize: PropTypes.number,
|
|
984
|
+
tickSpacing: PropTypes.number,
|
|
974
985
|
valueFormatter: PropTypes.func,
|
|
975
986
|
width: PropTypes.number,
|
|
976
987
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1029,6 +1040,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1029
1040
|
tickNumber: PropTypes.number,
|
|
1030
1041
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1031
1042
|
tickSize: PropTypes.number,
|
|
1043
|
+
tickSpacing: PropTypes.number,
|
|
1032
1044
|
valueFormatter: PropTypes.func,
|
|
1033
1045
|
width: PropTypes.number,
|
|
1034
1046
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1088,6 +1100,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1088
1100
|
tickNumber: PropTypes.number,
|
|
1089
1101
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1090
1102
|
tickSize: PropTypes.number,
|
|
1103
|
+
tickSpacing: PropTypes.number,
|
|
1091
1104
|
valueFormatter: PropTypes.func,
|
|
1092
1105
|
width: PropTypes.number,
|
|
1093
1106
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1146,6 +1159,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1146
1159
|
tickNumber: PropTypes.number,
|
|
1147
1160
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1148
1161
|
tickSize: PropTypes.number,
|
|
1162
|
+
tickSpacing: PropTypes.number,
|
|
1149
1163
|
valueFormatter: PropTypes.func,
|
|
1150
1164
|
width: PropTypes.number,
|
|
1151
1165
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1204,6 +1218,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1204
1218
|
tickNumber: PropTypes.number,
|
|
1205
1219
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1206
1220
|
tickSize: PropTypes.number,
|
|
1221
|
+
tickSpacing: PropTypes.number,
|
|
1207
1222
|
valueFormatter: PropTypes.func,
|
|
1208
1223
|
width: PropTypes.number,
|
|
1209
1224
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1266,6 +1281,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1266
1281
|
tickNumber: PropTypes.number,
|
|
1267
1282
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1268
1283
|
tickSize: PropTypes.number,
|
|
1284
|
+
tickSpacing: PropTypes.number,
|
|
1269
1285
|
valueFormatter: PropTypes.func,
|
|
1270
1286
|
width: PropTypes.number,
|
|
1271
1287
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1328,6 +1344,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1328
1344
|
tickNumber: PropTypes.number,
|
|
1329
1345
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1330
1346
|
tickSize: PropTypes.number,
|
|
1347
|
+
tickSpacing: PropTypes.number,
|
|
1331
1348
|
valueFormatter: PropTypes.func,
|
|
1332
1349
|
width: PropTypes.number,
|
|
1333
1350
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -1386,6 +1403,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1386
1403
|
tickNumber: PropTypes.number,
|
|
1387
1404
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1388
1405
|
tickSize: PropTypes.number,
|
|
1406
|
+
tickSpacing: PropTypes.number,
|
|
1389
1407
|
valueFormatter: PropTypes.func,
|
|
1390
1408
|
width: PropTypes.number,
|
|
1391
1409
|
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { styled
|
|
6
|
-
import { useDrawingArea } from '@mui/x-charts/hooks';
|
|
7
|
-
import { calculateSankeyLayout } from "./calculateSankeyLayout.js";
|
|
5
|
+
import { styled } from '@mui/material/styles';
|
|
8
6
|
import { SankeyNodeElement } from "./SankeyNodeElement.js";
|
|
9
7
|
import { SankeyLinkElement } from "./SankeyLinkElement.js";
|
|
10
8
|
import { SankeyLinkLabel } from "./SankeyLinkLabel.js";
|
|
11
|
-
import { useSankeySeriesContext } from "../hooks/useSankeySeries.js";
|
|
9
|
+
import { useSankeyLayout, useSankeySeriesContext } from "../hooks/useSankeySeries.js";
|
|
12
10
|
import { sankeyPlotClasses, useUtilityClasses } from "./sankeyClasses.js";
|
|
13
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
12
|
const SankeyPlotRoot = styled('g')({
|
|
@@ -32,25 +30,23 @@ function SankeyPlot(props) {
|
|
|
32
30
|
onLinkClick,
|
|
33
31
|
onNodeClick
|
|
34
32
|
} = props;
|
|
35
|
-
const seriesContext = useSankeySeriesContext();
|
|
36
|
-
if (!seriesContext) {
|
|
37
|
-
throw new Error(`MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartDataProviderPro.`);
|
|
38
|
-
}
|
|
39
|
-
const series = seriesContext.series[seriesContext.seriesOrder?.[0]];
|
|
40
33
|
const classes = useUtilityClasses({
|
|
41
34
|
classes: inputClasses
|
|
42
35
|
});
|
|
43
|
-
const
|
|
36
|
+
const sankeyContext = useSankeySeriesContext();
|
|
37
|
+
const sankeySeries = sankeyContext?.series[sankeyContext?.seriesOrder[0]];
|
|
38
|
+
const layout = useSankeyLayout();
|
|
39
|
+
if (!sankeySeries) {
|
|
40
|
+
throw new Error(`MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartDataProviderPro.`);
|
|
41
|
+
}
|
|
42
|
+
if (!layout) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
44
45
|
const {
|
|
45
46
|
data,
|
|
46
47
|
linkOptions,
|
|
47
48
|
nodeOptions
|
|
48
|
-
} =
|
|
49
|
-
const theme = useTheme();
|
|
50
|
-
|
|
51
|
-
// Calculate layout based on data and dimensions
|
|
52
|
-
const layout = React.useMemo(() => calculateSankeyLayout(data, drawingArea, theme, series), [drawingArea, data, series, theme]);
|
|
53
|
-
|
|
49
|
+
} = sankeySeries;
|
|
54
50
|
// Early return if no data or dimensions
|
|
55
51
|
if (!data || !data.links) {
|
|
56
52
|
return null;
|
|
@@ -60,7 +56,7 @@ function SankeyPlot(props) {
|
|
|
60
56
|
children: [/*#__PURE__*/_jsx("g", {
|
|
61
57
|
className: classes.links,
|
|
62
58
|
children: layout.links.map(link => /*#__PURE__*/_jsx(SankeyLinkElement, {
|
|
63
|
-
seriesId:
|
|
59
|
+
seriesId: sankeySeries.id,
|
|
64
60
|
link: link,
|
|
65
61
|
opacity: linkOptions?.opacity,
|
|
66
62
|
onClick: onLinkClick
|
|
@@ -68,7 +64,7 @@ function SankeyPlot(props) {
|
|
|
68
64
|
}), /*#__PURE__*/_jsx("g", {
|
|
69
65
|
className: classes.nodes,
|
|
70
66
|
children: layout.nodes.map(node => /*#__PURE__*/_jsx(SankeyNodeElement, {
|
|
71
|
-
seriesId:
|
|
67
|
+
seriesId: sankeySeries.id,
|
|
72
68
|
node: node,
|
|
73
69
|
showLabel: nodeOptions?.showLabels,
|
|
74
70
|
onClick: onNodeClick
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ChartDrawingArea } from '@mui/x-charts/hooks';
|
|
2
|
-
import type {
|
|
3
|
-
import type { SankeySeriesType, SankeyLayout, SankeyLayoutLink, DefaultizedSankeySeriesType } from "./sankey.types.js";
|
|
2
|
+
import type { SankeyLayout, SankeyLayoutLink, DefaultizedSankeySeriesType } from "./sankey.types.js";
|
|
4
3
|
/**
|
|
5
4
|
* Calculates the layout for a Sankey diagram using d3-sankey
|
|
6
5
|
*
|
|
@@ -9,5 +8,5 @@ import type { SankeySeriesType, SankeyLayout, SankeyLayoutLink, DefaultizedSanke
|
|
|
9
8
|
* @param options Layout configuration options
|
|
10
9
|
* @returns The calculated layout
|
|
11
10
|
*/
|
|
12
|
-
export declare function calculateSankeyLayout(
|
|
11
|
+
export declare function calculateSankeyLayout(series: DefaultizedSankeySeriesType, drawingArea: ChartDrawingArea): SankeyLayout;
|
|
13
12
|
export declare function improvedNaiveSankeyLinkPathHorizontal(link: SankeyLayoutLink, curveCorrection?: number): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import { sankey } from '@mui/x-charts-vendor/d3-sankey';
|
|
5
4
|
import { path } from '@mui/x-charts-vendor/d3-path';
|
|
5
|
+
import { sankey } from "./d3Sankey/index.js";
|
|
6
6
|
import { getNodeAlignFunction } from "./utils.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -14,8 +14,9 @@ import { getNodeAlignFunction } from "./utils.js";
|
|
|
14
14
|
* @returns The calculated layout
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export function calculateSankeyLayout(
|
|
17
|
+
export function calculateSankeyLayout(series, drawingArea) {
|
|
18
18
|
const {
|
|
19
|
+
data,
|
|
19
20
|
iterations = 6,
|
|
20
21
|
nodeOptions,
|
|
21
22
|
linkOptions
|