@undp/data-viz 1.5.5 → 1.5.7
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/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.js +2 -2
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +0 -2
- package/dist/ChoroplethMap.js +2 -2
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.js +2 -2
- package/dist/GraphEl-C6yjl1VM.cjs +2 -0
- package/dist/GraphEl-C6yjl1VM.cjs.map +1 -0
- package/dist/{GraphEl-CMWeARJ3.js → GraphEl-CqWzvOyr.js} +1 -2
- package/dist/GraphEl-CqWzvOyr.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -1
- package/dist/ScrollStory.d.ts +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -2
- package/dist/ThreeDGlobe.js +276 -280
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/Types.d.ts +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js +70 -0
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -0
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs +2 -0
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -0
- package/dist/index-9tDEUqOZ.js +752 -0
- package/dist/{index-qfWCwobm.js.map → index-9tDEUqOZ.js.map} +1 -1
- package/dist/index-CoZbeNM9.cjs +2 -0
- package/dist/{index-D05lK1Te.cjs.map → index-CoZbeNM9.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.js +34 -32
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +8 -0
- package/dist/utils.js +16 -14
- package/dist/utils.js.map +1 -1
- package/dist/{zoom-Bsbhil-K.cjs → zoom-BiMNsz72.cjs} +2 -2
- package/dist/{zoom-Bsbhil-K.cjs.map → zoom-BiMNsz72.cjs.map} +1 -1
- package/dist/{zoom-DAu91HKr.js → zoom-QipiAl5W.js} +2 -2
- package/dist/{zoom-DAu91HKr.js.map → zoom-QipiAl5W.js.map} +1 -1
- package/package.json +2 -1
- package/dist/GraphEl-BcYgMnN2.cjs +0 -2
- package/dist/GraphEl-BcYgMnN2.cjs.map +0 -1
- package/dist/GraphEl-CMWeARJ3.js.map +0 -1
- package/dist/index-D05lK1Te.cjs +0 -2
- package/dist/index-qfWCwobm.js +0 -682
package/dist/ThreeDGlobe.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { j as r, m as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { y as
|
|
4
|
-
import
|
|
5
|
-
import { i as
|
|
6
|
-
import * as
|
|
7
|
-
import { X as
|
|
1
|
+
import { j as r, m as xe } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
+
import { useState as N, useRef as ge, useEffect as D, useCallback as me } from "react";
|
|
3
|
+
import { y as ve } from "./Spinner-C85UF28E.js";
|
|
4
|
+
import we from "react-globe.gl";
|
|
5
|
+
import { i as be } from "./index-Bwrro8-q.js";
|
|
6
|
+
import * as P from "three";
|
|
7
|
+
import { X as Ce } from "./Modal-DVVwpKhP.js";
|
|
8
8
|
import { u as ue } from "./Typography-Ctgfl1J5.js";
|
|
9
|
-
import { t as Ce } from "./index-qfWCwobm.js";
|
|
10
9
|
import { T as je } from "./Tooltip-CVCGWyzw.js";
|
|
11
10
|
import { n as ke } from "./numberFormattingFunction-14YCbkN2.js";
|
|
12
11
|
import { X as Se } from "./index-BmCqpO1B.js";
|
|
13
12
|
import { s as De } from "./string2HTML-oFCROsus.js";
|
|
14
|
-
import {
|
|
13
|
+
import { g as Ne } from "./getCentroidCoordinates-Dfk6IqEG.js";
|
|
14
|
+
import { o as Le } from "./ordinal-w9Lu4Stb.js";
|
|
15
15
|
import { t as Me } from "./threshold-DFfqcDMa.js";
|
|
16
|
-
import { GraphHeader as
|
|
17
|
-
import { GraphFooter as
|
|
18
|
-
import { f as
|
|
16
|
+
import { GraphHeader as ze } from "./GraphHeader.js";
|
|
17
|
+
import { GraphFooter as Oe } from "./GraphFooter.js";
|
|
18
|
+
import { f as Pe } from "./fetchAndParseData-sapWbnYk.js";
|
|
19
19
|
import { Colors as A } from "./Colors.js";
|
|
20
20
|
import { g as Re } from "./getUniqValue-DiCh_MOD.js";
|
|
21
|
-
import { g as
|
|
22
|
-
function
|
|
21
|
+
import { g as Te } from "./getJenks-BbngDoBQ.js";
|
|
22
|
+
function Ee(e) {
|
|
23
23
|
let a;
|
|
24
24
|
switch (e.type) {
|
|
25
25
|
case "ambient":
|
|
26
|
-
a = new
|
|
26
|
+
a = new P.AmbientLight(e.color, e.intensity);
|
|
27
27
|
break;
|
|
28
28
|
case "directional":
|
|
29
|
-
a = new
|
|
29
|
+
a = new P.DirectionalLight(e.color, e.intensity), e.position && (e.position === "camera" ? a.position.set(0, 0, 0) : a.position.set(e.position.x, e.position.y, e.position.z)), (e.target || e.position === "camera") && a.target.position.set(
|
|
30
30
|
e.target?.x || 0,
|
|
31
31
|
e.target?.y || 0,
|
|
32
32
|
e.target?.z === void 0 ? -1 : e.target.z
|
|
33
33
|
), e.castShadow && (a.castShadow = !0, e.shadow && (a.shadow.mapSize.width = e.shadow.mapSize.width, a.shadow.mapSize.height = e.shadow.mapSize.height, a.shadow.camera.near = e.shadow.camera.near, a.shadow.camera.far = e.shadow.camera.far));
|
|
34
34
|
break;
|
|
35
35
|
case "point":
|
|
36
|
-
a = new
|
|
36
|
+
a = new P.PointLight(
|
|
37
37
|
e.color,
|
|
38
38
|
e.intensity,
|
|
39
39
|
e.distance || 0,
|
|
@@ -41,7 +41,7 @@ function Te(e) {
|
|
|
41
41
|
), e.position && (e.position === "camera" ? a.position.set(0, 0, 0) : a.position.set(e.position.x, e.position.y, e.position.z));
|
|
42
42
|
break;
|
|
43
43
|
case "spot":
|
|
44
|
-
a = new
|
|
44
|
+
a = new P.SpotLight(
|
|
45
45
|
e.color,
|
|
46
46
|
e.intensity,
|
|
47
47
|
e.distance || 0,
|
|
@@ -59,145 +59,139 @@ function Te(e) {
|
|
|
59
59
|
}
|
|
60
60
|
return a;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Ae(e) {
|
|
63
63
|
const {
|
|
64
64
|
width: a,
|
|
65
|
-
autoRotate:
|
|
66
|
-
data:
|
|
65
|
+
autoRotate: x,
|
|
66
|
+
data: v,
|
|
67
67
|
enableZoom: H,
|
|
68
68
|
categorical: R,
|
|
69
|
-
colorDomain:
|
|
70
|
-
colors:
|
|
71
|
-
globeMaterial:
|
|
72
|
-
height:
|
|
73
|
-
polygonData:
|
|
74
|
-
mapProperty:
|
|
75
|
-
mapBorderColor:
|
|
76
|
-
atmosphereColor:
|
|
77
|
-
tooltip:
|
|
78
|
-
styles:
|
|
69
|
+
colorDomain: h,
|
|
70
|
+
colors: l,
|
|
71
|
+
globeMaterial: c,
|
|
72
|
+
height: V,
|
|
73
|
+
polygonData: $,
|
|
74
|
+
mapProperty: d,
|
|
75
|
+
mapBorderColor: F,
|
|
76
|
+
atmosphereColor: X,
|
|
77
|
+
tooltip: Z,
|
|
78
|
+
styles: C,
|
|
79
79
|
classNames: re,
|
|
80
|
-
mapNoDataColor:
|
|
81
|
-
colorLegendTitle:
|
|
82
|
-
showColorScale:
|
|
83
|
-
hoverStrokeColor:
|
|
84
|
-
detailsOnClick:
|
|
85
|
-
onSeriesMouseClick:
|
|
86
|
-
onSeriesMouseOver:
|
|
87
|
-
resetSelectionOnDoubleClick:
|
|
88
|
-
highlightedIds:
|
|
89
|
-
scale:
|
|
90
|
-
globeOffset:
|
|
91
|
-
polygonAltitude:
|
|
80
|
+
mapNoDataColor: u,
|
|
81
|
+
colorLegendTitle: G,
|
|
82
|
+
showColorScale: oe,
|
|
83
|
+
hoverStrokeColor: ae,
|
|
84
|
+
detailsOnClick: w,
|
|
85
|
+
onSeriesMouseClick: L,
|
|
86
|
+
onSeriesMouseOver: y,
|
|
87
|
+
resetSelectionOnDoubleClick: T,
|
|
88
|
+
highlightedIds: J,
|
|
89
|
+
scale: g,
|
|
90
|
+
globeOffset: j,
|
|
91
|
+
polygonAltitude: I,
|
|
92
92
|
centerLng: B,
|
|
93
|
-
centerLat:
|
|
94
|
-
atmosphereAltitude:
|
|
95
|
-
globeCurvatureResolution:
|
|
96
|
-
fogSettings:
|
|
93
|
+
centerLat: U,
|
|
94
|
+
atmosphereAltitude: _,
|
|
95
|
+
globeCurvatureResolution: ie,
|
|
96
|
+
fogSettings: M,
|
|
97
97
|
lights: z,
|
|
98
|
-
highlightedAltitude:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
98
|
+
highlightedAltitude: Y,
|
|
99
|
+
selectedId: f
|
|
100
|
+
} = e, [K, se] = N(!1), n = ge(void 0), [k, E] = N(void 0), [ne, Q] = N(!(a < 680)), [ee, le] = N({ x: 0, y: 0 }), [S, de] = N(void 0), W = R ? Le().domain(h).range(l) : Me().domain(h).range(l);
|
|
101
|
+
D(() => {
|
|
102
|
+
n.current && (n.current.controls().enableZoom = H);
|
|
103
|
+
}, [H]), D(() => {
|
|
104
|
+
n.current && (S || f ? n.current.controls().autoRotate = !1 : (n.current.controls().autoRotate = x !== 0, n.current.controls().autoRotateSpeed = x));
|
|
105
|
+
}, [S, f, x]), D(() => {
|
|
106
|
+
if (n.current && f) {
|
|
107
|
+
const t = $.find(
|
|
108
|
+
(m) => m.properties[d] === f
|
|
109
|
+
), [o, s] = Ne(t);
|
|
110
|
+
n.current.pointOfView({ lat: s, lng: o, altitude: g }, 1e3);
|
|
111
|
+
}
|
|
112
|
+
}, [f, g, $, d]), D(() => {
|
|
113
|
+
const t = n.current?.renderer().domElement;
|
|
113
114
|
if (!t) return;
|
|
114
|
-
const
|
|
115
|
-
|
|
115
|
+
const o = (s) => {
|
|
116
|
+
le({ x: s.clientX, y: s.clientY });
|
|
116
117
|
};
|
|
117
|
-
return t.addEventListener("mousemove",
|
|
118
|
-
}, []),
|
|
119
|
-
|
|
120
|
-
}, [
|
|
121
|
-
const
|
|
118
|
+
return t.addEventListener("mousemove", o), () => t.removeEventListener("mousemove", o);
|
|
119
|
+
}, []), D(() => {
|
|
120
|
+
n.current && n.current.pointOfView({ lat: U, lng: B, altitude: g }, 1e3);
|
|
121
|
+
}, [g, B, U]);
|
|
122
|
+
const q = c || new P.MeshBasicMaterial({
|
|
122
123
|
color: "#FFF"
|
|
123
|
-
}),
|
|
124
|
-
if (!
|
|
125
|
-
const t =
|
|
126
|
-
let
|
|
127
|
-
t.traverse((
|
|
128
|
-
|
|
129
|
-
}),
|
|
130
|
-
z[
|
|
131
|
-
}),
|
|
132
|
-
}, [z,
|
|
133
|
-
|
|
134
|
-
}, [
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
}, [
|
|
124
|
+
}), p = me(() => {
|
|
125
|
+
if (!n.current) return;
|
|
126
|
+
const t = n.current.scene(), o = n.current.camera();
|
|
127
|
+
let s = [];
|
|
128
|
+
t.traverse((i) => {
|
|
129
|
+
i instanceof P.Light && s.push(i);
|
|
130
|
+
}), s = [...s, ...o.children], s.forEach((i) => i.parent?.remove(i)), z.map((i) => Ee(i)).forEach((i, b) => {
|
|
131
|
+
z[b].type !== "ambient" && z[b].position === "camera" ? (o.add(i), z[b].type !== "point" && o.add(i.target)) : t.add(i);
|
|
132
|
+
}), M && (t.fog = new P.Fog(M.color, M.near, M.far));
|
|
133
|
+
}, [z, M]), te = me(() => {
|
|
134
|
+
se(!0), p();
|
|
135
|
+
}, [p]);
|
|
136
|
+
return D(() => {
|
|
137
|
+
K && p();
|
|
138
|
+
}, [K, p]), /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
|
|
138
139
|
/* @__PURE__ */ r.jsx(
|
|
139
|
-
|
|
140
|
+
we,
|
|
140
141
|
{
|
|
141
|
-
ref:
|
|
142
|
-
height:
|
|
142
|
+
ref: n,
|
|
143
|
+
height: V,
|
|
143
144
|
width: a,
|
|
144
|
-
globeOffset:
|
|
145
|
+
globeOffset: j,
|
|
145
146
|
lineHoverPrecision: 0,
|
|
146
|
-
polygonsData:
|
|
147
|
-
polygonAltitude: (t) =>
|
|
147
|
+
polygonsData: $,
|
|
148
|
+
polygonAltitude: (t) => J.includes(t?.properties?.[d]) || t?.properties?.[d] === f ? Y * (t?.properties?.[d] === f ? 2 : 1) : t?.properties?.[d] === S?.id || t?.properties?.[d] === k?.id ? Y : I,
|
|
148
149
|
polygonCapColor: (t) => {
|
|
149
|
-
const
|
|
150
|
-
return
|
|
150
|
+
const o = t?.properties?.[d], s = v.find((m) => m.id === o)?.x;
|
|
151
|
+
return s != null ? W(s) : u;
|
|
151
152
|
},
|
|
152
153
|
polygonSideColor: (t) => {
|
|
153
|
-
const
|
|
154
|
-
return
|
|
154
|
+
const o = t?.properties?.[d], s = v.find((i) => i.id === o)?.x, m = s != null ? W(s) : u;
|
|
155
|
+
return J.includes(t?.properties?.[d]) || t?.properties?.[d] === f ? m : "rgba(100,100,100,0)";
|
|
155
156
|
},
|
|
156
|
-
polygonStrokeColor: (t) => t?.properties?.[
|
|
157
|
+
polygonStrokeColor: (t) => t?.properties?.[d] === S?.id ? ae : F,
|
|
157
158
|
onGlobeClick: () => {
|
|
158
|
-
|
|
159
|
+
E(void 0);
|
|
159
160
|
},
|
|
160
161
|
onPolygonClick: (t) => {
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
if (we(x, i) && P && i)
|
|
164
|
-
T(void 0), M?.(void 0), Y(void 0);
|
|
165
|
-
else {
|
|
166
|
-
T(i), M?.(i);
|
|
167
|
-
const [o, c] = Ce(t).geometry.coordinates;
|
|
168
|
-
Y([o, c]);
|
|
169
|
-
}
|
|
162
|
+
const o = t?.properties?.[d] ? v.find((s) => s.id === t?.properties?.[d]) : void 0;
|
|
163
|
+
(L || w) && (be(k, o) && T && o ? (E(void 0), L?.(void 0)) : (E(o), L?.(o)));
|
|
170
164
|
},
|
|
171
165
|
onPolygonHover: (t) => {
|
|
172
|
-
const
|
|
173
|
-
|
|
166
|
+
const o = t?.properties?.[d] ? v.find((s) => s.id === t?.properties?.[d]) : void 0;
|
|
167
|
+
de(o), y?.(o);
|
|
174
168
|
},
|
|
175
|
-
atmosphereColor:
|
|
176
|
-
atmosphereAltitude:
|
|
177
|
-
globeCurvatureResolution:
|
|
178
|
-
globeMaterial:
|
|
169
|
+
atmosphereColor: X,
|
|
170
|
+
atmosphereAltitude: _,
|
|
171
|
+
globeCurvatureResolution: ie,
|
|
172
|
+
globeMaterial: q,
|
|
179
173
|
backgroundColor: "rgba(0, 0, 0, 0)",
|
|
180
174
|
polygonsTransitionDuration: 100,
|
|
181
175
|
onGlobeReady: () => {
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
lat:
|
|
176
|
+
if (n.current) {
|
|
177
|
+
n.current.pointOfView({
|
|
178
|
+
lat: U,
|
|
185
179
|
lng: B
|
|
186
180
|
});
|
|
187
|
-
const t =
|
|
181
|
+
const t = n.current.scene();
|
|
188
182
|
setTimeout(() => {
|
|
189
|
-
(t.children[3]?.children[0]?.children[4]?.children || []).forEach((
|
|
190
|
-
const
|
|
191
|
-
|
|
183
|
+
(t.children[3]?.children[0]?.children[4]?.children || []).forEach((m) => {
|
|
184
|
+
const i = m.children[1];
|
|
185
|
+
i.renderOrder = 2;
|
|
192
186
|
});
|
|
193
187
|
}, 300);
|
|
194
|
-
const
|
|
195
|
-
t.add(
|
|
188
|
+
const o = n.current.camera();
|
|
189
|
+
t.add(o), te();
|
|
196
190
|
}
|
|
197
191
|
}
|
|
198
192
|
}
|
|
199
193
|
),
|
|
200
|
-
|
|
194
|
+
oe === !1 ? null : /* @__PURE__ */ r.jsx("div", { className: "absolute left-4 bottom-4", children: ne ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
201
195
|
/* @__PURE__ */ r.jsx(
|
|
202
196
|
"div",
|
|
203
197
|
{
|
|
@@ -215,7 +209,7 @@ function Ee(e) {
|
|
|
215
209
|
top: "-0.75rem"
|
|
216
210
|
},
|
|
217
211
|
onClick: () => {
|
|
218
|
-
|
|
212
|
+
Q(!1);
|
|
219
213
|
},
|
|
220
214
|
children: /* @__PURE__ */ r.jsx(Se, {})
|
|
221
215
|
}
|
|
@@ -229,7 +223,7 @@ function Ee(e) {
|
|
|
229
223
|
width: R ? void 0 : "340px"
|
|
230
224
|
},
|
|
231
225
|
children: [
|
|
232
|
-
|
|
226
|
+
G && G !== "" ? /* @__PURE__ */ r.jsx(
|
|
233
227
|
ue,
|
|
234
228
|
{
|
|
235
229
|
size: "xs",
|
|
@@ -240,54 +234,54 @@ function Ee(e) {
|
|
|
240
234
|
WebkitLineClamp: "1",
|
|
241
235
|
WebkitBoxOrient: "vertical"
|
|
242
236
|
},
|
|
243
|
-
children:
|
|
237
|
+
children: G
|
|
244
238
|
}
|
|
245
239
|
) : null,
|
|
246
|
-
R ? /* @__PURE__ */ r.jsx("div", { className: "flex flex-col gap-3", children:
|
|
240
|
+
R ? /* @__PURE__ */ r.jsx("div", { className: "flex flex-col gap-3", children: h.map((t, o) => /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
247
241
|
/* @__PURE__ */ r.jsx(
|
|
248
242
|
"div",
|
|
249
243
|
{
|
|
250
244
|
className: "w-2 h-2 rounded-full",
|
|
251
|
-
style: { backgroundColor:
|
|
245
|
+
style: { backgroundColor: l[o % l.length] }
|
|
252
246
|
}
|
|
253
247
|
),
|
|
254
248
|
/* @__PURE__ */ r.jsx(ue, { size: "sm", marginBottom: "none", leading: "none", children: t })
|
|
255
|
-
] },
|
|
256
|
-
|
|
249
|
+
] }, o)) }) : /* @__PURE__ */ r.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ r.jsxs("g", { children: [
|
|
250
|
+
h.map((t, o) => /* @__PURE__ */ r.jsxs("g", { className: "cursor-pointer", children: [
|
|
257
251
|
/* @__PURE__ */ r.jsx(
|
|
258
252
|
"rect",
|
|
259
253
|
{
|
|
260
|
-
x:
|
|
254
|
+
x: o * 320 / l.length + 1,
|
|
261
255
|
y: 1,
|
|
262
|
-
width: 320 /
|
|
256
|
+
width: 320 / l.length - 2,
|
|
263
257
|
height: 8,
|
|
264
258
|
style: {
|
|
265
|
-
fill:
|
|
266
|
-
stroke:
|
|
259
|
+
fill: l[o],
|
|
260
|
+
stroke: l[o]
|
|
267
261
|
}
|
|
268
262
|
}
|
|
269
263
|
),
|
|
270
264
|
/* @__PURE__ */ r.jsx(
|
|
271
265
|
"text",
|
|
272
266
|
{
|
|
273
|
-
x: (
|
|
267
|
+
x: (o + 1) * 320 / l.length,
|
|
274
268
|
y: 25,
|
|
275
269
|
className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",
|
|
276
270
|
style: { textAnchor: "middle" },
|
|
277
271
|
children: ke(t, "NA")
|
|
278
272
|
}
|
|
279
273
|
)
|
|
280
|
-
] },
|
|
274
|
+
] }, o)),
|
|
281
275
|
/* @__PURE__ */ r.jsx("g", { children: /* @__PURE__ */ r.jsx(
|
|
282
276
|
"rect",
|
|
283
277
|
{
|
|
284
|
-
x:
|
|
278
|
+
x: h.length * 320 / l.length + 1,
|
|
285
279
|
y: 1,
|
|
286
|
-
width: 320 /
|
|
280
|
+
width: 320 / l.length - 2,
|
|
287
281
|
height: 8,
|
|
288
282
|
style: {
|
|
289
|
-
fill:
|
|
290
|
-
stroke:
|
|
283
|
+
fill: l[h.length],
|
|
284
|
+
stroke: l[h.length]
|
|
291
285
|
}
|
|
292
286
|
}
|
|
293
287
|
) })
|
|
@@ -301,35 +295,35 @@ function Ee(e) {
|
|
|
301
295
|
type: "button",
|
|
302
296
|
className: "mb-0 border-0 bg-transparent p-0 self-start",
|
|
303
297
|
onClick: () => {
|
|
304
|
-
|
|
298
|
+
Q(!0);
|
|
305
299
|
},
|
|
306
300
|
children: /* @__PURE__ */ r.jsx("div", { className: "items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500", children: "Show Legend" })
|
|
307
301
|
}
|
|
308
302
|
) }),
|
|
309
|
-
|
|
303
|
+
S && Z ? /* @__PURE__ */ r.jsx(
|
|
310
304
|
je,
|
|
311
305
|
{
|
|
312
|
-
data:
|
|
313
|
-
body:
|
|
314
|
-
xPos:
|
|
315
|
-
yPos:
|
|
316
|
-
backgroundStyle:
|
|
306
|
+
data: S,
|
|
307
|
+
body: Z,
|
|
308
|
+
xPos: ee.x,
|
|
309
|
+
yPos: ee.y,
|
|
310
|
+
backgroundStyle: C?.tooltip,
|
|
317
311
|
className: re?.tooltip
|
|
318
312
|
}
|
|
319
313
|
) : null,
|
|
320
|
-
|
|
321
|
-
|
|
314
|
+
w && k !== void 0 ? /* @__PURE__ */ r.jsx(
|
|
315
|
+
Ce,
|
|
322
316
|
{
|
|
323
|
-
open:
|
|
317
|
+
open: k !== void 0,
|
|
324
318
|
onClose: () => {
|
|
325
|
-
|
|
319
|
+
E(void 0);
|
|
326
320
|
},
|
|
327
321
|
children: /* @__PURE__ */ r.jsx(
|
|
328
322
|
"div",
|
|
329
323
|
{
|
|
330
324
|
className: "graph-modal-content m-0",
|
|
331
|
-
dangerouslySetInnerHTML: typeof
|
|
332
|
-
children: typeof
|
|
325
|
+
dangerouslySetInnerHTML: typeof w == "string" ? { __html: De(w, k) } : void 0,
|
|
326
|
+
children: typeof w == "function" ? w(k) : null
|
|
333
327
|
}
|
|
334
328
|
)
|
|
335
329
|
}
|
|
@@ -339,51 +333,51 @@ function Ee(e) {
|
|
|
339
333
|
function ot(e) {
|
|
340
334
|
const {
|
|
341
335
|
data: a,
|
|
342
|
-
mapData:
|
|
343
|
-
graphTitle:
|
|
336
|
+
mapData: x = "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",
|
|
337
|
+
graphTitle: v,
|
|
344
338
|
colors: H,
|
|
345
339
|
sources: R,
|
|
346
|
-
graphDescription:
|
|
347
|
-
height:
|
|
348
|
-
width:
|
|
349
|
-
footNote:
|
|
350
|
-
colorDomain:
|
|
351
|
-
colorLegendTitle:
|
|
352
|
-
scaleType:
|
|
353
|
-
padding:
|
|
354
|
-
mapNoDataColor:
|
|
355
|
-
backgroundColor:
|
|
340
|
+
graphDescription: h,
|
|
341
|
+
height: l,
|
|
342
|
+
width: c,
|
|
343
|
+
footNote: V = "The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",
|
|
344
|
+
colorDomain: $,
|
|
345
|
+
colorLegendTitle: d,
|
|
346
|
+
scaleType: F = "threshold",
|
|
347
|
+
padding: X,
|
|
348
|
+
mapNoDataColor: Z = A.light.graphNoData,
|
|
349
|
+
backgroundColor: C = !1,
|
|
356
350
|
mapBorderColor: re = A.light.grays["gray-500"],
|
|
357
|
-
relativeHeight:
|
|
358
|
-
tooltip:
|
|
359
|
-
graphID:
|
|
360
|
-
mapProperty:
|
|
361
|
-
dataDownload:
|
|
362
|
-
language:
|
|
363
|
-
minHeight:
|
|
364
|
-
theme:
|
|
365
|
-
ariaLabel:
|
|
366
|
-
styles:
|
|
367
|
-
classNames:
|
|
368
|
-
autoRotate:
|
|
351
|
+
relativeHeight: u,
|
|
352
|
+
tooltip: G,
|
|
353
|
+
graphID: oe,
|
|
354
|
+
mapProperty: ae = "ISO3",
|
|
355
|
+
dataDownload: w = !1,
|
|
356
|
+
language: L = "en",
|
|
357
|
+
minHeight: y = 0,
|
|
358
|
+
theme: T = "light",
|
|
359
|
+
ariaLabel: J,
|
|
360
|
+
styles: g,
|
|
361
|
+
classNames: j,
|
|
362
|
+
autoRotate: I = !0,
|
|
369
363
|
enableZoom: B = !0,
|
|
370
|
-
globeMaterial:
|
|
371
|
-
centerPoint:
|
|
372
|
-
atmosphereColor:
|
|
373
|
-
showColorScale:
|
|
364
|
+
globeMaterial: U,
|
|
365
|
+
centerPoint: _ = [0, 0],
|
|
366
|
+
atmosphereColor: ie = "#999",
|
|
367
|
+
showColorScale: M = !0,
|
|
374
368
|
resetSelectionOnDoubleClick: z = !0,
|
|
375
|
-
detailsOnClick:
|
|
376
|
-
onSeriesMouseOver:
|
|
377
|
-
onSeriesMouseClick:
|
|
378
|
-
highlightedIds:
|
|
379
|
-
highlightedAltitude:
|
|
380
|
-
scale:
|
|
369
|
+
detailsOnClick: Y,
|
|
370
|
+
onSeriesMouseOver: f,
|
|
371
|
+
onSeriesMouseClick: K,
|
|
372
|
+
highlightedIds: se = [],
|
|
373
|
+
highlightedAltitude: n = 0.1,
|
|
374
|
+
scale: k = 1,
|
|
381
375
|
globeOffset: E = [0, 0],
|
|
382
|
-
polygonAltitude:
|
|
383
|
-
globeCurvatureResolution:
|
|
384
|
-
atmosphereAltitude:
|
|
385
|
-
fogSettings:
|
|
386
|
-
lights:
|
|
376
|
+
polygonAltitude: ne = 0.01,
|
|
377
|
+
globeCurvatureResolution: Q = 4,
|
|
378
|
+
atmosphereAltitude: ee = 0.15,
|
|
379
|
+
fogSettings: le,
|
|
380
|
+
lights: S = [
|
|
387
381
|
{
|
|
388
382
|
type: "ambient",
|
|
389
383
|
color: 4210752,
|
|
@@ -395,154 +389,156 @@ function ot(e) {
|
|
|
395
389
|
intensity: 1,
|
|
396
390
|
position: { x: 5, y: 10, z: 5 }
|
|
397
391
|
}
|
|
398
|
-
]
|
|
399
|
-
|
|
400
|
-
N(()
|
|
401
|
-
|
|
402
|
-
|
|
392
|
+
],
|
|
393
|
+
selectedId: de
|
|
394
|
+
} = e, [W, q] = N(void 0), [p, te] = N(0), [t, o] = N(0), s = ge(null);
|
|
395
|
+
D(() => {
|
|
396
|
+
const i = new ResizeObserver((b) => {
|
|
397
|
+
te(c || b[0].target.clientWidth || 760), o(l || b[0].target.clientHeight || 480);
|
|
403
398
|
});
|
|
404
|
-
return
|
|
405
|
-
}, [
|
|
406
|
-
typeof
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
410
|
-
const ce = [...
|
|
411
|
-
return { ...
|
|
399
|
+
return s.current && (o(s.current.clientHeight || 480), te(s.current.clientWidth || 760), c || i.observe(s.current)), () => i.disconnect();
|
|
400
|
+
}, [c, l]), D(() => {
|
|
401
|
+
typeof x == "string" ? Pe(x).then((b) => {
|
|
402
|
+
if (x === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
|
|
403
|
+
const ye = b.features.map((O) => {
|
|
404
|
+
if (O.geometry.type === "Polygon") {
|
|
405
|
+
const ce = [...O.geometry.coordinates[0]].reverse(), pe = { ...O.geometry, coordinates: [ce] };
|
|
406
|
+
return { ...O, geometry: pe };
|
|
412
407
|
}
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
const
|
|
416
|
-
|
|
408
|
+
const he = [];
|
|
409
|
+
O.geometry.coordinates.forEach((ce) => {
|
|
410
|
+
const pe = [...ce[0]].reverse();
|
|
411
|
+
he.push([pe]);
|
|
417
412
|
});
|
|
418
|
-
const
|
|
419
|
-
return { ...
|
|
413
|
+
const fe = { ...O.geometry, coordinates: he };
|
|
414
|
+
return { ...O, geometry: fe };
|
|
420
415
|
});
|
|
421
|
-
|
|
422
|
-
} else
|
|
423
|
-
}) :
|
|
424
|
-
}, [
|
|
425
|
-
const
|
|
426
|
-
a.map((
|
|
416
|
+
q(ye);
|
|
417
|
+
} else q(b.features);
|
|
418
|
+
}) : q(x.features);
|
|
419
|
+
}, [x]);
|
|
420
|
+
const m = $ || (F === "categorical" ? Re(a, "x") : Te(
|
|
421
|
+
a.map((i) => i.x),
|
|
427
422
|
H?.length || 4
|
|
428
423
|
));
|
|
429
424
|
return /* @__PURE__ */ r.jsx(
|
|
430
425
|
"div",
|
|
431
426
|
{
|
|
432
|
-
className: `${
|
|
433
|
-
dir:
|
|
427
|
+
className: `${T || "light"} flex ${c ? "w-fit grow-0" : "w-full grow"}`,
|
|
428
|
+
dir: L === "he" || L === "ar" ? "rtl" : void 0,
|
|
434
429
|
children: /* @__PURE__ */ r.jsx(
|
|
435
430
|
"div",
|
|
436
431
|
{
|
|
437
|
-
className:
|
|
438
|
-
`${
|
|
439
|
-
|
|
440
|
-
|
|
432
|
+
className: xe(
|
|
433
|
+
`${C ? C === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${L || "en"}`,
|
|
434
|
+
c ? "w-fit" : "w-full",
|
|
435
|
+
j?.graphContainer
|
|
441
436
|
),
|
|
442
437
|
style: {
|
|
443
|
-
...
|
|
444
|
-
...
|
|
438
|
+
...g?.graphContainer || {},
|
|
439
|
+
...C && C !== !0 ? { backgroundColor: C } : {}
|
|
445
440
|
},
|
|
446
|
-
id:
|
|
447
|
-
"aria-label":
|
|
441
|
+
id: oe,
|
|
442
|
+
"aria-label": J || `${v ? `The graph shows ${v}. ` : ""}This is a map.${h ? ` ${h}` : ""}`,
|
|
448
443
|
children: /* @__PURE__ */ r.jsx(
|
|
449
444
|
"div",
|
|
450
445
|
{
|
|
451
446
|
className: "flex grow",
|
|
452
|
-
style: { padding:
|
|
447
|
+
style: { padding: C ? X || "1rem" : X || 0 },
|
|
453
448
|
children: /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
454
|
-
|
|
455
|
-
|
|
449
|
+
v || h || w ? /* @__PURE__ */ r.jsx(
|
|
450
|
+
ze,
|
|
456
451
|
{
|
|
457
452
|
styles: {
|
|
458
|
-
title:
|
|
459
|
-
description:
|
|
453
|
+
title: g?.title,
|
|
454
|
+
description: g?.description
|
|
460
455
|
},
|
|
461
456
|
classNames: {
|
|
462
|
-
title:
|
|
463
|
-
description:
|
|
457
|
+
title: j?.title,
|
|
458
|
+
description: j?.description
|
|
464
459
|
},
|
|
465
|
-
graphTitle:
|
|
466
|
-
graphDescription:
|
|
467
|
-
width:
|
|
460
|
+
graphTitle: v,
|
|
461
|
+
graphDescription: h,
|
|
462
|
+
width: c,
|
|
468
463
|
graphDownload: void 0,
|
|
469
|
-
dataDownload:
|
|
464
|
+
dataDownload: w ? a.map((i) => i.data).filter((i) => i !== void 0).length > 0 ? a.map((i) => i.data).filter((i) => i !== void 0) : a.filter((i) => i !== void 0) : null
|
|
470
465
|
}
|
|
471
466
|
) : null,
|
|
472
467
|
/* @__PURE__ */ r.jsx(
|
|
473
468
|
"div",
|
|
474
469
|
{
|
|
475
470
|
className: "flex flex-col grow justify-center leading-0",
|
|
476
|
-
ref:
|
|
471
|
+
ref: s,
|
|
477
472
|
"aria-label": "Map area",
|
|
478
|
-
children: (
|
|
479
|
-
|
|
473
|
+
children: (c || p) && (l || t) && W ? /* @__PURE__ */ r.jsx(
|
|
474
|
+
Ae,
|
|
480
475
|
{
|
|
481
476
|
data: a,
|
|
482
477
|
globeOffset: E,
|
|
483
|
-
polygonData:
|
|
484
|
-
colorDomain:
|
|
485
|
-
width:
|
|
478
|
+
polygonData: W,
|
|
479
|
+
colorDomain: m,
|
|
480
|
+
width: c || p,
|
|
486
481
|
height: Math.max(
|
|
487
|
-
|
|
488
|
-
|
|
482
|
+
y,
|
|
483
|
+
l || (u ? y ? (c || p) * u > y ? (c || p) * u : y : (c || p) * u : t)
|
|
489
484
|
),
|
|
490
|
-
colors: H || (
|
|
491
|
-
mapNoDataColor:
|
|
492
|
-
categorical:
|
|
485
|
+
colors: H || (F === "categorical" ? A[T].sequentialColors[`neutralColorsx0${m.length}`] : A[T].sequentialColors[`neutralColorsx0${m.length + 1}`]),
|
|
486
|
+
mapNoDataColor: Z,
|
|
487
|
+
categorical: F === "categorical",
|
|
493
488
|
mapBorderColor: re,
|
|
494
|
-
tooltip:
|
|
495
|
-
mapProperty:
|
|
496
|
-
styles:
|
|
497
|
-
classNames:
|
|
498
|
-
autoRotate:
|
|
489
|
+
tooltip: G,
|
|
490
|
+
mapProperty: ae,
|
|
491
|
+
styles: g,
|
|
492
|
+
classNames: j,
|
|
493
|
+
autoRotate: I === !0 ? 1.5 : I === !1 ? 0 : I,
|
|
499
494
|
enableZoom: B,
|
|
500
|
-
globeMaterial:
|
|
501
|
-
atmosphereColor:
|
|
502
|
-
colorLegendTitle:
|
|
503
|
-
showColorScale:
|
|
504
|
-
hoverStrokeColor:
|
|
505
|
-
highlightedIds:
|
|
495
|
+
globeMaterial: U,
|
|
496
|
+
atmosphereColor: ie,
|
|
497
|
+
colorLegendTitle: d,
|
|
498
|
+
showColorScale: M,
|
|
499
|
+
hoverStrokeColor: T === "light" ? A.light.grays["gray-700"] : A.light.grays["gray-300"],
|
|
500
|
+
highlightedIds: se,
|
|
506
501
|
resetSelectionOnDoubleClick: z,
|
|
507
|
-
detailsOnClick:
|
|
508
|
-
onSeriesMouseOver:
|
|
509
|
-
onSeriesMouseClick:
|
|
510
|
-
scale:
|
|
511
|
-
polygonAltitude:
|
|
512
|
-
centerLat:
|
|
513
|
-
centerLng:
|
|
514
|
-
atmosphereAltitude:
|
|
515
|
-
globeCurvatureResolution:
|
|
516
|
-
fogSettings:
|
|
517
|
-
lights:
|
|
518
|
-
highlightedAltitude:
|
|
502
|
+
detailsOnClick: Y,
|
|
503
|
+
onSeriesMouseOver: f,
|
|
504
|
+
onSeriesMouseClick: K,
|
|
505
|
+
scale: k,
|
|
506
|
+
polygonAltitude: ne,
|
|
507
|
+
centerLat: _[0],
|
|
508
|
+
centerLng: _[1],
|
|
509
|
+
atmosphereAltitude: ee,
|
|
510
|
+
globeCurvatureResolution: Q,
|
|
511
|
+
fogSettings: le,
|
|
512
|
+
lights: S,
|
|
513
|
+
highlightedAltitude: n,
|
|
514
|
+
selectedId: de
|
|
519
515
|
}
|
|
520
516
|
) : /* @__PURE__ */ r.jsx(
|
|
521
517
|
"div",
|
|
522
518
|
{
|
|
523
519
|
style: {
|
|
524
520
|
height: `${Math.max(
|
|
525
|
-
|
|
526
|
-
|
|
521
|
+
y,
|
|
522
|
+
l || (u ? y ? (c || p) * u > y ? (c || p) * u : y : (c || p) * u : t)
|
|
527
523
|
)}px`
|
|
528
524
|
},
|
|
529
525
|
className: "flex items-center justify-center",
|
|
530
|
-
children: /* @__PURE__ */ r.jsx(
|
|
526
|
+
children: /* @__PURE__ */ r.jsx(ve, { "aria-label": "Loading graph" })
|
|
531
527
|
}
|
|
532
528
|
)
|
|
533
529
|
}
|
|
534
530
|
),
|
|
535
|
-
R ||
|
|
536
|
-
|
|
531
|
+
R || V ? /* @__PURE__ */ r.jsx(
|
|
532
|
+
Oe,
|
|
537
533
|
{
|
|
538
|
-
styles: { footnote:
|
|
534
|
+
styles: { footnote: g?.footnote, source: g?.source },
|
|
539
535
|
classNames: {
|
|
540
|
-
footnote:
|
|
541
|
-
source:
|
|
536
|
+
footnote: j?.footnote,
|
|
537
|
+
source: j?.source
|
|
542
538
|
},
|
|
543
539
|
sources: R,
|
|
544
|
-
footNote:
|
|
545
|
-
width:
|
|
540
|
+
footNote: V,
|
|
541
|
+
width: c
|
|
546
542
|
}
|
|
547
543
|
) : null
|
|
548
544
|
] })
|