@mui/x-charts-pro 8.10.2 → 8.11.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 +0 -36
- package/CHANGELOG.md +214 -13
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/FunnelChart/curves/bump.js +0 -2
- package/FunnelChart/curves/linear.js +0 -2
- package/FunnelChart/curves/pyramid.js +0 -2
- package/FunnelChart/curves/step-pyramid.js +0 -2
- package/FunnelChart/curves/step.js +0 -2
- package/FunnelChart/labelUtils.d.ts +7 -5
- package/FunnelChart/labelUtils.js +2 -2
- package/Heatmap/Heatmap.js +0 -4
- package/LineChartPro/LineChartPro.js +0 -36
- package/PieChartPro/PieChartPro.js +2 -2
- package/SankeyChart/SankeyChart.d.ts +32 -0
- package/SankeyChart/SankeyChart.js +161 -0
- package/SankeyChart/SankeyChart.plugins.d.ts +3 -0
- package/SankeyChart/SankeyChart.plugins.js +11 -0
- package/SankeyChart/SankeyLinkElement.d.ts +27 -0
- package/SankeyChart/SankeyLinkElement.js +53 -0
- package/SankeyChart/SankeyLinkLabel.d.ts +12 -0
- package/SankeyChart/SankeyLinkLabel.js +58 -0
- package/SankeyChart/SankeyNodeElement.d.ts +27 -0
- package/SankeyChart/SankeyNodeElement.js +76 -0
- package/SankeyChart/SankeyPlot.d.ts +29 -0
- package/SankeyChart/SankeyPlot.js +100 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.d.ts +2 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.js +27 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltip.d.ts +7 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltip.js +208 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +10 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltip.types.js +5 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltipContent.d.ts +7 -0
- package/SankeyChart/SankeyTooltip/SankeyTooltipContent.js +66 -0
- package/SankeyChart/SankeyTooltip/index.d.ts +3 -0
- package/SankeyChart/SankeyTooltip/index.js +27 -0
- package/SankeyChart/calculateSankeyLayout.d.ts +13 -0
- package/SankeyChart/calculateSankeyLayout.js +141 -0
- package/SankeyChart/index.d.ts +9 -0
- package/SankeyChart/index.js +70 -0
- package/SankeyChart/sankey.types.d.ts +225 -0
- package/SankeyChart/sankey.types.js +6 -0
- package/SankeyChart/sankeyClasses.d.ts +15 -0
- package/SankeyChart/sankeyClasses.js +28 -0
- package/SankeyChart/sankeySlots.types.d.ts +24 -0
- package/SankeyChart/sankeySlots.types.js +5 -0
- package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.d.ts +2 -0
- package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +55 -0
- package/SankeyChart/seriesConfig/index.d.ts +2 -0
- package/SankeyChart/seriesConfig/index.js +19 -0
- package/SankeyChart/seriesConfig/tooltipGetter.d.ts +2 -0
- package/SankeyChart/seriesConfig/tooltipGetter.js +46 -0
- package/SankeyChart/useSankeyChartProps.d.ts +22 -0
- package/SankeyChart/useSankeyChartProps.js +77 -0
- package/SankeyChart/utils.d.ts +3 -0
- package/SankeyChart/utils.js +21 -0
- package/ScatterChartPro/ScatterChartPro.js +1 -37
- package/esm/BarChartPro/BarChartPro.js +0 -36
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/FunnelChart/curves/bump.js +0 -2
- package/esm/FunnelChart/curves/linear.js +0 -2
- package/esm/FunnelChart/curves/pyramid.js +0 -2
- package/esm/FunnelChart/curves/step-pyramid.js +0 -2
- package/esm/FunnelChart/curves/step.js +0 -2
- package/esm/FunnelChart/labelUtils.d.ts +7 -5
- package/esm/FunnelChart/labelUtils.js +2 -2
- package/esm/Heatmap/Heatmap.js +0 -4
- package/esm/LineChartPro/LineChartPro.js +0 -36
- package/esm/PieChartPro/PieChartPro.js +2 -2
- package/esm/SankeyChart/SankeyChart.d.ts +32 -0
- package/esm/SankeyChart/SankeyChart.js +155 -0
- package/esm/SankeyChart/SankeyChart.plugins.d.ts +3 -0
- package/esm/SankeyChart/SankeyChart.plugins.js +9 -0
- package/esm/SankeyChart/SankeyLinkElement.d.ts +27 -0
- package/esm/SankeyChart/SankeyLinkElement.js +46 -0
- package/esm/SankeyChart/SankeyLinkLabel.d.ts +12 -0
- package/esm/SankeyChart/SankeyLinkLabel.js +52 -0
- package/esm/SankeyChart/SankeyNodeElement.d.ts +27 -0
- package/esm/SankeyChart/SankeyNodeElement.js +69 -0
- package/esm/SankeyChart/SankeyPlot.d.ts +29 -0
- package/esm/SankeyChart/SankeyPlot.js +94 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.classes.d.ts +2 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.classes.js +19 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.d.ts +7 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.js +202 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +10 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.js +1 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltipContent.d.ts +7 -0
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltipContent.js +59 -0
- package/esm/SankeyChart/SankeyTooltip/index.d.ts +3 -0
- package/esm/SankeyChart/SankeyTooltip/index.js +3 -0
- package/esm/SankeyChart/calculateSankeyLayout.d.ts +13 -0
- package/esm/SankeyChart/calculateSankeyLayout.js +135 -0
- package/esm/SankeyChart/index.d.ts +9 -0
- package/esm/SankeyChart/index.js +6 -0
- package/esm/SankeyChart/sankey.types.d.ts +225 -0
- package/esm/SankeyChart/sankey.types.js +3 -0
- package/esm/SankeyChart/sankeyClasses.d.ts +15 -0
- package/esm/SankeyChart/sankeyClasses.js +19 -0
- package/esm/SankeyChart/sankeySlots.types.d.ts +24 -0
- package/esm/SankeyChart/sankeySlots.types.js +1 -0
- package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.d.ts +2 -0
- package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +47 -0
- package/esm/SankeyChart/seriesConfig/index.d.ts +2 -0
- package/esm/SankeyChart/seriesConfig/index.js +14 -0
- package/esm/SankeyChart/seriesConfig/tooltipGetter.d.ts +2 -0
- package/esm/SankeyChart/seriesConfig/tooltipGetter.js +39 -0
- package/esm/SankeyChart/useSankeyChartProps.d.ts +22 -0
- package/esm/SankeyChart/useSankeyChartProps.js +70 -0
- package/esm/SankeyChart/utils.d.ts +3 -0
- package/esm/SankeyChart/utils.js +14 -0
- package/esm/ScatterChartPro/ScatterChartPro.js +1 -37
- package/esm/hooks/useSankeySeries.d.ts +33 -0
- package/esm/hooks/useSankeySeries.js +42 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/internals/plugins/allPlugins.d.ts +2 -2
- package/esm/typeOverloads/modules.d.ts +11 -0
- package/hooks/useSankeySeries.d.ts +33 -0
- package/hooks/useSankeySeries.js +48 -0
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/internals/plugins/allPlugins.d.ts +2 -2
- package/package.json +15 -15
- package/typeOverloads/modules.d.ts +11 -0
|
@@ -305,7 +305,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
305
305
|
disableLine: PropTypes.bool,
|
|
306
306
|
disableTicks: PropTypes.bool,
|
|
307
307
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
308
|
-
fill: PropTypes.string,
|
|
309
308
|
groups: PropTypes.arrayOf(PropTypes.shape({
|
|
310
309
|
getValue: PropTypes.func.isRequired,
|
|
311
310
|
tickLabelStyle: PropTypes.object,
|
|
@@ -325,7 +324,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
325
324
|
scaleType: PropTypes.oneOf(['band']),
|
|
326
325
|
slotProps: PropTypes.object,
|
|
327
326
|
slots: PropTypes.object,
|
|
328
|
-
stroke: PropTypes.string,
|
|
329
327
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
330
328
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
331
329
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -376,7 +374,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
376
374
|
disableLine: PropTypes.bool,
|
|
377
375
|
disableTicks: PropTypes.bool,
|
|
378
376
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
379
|
-
fill: PropTypes.string,
|
|
380
377
|
groups: PropTypes.arrayOf(PropTypes.shape({
|
|
381
378
|
getValue: PropTypes.func.isRequired,
|
|
382
379
|
tickLabelStyle: PropTypes.object,
|
|
@@ -396,7 +393,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
396
393
|
scaleType: PropTypes.oneOf(['point']),
|
|
397
394
|
slotProps: PropTypes.object,
|
|
398
395
|
slots: PropTypes.object,
|
|
399
|
-
stroke: PropTypes.string,
|
|
400
396
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
401
397
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
402
398
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -442,7 +438,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
442
438
|
disableLine: PropTypes.bool,
|
|
443
439
|
disableTicks: PropTypes.bool,
|
|
444
440
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
445
|
-
fill: PropTypes.string,
|
|
446
441
|
height: PropTypes.number,
|
|
447
442
|
hideTooltip: PropTypes.bool,
|
|
448
443
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -457,7 +452,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
457
452
|
scaleType: PropTypes.oneOf(['log']),
|
|
458
453
|
slotProps: PropTypes.object,
|
|
459
454
|
slots: PropTypes.object,
|
|
460
|
-
stroke: PropTypes.string,
|
|
461
455
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
462
456
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
463
457
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -504,7 +498,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
504
498
|
disableLine: PropTypes.bool,
|
|
505
499
|
disableTicks: PropTypes.bool,
|
|
506
500
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
507
|
-
fill: PropTypes.string,
|
|
508
501
|
height: PropTypes.number,
|
|
509
502
|
hideTooltip: PropTypes.bool,
|
|
510
503
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -519,7 +512,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
519
512
|
scaleType: PropTypes.oneOf(['symlog']),
|
|
520
513
|
slotProps: PropTypes.object,
|
|
521
514
|
slots: PropTypes.object,
|
|
522
|
-
stroke: PropTypes.string,
|
|
523
515
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
524
516
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
525
517
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -565,7 +557,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
565
557
|
disableLine: PropTypes.bool,
|
|
566
558
|
disableTicks: PropTypes.bool,
|
|
567
559
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
568
|
-
fill: PropTypes.string,
|
|
569
560
|
height: PropTypes.number,
|
|
570
561
|
hideTooltip: PropTypes.bool,
|
|
571
562
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -580,7 +571,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
580
571
|
scaleType: PropTypes.oneOf(['pow']),
|
|
581
572
|
slotProps: PropTypes.object,
|
|
582
573
|
slots: PropTypes.object,
|
|
583
|
-
stroke: PropTypes.string,
|
|
584
574
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
585
575
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
586
576
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -626,7 +616,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
626
616
|
disableLine: PropTypes.bool,
|
|
627
617
|
disableTicks: PropTypes.bool,
|
|
628
618
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
629
|
-
fill: PropTypes.string,
|
|
630
619
|
height: PropTypes.number,
|
|
631
620
|
hideTooltip: PropTypes.bool,
|
|
632
621
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -641,7 +630,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
641
630
|
scaleType: PropTypes.oneOf(['sqrt']),
|
|
642
631
|
slotProps: PropTypes.object,
|
|
643
632
|
slots: PropTypes.object,
|
|
644
|
-
stroke: PropTypes.string,
|
|
645
633
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
646
634
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
647
635
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -687,7 +675,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
687
675
|
disableLine: PropTypes.bool,
|
|
688
676
|
disableTicks: PropTypes.bool,
|
|
689
677
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
690
|
-
fill: PropTypes.string,
|
|
691
678
|
height: PropTypes.number,
|
|
692
679
|
hideTooltip: PropTypes.bool,
|
|
693
680
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -702,7 +689,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
702
689
|
scaleType: PropTypes.oneOf(['time']),
|
|
703
690
|
slotProps: PropTypes.object,
|
|
704
691
|
slots: PropTypes.object,
|
|
705
|
-
stroke: PropTypes.string,
|
|
706
692
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
707
693
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
708
694
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -748,7 +734,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
748
734
|
disableLine: PropTypes.bool,
|
|
749
735
|
disableTicks: PropTypes.bool,
|
|
750
736
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
751
|
-
fill: PropTypes.string,
|
|
752
737
|
height: PropTypes.number,
|
|
753
738
|
hideTooltip: PropTypes.bool,
|
|
754
739
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -763,7 +748,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
763
748
|
scaleType: PropTypes.oneOf(['utc']),
|
|
764
749
|
slotProps: PropTypes.object,
|
|
765
750
|
slots: PropTypes.object,
|
|
766
|
-
stroke: PropTypes.string,
|
|
767
751
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
768
752
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
769
753
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -809,7 +793,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
809
793
|
disableLine: PropTypes.bool,
|
|
810
794
|
disableTicks: PropTypes.bool,
|
|
811
795
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
812
|
-
fill: PropTypes.string,
|
|
813
796
|
height: PropTypes.number,
|
|
814
797
|
hideTooltip: PropTypes.bool,
|
|
815
798
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -824,7 +807,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
824
807
|
scaleType: PropTypes.oneOf(['linear']),
|
|
825
808
|
slotProps: PropTypes.object,
|
|
826
809
|
slots: PropTypes.object,
|
|
827
|
-
stroke: PropTypes.string,
|
|
828
810
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
829
811
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
830
812
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -883,7 +865,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
883
865
|
disableLine: PropTypes.bool,
|
|
884
866
|
disableTicks: PropTypes.bool,
|
|
885
867
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
886
|
-
fill: PropTypes.string,
|
|
887
868
|
groups: PropTypes.arrayOf(PropTypes.shape({
|
|
888
869
|
getValue: PropTypes.func.isRequired,
|
|
889
870
|
tickLabelStyle: PropTypes.object,
|
|
@@ -902,7 +883,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
902
883
|
scaleType: PropTypes.oneOf(['band']),
|
|
903
884
|
slotProps: PropTypes.object,
|
|
904
885
|
slots: PropTypes.object,
|
|
905
|
-
stroke: PropTypes.string,
|
|
906
886
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
907
887
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
908
888
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -953,7 +933,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
953
933
|
disableLine: PropTypes.bool,
|
|
954
934
|
disableTicks: PropTypes.bool,
|
|
955
935
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
956
|
-
fill: PropTypes.string,
|
|
957
936
|
groups: PropTypes.arrayOf(PropTypes.shape({
|
|
958
937
|
getValue: PropTypes.func.isRequired,
|
|
959
938
|
tickLabelStyle: PropTypes.object,
|
|
@@ -972,7 +951,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
972
951
|
scaleType: PropTypes.oneOf(['point']),
|
|
973
952
|
slotProps: PropTypes.object,
|
|
974
953
|
slots: PropTypes.object,
|
|
975
|
-
stroke: PropTypes.string,
|
|
976
954
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
977
955
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
978
956
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1018,7 +996,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1018
996
|
disableLine: PropTypes.bool,
|
|
1019
997
|
disableTicks: PropTypes.bool,
|
|
1020
998
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1021
|
-
fill: PropTypes.string,
|
|
1022
999
|
hideTooltip: PropTypes.bool,
|
|
1023
1000
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1024
1001
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1032,7 +1009,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1032
1009
|
scaleType: PropTypes.oneOf(['log']),
|
|
1033
1010
|
slotProps: PropTypes.object,
|
|
1034
1011
|
slots: PropTypes.object,
|
|
1035
|
-
stroke: PropTypes.string,
|
|
1036
1012
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1037
1013
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1038
1014
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1079,7 +1055,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1079
1055
|
disableLine: PropTypes.bool,
|
|
1080
1056
|
disableTicks: PropTypes.bool,
|
|
1081
1057
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1082
|
-
fill: PropTypes.string,
|
|
1083
1058
|
hideTooltip: PropTypes.bool,
|
|
1084
1059
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1085
1060
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1093,7 +1068,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1093
1068
|
scaleType: PropTypes.oneOf(['symlog']),
|
|
1094
1069
|
slotProps: PropTypes.object,
|
|
1095
1070
|
slots: PropTypes.object,
|
|
1096
|
-
stroke: PropTypes.string,
|
|
1097
1071
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1098
1072
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1099
1073
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1139,7 +1113,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1139
1113
|
disableLine: PropTypes.bool,
|
|
1140
1114
|
disableTicks: PropTypes.bool,
|
|
1141
1115
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1142
|
-
fill: PropTypes.string,
|
|
1143
1116
|
hideTooltip: PropTypes.bool,
|
|
1144
1117
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1145
1118
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1153,7 +1126,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1153
1126
|
scaleType: PropTypes.oneOf(['pow']),
|
|
1154
1127
|
slotProps: PropTypes.object,
|
|
1155
1128
|
slots: PropTypes.object,
|
|
1156
|
-
stroke: PropTypes.string,
|
|
1157
1129
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1158
1130
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1159
1131
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1199,7 +1171,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1199
1171
|
disableLine: PropTypes.bool,
|
|
1200
1172
|
disableTicks: PropTypes.bool,
|
|
1201
1173
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1202
|
-
fill: PropTypes.string,
|
|
1203
1174
|
hideTooltip: PropTypes.bool,
|
|
1204
1175
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1205
1176
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1213,7 +1184,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1213
1184
|
scaleType: PropTypes.oneOf(['sqrt']),
|
|
1214
1185
|
slotProps: PropTypes.object,
|
|
1215
1186
|
slots: PropTypes.object,
|
|
1216
|
-
stroke: PropTypes.string,
|
|
1217
1187
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1218
1188
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1219
1189
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1259,7 +1229,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1259
1229
|
disableLine: PropTypes.bool,
|
|
1260
1230
|
disableTicks: PropTypes.bool,
|
|
1261
1231
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1262
|
-
fill: PropTypes.string,
|
|
1263
1232
|
hideTooltip: PropTypes.bool,
|
|
1264
1233
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1265
1234
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1273,7 +1242,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1273
1242
|
scaleType: PropTypes.oneOf(['time']),
|
|
1274
1243
|
slotProps: PropTypes.object,
|
|
1275
1244
|
slots: PropTypes.object,
|
|
1276
|
-
stroke: PropTypes.string,
|
|
1277
1245
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1278
1246
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1279
1247
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1319,7 +1287,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1319
1287
|
disableLine: PropTypes.bool,
|
|
1320
1288
|
disableTicks: PropTypes.bool,
|
|
1321
1289
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1322
|
-
fill: PropTypes.string,
|
|
1323
1290
|
hideTooltip: PropTypes.bool,
|
|
1324
1291
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1325
1292
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1333,7 +1300,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1333
1300
|
scaleType: PropTypes.oneOf(['utc']),
|
|
1334
1301
|
slotProps: PropTypes.object,
|
|
1335
1302
|
slots: PropTypes.object,
|
|
1336
|
-
stroke: PropTypes.string,
|
|
1337
1303
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1338
1304
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1339
1305
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -1379,7 +1345,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1379
1345
|
disableLine: PropTypes.bool,
|
|
1380
1346
|
disableTicks: PropTypes.bool,
|
|
1381
1347
|
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
1382
|
-
fill: PropTypes.string,
|
|
1383
1348
|
hideTooltip: PropTypes.bool,
|
|
1384
1349
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
1385
1350
|
ignoreTooltip: PropTypes.bool,
|
|
@@ -1393,7 +1358,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1393
1358
|
scaleType: PropTypes.oneOf(['linear']),
|
|
1394
1359
|
slotProps: PropTypes.object,
|
|
1395
1360
|
slots: PropTypes.object,
|
|
1396
|
-
stroke: PropTypes.string,
|
|
1397
1361
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1398
1362
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
1399
1363
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
@@ -64,10 +64,10 @@ const PieChartPro = /*#__PURE__*/React.forwardRef(function PieChartPro(inProps,
|
|
|
64
64
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
65
65
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, {
|
|
66
66
|
legendPosition: props.slotProps?.legend?.position,
|
|
67
|
-
legendDirection: props
|
|
67
|
+
legendDirection: props.slotProps?.legend?.direction ?? 'vertical',
|
|
68
68
|
sx: sx,
|
|
69
69
|
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
70
|
-
direction: props
|
|
70
|
+
direction: props.slotProps?.legend?.direction ?? 'vertical',
|
|
71
71
|
slots: slots,
|
|
72
72
|
slotProps: slotProps
|
|
73
73
|
}), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ChartsOverlayProps } from '@mui/x-charts/ChartsOverlay';
|
|
3
|
+
import type { MakeOptional } from '@mui/x-internals/types';
|
|
4
|
+
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
5
|
+
import { type SankeyPlotProps } from "./SankeyPlot.js";
|
|
6
|
+
import { type SankeyChartPluginsSignatures } from "./SankeyChart.plugins.js";
|
|
7
|
+
import type { SankeySeriesType } from "./sankey.types.js";
|
|
8
|
+
import type { SankeyChartSlotExtension } from "./sankeySlots.types.js";
|
|
9
|
+
export type SankeySeries = MakeOptional<SankeySeriesType, 'type'>;
|
|
10
|
+
export interface SankeyChartProps extends Omit<ChartContainerProProps<'sankey', SankeyChartPluginsSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation' | 'highlightedItem' | 'onHighlightChange'>, Omit<SankeyPlotProps, 'data'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, SankeyChartSlotExtension {
|
|
11
|
+
/**
|
|
12
|
+
* The series to display in the Sankey chart.
|
|
13
|
+
* A single object is expected.
|
|
14
|
+
*/
|
|
15
|
+
series: SankeySeries;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Sankey Chart component
|
|
19
|
+
*
|
|
20
|
+
* Displays a Sankey diagram, visualizing flows between nodes where the width
|
|
21
|
+
* of the links is proportional to the flow quantity.
|
|
22
|
+
*
|
|
23
|
+
* Demos:
|
|
24
|
+
*
|
|
25
|
+
* - [Sankey Chart](https://mui.com/x/react-charts/sankey/)
|
|
26
|
+
*
|
|
27
|
+
* API:
|
|
28
|
+
*
|
|
29
|
+
* - [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/)
|
|
30
|
+
*/
|
|
31
|
+
declare const SankeyChart: React.ForwardRefExoticComponent<SankeyChartProps & React.RefAttributes<SVGSVGElement>>;
|
|
32
|
+
export { SankeyChart };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useThemeProps } from '@mui/material/styles';
|
|
7
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
8
|
+
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
9
|
+
import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
|
|
10
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
11
|
+
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
12
|
+
import { SankeyPlot } from "./SankeyPlot.js";
|
|
13
|
+
import { useSankeyChartProps } from "./useSankeyChartProps.js";
|
|
14
|
+
import { SANKEY_CHART_PLUGINS } from "./SankeyChart.plugins.js";
|
|
15
|
+
import { seriesConfig as sankeySeriesConfig } from "./seriesConfig/index.js";
|
|
16
|
+
import { SankeyTooltip } from "./SankeyTooltip/index.js";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const seriesConfig = {
|
|
19
|
+
sankey: sankeySeriesConfig
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Sankey Chart component
|
|
23
|
+
*
|
|
24
|
+
* Displays a Sankey diagram, visualizing flows between nodes where the width
|
|
25
|
+
* of the links is proportional to the flow quantity.
|
|
26
|
+
*
|
|
27
|
+
* Demos:
|
|
28
|
+
*
|
|
29
|
+
* - [Sankey Chart](https://mui.com/x/react-charts/sankey/)
|
|
30
|
+
*
|
|
31
|
+
* API:
|
|
32
|
+
*
|
|
33
|
+
* - [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/)
|
|
34
|
+
*/
|
|
35
|
+
const SankeyChart = /*#__PURE__*/React.forwardRef(function SankeyChart(props, ref) {
|
|
36
|
+
const themedProps = useThemeProps({
|
|
37
|
+
props,
|
|
38
|
+
name: 'MuiSankeyChart'
|
|
39
|
+
});
|
|
40
|
+
const {
|
|
41
|
+
chartContainerProps,
|
|
42
|
+
sankeyPlotProps,
|
|
43
|
+
overlayProps,
|
|
44
|
+
chartsWrapperProps,
|
|
45
|
+
children
|
|
46
|
+
} = useSankeyChartProps(themedProps);
|
|
47
|
+
const {
|
|
48
|
+
chartDataProviderProProps,
|
|
49
|
+
chartsSurfaceProps
|
|
50
|
+
} = useChartContainerProProps(chartContainerProps, ref);
|
|
51
|
+
const Tooltip = themedProps.slots?.tooltip ?? SankeyTooltip;
|
|
52
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
53
|
+
seriesConfig: seriesConfig,
|
|
54
|
+
plugins: SANKEY_CHART_PLUGINS,
|
|
55
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
56
|
+
children: [/*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(SankeyPlot, _extends({}, sankeyPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), children]
|
|
58
|
+
})), !themedProps.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
59
|
+
trigger: "item"
|
|
60
|
+
}, themedProps.slotProps?.tooltip))]
|
|
61
|
+
}))
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
if (process.env.NODE_ENV !== "production") SankeyChart.displayName = "SankeyChart";
|
|
65
|
+
process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
66
|
+
// ----------------------------- Warning --------------------------------
|
|
67
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
68
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
69
|
+
// ----------------------------------------------------------------------
|
|
70
|
+
apiRef: PropTypes.shape({
|
|
71
|
+
current: PropTypes.object
|
|
72
|
+
}),
|
|
73
|
+
/**
|
|
74
|
+
* Classes applied to the various elements.
|
|
75
|
+
*/
|
|
76
|
+
classes: PropTypes.object,
|
|
77
|
+
className: PropTypes.string,
|
|
78
|
+
/**
|
|
79
|
+
* Color palette used to colorize multiple series.
|
|
80
|
+
* @default rainbowSurgePalette
|
|
81
|
+
*/
|
|
82
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
83
|
+
desc: PropTypes.string,
|
|
84
|
+
/**
|
|
85
|
+
* Options to enable features planned for the next major.
|
|
86
|
+
*/
|
|
87
|
+
experimentalFeatures: PropTypes.shape({
|
|
88
|
+
preferStrictDomainInLineCharts: PropTypes.bool
|
|
89
|
+
}),
|
|
90
|
+
/**
|
|
91
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
92
|
+
*/
|
|
93
|
+
height: PropTypes.number,
|
|
94
|
+
/**
|
|
95
|
+
* This prop is used to help implement the accessibility logic.
|
|
96
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
97
|
+
*/
|
|
98
|
+
id: PropTypes.string,
|
|
99
|
+
/**
|
|
100
|
+
* If `true`, a loading overlay is displayed.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
loading: PropTypes.bool,
|
|
104
|
+
/**
|
|
105
|
+
* Localized text for chart components.
|
|
106
|
+
*/
|
|
107
|
+
localeText: PropTypes.object,
|
|
108
|
+
/**
|
|
109
|
+
* The margin between the SVG and the drawing area.
|
|
110
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
111
|
+
*
|
|
112
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
113
|
+
*/
|
|
114
|
+
margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
115
|
+
bottom: PropTypes.number,
|
|
116
|
+
left: PropTypes.number,
|
|
117
|
+
right: PropTypes.number,
|
|
118
|
+
top: PropTypes.number
|
|
119
|
+
})]),
|
|
120
|
+
/**
|
|
121
|
+
* Callback fired when a sankey item is clicked.
|
|
122
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
123
|
+
* @param {SankeyLinkIdentifierWithData} link The sankey link identifier.
|
|
124
|
+
*/
|
|
125
|
+
onLinkClick: PropTypes.func,
|
|
126
|
+
/**
|
|
127
|
+
* Callback fired when a sankey item is clicked.
|
|
128
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
129
|
+
* @param {SankeyNodeIdentifierWithData} node The sankey node identifier.
|
|
130
|
+
*/
|
|
131
|
+
onNodeClick: PropTypes.func,
|
|
132
|
+
/**
|
|
133
|
+
* The series to display in the Sankey chart.
|
|
134
|
+
* A single object is expected.
|
|
135
|
+
*/
|
|
136
|
+
series: PropTypes.object.isRequired,
|
|
137
|
+
/**
|
|
138
|
+
* The props used for each component slot.
|
|
139
|
+
* @default {}
|
|
140
|
+
*/
|
|
141
|
+
slotProps: PropTypes.object,
|
|
142
|
+
/**
|
|
143
|
+
* Overridable component slots.
|
|
144
|
+
* @default {}
|
|
145
|
+
*/
|
|
146
|
+
slots: PropTypes.object,
|
|
147
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
148
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
149
|
+
title: PropTypes.string,
|
|
150
|
+
/**
|
|
151
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
152
|
+
*/
|
|
153
|
+
width: PropTypes.number
|
|
154
|
+
} : void 0;
|
|
155
|
+
export { SankeyChart };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
|
+
export type SankeyChartPluginsSignatures = [UseChartInteractionSignature, UseChartHighlightSignature];
|
|
3
|
+
export declare const SANKEY_CHART_PLUGINS: ConvertSignaturesIntoPlugins<SankeyChartPluginsSignatures>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useChartHighlight
|
|
2
|
+
// useChartHighlight,
|
|
3
|
+
, useChartInteraction } from '@mui/x-charts/internals';
|
|
4
|
+
import // useChartProExport,
|
|
5
|
+
// UseChartProExportSignature,
|
|
6
|
+
"../internals/plugins/useChartProExport/index.js";
|
|
7
|
+
export const SANKEY_CHART_PLUGINS = [useChartInteraction, useChartHighlight
|
|
8
|
+
// useChartProExport,
|
|
9
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
+
import { SankeyLayoutLink, type SankeyLinkIdentifierWithData } from "./sankey.types.js";
|
|
4
|
+
export interface SankeyLinkElementProps {
|
|
5
|
+
/**
|
|
6
|
+
* The series ID to which the link belongs
|
|
7
|
+
*/
|
|
8
|
+
seriesId: SeriesId;
|
|
9
|
+
/**
|
|
10
|
+
* The link data
|
|
11
|
+
*/
|
|
12
|
+
link: SankeyLayoutLink;
|
|
13
|
+
/**
|
|
14
|
+
* Opacity to apply to the link
|
|
15
|
+
*/
|
|
16
|
+
opacity?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when a sankey item is clicked.
|
|
19
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
20
|
+
* @param {SankeyLinkIdentifierWithData} link The sankey link identifier.
|
|
21
|
+
*/
|
|
22
|
+
onClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, link: SankeyLinkIdentifierWithData) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @ignore - internal component.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SankeyLinkElement: React.ForwardRefExoticComponent<SankeyLinkElementProps & React.RefAttributes<SVGPathElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
+
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* @ignore - internal component.
|
|
10
|
+
*/
|
|
11
|
+
export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLinkElement(props, ref) {
|
|
12
|
+
const {
|
|
13
|
+
link,
|
|
14
|
+
opacity = 0.4,
|
|
15
|
+
onClick,
|
|
16
|
+
seriesId
|
|
17
|
+
} = props;
|
|
18
|
+
const identifier = {
|
|
19
|
+
type: 'sankey',
|
|
20
|
+
seriesId,
|
|
21
|
+
subType: 'link',
|
|
22
|
+
targetId: link.target.id,
|
|
23
|
+
sourceId: link.source.id,
|
|
24
|
+
link
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// Add interaction props for tooltips
|
|
28
|
+
const interactionProps = useInteractionItemProps(identifier);
|
|
29
|
+
const handleClick = useEventCallback(event => {
|
|
30
|
+
onClick?.(event, identifier);
|
|
31
|
+
});
|
|
32
|
+
if (!link.path) {
|
|
33
|
+
return null; // No path defined, nothing to render
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/_jsx("path", _extends({
|
|
36
|
+
ref: ref,
|
|
37
|
+
d: link.path,
|
|
38
|
+
fill: link.color,
|
|
39
|
+
opacity: opacity,
|
|
40
|
+
"data-link-source": link.source.id,
|
|
41
|
+
"data-link-target": link.target.id,
|
|
42
|
+
onClick: onClick ? handleClick : undefined,
|
|
43
|
+
cursor: onClick ? 'pointer' : 'default'
|
|
44
|
+
}, interactionProps));
|
|
45
|
+
});
|
|
46
|
+
if (process.env.NODE_ENV !== "production") SankeyLinkElement.displayName = "SankeyLinkElement";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SankeyLayoutLink } from "./sankey.types.js";
|
|
3
|
+
export interface SankeyLinkLabelProps {
|
|
4
|
+
/**
|
|
5
|
+
* The link data
|
|
6
|
+
*/
|
|
7
|
+
link: SankeyLayoutLink;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @ignore - internal component.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SankeyLinkLabel: React.ForwardRefExoticComponent<SankeyLinkLabelProps & React.RefAttributes<SVGTextElement>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useTheme } from '@mui/material/styles';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const getLinkMidpoint = link => {
|
|
7
|
+
if (link.y0 === undefined || link.y1 === undefined) {
|
|
8
|
+
return {
|
|
9
|
+
x: 0,
|
|
10
|
+
y: 0
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// For Sankey links, we can calculate the midpoint using the source and target positions
|
|
15
|
+
const sourceX = link.source.x1 || 0;
|
|
16
|
+
const sourceY = (link.y0 + link.y1) / 2;
|
|
17
|
+
const targetX = link.target.x0 || 0;
|
|
18
|
+
const targetY = (link.y0 + link.y1) / 2;
|
|
19
|
+
return {
|
|
20
|
+
x: (sourceX + targetX) / 2,
|
|
21
|
+
y: (sourceY + targetY) / 2
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @ignore - internal component.
|
|
27
|
+
*/
|
|
28
|
+
export const SankeyLinkLabel = /*#__PURE__*/React.forwardRef(function SankeyLinkLabel(props, ref) {
|
|
29
|
+
const {
|
|
30
|
+
link
|
|
31
|
+
} = props;
|
|
32
|
+
const theme = useTheme();
|
|
33
|
+
if (!link.path || link.y0 === undefined || link.y1 === undefined) {
|
|
34
|
+
return null; // No path defined or invalid coordinates, nothing to render
|
|
35
|
+
}
|
|
36
|
+
const midpoint = getLinkMidpoint(link);
|
|
37
|
+
return /*#__PURE__*/_jsx("text", {
|
|
38
|
+
ref: ref,
|
|
39
|
+
x: midpoint.x,
|
|
40
|
+
y: midpoint.y,
|
|
41
|
+
textAnchor: "middle",
|
|
42
|
+
dominantBaseline: "middle",
|
|
43
|
+
fontSize: theme.typography.caption.fontSize,
|
|
44
|
+
fill: (theme.vars || theme).palette.text.primary,
|
|
45
|
+
"data-link-source": link.source.id,
|
|
46
|
+
"data-link-target": link.target.id,
|
|
47
|
+
fontFamily: theme.typography.fontFamily,
|
|
48
|
+
pointerEvents: "none",
|
|
49
|
+
children: link.value
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
if (process.env.NODE_ENV !== "production") SankeyLinkLabel.displayName = "SankeyLinkLabel";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
+
import { SankeyLayoutNode, type SankeyNodeIdentifierWithData } from "./sankey.types.js";
|
|
4
|
+
export interface SankeyNodeElementProps {
|
|
5
|
+
/**
|
|
6
|
+
* The series ID to which the node belongs
|
|
7
|
+
*/
|
|
8
|
+
seriesId: SeriesId;
|
|
9
|
+
/**
|
|
10
|
+
* The node data
|
|
11
|
+
*/
|
|
12
|
+
node: SankeyLayoutNode;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to show the node label
|
|
15
|
+
*/
|
|
16
|
+
showLabel?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Callback fired when a sankey item is clicked.
|
|
19
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
20
|
+
* @param {SankeyNodeIdentifierWithData} node The sankey node identifier.
|
|
21
|
+
*/
|
|
22
|
+
onClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, node: SankeyNodeIdentifierWithData) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @ignore - internal component.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<SVGGElement>>;
|