@undp/data-viz 1.4.3 → 1.4.5
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/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.d.ts +2 -0
- package/dist/BarGraph.js +1180 -1170
- package/dist/BarGraph.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.d.ts +2 -0
- package/dist/DumbbellChart.js +354 -345
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GraphEl-C0FNZlDn.cjs +2 -0
- package/dist/GraphEl-C0FNZlDn.cjs.map +1 -0
- package/dist/{GraphEl-BdIyscdt.js → GraphEl-DfPT8ffl.js} +3 -1
- package/dist/GraphEl-DfPT8ffl.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +246 -237
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
- package/dist/GraphEl-B5gAX1IQ.cjs +0 -2
- package/dist/GraphEl-B5gAX1IQ.cjs.map +0 -1
- package/dist/GraphEl-BdIyscdt.js.map +0 -1
package/dist/ThreeDGlobe.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as t, m as pe } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
-
import { useRef as ge, useState as
|
|
2
|
+
import { useRef as ge, useState as L, useEffect as S } from "react";
|
|
3
3
|
import { y as ue } from "./Spinner-C85UF28E.js";
|
|
4
4
|
import fe from "react-globe.gl";
|
|
5
5
|
import { i as ye } from "./index-27yTRcko.js";
|
|
@@ -15,123 +15,133 @@ import { t as De } from "./threshold-DFfqcDMa.js";
|
|
|
15
15
|
import { GraphHeader as ke } from "./GraphHeader.js";
|
|
16
16
|
import { GraphFooter as Ne } from "./GraphFooter.js";
|
|
17
17
|
import { f as Se } from "./fetchAndParseData-4gsYTy6_.js";
|
|
18
|
-
import { Colors as
|
|
19
|
-
import { g as
|
|
20
|
-
import { g as
|
|
18
|
+
import { Colors as T } from "./Colors.js";
|
|
19
|
+
import { g as Le } from "./getUniqValue-BtUENB2H.js";
|
|
20
|
+
import { g as Me } from "./getJenks-VhM3GIoC.js";
|
|
21
21
|
function Oe(_) {
|
|
22
22
|
const {
|
|
23
|
-
width:
|
|
24
|
-
autoRotate:
|
|
25
|
-
data:
|
|
26
|
-
enableZoom:
|
|
27
|
-
categorical:
|
|
28
|
-
colorDomain:
|
|
29
|
-
colors:
|
|
23
|
+
width: p,
|
|
24
|
+
autoRotate: d,
|
|
25
|
+
data: u,
|
|
26
|
+
enableZoom: R,
|
|
27
|
+
categorical: M,
|
|
28
|
+
colorDomain: l,
|
|
29
|
+
colors: i,
|
|
30
30
|
globeMaterial: s,
|
|
31
|
-
height:
|
|
31
|
+
height: I,
|
|
32
32
|
polygonData: Y,
|
|
33
|
-
mapProperty:
|
|
34
|
-
mapBorderColor:
|
|
35
|
-
atmosphereColor:
|
|
36
|
-
tooltip:
|
|
37
|
-
styles:
|
|
33
|
+
mapProperty: c,
|
|
34
|
+
mapBorderColor: E,
|
|
35
|
+
atmosphereColor: W,
|
|
36
|
+
tooltip: z,
|
|
37
|
+
styles: v,
|
|
38
38
|
classNames: K,
|
|
39
|
-
mapNoDataColor:
|
|
40
|
-
|
|
41
|
-
colorLegendTitle: T,
|
|
39
|
+
mapNoDataColor: g,
|
|
40
|
+
colorLegendTitle: H,
|
|
42
41
|
showColorScale: Q,
|
|
43
|
-
hoverStrokeColor:
|
|
44
|
-
detailsOnClick:
|
|
45
|
-
onSeriesMouseClick:
|
|
46
|
-
onSeriesMouseOver:
|
|
47
|
-
resetSelectionOnDoubleClick:
|
|
48
|
-
highlightedIds:
|
|
49
|
-
scale:
|
|
50
|
-
globeOffset:
|
|
51
|
-
polygonAltitude:
|
|
52
|
-
centerLng:
|
|
53
|
-
centerLat:
|
|
54
|
-
atmosphereAltitude:
|
|
55
|
-
globeCurvatureResolution:
|
|
56
|
-
lightColor:
|
|
57
|
-
} = _,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
65
|
-
const
|
|
66
|
-
|
|
42
|
+
hoverStrokeColor: ee,
|
|
43
|
+
detailsOnClick: f,
|
|
44
|
+
onSeriesMouseClick: b,
|
|
45
|
+
onSeriesMouseOver: h,
|
|
46
|
+
resetSelectionOnDoubleClick: O,
|
|
47
|
+
highlightedIds: U,
|
|
48
|
+
scale: y,
|
|
49
|
+
globeOffset: j,
|
|
50
|
+
polygonAltitude: $,
|
|
51
|
+
centerLng: A,
|
|
52
|
+
centerLat: F,
|
|
53
|
+
atmosphereAltitude: q,
|
|
54
|
+
globeCurvatureResolution: te,
|
|
55
|
+
lightColor: B
|
|
56
|
+
} = _, a = ge(void 0), [D, P] = L(void 0), [oe, X] = L(!(p < 680)), [V, re] = L({ x: 0, y: 0 }), [w, ie] = L(void 0), Z = M ? Ce().domain(l).range(i) : De().domain(l).range(i);
|
|
57
|
+
S(() => {
|
|
58
|
+
a?.current && (a.current.controls().autoRotate = d !== 0, a.current.controls().enableZoom = R, a.current.controls().autoRotateSpeed = d);
|
|
59
|
+
}, [d, R]), S(() => {
|
|
60
|
+
a.current && (w ? a.current.controls().autoRotate = !1 : a.current.controls().autoRotate = d !== 0);
|
|
61
|
+
}, [w, d]), S(() => {
|
|
62
|
+
const e = a.current?.renderer().domElement;
|
|
63
|
+
if (!e) return;
|
|
64
|
+
const o = (r) => {
|
|
65
|
+
re({ x: r.clientX, y: r.clientY });
|
|
67
66
|
};
|
|
68
|
-
return
|
|
69
|
-
}, []),
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
const
|
|
67
|
+
return e.addEventListener("mousemove", o), () => e.removeEventListener("mousemove", o);
|
|
68
|
+
}, []), S(() => {
|
|
69
|
+
a.current && a.current.pointOfView({ lat: F, lng: A, altitude: y }, 1e3);
|
|
70
|
+
}, [y, A, F]);
|
|
71
|
+
const ae = s || new J.MeshPhysicalMaterial({
|
|
73
72
|
color: "#FFF",
|
|
74
73
|
roughness: 0.5,
|
|
75
74
|
reflectivity: 1.2
|
|
76
75
|
});
|
|
77
|
-
return
|
|
76
|
+
return S(() => {
|
|
77
|
+
if (!a.current) return;
|
|
78
|
+
const e = a.current.scene();
|
|
79
|
+
e.children.filter((r) => r.type === "DirectionalLight" || r.type === "AmbientLight").forEach((r) => e.remove(r));
|
|
80
|
+
const o = new J.AmbientLight(B, 0.2);
|
|
81
|
+
e.add(o), setTimeout(() => {
|
|
82
|
+
(e.children[3]?.children[0]?.children[4]?.children || []).forEach((m) => {
|
|
83
|
+
const x = m.children[1];
|
|
84
|
+
x && (x.renderOrder = 2);
|
|
85
|
+
});
|
|
86
|
+
}, 300);
|
|
87
|
+
}, [B]), /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
|
|
78
88
|
/* @__PURE__ */ t.jsx(
|
|
79
89
|
fe,
|
|
80
90
|
{
|
|
81
|
-
ref:
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
84
|
-
globeOffset:
|
|
91
|
+
ref: a,
|
|
92
|
+
width: p,
|
|
93
|
+
height: I,
|
|
94
|
+
globeOffset: j,
|
|
85
95
|
lineHoverPrecision: 0,
|
|
86
96
|
polygonsData: Y,
|
|
87
|
-
polygonAltitude: (
|
|
88
|
-
polygonCapColor: (
|
|
89
|
-
const
|
|
90
|
-
return r != null ?
|
|
97
|
+
polygonAltitude: (e) => U.includes(e?.properties?.[c]) ? 0.1 : e?.properties?.[c] === w?.id ? 0.01 : $,
|
|
98
|
+
polygonCapColor: (e) => {
|
|
99
|
+
const o = e?.properties?.[c], r = u.find((m) => m.id === o)?.x;
|
|
100
|
+
return r != null ? Z(r) : g;
|
|
91
101
|
},
|
|
92
|
-
polygonSideColor: (
|
|
93
|
-
const
|
|
94
|
-
return
|
|
102
|
+
polygonSideColor: (e) => {
|
|
103
|
+
const o = e?.properties?.[c], r = u.find((x) => x.id === o)?.x, m = r != null ? Z(r) : g;
|
|
104
|
+
return U.includes(e?.properties?.[c]) ? m : "rgba(100,100,100,0)";
|
|
95
105
|
},
|
|
96
|
-
polygonStrokeColor: (
|
|
97
|
-
onPolygonClick: (
|
|
98
|
-
const
|
|
99
|
-
(
|
|
106
|
+
polygonStrokeColor: (e) => e?.properties?.[c] === w?.id ? ee : E,
|
|
107
|
+
onPolygonClick: (e) => {
|
|
108
|
+
const o = e?.properties?.[c] ? u.find((r) => r.id === e?.properties?.[c]) : void 0;
|
|
109
|
+
(b || f) && (ye(D, o) && O && o ? (P(void 0), b?.(void 0)) : (P(o), b?.(o))), P(o), b?.(o);
|
|
100
110
|
},
|
|
101
|
-
onPolygonHover: (
|
|
102
|
-
const
|
|
103
|
-
|
|
111
|
+
onPolygonHover: (e) => {
|
|
112
|
+
const o = e?.properties?.[c] ? u.find((r) => r.id === e?.properties?.[c]) : void 0;
|
|
113
|
+
ie(o), h?.(o);
|
|
104
114
|
},
|
|
105
|
-
atmosphereColor:
|
|
106
|
-
atmosphereAltitude:
|
|
107
|
-
globeCurvatureResolution:
|
|
108
|
-
globeMaterial:
|
|
115
|
+
atmosphereColor: W,
|
|
116
|
+
atmosphereAltitude: q,
|
|
117
|
+
globeCurvatureResolution: te,
|
|
118
|
+
globeMaterial: ae,
|
|
109
119
|
backgroundColor: "rgba(0, 0, 0, 0)",
|
|
110
120
|
polygonsTransitionDuration: 100,
|
|
111
121
|
onGlobeReady: () => {
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
lat:
|
|
115
|
-
lng:
|
|
122
|
+
if (a.current) {
|
|
123
|
+
a.current.pointOfView({
|
|
124
|
+
lat: F,
|
|
125
|
+
lng: A
|
|
116
126
|
});
|
|
117
|
-
const
|
|
127
|
+
const e = a.current.scene();
|
|
118
128
|
setTimeout(() => {
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
e.children.filter((C) => C.type === "DirectionalLight").map((C) => {
|
|
130
|
+
e.remove(C);
|
|
121
131
|
});
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
132
|
+
const m = new J.AmbientLight(B, 0.2);
|
|
133
|
+
e.add(m), (e.children[3]?.children[0]?.children[4]?.children || []).forEach((C) => {
|
|
134
|
+
const k = C.children[1];
|
|
135
|
+
k.renderOrder = 2;
|
|
126
136
|
});
|
|
127
137
|
}, 300);
|
|
128
|
-
const
|
|
129
|
-
|
|
138
|
+
const o = new J.DirectionalLight(16777215, 0.1), r = a.current.camera();
|
|
139
|
+
o.position.set(0, 0, 1), r.add(o), e.add(r);
|
|
130
140
|
}
|
|
131
141
|
}
|
|
132
142
|
}
|
|
133
143
|
),
|
|
134
|
-
Q === !1 ? null : /* @__PURE__ */ t.jsx("div", { className: "absolute left-4 bottom-4", children:
|
|
144
|
+
Q === !1 ? null : /* @__PURE__ */ t.jsx("div", { className: "absolute left-4 bottom-4", children: oe ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
135
145
|
/* @__PURE__ */ t.jsx(
|
|
136
146
|
"div",
|
|
137
147
|
{
|
|
@@ -149,7 +159,7 @@ function Oe(_) {
|
|
|
149
159
|
top: "-0.75rem"
|
|
150
160
|
},
|
|
151
161
|
onClick: () => {
|
|
152
|
-
|
|
162
|
+
X(!1);
|
|
153
163
|
},
|
|
154
164
|
children: /* @__PURE__ */ t.jsx(je, {})
|
|
155
165
|
}
|
|
@@ -160,10 +170,10 @@ function Oe(_) {
|
|
|
160
170
|
className: "p-2",
|
|
161
171
|
style: {
|
|
162
172
|
backgroundColor: "rgba(240,240,240, 0.7)",
|
|
163
|
-
width:
|
|
173
|
+
width: M ? void 0 : "340px"
|
|
164
174
|
},
|
|
165
175
|
children: [
|
|
166
|
-
|
|
176
|
+
H && H !== "" ? /* @__PURE__ */ t.jsx(
|
|
167
177
|
de,
|
|
168
178
|
{
|
|
169
179
|
size: "xs",
|
|
@@ -174,54 +184,54 @@ function Oe(_) {
|
|
|
174
184
|
WebkitLineClamp: "1",
|
|
175
185
|
WebkitBoxOrient: "vertical"
|
|
176
186
|
},
|
|
177
|
-
children:
|
|
187
|
+
children: H
|
|
178
188
|
}
|
|
179
189
|
) : null,
|
|
180
|
-
|
|
190
|
+
M ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-3", children: l.map((e, o) => /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
181
191
|
/* @__PURE__ */ t.jsx(
|
|
182
192
|
"div",
|
|
183
193
|
{
|
|
184
194
|
className: "w-2 h-2 rounded-full",
|
|
185
|
-
style: { backgroundColor:
|
|
195
|
+
style: { backgroundColor: i[o % i.length] }
|
|
186
196
|
}
|
|
187
197
|
),
|
|
188
|
-
/* @__PURE__ */ t.jsx(de, { size: "sm", marginBottom: "none", leading: "none", children:
|
|
189
|
-
] },
|
|
190
|
-
|
|
198
|
+
/* @__PURE__ */ t.jsx(de, { size: "sm", marginBottom: "none", leading: "none", children: e })
|
|
199
|
+
] }, o)) }) : /* @__PURE__ */ t.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { children: [
|
|
200
|
+
l.map((e, o) => /* @__PURE__ */ t.jsxs("g", { className: "cursor-pointer", children: [
|
|
191
201
|
/* @__PURE__ */ t.jsx(
|
|
192
202
|
"rect",
|
|
193
203
|
{
|
|
194
|
-
x:
|
|
204
|
+
x: o * 320 / i.length + 1,
|
|
195
205
|
y: 1,
|
|
196
|
-
width: 320 /
|
|
206
|
+
width: 320 / i.length - 2,
|
|
197
207
|
height: 8,
|
|
198
208
|
style: {
|
|
199
|
-
fill:
|
|
200
|
-
stroke:
|
|
209
|
+
fill: i[o],
|
|
210
|
+
stroke: i[o]
|
|
201
211
|
}
|
|
202
212
|
}
|
|
203
213
|
),
|
|
204
214
|
/* @__PURE__ */ t.jsx(
|
|
205
215
|
"text",
|
|
206
216
|
{
|
|
207
|
-
x: (
|
|
217
|
+
x: (o + 1) * 320 / i.length,
|
|
208
218
|
y: 25,
|
|
209
219
|
className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",
|
|
210
220
|
style: { textAnchor: "middle" },
|
|
211
|
-
children: be(
|
|
221
|
+
children: be(e, "NA")
|
|
212
222
|
}
|
|
213
223
|
)
|
|
214
|
-
] },
|
|
224
|
+
] }, o)),
|
|
215
225
|
/* @__PURE__ */ t.jsx("g", { children: /* @__PURE__ */ t.jsx(
|
|
216
226
|
"rect",
|
|
217
227
|
{
|
|
218
|
-
x:
|
|
228
|
+
x: l.length * 320 / i.length + 1,
|
|
219
229
|
y: 1,
|
|
220
|
-
width: 320 /
|
|
230
|
+
width: 320 / i.length - 2,
|
|
221
231
|
height: 8,
|
|
222
232
|
style: {
|
|
223
|
-
fill:
|
|
224
|
-
stroke:
|
|
233
|
+
fill: i[l.length],
|
|
234
|
+
stroke: i[l.length]
|
|
225
235
|
}
|
|
226
236
|
}
|
|
227
237
|
) })
|
|
@@ -235,35 +245,35 @@ function Oe(_) {
|
|
|
235
245
|
type: "button",
|
|
236
246
|
className: "mb-0 border-0 bg-transparent p-0 self-start",
|
|
237
247
|
onClick: () => {
|
|
238
|
-
|
|
248
|
+
X(!0);
|
|
239
249
|
},
|
|
240
250
|
children: /* @__PURE__ */ t.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" })
|
|
241
251
|
}
|
|
242
252
|
) }),
|
|
243
|
-
|
|
253
|
+
w && z ? /* @__PURE__ */ t.jsx(
|
|
244
254
|
ve,
|
|
245
255
|
{
|
|
246
|
-
data:
|
|
247
|
-
body:
|
|
248
|
-
xPos:
|
|
249
|
-
yPos:
|
|
250
|
-
backgroundStyle:
|
|
256
|
+
data: w,
|
|
257
|
+
body: z,
|
|
258
|
+
xPos: V.x,
|
|
259
|
+
yPos: V.y,
|
|
260
|
+
backgroundStyle: v?.tooltip,
|
|
251
261
|
className: K?.tooltip
|
|
252
262
|
}
|
|
253
263
|
) : null,
|
|
254
|
-
|
|
264
|
+
f && D !== void 0 ? /* @__PURE__ */ t.jsx(
|
|
255
265
|
xe,
|
|
256
266
|
{
|
|
257
|
-
open:
|
|
267
|
+
open: D !== void 0,
|
|
258
268
|
onClose: () => {
|
|
259
|
-
|
|
269
|
+
P(void 0);
|
|
260
270
|
},
|
|
261
271
|
children: /* @__PURE__ */ t.jsx(
|
|
262
272
|
"div",
|
|
263
273
|
{
|
|
264
274
|
className: "graph-modal-content m-0",
|
|
265
|
-
dangerouslySetInnerHTML: typeof
|
|
266
|
-
children: typeof
|
|
275
|
+
dangerouslySetInnerHTML: typeof f == "string" ? { __html: we(f, D) } : void 0,
|
|
276
|
+
children: typeof f == "function" ? f(D) : null
|
|
267
277
|
}
|
|
268
278
|
)
|
|
269
279
|
}
|
|
@@ -272,105 +282,105 @@ function Oe(_) {
|
|
|
272
282
|
}
|
|
273
283
|
function _e(_) {
|
|
274
284
|
const {
|
|
275
|
-
data:
|
|
276
|
-
mapData:
|
|
277
|
-
graphTitle:
|
|
278
|
-
colors:
|
|
279
|
-
sources:
|
|
280
|
-
graphDescription:
|
|
281
|
-
height:
|
|
285
|
+
data: p,
|
|
286
|
+
mapData: d = "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",
|
|
287
|
+
graphTitle: u,
|
|
288
|
+
colors: R,
|
|
289
|
+
sources: M,
|
|
290
|
+
graphDescription: l,
|
|
291
|
+
height: i,
|
|
282
292
|
width: s,
|
|
283
|
-
footNote:
|
|
293
|
+
footNote: I = "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.",
|
|
284
294
|
colorDomain: Y,
|
|
285
|
-
colorLegendTitle:
|
|
286
|
-
scaleType:
|
|
287
|
-
padding:
|
|
288
|
-
mapNoDataColor:
|
|
289
|
-
backgroundColor:
|
|
290
|
-
mapBorderColor: K =
|
|
291
|
-
relativeHeight:
|
|
292
|
-
tooltip:
|
|
293
|
-
graphID:
|
|
294
|
-
mapProperty:
|
|
295
|
-
dataDownload:
|
|
296
|
-
language:
|
|
297
|
-
minHeight:
|
|
298
|
-
theme:
|
|
299
|
-
ariaLabel:
|
|
295
|
+
colorLegendTitle: c,
|
|
296
|
+
scaleType: E = "threshold",
|
|
297
|
+
padding: W,
|
|
298
|
+
mapNoDataColor: z = T.light.graphNoData,
|
|
299
|
+
backgroundColor: v = !1,
|
|
300
|
+
mapBorderColor: K = T.light.grays["gray-500"],
|
|
301
|
+
relativeHeight: g,
|
|
302
|
+
tooltip: H,
|
|
303
|
+
graphID: Q,
|
|
304
|
+
mapProperty: ee = "ISO3",
|
|
305
|
+
dataDownload: f = !1,
|
|
306
|
+
language: b = "en",
|
|
307
|
+
minHeight: h = 0,
|
|
308
|
+
theme: O = "light",
|
|
309
|
+
ariaLabel: U,
|
|
300
310
|
styles: y,
|
|
301
|
-
classNames:
|
|
302
|
-
autoRotate:
|
|
303
|
-
enableZoom:
|
|
304
|
-
globeMaterial:
|
|
305
|
-
centerPoint:
|
|
306
|
-
atmosphereColor:
|
|
307
|
-
showColorScale:
|
|
308
|
-
resetSelectionOnDoubleClick:
|
|
309
|
-
detailsOnClick:
|
|
310
|
-
onSeriesMouseOver:
|
|
311
|
-
onSeriesMouseClick:
|
|
312
|
-
highlightedIds:
|
|
313
|
-
scale:
|
|
314
|
-
globeOffset:
|
|
315
|
-
polygonAltitude:
|
|
316
|
-
globeCurvatureResolution:
|
|
317
|
-
atmosphereAltitude:
|
|
318
|
-
lightColor:
|
|
319
|
-
} = _, [
|
|
320
|
-
|
|
321
|
-
const n = new ResizeObserver((
|
|
322
|
-
|
|
311
|
+
classNames: j,
|
|
312
|
+
autoRotate: $ = !0,
|
|
313
|
+
enableZoom: A = !0,
|
|
314
|
+
globeMaterial: F,
|
|
315
|
+
centerPoint: q = [0, 0],
|
|
316
|
+
atmosphereColor: te = "#999",
|
|
317
|
+
showColorScale: B = !0,
|
|
318
|
+
resetSelectionOnDoubleClick: a = !0,
|
|
319
|
+
detailsOnClick: D,
|
|
320
|
+
onSeriesMouseOver: P,
|
|
321
|
+
onSeriesMouseClick: oe,
|
|
322
|
+
highlightedIds: X = [],
|
|
323
|
+
scale: V = 1,
|
|
324
|
+
globeOffset: re = [0, 0],
|
|
325
|
+
polygonAltitude: w = 0.01,
|
|
326
|
+
globeCurvatureResolution: ie = 4,
|
|
327
|
+
atmosphereAltitude: Z = 0.15,
|
|
328
|
+
lightColor: ae = "#dce9fe"
|
|
329
|
+
} = _, [e, o] = L(void 0), [r, m] = L(0), [x, C] = L(0), k = ge(null);
|
|
330
|
+
S(() => {
|
|
331
|
+
const n = new ResizeObserver((G) => {
|
|
332
|
+
m(s || G[0].target.clientWidth || 760), C(i || G[0].target.clientHeight || 480);
|
|
323
333
|
});
|
|
324
|
-
return
|
|
325
|
-
}, [s,
|
|
326
|
-
typeof
|
|
327
|
-
if (
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
const ne = [...
|
|
331
|
-
return { ...
|
|
334
|
+
return k.current && (C(k.current.clientHeight || 480), m(k.current.clientWidth || 760), s || n.observe(k.current)), () => n.disconnect();
|
|
335
|
+
}, [s, i]), S(() => {
|
|
336
|
+
typeof d == "string" ? Se(d).then((G) => {
|
|
337
|
+
if (d === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
|
|
338
|
+
const he = G.features.map((N) => {
|
|
339
|
+
if (N.geometry.type === "Polygon") {
|
|
340
|
+
const ne = [...N.geometry.coordinates[0]].reverse(), le = { ...N.geometry, coordinates: [ne] };
|
|
341
|
+
return { ...N, geometry: le };
|
|
332
342
|
}
|
|
333
343
|
const ce = [];
|
|
334
|
-
|
|
344
|
+
N.geometry.coordinates.forEach((ne) => {
|
|
335
345
|
const le = [...ne[0]].reverse();
|
|
336
346
|
ce.push([le]);
|
|
337
347
|
});
|
|
338
|
-
const
|
|
339
|
-
return { ...
|
|
348
|
+
const me = { ...N.geometry, coordinates: ce };
|
|
349
|
+
return { ...N, geometry: me };
|
|
340
350
|
});
|
|
341
|
-
o(
|
|
342
|
-
} else o(
|
|
343
|
-
}) : o(
|
|
344
|
-
}, [
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
|
|
351
|
+
o(he);
|
|
352
|
+
} else o(G.features);
|
|
353
|
+
}) : o(d.features);
|
|
354
|
+
}, [d]);
|
|
355
|
+
const se = Y || (E === "categorical" ? Le(p, "x") : Me(
|
|
356
|
+
p.map((n) => n.x),
|
|
357
|
+
R?.length || 4
|
|
348
358
|
));
|
|
349
359
|
return /* @__PURE__ */ t.jsx(
|
|
350
360
|
"div",
|
|
351
361
|
{
|
|
352
|
-
className: `${
|
|
353
|
-
dir:
|
|
362
|
+
className: `${O || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
|
|
363
|
+
dir: b === "he" || b === "ar" ? "rtl" : void 0,
|
|
354
364
|
children: /* @__PURE__ */ t.jsx(
|
|
355
365
|
"div",
|
|
356
366
|
{
|
|
357
367
|
className: pe(
|
|
358
|
-
`${
|
|
359
|
-
|
|
368
|
+
`${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b || "en"}`,
|
|
369
|
+
j?.graphContainer
|
|
360
370
|
),
|
|
361
371
|
style: {
|
|
362
372
|
...y?.graphContainer || {},
|
|
363
|
-
...
|
|
373
|
+
...v && v !== !0 ? { backgroundColor: v } : {}
|
|
364
374
|
},
|
|
365
|
-
id:
|
|
366
|
-
"aria-label":
|
|
375
|
+
id: Q,
|
|
376
|
+
"aria-label": U || `${u ? `The graph shows ${u}. ` : ""}This is a map.${l ? ` ${l}` : ""}`,
|
|
367
377
|
children: /* @__PURE__ */ t.jsx(
|
|
368
378
|
"div",
|
|
369
379
|
{
|
|
370
380
|
className: "flex grow",
|
|
371
|
-
style: { padding:
|
|
381
|
+
style: { padding: v ? W || "1rem" : W || 0 },
|
|
372
382
|
children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
373
|
-
|
|
383
|
+
u || l || f ? /* @__PURE__ */ t.jsx(
|
|
374
384
|
ke,
|
|
375
385
|
{
|
|
376
386
|
styles: {
|
|
@@ -378,70 +388,69 @@ function _e(_) {
|
|
|
378
388
|
description: y?.description
|
|
379
389
|
},
|
|
380
390
|
classNames: {
|
|
381
|
-
title:
|
|
382
|
-
description:
|
|
391
|
+
title: j?.title,
|
|
392
|
+
description: j?.description
|
|
383
393
|
},
|
|
384
|
-
graphTitle:
|
|
385
|
-
graphDescription:
|
|
394
|
+
graphTitle: u,
|
|
395
|
+
graphDescription: l,
|
|
386
396
|
width: s,
|
|
387
397
|
graphDownload: void 0,
|
|
388
|
-
dataDownload:
|
|
398
|
+
dataDownload: f ? p.map((n) => n.data).filter((n) => n !== void 0).length > 0 ? p.map((n) => n.data).filter((n) => n !== void 0) : p.filter((n) => n !== void 0) : null
|
|
389
399
|
}
|
|
390
400
|
) : null,
|
|
391
401
|
/* @__PURE__ */ t.jsx(
|
|
392
402
|
"div",
|
|
393
403
|
{
|
|
394
404
|
className: "flex flex-col grow justify-center leading-0",
|
|
395
|
-
ref:
|
|
405
|
+
ref: k,
|
|
396
406
|
"aria-label": "Map area",
|
|
397
|
-
children: (s ||
|
|
407
|
+
children: (s || r) && (i || x) && e ? /* @__PURE__ */ t.jsx(
|
|
398
408
|
Oe,
|
|
399
409
|
{
|
|
400
|
-
data:
|
|
401
|
-
globeOffset:
|
|
402
|
-
polygonData:
|
|
403
|
-
colorDomain:
|
|
404
|
-
width: s ||
|
|
410
|
+
data: p,
|
|
411
|
+
globeOffset: re,
|
|
412
|
+
polygonData: e,
|
|
413
|
+
colorDomain: se,
|
|
414
|
+
width: s || r,
|
|
405
415
|
height: Math.max(
|
|
406
|
-
|
|
407
|
-
|
|
416
|
+
h,
|
|
417
|
+
i || (g ? h ? (s || r) * g > h ? (s || r) * g : h : (s || r) * g : x)
|
|
408
418
|
),
|
|
409
|
-
colors:
|
|
410
|
-
mapNoDataColor:
|
|
411
|
-
categorical:
|
|
419
|
+
colors: R || (E === "categorical" ? T[O].sequentialColors[`neutralColorsx0${se.length}`] : T[O].sequentialColors[`neutralColorsx0${se.length + 1}`]),
|
|
420
|
+
mapNoDataColor: z,
|
|
421
|
+
categorical: E === "categorical",
|
|
412
422
|
mapBorderColor: K,
|
|
413
|
-
tooltip:
|
|
414
|
-
mapProperty:
|
|
423
|
+
tooltip: H,
|
|
424
|
+
mapProperty: ee,
|
|
415
425
|
styles: y,
|
|
416
|
-
classNames:
|
|
417
|
-
autoRotate:
|
|
418
|
-
enableZoom:
|
|
419
|
-
globeMaterial:
|
|
420
|
-
atmosphereColor:
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
lightColor: V
|
|
426
|
+
classNames: j,
|
|
427
|
+
autoRotate: $ === !0 ? 1.5 : $ === !1 ? 0 : $,
|
|
428
|
+
enableZoom: A,
|
|
429
|
+
globeMaterial: F,
|
|
430
|
+
atmosphereColor: te,
|
|
431
|
+
colorLegendTitle: c,
|
|
432
|
+
showColorScale: B,
|
|
433
|
+
hoverStrokeColor: O === "light" ? T.light.grays["gray-700"] : T.light.grays["gray-300"],
|
|
434
|
+
highlightedIds: X,
|
|
435
|
+
resetSelectionOnDoubleClick: a,
|
|
436
|
+
detailsOnClick: D,
|
|
437
|
+
onSeriesMouseOver: P,
|
|
438
|
+
onSeriesMouseClick: oe,
|
|
439
|
+
scale: V,
|
|
440
|
+
polygonAltitude: w,
|
|
441
|
+
centerLat: q[0],
|
|
442
|
+
centerLng: q[1],
|
|
443
|
+
atmosphereAltitude: Z,
|
|
444
|
+
globeCurvatureResolution: ie,
|
|
445
|
+
lightColor: ae
|
|
437
446
|
}
|
|
438
447
|
) : /* @__PURE__ */ t.jsx(
|
|
439
448
|
"div",
|
|
440
449
|
{
|
|
441
450
|
style: {
|
|
442
451
|
height: `${Math.max(
|
|
443
|
-
|
|
444
|
-
|
|
452
|
+
h,
|
|
453
|
+
i || (g ? h ? (s || r) * g > h ? (s || r) * g : h : (s || r) * g : x)
|
|
445
454
|
)}px`
|
|
446
455
|
},
|
|
447
456
|
className: "flex items-center justify-center",
|
|
@@ -450,16 +459,16 @@ function _e(_) {
|
|
|
450
459
|
)
|
|
451
460
|
}
|
|
452
461
|
),
|
|
453
|
-
|
|
462
|
+
M || I ? /* @__PURE__ */ t.jsx(
|
|
454
463
|
Ne,
|
|
455
464
|
{
|
|
456
465
|
styles: { footnote: y?.footnote, source: y?.source },
|
|
457
466
|
classNames: {
|
|
458
|
-
footnote:
|
|
459
|
-
source:
|
|
467
|
+
footnote: j?.footnote,
|
|
468
|
+
source: j?.source
|
|
460
469
|
},
|
|
461
|
-
sources:
|
|
462
|
-
footNote:
|
|
470
|
+
sources: M,
|
|
471
|
+
footNote: I,
|
|
463
472
|
width: s
|
|
464
473
|
}
|
|
465
474
|
) : null
|