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