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