@mui/x-charts-pro 8.20.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 +112 -0
- package/ChartDataProviderPro/ChartDataProviderPro.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/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/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/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
|
@@ -348,6 +348,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
348
348
|
tickNumber: _propTypes.default.number,
|
|
349
349
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
350
350
|
tickSize: _propTypes.default.number,
|
|
351
|
+
tickSpacing: _propTypes.default.number,
|
|
351
352
|
valueFormatter: _propTypes.default.func,
|
|
352
353
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
353
354
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -415,6 +416,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
415
416
|
tickNumber: _propTypes.default.number,
|
|
416
417
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
417
418
|
tickSize: _propTypes.default.number,
|
|
419
|
+
tickSpacing: _propTypes.default.number,
|
|
418
420
|
valueFormatter: _propTypes.default.func,
|
|
419
421
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
420
422
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -474,6 +476,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
474
476
|
tickNumber: _propTypes.default.number,
|
|
475
477
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
476
478
|
tickSize: _propTypes.default.number,
|
|
479
|
+
tickSpacing: _propTypes.default.number,
|
|
477
480
|
valueFormatter: _propTypes.default.func,
|
|
478
481
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
479
482
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -534,6 +537,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
534
537
|
tickNumber: _propTypes.default.number,
|
|
535
538
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
536
539
|
tickSize: _propTypes.default.number,
|
|
540
|
+
tickSpacing: _propTypes.default.number,
|
|
537
541
|
valueFormatter: _propTypes.default.func,
|
|
538
542
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
539
543
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -593,6 +597,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
593
597
|
tickNumber: _propTypes.default.number,
|
|
594
598
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
595
599
|
tickSize: _propTypes.default.number,
|
|
600
|
+
tickSpacing: _propTypes.default.number,
|
|
596
601
|
valueFormatter: _propTypes.default.func,
|
|
597
602
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
598
603
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -652,6 +657,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
652
657
|
tickNumber: _propTypes.default.number,
|
|
653
658
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
654
659
|
tickSize: _propTypes.default.number,
|
|
660
|
+
tickSpacing: _propTypes.default.number,
|
|
655
661
|
valueFormatter: _propTypes.default.func,
|
|
656
662
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
657
663
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -715,6 +721,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
715
721
|
tickNumber: _propTypes.default.number,
|
|
716
722
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
717
723
|
tickSize: _propTypes.default.number,
|
|
724
|
+
tickSpacing: _propTypes.default.number,
|
|
718
725
|
valueFormatter: _propTypes.default.func,
|
|
719
726
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
720
727
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -778,6 +785,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
778
785
|
tickNumber: _propTypes.default.number,
|
|
779
786
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
780
787
|
tickSize: _propTypes.default.number,
|
|
788
|
+
tickSpacing: _propTypes.default.number,
|
|
781
789
|
valueFormatter: _propTypes.default.func,
|
|
782
790
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
783
791
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -837,6 +845,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
837
845
|
tickNumber: _propTypes.default.number,
|
|
838
846
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
839
847
|
tickSize: _propTypes.default.number,
|
|
848
|
+
tickSpacing: _propTypes.default.number,
|
|
840
849
|
valueFormatter: _propTypes.default.func,
|
|
841
850
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
842
851
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -910,6 +919,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
910
919
|
tickNumber: _propTypes.default.number,
|
|
911
920
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
912
921
|
tickSize: _propTypes.default.number,
|
|
922
|
+
tickSpacing: _propTypes.default.number,
|
|
913
923
|
valueFormatter: _propTypes.default.func,
|
|
914
924
|
width: _propTypes.default.number,
|
|
915
925
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -976,6 +986,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
976
986
|
tickNumber: _propTypes.default.number,
|
|
977
987
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
978
988
|
tickSize: _propTypes.default.number,
|
|
989
|
+
tickSpacing: _propTypes.default.number,
|
|
979
990
|
valueFormatter: _propTypes.default.func,
|
|
980
991
|
width: _propTypes.default.number,
|
|
981
992
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1034,6 +1045,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1034
1045
|
tickNumber: _propTypes.default.number,
|
|
1035
1046
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1036
1047
|
tickSize: _propTypes.default.number,
|
|
1048
|
+
tickSpacing: _propTypes.default.number,
|
|
1037
1049
|
valueFormatter: _propTypes.default.func,
|
|
1038
1050
|
width: _propTypes.default.number,
|
|
1039
1051
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1093,6 +1105,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1093
1105
|
tickNumber: _propTypes.default.number,
|
|
1094
1106
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1095
1107
|
tickSize: _propTypes.default.number,
|
|
1108
|
+
tickSpacing: _propTypes.default.number,
|
|
1096
1109
|
valueFormatter: _propTypes.default.func,
|
|
1097
1110
|
width: _propTypes.default.number,
|
|
1098
1111
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1151,6 +1164,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1151
1164
|
tickNumber: _propTypes.default.number,
|
|
1152
1165
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1153
1166
|
tickSize: _propTypes.default.number,
|
|
1167
|
+
tickSpacing: _propTypes.default.number,
|
|
1154
1168
|
valueFormatter: _propTypes.default.func,
|
|
1155
1169
|
width: _propTypes.default.number,
|
|
1156
1170
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1209,6 +1223,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1209
1223
|
tickNumber: _propTypes.default.number,
|
|
1210
1224
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1211
1225
|
tickSize: _propTypes.default.number,
|
|
1226
|
+
tickSpacing: _propTypes.default.number,
|
|
1212
1227
|
valueFormatter: _propTypes.default.func,
|
|
1213
1228
|
width: _propTypes.default.number,
|
|
1214
1229
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1271,6 +1286,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1271
1286
|
tickNumber: _propTypes.default.number,
|
|
1272
1287
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1273
1288
|
tickSize: _propTypes.default.number,
|
|
1289
|
+
tickSpacing: _propTypes.default.number,
|
|
1274
1290
|
valueFormatter: _propTypes.default.func,
|
|
1275
1291
|
width: _propTypes.default.number,
|
|
1276
1292
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1333,6 +1349,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1333
1349
|
tickNumber: _propTypes.default.number,
|
|
1334
1350
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1335
1351
|
tickSize: _propTypes.default.number,
|
|
1352
|
+
tickSpacing: _propTypes.default.number,
|
|
1336
1353
|
valueFormatter: _propTypes.default.func,
|
|
1337
1354
|
width: _propTypes.default.number,
|
|
1338
1355
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1391,6 +1408,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1391
1408
|
tickNumber: _propTypes.default.number,
|
|
1392
1409
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1393
1410
|
tickSize: _propTypes.default.number,
|
|
1411
|
+
tickSpacing: _propTypes.default.number,
|
|
1394
1412
|
valueFormatter: _propTypes.default.func,
|
|
1395
1413
|
width: _propTypes.default.number,
|
|
1396
1414
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,118 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.21.0
|
|
9
|
+
|
|
10
|
+
_Dec 3, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- ✨ Add [tick spacing property](https://mui.com/x/react-charts/axis/#tick-spacing) to charts axis to control the distance between ticks.
|
|
15
|
+
|
|
16
|
+
The following team members contributed to this release:
|
|
17
|
+
@alexfauquette, @bernardobelchior, @ElliottMiller, @Janpot, @JCQuintas, @romgrk, @sai6855, @siriwatknp
|
|
18
|
+
|
|
19
|
+
### Data Grid
|
|
20
|
+
|
|
21
|
+
#### `@mui/x-data-grid@8.21.0`
|
|
22
|
+
|
|
23
|
+
- [DataGrid] Fix autosizing header width calculation (#20323) @siriwatknp
|
|
24
|
+
- [DataGrid] Virtualizer refactor (#19465) @romgrk
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@8.21.0`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@8.21.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@8.21.0`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPremium] Prevent pasting to non-editable cells (#20333) @ElliottMiller
|
|
35
|
+
|
|
36
|
+
### Date and Time Pickers
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-date-pickers@8.21.0`
|
|
39
|
+
|
|
40
|
+
Internal changes.
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-date-pickers-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-date-pickers@8.21.0`.
|
|
45
|
+
|
|
46
|
+
### Charts
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-charts@8.21.0`
|
|
49
|
+
|
|
50
|
+
- [charts] Fix string measuring types (#20454) @bernardobelchior
|
|
51
|
+
- [charts] Fix typo in performance note for CustomLineMarks demo (#20529) @sai6855
|
|
52
|
+
- [charts] Introduce the notion of series with positions (#20461) @alexfauquette
|
|
53
|
+
- [charts] Migrate from sinon to Vitest mocking utilities for x-charts\* packages (#20444) @Copilot
|
|
54
|
+
- [charts] Move series-level values to series computed data in bar plot (#20467) @bernardobelchior
|
|
55
|
+
- [charts] Refactor bar chart components in preparation for range bar chart (#20521) @bernardobelchior
|
|
56
|
+
- [charts] Remove unnecessary `any` types (#20527) @sai6855
|
|
57
|
+
- [charts] Remove unused `drawingArea` from `findClosestPoints` (#20471) @bernardobelchior
|
|
58
|
+
- [charts] Revert `useIsHydrated` to default=false (#20511) @JCQuintas
|
|
59
|
+
- [charts] Support tooltip anchor position for radar (#20422) @alexfauquette
|
|
60
|
+
- [charts] Add tick spacing property (#20282) @bernardobelchior
|
|
61
|
+
- [charts] Fix Vitest lint error (#20550) @bernardobelchior
|
|
62
|
+
- [charts] Fix infinite loop when highlighting pie slices or scatter points (#20549) @bernardobelchior
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-charts-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-charts@8.21.0`, plus:
|
|
67
|
+
|
|
68
|
+
- [charts-pro] Add support for `anchor="node"` on Sankey tooltip (#20462) @alexfauquette
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-charts-premium@8.21.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
71
|
+
|
|
72
|
+
Same changes as in `@mui/x-charts-pro@8.21.0`.
|
|
73
|
+
|
|
74
|
+
### Tree View
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-tree-view@8.21.0`
|
|
77
|
+
|
|
78
|
+
Internal changes.
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-tree-view-pro@8.21.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
81
|
+
|
|
82
|
+
Same changes as in `@mui/x-tree-view@8.21.0`.
|
|
83
|
+
|
|
84
|
+
### Codemod
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-codemod@8.21.0`
|
|
87
|
+
|
|
88
|
+
Internal changes.
|
|
89
|
+
|
|
90
|
+
### Docs
|
|
91
|
+
|
|
92
|
+
- [docs] Migrate to `next/font` for fonts loading (#20407) @Copilot
|
|
93
|
+
|
|
94
|
+
### Core
|
|
95
|
+
|
|
96
|
+
- [code-infra] Enable vitest eslint plugin (#20530) @Janpot
|
|
97
|
+
- [code-infra] Fix missing font loading for local fonts (#20480) @Janpot
|
|
98
|
+
- [internal] Performance: use raw `useSyncExternalStore` (#20447) @romgrk
|
|
99
|
+
- [code-infra] Enable `vitest/expect-expect` and `vitest/no-standalone-expect` rules for x-charts packages (#20535) @Copilot
|
|
100
|
+
|
|
101
|
+
### Miscellaneous
|
|
102
|
+
|
|
103
|
+
- Bump @types/d3-sankey to ^0.12.5 (#20489) @renovate[bot]
|
|
104
|
+
- Bump @types/react to 19.2.7 (#20490) @renovate[bot]
|
|
105
|
+
- Bump @types/yargs to ^17.0.35 (#20491) @renovate[bot]
|
|
106
|
+
- Bump Vite & Vitest to ^4.0.14 (#20500) @renovate[bot]
|
|
107
|
+
- Bump csstype to ^3.2.3 (#20493) @renovate[bot]
|
|
108
|
+
- Bump es-toolkit to ^1.42.0 (#20494) @renovate[bot]
|
|
109
|
+
- Bump eslint to ^8.48.0 (#20495) @renovate[bot]
|
|
110
|
+
- Bump lerna to ^9.0.3 (#20496) @renovate[bot]
|
|
111
|
+
- Bump lucide-react to ^0.555.0 (#20502) @renovate[bot]
|
|
112
|
+
- Bump playwright monorepo (#20503) @renovate[bot]
|
|
113
|
+
- Bump pnpm to 10.24.0 (#20504) @renovate[bot]
|
|
114
|
+
- Bump react monorepo (#20340) @renovate[bot]
|
|
115
|
+
- Bump react-hook-form to ^7.66.1 (#20497) @renovate[bot]
|
|
116
|
+
- Bump rimraf to ^6.1.2 (#20498) @renovate[bot]
|
|
117
|
+
- Bump webpack-bundle-analyzer to ^5.0.1 (#20508) @renovate[bot]
|
|
118
|
+
- Bump next to ^15.5.6 [SECURITY] (#20555) @renovate[bot]
|
|
119
|
+
|
|
8
120
|
## 8.20.0
|
|
9
121
|
|
|
10
122
|
_Nov 26, 2025_
|
|
@@ -16,7 +16,7 @@ var _material = require("../internals/material");
|
|
|
16
16
|
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
17
17
|
var _useChartDataProviderProProps = require("./useChartDataProviderProProps");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const releaseInfo = "
|
|
19
|
+
const releaseInfo = "MTc2NDgwNjQwMDAwMA==";
|
|
20
20
|
const packageIdentifier = 'x-charts-pro';
|
|
21
21
|
/**
|
|
22
22
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -22,16 +22,16 @@ function BarPreviewPlot(props) {
|
|
|
22
22
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
23
23
|
children: completedData.map(({
|
|
24
24
|
seriesId,
|
|
25
|
+
layout,
|
|
26
|
+
xOrigin,
|
|
27
|
+
yOrigin,
|
|
25
28
|
data
|
|
26
29
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
27
30
|
children: data.map(({
|
|
28
31
|
dataIndex,
|
|
29
32
|
color,
|
|
30
|
-
layout,
|
|
31
33
|
x,
|
|
32
|
-
xOrigin,
|
|
33
34
|
y,
|
|
34
|
-
yOrigin,
|
|
35
35
|
width,
|
|
36
36
|
height
|
|
37
37
|
}) => {
|
package/Heatmap/Heatmap.js
CHANGED
|
@@ -340,6 +340,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
340
340
|
tickNumber: _propTypes.default.number,
|
|
341
341
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
342
342
|
tickSize: _propTypes.default.number,
|
|
343
|
+
tickSpacing: _propTypes.default.number,
|
|
343
344
|
valueFormatter: _propTypes.default.func
|
|
344
345
|
})).isRequired,
|
|
345
346
|
/**
|
|
@@ -398,6 +399,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
398
399
|
tickNumber: _propTypes.default.number,
|
|
399
400
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
400
401
|
tickSize: _propTypes.default.number,
|
|
402
|
+
tickSpacing: _propTypes.default.number,
|
|
401
403
|
valueFormatter: _propTypes.default.func,
|
|
402
404
|
width: _propTypes.default.number
|
|
403
405
|
})).isRequired,
|
|
@@ -350,6 +350,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
350
350
|
tickNumber: _propTypes.default.number,
|
|
351
351
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
352
352
|
tickSize: _propTypes.default.number,
|
|
353
|
+
tickSpacing: _propTypes.default.number,
|
|
353
354
|
valueFormatter: _propTypes.default.func,
|
|
354
355
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
355
356
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -417,6 +418,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
417
418
|
tickNumber: _propTypes.default.number,
|
|
418
419
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
419
420
|
tickSize: _propTypes.default.number,
|
|
421
|
+
tickSpacing: _propTypes.default.number,
|
|
420
422
|
valueFormatter: _propTypes.default.func,
|
|
421
423
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
422
424
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -476,6 +478,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
476
478
|
tickNumber: _propTypes.default.number,
|
|
477
479
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
478
480
|
tickSize: _propTypes.default.number,
|
|
481
|
+
tickSpacing: _propTypes.default.number,
|
|
479
482
|
valueFormatter: _propTypes.default.func,
|
|
480
483
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
481
484
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -536,6 +539,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
536
539
|
tickNumber: _propTypes.default.number,
|
|
537
540
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
538
541
|
tickSize: _propTypes.default.number,
|
|
542
|
+
tickSpacing: _propTypes.default.number,
|
|
539
543
|
valueFormatter: _propTypes.default.func,
|
|
540
544
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
541
545
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -595,6 +599,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
595
599
|
tickNumber: _propTypes.default.number,
|
|
596
600
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
597
601
|
tickSize: _propTypes.default.number,
|
|
602
|
+
tickSpacing: _propTypes.default.number,
|
|
598
603
|
valueFormatter: _propTypes.default.func,
|
|
599
604
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
600
605
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -654,6 +659,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
654
659
|
tickNumber: _propTypes.default.number,
|
|
655
660
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
656
661
|
tickSize: _propTypes.default.number,
|
|
662
|
+
tickSpacing: _propTypes.default.number,
|
|
657
663
|
valueFormatter: _propTypes.default.func,
|
|
658
664
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
659
665
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -717,6 +723,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
717
723
|
tickNumber: _propTypes.default.number,
|
|
718
724
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
719
725
|
tickSize: _propTypes.default.number,
|
|
726
|
+
tickSpacing: _propTypes.default.number,
|
|
720
727
|
valueFormatter: _propTypes.default.func,
|
|
721
728
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
722
729
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -780,6 +787,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
780
787
|
tickNumber: _propTypes.default.number,
|
|
781
788
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
782
789
|
tickSize: _propTypes.default.number,
|
|
790
|
+
tickSpacing: _propTypes.default.number,
|
|
783
791
|
valueFormatter: _propTypes.default.func,
|
|
784
792
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
785
793
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -839,6 +847,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
839
847
|
tickNumber: _propTypes.default.number,
|
|
840
848
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
841
849
|
tickSize: _propTypes.default.number,
|
|
850
|
+
tickSpacing: _propTypes.default.number,
|
|
842
851
|
valueFormatter: _propTypes.default.func,
|
|
843
852
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
844
853
|
filterMode: _propTypes.default.oneOf(['discard', 'keep']),
|
|
@@ -912,6 +921,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
912
921
|
tickNumber: _propTypes.default.number,
|
|
913
922
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
914
923
|
tickSize: _propTypes.default.number,
|
|
924
|
+
tickSpacing: _propTypes.default.number,
|
|
915
925
|
valueFormatter: _propTypes.default.func,
|
|
916
926
|
width: _propTypes.default.number,
|
|
917
927
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -978,6 +988,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
978
988
|
tickNumber: _propTypes.default.number,
|
|
979
989
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
980
990
|
tickSize: _propTypes.default.number,
|
|
991
|
+
tickSpacing: _propTypes.default.number,
|
|
981
992
|
valueFormatter: _propTypes.default.func,
|
|
982
993
|
width: _propTypes.default.number,
|
|
983
994
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1036,6 +1047,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1036
1047
|
tickNumber: _propTypes.default.number,
|
|
1037
1048
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1038
1049
|
tickSize: _propTypes.default.number,
|
|
1050
|
+
tickSpacing: _propTypes.default.number,
|
|
1039
1051
|
valueFormatter: _propTypes.default.func,
|
|
1040
1052
|
width: _propTypes.default.number,
|
|
1041
1053
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1095,6 +1107,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1095
1107
|
tickNumber: _propTypes.default.number,
|
|
1096
1108
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1097
1109
|
tickSize: _propTypes.default.number,
|
|
1110
|
+
tickSpacing: _propTypes.default.number,
|
|
1098
1111
|
valueFormatter: _propTypes.default.func,
|
|
1099
1112
|
width: _propTypes.default.number,
|
|
1100
1113
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1153,6 +1166,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1153
1166
|
tickNumber: _propTypes.default.number,
|
|
1154
1167
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1155
1168
|
tickSize: _propTypes.default.number,
|
|
1169
|
+
tickSpacing: _propTypes.default.number,
|
|
1156
1170
|
valueFormatter: _propTypes.default.func,
|
|
1157
1171
|
width: _propTypes.default.number,
|
|
1158
1172
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1211,6 +1225,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1211
1225
|
tickNumber: _propTypes.default.number,
|
|
1212
1226
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1213
1227
|
tickSize: _propTypes.default.number,
|
|
1228
|
+
tickSpacing: _propTypes.default.number,
|
|
1214
1229
|
valueFormatter: _propTypes.default.func,
|
|
1215
1230
|
width: _propTypes.default.number,
|
|
1216
1231
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1273,6 +1288,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1273
1288
|
tickNumber: _propTypes.default.number,
|
|
1274
1289
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1275
1290
|
tickSize: _propTypes.default.number,
|
|
1291
|
+
tickSpacing: _propTypes.default.number,
|
|
1276
1292
|
valueFormatter: _propTypes.default.func,
|
|
1277
1293
|
width: _propTypes.default.number,
|
|
1278
1294
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1335,6 +1351,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1335
1351
|
tickNumber: _propTypes.default.number,
|
|
1336
1352
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1337
1353
|
tickSize: _propTypes.default.number,
|
|
1354
|
+
tickSpacing: _propTypes.default.number,
|
|
1338
1355
|
valueFormatter: _propTypes.default.func,
|
|
1339
1356
|
width: _propTypes.default.number,
|
|
1340
1357
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -1393,6 +1410,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1393
1410
|
tickNumber: _propTypes.default.number,
|
|
1394
1411
|
tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
1395
1412
|
tickSize: _propTypes.default.number,
|
|
1413
|
+
tickSpacing: _propTypes.default.number,
|
|
1396
1414
|
valueFormatter: _propTypes.default.func,
|
|
1397
1415
|
width: _propTypes.default.number,
|
|
1398
1416
|
zoom: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -10,8 +10,6 @@ exports.SankeyPlot = SankeyPlot;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var _hooks = require("@mui/x-charts/hooks");
|
|
14
|
-
var _calculateSankeyLayout = require("./calculateSankeyLayout");
|
|
15
13
|
var _SankeyNodeElement = require("./SankeyNodeElement");
|
|
16
14
|
var _SankeyLinkElement = require("./SankeyLinkElement");
|
|
17
15
|
var _SankeyLinkLabel = require("./SankeyLinkLabel");
|
|
@@ -39,25 +37,23 @@ function SankeyPlot(props) {
|
|
|
39
37
|
onLinkClick,
|
|
40
38
|
onNodeClick
|
|
41
39
|
} = props;
|
|
42
|
-
const seriesContext = (0, _useSankeySeries.useSankeySeriesContext)();
|
|
43
|
-
if (!seriesContext) {
|
|
44
|
-
throw new Error(`MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartDataProviderPro.`);
|
|
45
|
-
}
|
|
46
|
-
const series = seriesContext.series[seriesContext.seriesOrder?.[0]];
|
|
47
40
|
const classes = (0, _sankeyClasses.useUtilityClasses)({
|
|
48
41
|
classes: inputClasses
|
|
49
42
|
});
|
|
50
|
-
const
|
|
43
|
+
const sankeyContext = (0, _useSankeySeries.useSankeySeriesContext)();
|
|
44
|
+
const sankeySeries = sankeyContext?.series[sankeyContext?.seriesOrder[0]];
|
|
45
|
+
const layout = (0, _useSankeySeries.useSankeyLayout)();
|
|
46
|
+
if (!sankeySeries) {
|
|
47
|
+
throw new Error(`MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartDataProviderPro.`);
|
|
48
|
+
}
|
|
49
|
+
if (!layout) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
51
52
|
const {
|
|
52
53
|
data,
|
|
53
54
|
linkOptions,
|
|
54
55
|
nodeOptions
|
|
55
|
-
} =
|
|
56
|
-
const theme = (0, _styles.useTheme)();
|
|
57
|
-
|
|
58
|
-
// Calculate layout based on data and dimensions
|
|
59
|
-
const layout = React.useMemo(() => (0, _calculateSankeyLayout.calculateSankeyLayout)(data, drawingArea, theme, series), [drawingArea, data, series, theme]);
|
|
60
|
-
|
|
56
|
+
} = sankeySeries;
|
|
61
57
|
// Early return if no data or dimensions
|
|
62
58
|
if (!data || !data.links) {
|
|
63
59
|
return null;
|
|
@@ -67,7 +63,7 @@ function SankeyPlot(props) {
|
|
|
67
63
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
68
64
|
className: classes.links,
|
|
69
65
|
children: layout.links.map(link => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyLinkElement.SankeyLinkElement, {
|
|
70
|
-
seriesId:
|
|
66
|
+
seriesId: sankeySeries.id,
|
|
71
67
|
link: link,
|
|
72
68
|
opacity: linkOptions?.opacity,
|
|
73
69
|
onClick: onLinkClick
|
|
@@ -75,7 +71,7 @@ function SankeyPlot(props) {
|
|
|
75
71
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
76
72
|
className: classes.nodes,
|
|
77
73
|
children: layout.nodes.map(node => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyNodeElement.SankeyNodeElement, {
|
|
78
|
-
seriesId:
|
|
74
|
+
seriesId: sankeySeries.id,
|
|
79
75
|
node: node,
|
|
80
76
|
showLabel: nodeOptions?.showLabels,
|
|
81
77
|
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;
|
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.calculateSankeyLayout = calculateSankeyLayout;
|
|
9
9
|
exports.improvedNaiveSankeyLinkPathHorizontal = improvedNaiveSankeyLinkPathHorizontal;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _d3Sankey = require("@mui/x-charts-vendor/d3-sankey");
|
|
12
11
|
var _d3Path = require("@mui/x-charts-vendor/d3-path");
|
|
12
|
+
var _d3Sankey = require("./d3Sankey");
|
|
13
13
|
var _utils = require("./utils");
|
|
14
14
|
/**
|
|
15
15
|
* Calculates the layout for a Sankey diagram using d3-sankey
|
|
@@ -20,8 +20,9 @@ var _utils = require("./utils");
|
|
|
20
20
|
* @returns The calculated layout
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
function calculateSankeyLayout(
|
|
23
|
+
function calculateSankeyLayout(series, drawingArea) {
|
|
24
24
|
const {
|
|
25
|
+
data,
|
|
25
26
|
iterations = 6,
|
|
26
27
|
nodeOptions,
|
|
27
28
|
linkOptions
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SankeyNode } from "./sankey.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Compute the horizontal node position of a node in a Sankey layout with left alignment.
|
|
4
|
+
* Returns (node.depth) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
5
|
+
*
|
|
6
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
7
|
+
*/
|
|
8
|
+
export declare function sankeyLeft(node: SankeyNode<{}, {}>): number;
|
|
9
|
+
/**
|
|
10
|
+
* Compute the horizontal node position of a node in a Sankey layout with right alignment.
|
|
11
|
+
* Returns (n - 1 - node.height) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
12
|
+
*
|
|
13
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
14
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
15
|
+
*/
|
|
16
|
+
export declare function sankeyRight(node: SankeyNode<{}, {}>, n: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Compute the horizontal node position of a node in a Sankey layout with justified alignment.
|
|
19
|
+
* Like d3.sankeyLeft, except that nodes without any outgoing links are moved to the far right.
|
|
20
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
21
|
+
*
|
|
22
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
23
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
24
|
+
*/
|
|
25
|
+
export declare function sankeyJustify(node: SankeyNode<{}, {}>, n: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the horizontal node position of a node in a Sankey layout with center alignment.
|
|
28
|
+
* Like d3.sankeyLeft, except that nodes without any incoming links are moved as right as possible.
|
|
29
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
30
|
+
*
|
|
31
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sankeyCenter(node: SankeyNode<{}, {}>): number;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sankeyCenter = sankeyCenter;
|
|
7
|
+
exports.sankeyJustify = sankeyJustify;
|
|
8
|
+
exports.sankeyLeft = sankeyLeft;
|
|
9
|
+
exports.sankeyRight = sankeyRight;
|
|
10
|
+
var _d3Array = require("@mui/x-charts-vendor/d3-array");
|
|
11
|
+
function targetDepth(d) {
|
|
12
|
+
return d.target.depth ?? 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Compute the horizontal node position of a node in a Sankey layout with left alignment.
|
|
17
|
+
* Returns (node.depth) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
18
|
+
*
|
|
19
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
20
|
+
*/
|
|
21
|
+
function sankeyLeft(node) {
|
|
22
|
+
return node.depth ?? 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Compute the horizontal node position of a node in a Sankey layout with right alignment.
|
|
27
|
+
* Returns (n - 1 - node.height) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
28
|
+
*
|
|
29
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
30
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
31
|
+
*/
|
|
32
|
+
function sankeyRight(node, n) {
|
|
33
|
+
return n - 1 - (node.height ?? 0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Compute the horizontal node position of a node in a Sankey layout with justified alignment.
|
|
38
|
+
* Like d3.sankeyLeft, except that nodes without any outgoing links are moved to the far right.
|
|
39
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
40
|
+
*
|
|
41
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
42
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
43
|
+
*/
|
|
44
|
+
function sankeyJustify(node, n) {
|
|
45
|
+
return node.sourceLinks?.length ? node.depth ?? 0 : n - 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Compute the horizontal node position of a node in a Sankey layout with center alignment.
|
|
50
|
+
* Like d3.sankeyLeft, except that nodes without any incoming links are moved as right as possible.
|
|
51
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
52
|
+
*
|
|
53
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
54
|
+
*/
|
|
55
|
+
function sankeyCenter(node) {
|
|
56
|
+
if (node.targetLinks?.length) {
|
|
57
|
+
return node.depth ?? 0;
|
|
58
|
+
}
|
|
59
|
+
if (node.sourceLinks?.length) {
|
|
60
|
+
return ((0, _d3Array.min)(node.sourceLinks, targetDepth) ?? 0) - 1;
|
|
61
|
+
}
|
|
62
|
+
return 0;
|
|
63
|
+
}
|