@undp/data-viz 1.5.2 → 1.5.4
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/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.js +3 -2
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +1196 -1224
- package/dist/BarGraph.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +130 -142
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +41 -41
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +484 -488
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +99 -99
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +125 -125
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +2 -2
- package/dist/DataCards.cjs +2 -2
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +6 -6
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.js +66 -68
- package/dist/DataTable.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +3 -2
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.js +205 -205
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +78 -81
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +3 -2
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +66 -67
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +1 -1
- package/dist/{GraphEl-4RUlclvW.cjs → GraphEl-BcYgMnN2.cjs} +2 -2
- package/dist/{GraphEl-4RUlclvW.cjs.map → GraphEl-BcYgMnN2.cjs.map} +1 -1
- package/dist/{GraphEl-ClIxlWa3.js → GraphEl-CMWeARJ3.js} +2 -2
- package/dist/{GraphEl-ClIxlWa3.js.map → GraphEl-CMWeARJ3.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +4 -4
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.js +83 -83
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +7 -6
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.js +2 -2
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +82 -91
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +3 -2
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +2 -2
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +124 -130
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.js +200 -200
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +149 -155
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +44 -43
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +4 -4
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +107 -113
- package/dist/SlopeChart.js.map +1 -1
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.cjs.map +1 -1
- package/dist/SparkLine.js +3 -2
- package/dist/SparkLine.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +159 -159
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +3 -3
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.js +194 -200
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/XAxesLabels-Drf7M3YK.cjs +2 -0
- package/dist/XAxesLabels-Drf7M3YK.cjs.map +1 -0
- package/dist/{XAxesLabels-CaV2q-6H.js → XAxesLabels-loO78vUO.js} +19 -19
- package/dist/XAxesLabels-loO78vUO.js.map +1 -0
- package/dist/YAxesLabels-CctDydGR.cjs +2 -0
- package/dist/YAxesLabels-CctDydGR.cjs.map +1 -0
- package/dist/{YAxesLabels-CPGZjmZJ.js → YAxesLabels-DSm6I5zG.js} +16 -17
- package/dist/YAxesLabels-DSm6I5zG.js.map +1 -0
- package/dist/ensureCompleteData-DkQYPeDa.cjs +2 -0
- package/dist/ensureCompleteData-DkQYPeDa.cjs.map +1 -0
- package/dist/{ensureCompleteData-BALdOrsS.js → ensureCompleteData-DlmibgaI.js} +28 -8
- package/dist/ensureCompleteData-DlmibgaI.js.map +1 -0
- package/dist/fetchAndParseData-Ba-_CgxS.cjs +16 -0
- package/dist/fetchAndParseData-Ba-_CgxS.cjs.map +1 -0
- package/dist/fetchAndParseData-sapWbnYk.js +583 -0
- package/dist/fetchAndParseData-sapWbnYk.js.map +1 -0
- package/dist/fetchAndParseData.cjs +1 -1
- package/dist/fetchAndParseData.js +1 -1
- package/dist/getJenks-BbngDoBQ.js +19 -0
- package/dist/getJenks-BbngDoBQ.js.map +1 -0
- package/dist/getJenks-GYmdwBqm.cjs +2 -0
- package/dist/getJenks-GYmdwBqm.cjs.map +1 -0
- package/dist/getSliderMarks-9cNoRkDx.js +1023 -0
- package/dist/getSliderMarks-9cNoRkDx.js.map +1 -0
- package/dist/getSliderMarks-CRIbTGYV.cjs +6 -0
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +1 -0
- package/dist/getUniqValue-DiCh_MOD.js +13 -0
- package/dist/getUniqValue-DiCh_MOD.js.map +1 -0
- package/dist/getUniqValue-RViz8tTw.cjs +2 -0
- package/dist/getUniqValue-RViz8tTw.cjs.map +1 -0
- package/dist/{index-BMgDMxKJ.js → index-37q0ULNQ.js} +44 -50
- package/dist/index-37q0ULNQ.js.map +1 -0
- package/dist/index-CVlCtJbC.cjs +2 -0
- package/dist/index-CVlCtJbC.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/sort-DfK1b0F5.js +34 -0
- package/dist/sort-DfK1b0F5.js.map +1 -0
- package/dist/sort-O96oMZLb.cjs +2 -0
- package/dist/sort-O96oMZLb.cjs.map +1 -0
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +3 -3
- package/dist/transformDataForAggregation-KXGm6flX.cjs +2 -0
- package/dist/{transformDataForAggregation-BVxVu4yY.cjs.map → transformDataForAggregation-KXGm6flX.cjs.map} +1 -1
- package/dist/{transformDataForAggregation-1BYVFqvF.js → transformDataForAggregation-sBpdlX8n.js} +40 -44
- package/dist/{transformDataForAggregation-1BYVFqvF.js.map → transformDataForAggregation-sBpdlX8n.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js → transformDataForGraphFromFile-ComYvzuz.js} +3 -3
- package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js.map → transformDataForGraphFromFile-ComYvzuz.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs → transformDataForGraphFromFile-DVZodTHd.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs.map → transformDataForGraphFromFile-DVZodTHd.cjs.map} +1 -1
- package/dist/uniqBy-BHy4I8PK.js +8 -0
- package/dist/uniqBy-BHy4I8PK.js.map +1 -0
- package/dist/uniqBy-O05lp2S5.cjs +2 -0
- package/dist/uniqBy-O05lp2S5.cjs.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +1 -7
- package/dist/XAxesLabels-CaV2q-6H.js.map +0 -1
- package/dist/XAxesLabels-OjBNl_lS.cjs +0 -2
- package/dist/XAxesLabels-OjBNl_lS.cjs.map +0 -1
- package/dist/YAxesLabels-CPGZjmZJ.js.map +0 -1
- package/dist/YAxesLabels-D8IydyZj.cjs +0 -2
- package/dist/YAxesLabels-D8IydyZj.cjs.map +0 -1
- package/dist/ensureCompleteData-BALdOrsS.js.map +0 -1
- package/dist/ensureCompleteData-BU5Zlccy.cjs +0 -2
- package/dist/ensureCompleteData-BU5Zlccy.cjs.map +0 -1
- package/dist/fetchAndParseData-DBOl1Icl.js +0 -1196
- package/dist/fetchAndParseData-DBOl1Icl.js.map +0 -1
- package/dist/fetchAndParseData-Dcy7AS_0.cjs +0 -16
- package/dist/fetchAndParseData-Dcy7AS_0.cjs.map +0 -1
- package/dist/getJenks-DW96UYNE.js +0 -23
- package/dist/getJenks-DW96UYNE.js.map +0 -1
- package/dist/getJenks-vofIZmeb.cjs +0 -2
- package/dist/getJenks-vofIZmeb.cjs.map +0 -1
- package/dist/getSliderMarks-C0jptXeP.js +0 -1054
- package/dist/getSliderMarks-C0jptXeP.js.map +0 -1
- package/dist/getSliderMarks-CtsEXiLV.cjs +0 -6
- package/dist/getSliderMarks-CtsEXiLV.cjs.map +0 -1
- package/dist/getUniqValue-CfuE_l9c.cjs +0 -2
- package/dist/getUniqValue-CfuE_l9c.cjs.map +0 -1
- package/dist/getUniqValue-CttuU_wn.js +0 -20
- package/dist/getUniqValue-CttuU_wn.js.map +0 -1
- package/dist/index-AqnpA7_O.js +0 -631
- package/dist/index-AqnpA7_O.js.map +0 -1
- package/dist/index-BJOeaYTk.cjs +0 -2
- package/dist/index-BJOeaYTk.cjs.map +0 -1
- package/dist/index-BMgDMxKJ.js.map +0 -1
- package/dist/index-DYH8g9WA.cjs +0 -2
- package/dist/index-DYH8g9WA.cjs.map +0 -1
- package/dist/index-Da2GUKrr.cjs +0 -2
- package/dist/index-Da2GUKrr.cjs.map +0 -1
- package/dist/index-fwdktvAS.js +0 -707
- package/dist/index-fwdktvAS.js.map +0 -1
- package/dist/transformDataForAggregation-BVxVu4yY.cjs +0 -2
package/dist/SankeyChart.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { j as h, m as rt } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { s as Nt } from "./index-CeVNqhMO.js";
|
|
2
|
+
import { useRef as vt, useState as Z, useEffect as Mt } from "react";
|
|
3
|
+
import { s as _t } from "./index-CeVNqhMO.js";
|
|
4
|
+
import { o as Nt } from "./index-DvVprvy6.js";
|
|
6
5
|
import { i as Ht } from "./index-Bwrro8-q.js";
|
|
7
6
|
import { X as Wt } from "./Modal-DVVwpKhP.js";
|
|
8
|
-
import { u as
|
|
7
|
+
import { u as ct } from "./Typography-Ctgfl1J5.js";
|
|
9
8
|
import { n as St } from "./numberFormattingFunction-14YCbkN2.js";
|
|
10
9
|
import { T as Rt } from "./Tooltip-CVCGWyzw.js";
|
|
11
10
|
import { s as Gt } from "./string2HTML-oFCROsus.js";
|
|
12
11
|
import { u as qt } from "./use-in-view-yS6jzJAp.js";
|
|
13
|
-
import { m as
|
|
12
|
+
import { m as dt } from "./proxy-CkpFesk1.js";
|
|
14
13
|
import { A as Xt } from "./index-CNvov0eg.js";
|
|
15
14
|
import { GraphHeader as Ft } from "./GraphHeader.js";
|
|
16
15
|
import { GraphFooter as Yt } from "./GraphFooter.js";
|
|
17
16
|
import { Colors as Tt } from "./Colors.js";
|
|
18
17
|
import { g as Ut } from "./generateRandomString-za3IQGfQ.js";
|
|
19
18
|
import { E as Zt } from "./EmptyState-DdTp-Mdn.js";
|
|
19
|
+
import { u as ot } from "./uniqBy-BHy4I8PK.js";
|
|
20
20
|
function Ct(e, n) {
|
|
21
21
|
let i;
|
|
22
22
|
if (n === void 0)
|
|
@@ -41,7 +41,7 @@ function Bt(e, n) {
|
|
|
41
41
|
}
|
|
42
42
|
return i;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function pt(e, n) {
|
|
45
45
|
let i = 0;
|
|
46
46
|
if (n === void 0)
|
|
47
47
|
for (let a of e)
|
|
@@ -59,24 +59,24 @@ function Qt(e) {
|
|
|
59
59
|
function Jt(e, n) {
|
|
60
60
|
return e.sourceLinks.length ? e.depth : n - 1;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function mt(e) {
|
|
63
63
|
return e.targetLinks.length ? e.depth : e.sourceLinks.length ? Bt(e.sourceLinks, Qt) - 1 : 0;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function ft(e) {
|
|
66
66
|
return function() {
|
|
67
67
|
return e;
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
function Ot(e, n) {
|
|
71
|
-
return
|
|
71
|
+
return ht(e.source, n.source) || e.index - n.index;
|
|
72
72
|
}
|
|
73
73
|
function Dt(e, n) {
|
|
74
|
-
return
|
|
74
|
+
return ht(e.target, n.target) || e.index - n.index;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ht(e, n) {
|
|
77
77
|
return e.y0 - n.y0;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function yt(e) {
|
|
80
80
|
return e.value;
|
|
81
81
|
}
|
|
82
82
|
function Kt(e) {
|
|
@@ -102,38 +102,38 @@ function zt({ nodes: e }) {
|
|
|
102
102
|
l.y1 = a + l.width / 2, a += l.width;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
let e = 0, n = 0, i = 1, a = 1, l = 24, y = 8, g, p = Kt,
|
|
105
|
+
function xt() {
|
|
106
|
+
let e = 0, n = 0, i = 1, a = 1, l = 24, y = 8, g, p = Kt, x = Jt, k, v, w = te, b = ee, S = 6;
|
|
107
107
|
function d() {
|
|
108
|
-
const t = { nodes:
|
|
109
|
-
return
|
|
108
|
+
const t = { nodes: w.apply(null, arguments), links: b.apply(null, arguments) };
|
|
109
|
+
return T(t), L(t), z(t), X(t), W(t), zt(t), t;
|
|
110
110
|
}
|
|
111
111
|
d.update = function(t) {
|
|
112
112
|
return zt(t), t;
|
|
113
113
|
}, d.nodeId = function(t) {
|
|
114
|
-
return arguments.length ? (p = typeof t == "function" ? t :
|
|
114
|
+
return arguments.length ? (p = typeof t == "function" ? t : ft(t), d) : p;
|
|
115
115
|
}, d.nodeAlign = function(t) {
|
|
116
|
-
return arguments.length ? (
|
|
116
|
+
return arguments.length ? (x = typeof t == "function" ? t : ft(t), d) : x;
|
|
117
117
|
}, d.nodeSort = function(t) {
|
|
118
|
-
return arguments.length ? (
|
|
118
|
+
return arguments.length ? (k = t, d) : k;
|
|
119
119
|
}, d.nodeWidth = function(t) {
|
|
120
120
|
return arguments.length ? (l = +t, d) : l;
|
|
121
121
|
}, d.nodePadding = function(t) {
|
|
122
122
|
return arguments.length ? (y = g = +t, d) : y;
|
|
123
123
|
}, d.nodes = function(t) {
|
|
124
|
-
return arguments.length ? (
|
|
124
|
+
return arguments.length ? (w = typeof t == "function" ? t : ft(t), d) : w;
|
|
125
125
|
}, d.links = function(t) {
|
|
126
|
-
return arguments.length ? (
|
|
126
|
+
return arguments.length ? (b = typeof t == "function" ? t : ft(t), d) : b;
|
|
127
127
|
}, d.linkSort = function(t) {
|
|
128
|
-
return arguments.length ? (
|
|
128
|
+
return arguments.length ? (v = t, d) : v;
|
|
129
129
|
}, d.size = function(t) {
|
|
130
130
|
return arguments.length ? (e = n = 0, i = +t[0], a = +t[1], d) : [i - e, a - n];
|
|
131
131
|
}, d.extent = function(t) {
|
|
132
132
|
return arguments.length ? (e = +t[0][0], i = +t[1][0], n = +t[0][1], a = +t[1][1], d) : [[e, n], [i, a]];
|
|
133
133
|
}, d.iterations = function(t) {
|
|
134
|
-
return arguments.length ? (
|
|
134
|
+
return arguments.length ? (S = +t, d) : S;
|
|
135
135
|
};
|
|
136
|
-
function
|
|
136
|
+
function T({ nodes: t, links: u }) {
|
|
137
137
|
for (const [c, r] of t.entries())
|
|
138
138
|
r.index = c, r.sourceLinks = [], r.targetLinks = [];
|
|
139
139
|
const s = new Map(t.map((c, r) => [p(c, r, t), c]));
|
|
@@ -142,13 +142,13 @@ function kt() {
|
|
|
142
142
|
let { source: f, target: m } = r;
|
|
143
143
|
typeof f != "object" && (f = r.source = Vt(s, f)), typeof m != "object" && (m = r.target = Vt(s, m)), f.sourceLinks.push(r), m.targetLinks.push(r);
|
|
144
144
|
}
|
|
145
|
-
if (
|
|
145
|
+
if (v != null)
|
|
146
146
|
for (const { sourceLinks: c, targetLinks: r } of t)
|
|
147
|
-
c.sort(
|
|
147
|
+
c.sort(v), r.sort(v);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function L({ nodes: t }) {
|
|
150
150
|
for (const u of t)
|
|
151
|
-
u.value = u.fixedValue === void 0 ? Math.max(
|
|
151
|
+
u.value = u.fixedValue === void 0 ? Math.max(pt(u.sourceLinks, yt), pt(u.targetLinks, yt)) : u.fixedValue;
|
|
152
152
|
}
|
|
153
153
|
function z({ nodes: t }) {
|
|
154
154
|
const u = t.length;
|
|
@@ -179,15 +179,15 @@ function kt() {
|
|
|
179
179
|
function P({ nodes: t }) {
|
|
180
180
|
const u = Ct(t, (r) => r.depth) + 1, s = (i - e - l) / (u - 1), c = new Array(u);
|
|
181
181
|
for (const r of t) {
|
|
182
|
-
const f = Math.max(0, Math.min(u - 1, Math.floor(
|
|
182
|
+
const f = Math.max(0, Math.min(u - 1, Math.floor(x.call(null, r, u))));
|
|
183
183
|
r.layer = f, r.x0 = e + f * s, r.x1 = r.x0 + l, c[f] ? c[f].push(r) : c[f] = [r];
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
186
|
-
r.sort(
|
|
185
|
+
if (k) for (const r of c)
|
|
186
|
+
r.sort(k);
|
|
187
187
|
return c;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
const u = Bt(t, (s) => (a - n - (s.length - 1) * g) /
|
|
189
|
+
function C(t) {
|
|
190
|
+
const u = Bt(t, (s) => (a - n - (s.length - 1) * g) / pt(s, yt));
|
|
191
191
|
for (const s of t) {
|
|
192
192
|
let c = n;
|
|
193
193
|
for (const r of s) {
|
|
@@ -205,9 +205,9 @@ function kt() {
|
|
|
205
205
|
}
|
|
206
206
|
function W(t) {
|
|
207
207
|
const u = P(t);
|
|
208
|
-
g = Math.min(y, (a - n) / (Ct(u, (s) => s.length) - 1)),
|
|
209
|
-
for (let s = 0; s <
|
|
210
|
-
const c = Math.pow(0.99, s), r = Math.max(1 - c, (s + 1) /
|
|
208
|
+
g = Math.min(y, (a - n) / (Ct(u, (s) => s.length) - 1)), C(u);
|
|
209
|
+
for (let s = 0; s < S; ++s) {
|
|
210
|
+
const c = Math.pow(0.99, s), r = Math.max(1 - c, (s + 1) / S);
|
|
211
211
|
et(u, c, r), tt(u, c, r);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
@@ -215,32 +215,32 @@ function kt() {
|
|
|
215
215
|
for (let c = 1, r = t.length; c < r; ++c) {
|
|
216
216
|
const f = t[c];
|
|
217
217
|
for (const m of f) {
|
|
218
|
-
let
|
|
219
|
-
for (const { source: E, value:
|
|
220
|
-
let H =
|
|
221
|
-
|
|
218
|
+
let O = 0, D = 0;
|
|
219
|
+
for (const { source: E, value: _ } of m.targetLinks) {
|
|
220
|
+
let H = _ * (m.layer - E.layer);
|
|
221
|
+
O += Y(E, m) * H, D += H;
|
|
222
222
|
}
|
|
223
|
-
if (!(
|
|
224
|
-
let R = (
|
|
225
|
-
m.y0 += R, m.y1 += R,
|
|
223
|
+
if (!(D > 0)) continue;
|
|
224
|
+
let R = (O / D - m.y0) * u;
|
|
225
|
+
m.y0 += R, m.y1 += R, V(m);
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
k === void 0 && f.sort(ht), B(f, s);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
function et(t, u, s) {
|
|
231
231
|
for (let c = t.length, r = c - 2; r >= 0; --r) {
|
|
232
232
|
const f = t[r];
|
|
233
233
|
for (const m of f) {
|
|
234
|
-
let
|
|
235
|
-
for (const { target: E, value:
|
|
236
|
-
let H =
|
|
237
|
-
|
|
234
|
+
let O = 0, D = 0;
|
|
235
|
+
for (const { target: E, value: _ } of m.sourceLinks) {
|
|
236
|
+
let H = _ * (E.layer - m.layer);
|
|
237
|
+
O += nt(m, E) * H, D += H;
|
|
238
238
|
}
|
|
239
|
-
if (!(
|
|
240
|
-
let R = (
|
|
241
|
-
m.y0 += R, m.y1 += R,
|
|
239
|
+
if (!(D > 0)) continue;
|
|
240
|
+
let R = (O / D - m.y0) * u;
|
|
241
|
+
m.y0 += R, m.y1 += R, V(m);
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
k === void 0 && f.sort(ht), B(f, s);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
function B(t, u) {
|
|
@@ -259,8 +259,8 @@ function kt() {
|
|
|
259
259
|
f > 1e-6 && (r.y0 -= f, r.y1 -= f), u = r.y0 - g;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
if (
|
|
262
|
+
function V({ sourceLinks: t, targetLinks: u }) {
|
|
263
|
+
if (v === void 0) {
|
|
264
264
|
for (const { source: { sourceLinks: s } } of u)
|
|
265
265
|
s.sort(Dt);
|
|
266
266
|
for (const { target: { targetLinks: s } } of t)
|
|
@@ -268,7 +268,7 @@ function kt() {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
function I(t) {
|
|
271
|
-
if (
|
|
271
|
+
if (v === void 0)
|
|
272
272
|
for (const { sourceLinks: u, targetLinks: s } of t)
|
|
273
273
|
u.sort(Dt), s.sort(Ot);
|
|
274
274
|
}
|
|
@@ -298,16 +298,16 @@ function kt() {
|
|
|
298
298
|
}
|
|
299
299
|
return d;
|
|
300
300
|
}
|
|
301
|
-
var
|
|
302
|
-
function
|
|
301
|
+
var kt = Math.PI, wt = 2 * kt, K = 1e-6, ne = wt - K;
|
|
302
|
+
function bt() {
|
|
303
303
|
this._x0 = this._y0 = // start of current subpath
|
|
304
304
|
this._x1 = this._y1 = null, this._ = "";
|
|
305
305
|
}
|
|
306
306
|
function It() {
|
|
307
|
-
return new
|
|
307
|
+
return new bt();
|
|
308
308
|
}
|
|
309
|
-
|
|
310
|
-
constructor:
|
|
309
|
+
bt.prototype = It.prototype = {
|
|
310
|
+
constructor: bt,
|
|
311
311
|
moveTo: function(e, n) {
|
|
312
312
|
this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +n);
|
|
313
313
|
},
|
|
@@ -325,22 +325,22 @@ jt.prototype = It.prototype = {
|
|
|
325
325
|
},
|
|
326
326
|
arcTo: function(e, n, i, a, l) {
|
|
327
327
|
e = +e, n = +n, i = +i, a = +a, l = +l;
|
|
328
|
-
var y = this._x1, g = this._y1, p = i - e,
|
|
328
|
+
var y = this._x1, g = this._y1, p = i - e, x = a - n, k = y - e, v = g - n, w = k * k + v * v;
|
|
329
329
|
if (l < 0) throw new Error("negative radius: " + l);
|
|
330
330
|
if (this._x1 === null)
|
|
331
331
|
this._ += "M" + (this._x1 = e) + "," + (this._y1 = n);
|
|
332
|
-
else if (
|
|
332
|
+
else if (w > K) if (!(Math.abs(v * p - x * k) > K) || !l)
|
|
333
333
|
this._ += "L" + (this._x1 = e) + "," + (this._y1 = n);
|
|
334
334
|
else {
|
|
335
|
-
var
|
|
336
|
-
Math.abs(P - 1) > K && (this._ += "L" + (e + P *
|
|
335
|
+
var b = i - y, S = a - g, d = p * p + x * x, T = b * b + S * S, L = Math.sqrt(d), z = Math.sqrt(w), X = l * Math.tan((kt - Math.acos((d + w - T) / (2 * L * z))) / 2), P = X / z, C = X / L;
|
|
336
|
+
Math.abs(P - 1) > K && (this._ += "L" + (e + P * k) + "," + (n + P * v)), this._ += "A" + l + "," + l + ",0,0," + +(v * b > k * S) + "," + (this._x1 = e + C * p) + "," + (this._y1 = n + C * x);
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
339
|
arc: function(e, n, i, a, l, y) {
|
|
340
340
|
e = +e, n = +n, i = +i, y = !!y;
|
|
341
|
-
var g = i * Math.cos(a), p = i * Math.sin(a),
|
|
341
|
+
var g = i * Math.cos(a), p = i * Math.sin(a), x = e + g, k = n + p, v = 1 ^ y, w = y ? a - l : l - a;
|
|
342
342
|
if (i < 0) throw new Error("negative radius: " + i);
|
|
343
|
-
this._x1 === null ? this._ += "M" +
|
|
343
|
+
this._x1 === null ? this._ += "M" + x + "," + k : (Math.abs(this._x1 - x) > K || Math.abs(this._y1 - k) > K) && (this._ += "L" + x + "," + k), i && (w < 0 && (w = w % wt + wt), w > ne ? this._ += "A" + i + "," + i + ",0,1," + v + "," + (e - g) + "," + (n - p) + "A" + i + "," + i + ",0,1," + v + "," + (this._x1 = x) + "," + (this._y1 = k) : w > K && (this._ += "A" + i + "," + i + ",0," + +(w >= kt) + "," + v + "," + (this._x1 = e + i * Math.cos(l)) + "," + (this._y1 = n + i * Math.sin(l))));
|
|
344
344
|
},
|
|
345
345
|
rect: function(e, n, i, a) {
|
|
346
346
|
this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +n) + "h" + +i + "v" + +a + "h" + -i + "Z";
|
|
@@ -370,8 +370,8 @@ function ae(e) {
|
|
|
370
370
|
function le(e) {
|
|
371
371
|
var n = se, i = ae, a = oe, l = ie, y = null;
|
|
372
372
|
function g() {
|
|
373
|
-
var p,
|
|
374
|
-
if (y || (y = p = It()), e(y, +a.apply(this, (
|
|
373
|
+
var p, x = re.call(arguments), k = n.apply(this, x), v = i.apply(this, x);
|
|
374
|
+
if (y || (y = p = It()), e(y, +a.apply(this, (x[0] = k, x)), +l.apply(this, x), +a.apply(this, (x[0] = v, x)), +l.apply(this, x)), p) return y = null, p + "" || null;
|
|
375
375
|
}
|
|
376
376
|
return g.source = function(p) {
|
|
377
377
|
return arguments.length ? (n = p, g) : n;
|
|
@@ -409,44 +409,44 @@ function de(e) {
|
|
|
409
409
|
truncateBy: y,
|
|
410
410
|
width: g,
|
|
411
411
|
height: p,
|
|
412
|
-
topMargin:
|
|
413
|
-
bottomMargin:
|
|
414
|
-
tooltip:
|
|
415
|
-
onSeriesMouseOver:
|
|
416
|
-
suffix:
|
|
417
|
-
prefix:
|
|
412
|
+
topMargin: x,
|
|
413
|
+
bottomMargin: k,
|
|
414
|
+
tooltip: v,
|
|
415
|
+
onSeriesMouseOver: w,
|
|
416
|
+
suffix: b,
|
|
417
|
+
prefix: S,
|
|
418
418
|
showValues: d,
|
|
419
|
-
onSeriesMouseClick:
|
|
420
|
-
nodePadding:
|
|
419
|
+
onSeriesMouseClick: T,
|
|
420
|
+
nodePadding: L,
|
|
421
421
|
nodeWidth: z,
|
|
422
422
|
id: X,
|
|
423
423
|
highlightedSourceDataPoints: P,
|
|
424
|
-
highlightedTargetDataPoints:
|
|
424
|
+
highlightedTargetDataPoints: C,
|
|
425
425
|
defaultLinkOpacity: W,
|
|
426
426
|
sourceTitle: tt,
|
|
427
427
|
targetTitle: et,
|
|
428
428
|
animate: B,
|
|
429
429
|
sortNodes: F,
|
|
430
430
|
resetSelectionOnDoubleClick: Q,
|
|
431
|
-
detailsOnClick:
|
|
431
|
+
detailsOnClick: V,
|
|
432
432
|
styles: I,
|
|
433
433
|
classNames: Y,
|
|
434
434
|
precision: nt,
|
|
435
435
|
customLayers: t
|
|
436
|
-
} = e, u =
|
|
436
|
+
} = e, u = vt(null), s = qt(u, {
|
|
437
437
|
once: B.once,
|
|
438
438
|
amount: B.amount
|
|
439
|
-
}), [c, r] = Z(void 0), [f, m] = Z(void 0), [
|
|
440
|
-
top:
|
|
441
|
-
bottom:
|
|
439
|
+
}), [c, r] = Z(void 0), [f, m] = Z(void 0), [O, D] = Z(void 0), [R, E] = Z(void 0), [_, H] = Z(void 0), A = {
|
|
440
|
+
top: x,
|
|
441
|
+
bottom: k,
|
|
442
442
|
left: a,
|
|
443
443
|
right: l
|
|
444
|
-
}, G = g - A.left - A.right, q = p - A.top - A.bottom, st = F === "mostReadable" ?
|
|
445
|
-
F === "desc" ? (o,
|
|
444
|
+
}, G = g - A.left - A.right, q = p - A.top - A.bottom, st = F === "mostReadable" ? xt().nodeWidth(z).nodePadding(L).size([G, q]).nodeAlign(mt) : F === "none" ? xt().nodeWidth(z).nodePadding(L).size([G, q]).nodeAlign(mt).nodeSort(() => null).linkSort(() => null) : xt().nodeWidth(z).nodePadding(L).size([G, q]).nodeAlign(mt).nodeSort(
|
|
445
|
+
F === "desc" ? (o, N) => (N.value || 0) - (o.value || 0) : (o, N) => (o.value || 0) - (N.value || 0)
|
|
446
446
|
), { nodes: at, links: lt } = st(n), J = ge();
|
|
447
447
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
448
448
|
/* @__PURE__ */ h.jsxs(
|
|
449
|
-
|
|
449
|
+
dt.svg,
|
|
450
450
|
{
|
|
451
451
|
width: `${g}px`,
|
|
452
452
|
height: `${p}px`,
|
|
@@ -477,14 +477,14 @@ function de(e) {
|
|
|
477
477
|
) : null,
|
|
478
478
|
/* @__PURE__ */ h.jsxs("g", { transform: `translate(${A.left},${A.top})`, children: [
|
|
479
479
|
t.filter((o) => o.position === "before").map((o) => o.layer),
|
|
480
|
-
at.filter((o) => o.type === "source").map((o,
|
|
480
|
+
at.filter((o) => o.type === "source").map((o, N) => /* @__PURE__ */ h.jsx(
|
|
481
481
|
"g",
|
|
482
482
|
{
|
|
483
483
|
onMouseEnter: () => {
|
|
484
|
-
|
|
484
|
+
D(o);
|
|
485
485
|
},
|
|
486
486
|
onMouseLeave: () => {
|
|
487
|
-
|
|
487
|
+
D(void 0);
|
|
488
488
|
},
|
|
489
489
|
children: /* @__PURE__ */ h.jsxs("g", { transform: `translate(${o.x0},${o.y0})`, children: [
|
|
490
490
|
/* @__PURE__ */ h.jsx(
|
|
@@ -500,21 +500,21 @@ function de(e) {
|
|
|
500
500
|
i || d ? /* @__PURE__ */ h.jsx(
|
|
501
501
|
"foreignObject",
|
|
502
502
|
{
|
|
503
|
-
y: 0 -
|
|
503
|
+
y: 0 - L / 2,
|
|
504
504
|
x: 0 - a,
|
|
505
505
|
width: a,
|
|
506
|
-
height: (o.y1 || 0) - (o.y0 || 0) +
|
|
506
|
+
height: (o.y1 || 0) - (o.y0 || 0) + L,
|
|
507
507
|
children: /* @__PURE__ */ h.jsxs(
|
|
508
508
|
"div",
|
|
509
509
|
{
|
|
510
510
|
className: "flex flex-col gap-0.5 justify-center py-0 px-1.5",
|
|
511
511
|
style: {
|
|
512
|
-
height: `${(o.y1 || 0) - (o.y0 || 0) +
|
|
512
|
+
height: `${(o.y1 || 0) - (o.y0 || 0) + L}px`,
|
|
513
513
|
overflow: "visible"
|
|
514
514
|
},
|
|
515
515
|
children: [
|
|
516
516
|
i ? /* @__PURE__ */ h.jsx(
|
|
517
|
-
|
|
517
|
+
ct,
|
|
518
518
|
{
|
|
519
519
|
marginBottom: d ? "3xs" : "none",
|
|
520
520
|
size: "sm",
|
|
@@ -532,7 +532,7 @@ function de(e) {
|
|
|
532
532
|
}
|
|
533
533
|
) : null,
|
|
534
534
|
d ? /* @__PURE__ */ h.jsx(
|
|
535
|
-
|
|
535
|
+
ct,
|
|
536
536
|
{
|
|
537
537
|
marginBottom: "none",
|
|
538
538
|
size: "sm",
|
|
@@ -546,7 +546,7 @@ function de(e) {
|
|
|
546
546
|
color: o.color,
|
|
547
547
|
...I?.graphObjectValues
|
|
548
548
|
},
|
|
549
|
-
children: St(o.value, "NA", nt,
|
|
549
|
+
children: St(o.value, "NA", nt, S, b)
|
|
550
550
|
}
|
|
551
551
|
) : null
|
|
552
552
|
]
|
|
@@ -556,16 +556,16 @@ function de(e) {
|
|
|
556
556
|
) : null
|
|
557
557
|
] })
|
|
558
558
|
},
|
|
559
|
-
|
|
559
|
+
N
|
|
560
560
|
)),
|
|
561
|
-
at.filter((o) => o.type === "target").map((o,
|
|
561
|
+
at.filter((o) => o.type === "target").map((o, N) => /* @__PURE__ */ h.jsx(
|
|
562
562
|
"g",
|
|
563
563
|
{
|
|
564
564
|
onMouseEnter: () => {
|
|
565
|
-
|
|
565
|
+
D(o);
|
|
566
566
|
},
|
|
567
567
|
onMouseLeave: () => {
|
|
568
|
-
|
|
568
|
+
D(void 0);
|
|
569
569
|
},
|
|
570
570
|
children: /* @__PURE__ */ h.jsxs("g", { transform: `translate(${o.x0},${o.y0})`, children: [
|
|
571
571
|
/* @__PURE__ */ h.jsx(
|
|
@@ -581,20 +581,20 @@ function de(e) {
|
|
|
581
581
|
i || d ? /* @__PURE__ */ h.jsx(
|
|
582
582
|
"foreignObject",
|
|
583
583
|
{
|
|
584
|
-
y: 0 -
|
|
584
|
+
y: 0 - L / 2,
|
|
585
585
|
x: z,
|
|
586
586
|
width: l - z,
|
|
587
|
-
height: (o.y1 || 0) - (o.y0 || 0) +
|
|
587
|
+
height: (o.y1 || 0) - (o.y0 || 0) + L,
|
|
588
588
|
children: /* @__PURE__ */ h.jsxs(
|
|
589
589
|
"div",
|
|
590
590
|
{
|
|
591
591
|
className: "flex flex-col gap-0.5 justify-center py-0 px-1.5",
|
|
592
592
|
style: {
|
|
593
|
-
height: `${(o.y1 || 0) - (o.y0 || 0) +
|
|
593
|
+
height: `${(o.y1 || 0) - (o.y0 || 0) + L}px`
|
|
594
594
|
},
|
|
595
595
|
children: [
|
|
596
596
|
i ? /* @__PURE__ */ h.jsx(
|
|
597
|
-
|
|
597
|
+
ct,
|
|
598
598
|
{
|
|
599
599
|
marginBottom: d ? "3xs" : "none",
|
|
600
600
|
size: "sm",
|
|
@@ -612,7 +612,7 @@ function de(e) {
|
|
|
612
612
|
}
|
|
613
613
|
) : null,
|
|
614
614
|
d ? /* @__PURE__ */ h.jsx(
|
|
615
|
-
|
|
615
|
+
ct,
|
|
616
616
|
{
|
|
617
617
|
size: "sm",
|
|
618
618
|
leading: "none",
|
|
@@ -626,7 +626,7 @@ function de(e) {
|
|
|
626
626
|
color: o.color,
|
|
627
627
|
...I?.graphObjectValues
|
|
628
628
|
},
|
|
629
|
-
children: St(o.value, "NA", nt,
|
|
629
|
+
children: St(o.value, "NA", nt, S, b)
|
|
630
630
|
}
|
|
631
631
|
) : null
|
|
632
632
|
]
|
|
@@ -636,12 +636,12 @@ function de(e) {
|
|
|
636
636
|
) : null
|
|
637
637
|
] })
|
|
638
638
|
},
|
|
639
|
-
|
|
639
|
+
N
|
|
640
640
|
)),
|
|
641
|
-
/* @__PURE__ */ h.jsx("defs", { children: lt.map((o,
|
|
641
|
+
/* @__PURE__ */ h.jsx("defs", { children: lt.map((o, N) => /* @__PURE__ */ h.jsxs(
|
|
642
642
|
"linearGradient",
|
|
643
643
|
{
|
|
644
|
-
id: `${X}-gradient-${
|
|
644
|
+
id: `${X}-gradient-${N}`,
|
|
645
645
|
x1: "0%",
|
|
646
646
|
y1: "0%",
|
|
647
647
|
x2: "100%",
|
|
@@ -670,48 +670,48 @@ function de(e) {
|
|
|
670
670
|
)
|
|
671
671
|
]
|
|
672
672
|
},
|
|
673
|
-
|
|
673
|
+
N
|
|
674
674
|
)) }),
|
|
675
|
-
/* @__PURE__ */ h.jsx("g", { children: /* @__PURE__ */ h.jsx(Xt, { children: lt.map((o,
|
|
676
|
-
|
|
675
|
+
/* @__PURE__ */ h.jsx("g", { children: /* @__PURE__ */ h.jsx(Xt, { children: lt.map((o, N) => /* @__PURE__ */ h.jsx(
|
|
676
|
+
dt.g,
|
|
677
677
|
{
|
|
678
678
|
className: "undp-viz-g-with-hover",
|
|
679
679
|
onMouseEnter: (U) => {
|
|
680
|
-
r(o.data), H(U.clientY), E(U.clientX),
|
|
680
|
+
r(o.data), H(U.clientY), E(U.clientX), w?.(o);
|
|
681
681
|
},
|
|
682
682
|
onMouseMove: (U) => {
|
|
683
683
|
r(o.data), H(U.clientY), E(U.clientX);
|
|
684
684
|
},
|
|
685
685
|
onClick: () => {
|
|
686
|
-
(
|
|
687
|
-
Ht(f, o.data) && Q ? (m(void 0),
|
|
686
|
+
(T || V) && (// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
687
|
+
Ht(f, o.data) && Q ? (m(void 0), T?.(void 0)) : (m(o.data), T?.(o.data)));
|
|
688
688
|
},
|
|
689
689
|
onMouseLeave: () => {
|
|
690
|
-
r(void 0), E(void 0), H(void 0),
|
|
690
|
+
r(void 0), E(void 0), H(void 0), w?.(void 0);
|
|
691
691
|
},
|
|
692
692
|
variants: {
|
|
693
693
|
initial: {
|
|
694
|
-
opacity:
|
|
694
|
+
opacity: O ? (
|
|
695
695
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
696
|
-
o.source.name ===
|
|
697
|
-
o.target.name ===
|
|
698
|
-
) : (P.length !== 0 ||
|
|
696
|
+
o.source.name === O.name || // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
697
|
+
o.target.name === O.name ? 0.85 : W
|
|
698
|
+
) : (P.length !== 0 || C.length !== 0) && (P.indexOf(
|
|
699
699
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
700
700
|
o.source.label
|
|
701
|
-
) !== -1 ||
|
|
701
|
+
) !== -1 || C.indexOf(
|
|
702
702
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
703
703
|
o.target.label
|
|
704
704
|
) !== -1) ? 0.85 : W
|
|
705
705
|
},
|
|
706
706
|
whileInView: {
|
|
707
|
-
opacity:
|
|
707
|
+
opacity: O ? (
|
|
708
708
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
709
|
-
o.source.name ===
|
|
710
|
-
o.target.name ===
|
|
711
|
-
) : (P.length !== 0 ||
|
|
709
|
+
o.source.name === O.name || // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
710
|
+
o.target.name === O.name ? 0.85 : W
|
|
711
|
+
) : (P.length !== 0 || C.length !== 0) && (P.indexOf(
|
|
712
712
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
713
713
|
o.source.label
|
|
714
|
-
) !== -1 ||
|
|
714
|
+
) !== -1 || C.indexOf(
|
|
715
715
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
716
716
|
o.target.label
|
|
717
717
|
) !== -1) ? 0.85 : W,
|
|
@@ -722,11 +722,11 @@ function de(e) {
|
|
|
722
722
|
animate: s ? "whileInView" : "initial",
|
|
723
723
|
exit: { opacity: 0, transition: { duration: B.duration } },
|
|
724
724
|
children: /* @__PURE__ */ h.jsx(
|
|
725
|
-
|
|
725
|
+
dt.path,
|
|
726
726
|
{
|
|
727
727
|
d: J(o) || "",
|
|
728
728
|
style: {
|
|
729
|
-
stroke: `url(#${X}-gradient-${
|
|
729
|
+
stroke: `url(#${X}-gradient-${N})`,
|
|
730
730
|
strokeWidth: o.width,
|
|
731
731
|
fill: "none"
|
|
732
732
|
},
|
|
@@ -755,18 +755,18 @@ function de(e) {
|
|
|
755
755
|
]
|
|
756
756
|
}
|
|
757
757
|
),
|
|
758
|
-
c &&
|
|
758
|
+
c && v && R && _ ? /* @__PURE__ */ h.jsx(
|
|
759
759
|
Rt,
|
|
760
760
|
{
|
|
761
761
|
data: c,
|
|
762
|
-
body:
|
|
762
|
+
body: v,
|
|
763
763
|
xPos: R,
|
|
764
|
-
yPos:
|
|
764
|
+
yPos: _,
|
|
765
765
|
backgroundStyle: I?.tooltip,
|
|
766
766
|
className: Y?.tooltip
|
|
767
767
|
}
|
|
768
768
|
) : null,
|
|
769
|
-
|
|
769
|
+
V && f !== void 0 ? /* @__PURE__ */ h.jsx(
|
|
770
770
|
Wt,
|
|
771
771
|
{
|
|
772
772
|
open: f !== void 0,
|
|
@@ -777,8 +777,8 @@ function de(e) {
|
|
|
777
777
|
"div",
|
|
778
778
|
{
|
|
779
779
|
className: "graph-modal-content m-0",
|
|
780
|
-
dangerouslySetInnerHTML: typeof
|
|
781
|
-
children: typeof
|
|
780
|
+
dangerouslySetInnerHTML: typeof V == "string" ? { __html: Gt(V, f) } : void 0,
|
|
781
|
+
children: typeof V == "function" ? V(f) : null
|
|
782
782
|
}
|
|
783
783
|
)
|
|
784
784
|
}
|
|
@@ -794,26 +794,26 @@ function Ve(e) {
|
|
|
794
794
|
showLabels: y = !0,
|
|
795
795
|
leftMargin: g = 75,
|
|
796
796
|
rightMargin: p = 75,
|
|
797
|
-
topMargin:
|
|
798
|
-
bottomMargin:
|
|
799
|
-
truncateBy:
|
|
800
|
-
height:
|
|
801
|
-
width:
|
|
802
|
-
footNote:
|
|
797
|
+
topMargin: x = 30,
|
|
798
|
+
bottomMargin: k = 10,
|
|
799
|
+
truncateBy: v = 999,
|
|
800
|
+
height: w,
|
|
801
|
+
width: b,
|
|
802
|
+
footNote: S,
|
|
803
803
|
padding: d,
|
|
804
|
-
backgroundColor:
|
|
805
|
-
tooltip:
|
|
804
|
+
backgroundColor: T,
|
|
805
|
+
tooltip: L,
|
|
806
806
|
onSeriesMouseOver: z,
|
|
807
807
|
suffix: X = "",
|
|
808
808
|
prefix: P = "",
|
|
809
|
-
relativeHeight:
|
|
809
|
+
relativeHeight: C,
|
|
810
810
|
showValues: W = !0,
|
|
811
811
|
graphID: tt,
|
|
812
812
|
onSeriesMouseClick: et,
|
|
813
813
|
graphDownload: B = !1,
|
|
814
814
|
dataDownload: F = !1,
|
|
815
815
|
fillContainer: Q = !0,
|
|
816
|
-
language:
|
|
816
|
+
language: V = "en",
|
|
817
817
|
minHeight: I = 0,
|
|
818
818
|
theme: Y = "light",
|
|
819
819
|
ariaLabel: nt,
|
|
@@ -824,11 +824,11 @@ function Ve(e) {
|
|
|
824
824
|
nodePadding: r = 5,
|
|
825
825
|
nodeWidth: f = 5,
|
|
826
826
|
highlightedSourceDataPoints: m = [],
|
|
827
|
-
highlightedTargetDataPoints:
|
|
828
|
-
defaultLinkOpacity:
|
|
827
|
+
highlightedTargetDataPoints: O = [],
|
|
828
|
+
defaultLinkOpacity: D = 0.3,
|
|
829
829
|
sourceTitle: R,
|
|
830
830
|
targetTitle: E,
|
|
831
|
-
sortNodes:
|
|
831
|
+
sortNodes: _ = "mostReadable",
|
|
832
832
|
resetSelectionOnDoubleClick: H = !0,
|
|
833
833
|
detailsOnClick: A,
|
|
834
834
|
styles: G,
|
|
@@ -836,68 +836,68 @@ function Ve(e) {
|
|
|
836
836
|
animate: st = !1,
|
|
837
837
|
precision: at = 2,
|
|
838
838
|
customLayers: lt = []
|
|
839
|
-
} = e, [J, o] = Z(0), [
|
|
840
|
-
return
|
|
841
|
-
const
|
|
842
|
-
name: `source_${
|
|
839
|
+
} = e, [J, o] = Z(0), [N, U] = Z(0), [jt, At] = Z(void 0), it = vt(null), $t = vt(null);
|
|
840
|
+
return Mt(() => {
|
|
841
|
+
const j = ot(n, "source", !0).map((M) => ({
|
|
842
|
+
name: `source_${M}`,
|
|
843
843
|
type: "source",
|
|
844
|
-
label: `${
|
|
845
|
-
color: typeof t == "string" || !t ? t || Tt.graphMainColor : t[(s || ot(n, "source"
|
|
846
|
-
(
|
|
847
|
-
) > t.length ? t.length - 1 : (s || ot(n, "source"
|
|
848
|
-
(
|
|
844
|
+
label: `${M}`,
|
|
845
|
+
color: typeof t == "string" || !t ? t || Tt.graphMainColor : t[(s || ot(n, "source", !0)).findIndex(
|
|
846
|
+
($) => `${$}` == `${M}`
|
|
847
|
+
) > t.length ? t.length - 1 : (s || ot(n, "source", !0)).findIndex(
|
|
848
|
+
($) => `${$}` == `${M}`
|
|
849
849
|
)],
|
|
850
|
-
totalValue:
|
|
851
|
-
})), ut =
|
|
852
|
-
name: `target_${
|
|
850
|
+
totalValue: _t(n.filter(($) => `${$.source}` == `${M}`).map(($) => $.value))
|
|
851
|
+
})), ut = _ === "asc" || _ === "desc" ? Nt(j, ["totalValue"], [_]) : j, Lt = ot(n, "target", !0).map((M) => ({
|
|
852
|
+
name: `target_${M}`,
|
|
853
853
|
type: "target",
|
|
854
|
-
label: `${
|
|
855
|
-
color: typeof u == "string" || !u ? u || Tt.graphMainColor : u[(c || ot(n, "target"
|
|
856
|
-
(
|
|
857
|
-
) > u.length ? u.length - 1 : (c || ot(n, "target"
|
|
858
|
-
(
|
|
854
|
+
label: `${M}`,
|
|
855
|
+
color: typeof u == "string" || !u ? u || Tt.graphMainColor : u[(c || ot(n, "target", !0)).findIndex(
|
|
856
|
+
($) => `${$}` == `${M}`
|
|
857
|
+
) > u.length ? u.length - 1 : (c || ot(n, "target", !0)).findIndex(
|
|
858
|
+
($) => `${$}` == `${M}`
|
|
859
859
|
)],
|
|
860
|
-
totalValue:
|
|
861
|
-
})), Et =
|
|
860
|
+
totalValue: _t(n.filter(($) => `${$.target}` == `${M}`).map(($) => $.value))
|
|
861
|
+
})), Et = _ === "asc" || _ === "desc" ? Nt(Lt, ["totalValue"], [_]) : Lt, gt = [...ut, ...Et];
|
|
862
862
|
At({
|
|
863
|
-
nodes:
|
|
864
|
-
links: n.map((
|
|
865
|
-
source:
|
|
866
|
-
target:
|
|
867
|
-
value:
|
|
868
|
-
data: { ...
|
|
863
|
+
nodes: gt,
|
|
864
|
+
links: n.map((M) => ({
|
|
865
|
+
source: gt.findIndex(($) => $.name === `source_${M.source}`),
|
|
866
|
+
target: gt.findIndex(($) => $.name === `target_${M.target}`),
|
|
867
|
+
value: M.value,
|
|
868
|
+
data: { ...M }
|
|
869
869
|
}))
|
|
870
870
|
});
|
|
871
|
-
}, [n,
|
|
872
|
-
const
|
|
873
|
-
o(
|
|
871
|
+
}, [n, _, s, t, c, u]), Mt(() => {
|
|
872
|
+
const j = new ResizeObserver((ut) => {
|
|
873
|
+
o(b || ut[0].target.clientWidth || 620), U(w || ut[0].target.clientHeight || 480);
|
|
874
874
|
});
|
|
875
|
-
return it.current && (U(it.current.clientHeight || 480), o(it.current.clientWidth || 620),
|
|
876
|
-
}, [
|
|
875
|
+
return it.current && (U(it.current.clientHeight || 480), o(it.current.clientWidth || 620), b || j.observe(it.current)), () => j.disconnect();
|
|
876
|
+
}, [b, w]), /* @__PURE__ */ h.jsx(
|
|
877
877
|
"div",
|
|
878
878
|
{
|
|
879
|
-
className: `${Y || "light"} flex ${
|
|
880
|
-
dir:
|
|
879
|
+
className: `${Y || "light"} flex ${b ? "grow-0" : "grow"} ${Q ? "w-full" : "w-fit"} `,
|
|
880
|
+
dir: V === "he" || V === "ar" ? "rtl" : void 0,
|
|
881
881
|
children: /* @__PURE__ */ h.jsx(
|
|
882
882
|
"div",
|
|
883
883
|
{
|
|
884
884
|
className: rt(
|
|
885
|
-
`${
|
|
885
|
+
`${T ? T === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${V || "en"}`,
|
|
886
886
|
Q ? "w-full" : "w-fit",
|
|
887
887
|
q?.graphContainer
|
|
888
888
|
),
|
|
889
889
|
style: {
|
|
890
890
|
...G?.graphContainer || {},
|
|
891
|
-
...
|
|
891
|
+
...T && T !== !0 ? { backgroundColor: T } : {}
|
|
892
892
|
},
|
|
893
893
|
id: tt,
|
|
894
|
-
ref:
|
|
894
|
+
ref: $t,
|
|
895
895
|
"aria-label": nt || `${i ? `The graph shows ${i}. ` : ""}This is a sankey chart showing flow. ${l ? ` ${l}` : ""}`,
|
|
896
896
|
children: /* @__PURE__ */ h.jsx(
|
|
897
897
|
"div",
|
|
898
898
|
{
|
|
899
899
|
className: "flex grow",
|
|
900
|
-
style: { padding:
|
|
900
|
+
style: { padding: T ? d || "1rem" : d || 0 },
|
|
901
901
|
children: /* @__PURE__ */ h.jsxs("div", { className: "flex flex-col gap-4 w-full grow justify-between", children: [
|
|
902
902
|
i || l || B || F ? /* @__PURE__ */ h.jsx(
|
|
903
903
|
Ft,
|
|
@@ -912,9 +912,9 @@ function Ve(e) {
|
|
|
912
912
|
},
|
|
913
913
|
graphTitle: i,
|
|
914
914
|
graphDescription: l,
|
|
915
|
-
width:
|
|
916
|
-
graphDownload: B ?
|
|
917
|
-
dataDownload: F ? n.map((
|
|
915
|
+
width: b,
|
|
916
|
+
graphDownload: B ? $t.current : void 0,
|
|
917
|
+
dataDownload: F ? n.map((j) => j.data).filter((j) => j !== void 0).length > 0 ? n.map((j) => j.data).filter((j) => j !== void 0) : n.filter((j) => j !== void 0) : null
|
|
918
918
|
}
|
|
919
919
|
) : null,
|
|
920
920
|
/* @__PURE__ */ h.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: n.length === 0 ? /* @__PURE__ */ h.jsx(Zt, {}) : /* @__PURE__ */ h.jsx(
|
|
@@ -923,36 +923,36 @@ function Ve(e) {
|
|
|
923
923
|
className: "flex flex-col grow justify-center gap-3 w-full leading-0",
|
|
924
924
|
ref: it,
|
|
925
925
|
"aria-label": "Graph area",
|
|
926
|
-
children: (
|
|
926
|
+
children: (b || J) && (w || N) && jt ? /* @__PURE__ */ h.jsx(
|
|
927
927
|
de,
|
|
928
928
|
{
|
|
929
|
-
data:
|
|
930
|
-
width:
|
|
929
|
+
data: jt,
|
|
930
|
+
width: b || J,
|
|
931
931
|
nodePadding: r,
|
|
932
932
|
nodeWidth: f,
|
|
933
933
|
height: Math.max(
|
|
934
934
|
I,
|
|
935
|
-
|
|
935
|
+
w || (C ? I ? (b || J) * C > I ? (b || J) * C : I : (b || J) * C : N)
|
|
936
936
|
),
|
|
937
937
|
showLabels: y,
|
|
938
938
|
leftMargin: g,
|
|
939
939
|
rightMargin: p,
|
|
940
|
-
topMargin:
|
|
941
|
-
bottomMargin:
|
|
942
|
-
truncateBy:
|
|
943
|
-
tooltip:
|
|
940
|
+
topMargin: x,
|
|
941
|
+
bottomMargin: k,
|
|
942
|
+
truncateBy: v,
|
|
943
|
+
tooltip: L,
|
|
944
944
|
onSeriesMouseOver: z,
|
|
945
945
|
showValues: W,
|
|
946
946
|
suffix: X,
|
|
947
947
|
prefix: P,
|
|
948
948
|
onSeriesMouseClick: et,
|
|
949
949
|
id: Ut(8),
|
|
950
|
-
highlightedSourceDataPoints: m.map((
|
|
951
|
-
highlightedTargetDataPoints:
|
|
952
|
-
defaultLinkOpacity:
|
|
950
|
+
highlightedSourceDataPoints: m.map((j) => `${j}`),
|
|
951
|
+
highlightedTargetDataPoints: O.map((j) => `${j}`),
|
|
952
|
+
defaultLinkOpacity: D,
|
|
953
953
|
sourceTitle: R,
|
|
954
954
|
targetTitle: E,
|
|
955
|
-
sortNodes:
|
|
955
|
+
sortNodes: _,
|
|
956
956
|
resetSelectionOnDoubleClick: H,
|
|
957
957
|
styles: G,
|
|
958
958
|
classNames: q,
|
|
@@ -964,7 +964,7 @@ function Ve(e) {
|
|
|
964
964
|
) : null
|
|
965
965
|
}
|
|
966
966
|
) }),
|
|
967
|
-
a ||
|
|
967
|
+
a || S ? /* @__PURE__ */ h.jsx(
|
|
968
968
|
Yt,
|
|
969
969
|
{
|
|
970
970
|
styles: { footnote: G?.footnote, source: G?.source },
|
|
@@ -973,8 +973,8 @@ function Ve(e) {
|
|
|
973
973
|
source: q?.source
|
|
974
974
|
},
|
|
975
975
|
sources: a,
|
|
976
|
-
footNote:
|
|
977
|
-
width:
|
|
976
|
+
footNote: S,
|
|
977
|
+
width: b
|
|
978
978
|
}
|
|
979
979
|
) : null
|
|
980
980
|
] })
|