@undp/data-viz 2.0.3 → 2.0.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/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +317 -277
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +3 -2
package/dist/ThreeDGlobe.js
CHANGED
|
@@ -1,272 +1,312 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { w as
|
|
4
|
-
import
|
|
5
|
-
import { i as
|
|
6
|
-
import * as
|
|
7
|
-
import { l as
|
|
8
|
-
import { j as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { g as
|
|
22
|
-
import {
|
|
23
|
-
|
|
1
|
+
import { j as i, m as lt, c as ct } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
|
+
import { useState as U, useRef as Qe, useEffect as H, useCallback as dt, useEffectEvent as pt } from "react";
|
|
3
|
+
import { w as ht } from "./Spinner-D7rnnwnA.js";
|
|
4
|
+
import mt from "react-globe.gl";
|
|
5
|
+
import { i as ut } from "./index-Bwrro8-q.js";
|
|
6
|
+
import * as W from "three";
|
|
7
|
+
import { l as gt } from "./Modal-DGcuAHyK.js";
|
|
8
|
+
import { j as et } from "./Typography-PxtFcnJb.js";
|
|
9
|
+
import { g as ft } from "./_commonjsHelpers-ByX85dGu.js";
|
|
10
|
+
import { T as vt } from "./Tooltip-CwWUegPB.js";
|
|
11
|
+
import { n as yt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
12
|
+
import { X as bt } from "./index-D491FEn1.js";
|
|
13
|
+
import { s as xt } from "./string2HTML-DhG75NqA.js";
|
|
14
|
+
import { g as wt } from "./getCentroidCoordinates-D7r34N4w.js";
|
|
15
|
+
import { o as Ct } from "./ordinal-P77xw8aL.js";
|
|
16
|
+
import { t as Dt } from "./threshold-Bgr20hik.js";
|
|
17
|
+
import { GraphHeader as St } from "./GraphHeader.js";
|
|
18
|
+
import { GraphFooter as jt } from "./GraphFooter.js";
|
|
19
|
+
import { f as Nt } from "./fetchAndParseData-BpqkBPQL.js";
|
|
20
|
+
import { Colors as te } from "./Colors.js";
|
|
21
|
+
import { g as kt } from "./getUniqValue-BKHCm3zE.js";
|
|
22
|
+
import { g as Rt } from "./getJenks-BbngDoBQ.js";
|
|
23
|
+
import { a as Lt, G as Ot } from "./GraphContainer-CRqzdKu2.js";
|
|
24
|
+
var Ke, tt;
|
|
25
|
+
function Tt() {
|
|
26
|
+
if (tt) return Ke;
|
|
27
|
+
tt = 1;
|
|
28
|
+
var t = function(o) {
|
|
29
|
+
return o.charAt(0) === "#" ? o.slice(1) : o;
|
|
30
|
+
}, e = function(o) {
|
|
31
|
+
var n = o.length === 3 || o.length === 4, f = n ? "".concat(o.slice(0, 1)).concat(o.slice(0, 1)) : o.slice(0, 2), s = n ? "".concat(o.slice(1, 2)).concat(o.slice(1, 2)) : o.slice(2, 4), w = n ? "".concat(o.slice(2, 3)).concat(o.slice(2, 3)) : o.slice(4, 6), M = (n ? "".concat(o.slice(3, 4)).concat(o.slice(3, 4)) : o.slice(6, 8)) || "ff";
|
|
32
|
+
return {
|
|
33
|
+
r: f,
|
|
34
|
+
g: s,
|
|
35
|
+
b: w,
|
|
36
|
+
a: M
|
|
37
|
+
};
|
|
38
|
+
}, d = function(o) {
|
|
39
|
+
return parseInt(o, 16);
|
|
40
|
+
}, b = function(o) {
|
|
41
|
+
var n = o.r, f = o.g, s = o.b, w = o.a;
|
|
42
|
+
return {
|
|
43
|
+
r: d(n),
|
|
44
|
+
g: d(f),
|
|
45
|
+
b: d(s),
|
|
46
|
+
a: +(d(w) / 255).toFixed(2)
|
|
47
|
+
};
|
|
48
|
+
}, x = function(o) {
|
|
49
|
+
return !isNaN(parseFloat(o)) && isFinite(o);
|
|
50
|
+
}, D = function(o, n) {
|
|
51
|
+
var f = o.r, s = o.g, w = o.b, M = o.a, P = x(n) ? n : M;
|
|
52
|
+
return "rgba(".concat(f, ", ").concat(s, ", ").concat(w, ", ").concat(P, ")");
|
|
53
|
+
}, g = function(o, n) {
|
|
54
|
+
var f = t(o), s = e(f), w = b(s);
|
|
55
|
+
return D(w, n);
|
|
56
|
+
};
|
|
57
|
+
return Ke = g, Ke;
|
|
58
|
+
}
|
|
59
|
+
var Mt = Tt();
|
|
60
|
+
const ot = /* @__PURE__ */ ft(Mt);
|
|
61
|
+
function Pt(t) {
|
|
24
62
|
let e;
|
|
25
63
|
switch (t.type) {
|
|
26
64
|
case "ambient":
|
|
27
|
-
e = new
|
|
65
|
+
e = new W.AmbientLight(t.color, t.intensity);
|
|
28
66
|
break;
|
|
29
67
|
case "directional":
|
|
30
|
-
e = new
|
|
68
|
+
e = new W.DirectionalLight(t.color, t.intensity), t.position && (t.position === "camera" ? e.position.set(0, 0, 0) : e.position.set(t.position.x, t.position.y, t.position.z)), (t.target || t.position === "camera") && e.target.position.set(t.target?.x || 0, t.target?.y || 0, t.target?.z === void 0 ? -1 : t.target.z), t.castShadow && (e.castShadow = !0, t.shadow && (e.shadow.mapSize.width = t.shadow.mapSize.width, e.shadow.mapSize.height = t.shadow.mapSize.height, e.shadow.camera.near = t.shadow.camera.near, e.shadow.camera.far = t.shadow.camera.far));
|
|
31
69
|
break;
|
|
32
70
|
case "point":
|
|
33
|
-
e = new
|
|
71
|
+
e = new W.PointLight(t.color, t.intensity, t.distance || 0, t.decay || 2), t.position && (t.position === "camera" ? e.position.set(0, 0, 0) : e.position.set(t.position.x, t.position.y, t.position.z));
|
|
34
72
|
break;
|
|
35
73
|
case "spot":
|
|
36
|
-
e = new
|
|
74
|
+
e = new W.SpotLight(t.color, t.intensity, t.distance || 0, t.angle || Math.PI / 3, t.penumbra || 0, t.decay || 2), t.position && (t.position === "camera" ? e.position.set(0, 0, 0) : e.position.set(t.position.x, t.position.y, t.position.z)), (t.target || t.position === "camera") && e.target.position.set(t.target?.x || 0, t.target?.y || 0, t.target?.z || 0), t.castShadow && (e.castShadow = !0, t.shadow && (e.shadow.mapSize.width = t.shadow.mapSize.width, e.shadow.mapSize.height = t.shadow.mapSize.height, e.shadow.camera.near = t.shadow.camera.near, e.shadow.camera.far = t.shadow.camera.far));
|
|
37
75
|
break;
|
|
38
76
|
default:
|
|
39
77
|
throw new Error("Unknown light type");
|
|
40
78
|
}
|
|
41
79
|
return e;
|
|
42
80
|
}
|
|
43
|
-
function
|
|
81
|
+
function zt(t) {
|
|
44
82
|
const {
|
|
45
83
|
width: e,
|
|
46
|
-
autoRotate:
|
|
47
|
-
data:
|
|
48
|
-
enableZoom:
|
|
49
|
-
categorical:
|
|
84
|
+
autoRotate: d,
|
|
85
|
+
data: b,
|
|
86
|
+
enableZoom: x,
|
|
87
|
+
categorical: D,
|
|
50
88
|
colorDomain: g,
|
|
51
|
-
colors:
|
|
52
|
-
globeMaterial:
|
|
53
|
-
height:
|
|
54
|
-
polygonData:
|
|
55
|
-
mapProperty:
|
|
56
|
-
mapBorderColor:
|
|
57
|
-
atmosphereColor:
|
|
58
|
-
tooltip:
|
|
59
|
-
styles:
|
|
60
|
-
classNames:
|
|
61
|
-
mapNoDataColor:
|
|
62
|
-
colorLegendTitle:
|
|
63
|
-
showColorScale:
|
|
64
|
-
hoverStrokeColor:
|
|
65
|
-
detailsOnClick:
|
|
66
|
-
onSeriesMouseClick:
|
|
89
|
+
colors: l,
|
|
90
|
+
globeMaterial: o,
|
|
91
|
+
height: n,
|
|
92
|
+
polygonData: f,
|
|
93
|
+
mapProperty: s,
|
|
94
|
+
mapBorderColor: w,
|
|
95
|
+
atmosphereColor: M,
|
|
96
|
+
tooltip: P,
|
|
97
|
+
styles: ye,
|
|
98
|
+
classNames: oe,
|
|
99
|
+
mapNoDataColor: re,
|
|
100
|
+
colorLegendTitle: C,
|
|
101
|
+
showColorScale: ae,
|
|
102
|
+
hoverStrokeColor: ie,
|
|
103
|
+
detailsOnClick: k,
|
|
104
|
+
onSeriesMouseClick: _,
|
|
67
105
|
onSeriesMouseOver: be,
|
|
68
106
|
resetSelectionOnDoubleClick: xe,
|
|
69
|
-
highlightedIds:
|
|
70
|
-
scale:
|
|
71
|
-
globeOffset:
|
|
72
|
-
polygonAltitude:
|
|
73
|
-
centerLng:
|
|
74
|
-
centerLat:
|
|
107
|
+
highlightedIds: z,
|
|
108
|
+
scale: E,
|
|
109
|
+
globeOffset: m,
|
|
110
|
+
polygonAltitude: u,
|
|
111
|
+
centerLng: V,
|
|
112
|
+
centerLat: Z,
|
|
75
113
|
atmosphereAltitude: se,
|
|
76
|
-
globeCurvatureResolution:
|
|
77
|
-
fogSettings:
|
|
78
|
-
lights:
|
|
79
|
-
highlightedAltitude:
|
|
80
|
-
selectedId:
|
|
81
|
-
collapseColorScaleByDefault:
|
|
82
|
-
|
|
114
|
+
globeCurvatureResolution: J,
|
|
115
|
+
fogSettings: A,
|
|
116
|
+
lights: B,
|
|
117
|
+
highlightedAltitude: ne,
|
|
118
|
+
selectedId: v,
|
|
119
|
+
collapseColorScaleByDefault: X,
|
|
120
|
+
dimmedOpacity: F
|
|
121
|
+
} = t, [q, we] = U(!1), p = Qe(void 0), [R, L] = U(void 0), [Ce, le] = U(X === void 0 ? !(e < 680) : !X), [ce, de] = U({
|
|
83
122
|
x: 0,
|
|
84
123
|
y: 0
|
|
85
|
-
}), [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}, [
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
if (
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
lat:
|
|
95
|
-
lng:
|
|
96
|
-
altitude:
|
|
124
|
+
}), [S, pe] = U(void 0), Y = D ? Ct().domain(g).range(l) : Dt().domain(g).range(l);
|
|
125
|
+
H(() => {
|
|
126
|
+
p.current && (p.current.controls().enableZoom = x);
|
|
127
|
+
}, [x]), H(() => {
|
|
128
|
+
p.current && (S || v ? p.current.controls().autoRotate = !1 : (p.current.controls().autoRotate = d !== 0, p.current.controls().autoRotateSpeed = d));
|
|
129
|
+
}, [S, v, d]), H(() => {
|
|
130
|
+
if (p.current && v) {
|
|
131
|
+
const r = f.find((y) => y.properties[s] === v), [a, c] = wt(r);
|
|
132
|
+
p.current.pointOfView({
|
|
133
|
+
lat: c,
|
|
134
|
+
lng: a,
|
|
135
|
+
altitude: E
|
|
97
136
|
}, 1e3);
|
|
98
137
|
}
|
|
99
|
-
}, [
|
|
100
|
-
const
|
|
101
|
-
if (!
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
x:
|
|
105
|
-
y:
|
|
138
|
+
}, [v, E, f, s]), H(() => {
|
|
139
|
+
const r = p.current?.renderer().domElement;
|
|
140
|
+
if (!r) return;
|
|
141
|
+
const a = (c) => {
|
|
142
|
+
de({
|
|
143
|
+
x: c.clientX,
|
|
144
|
+
y: c.clientY
|
|
106
145
|
});
|
|
107
146
|
};
|
|
108
|
-
return
|
|
109
|
-
}, []),
|
|
110
|
-
|
|
111
|
-
lat:
|
|
112
|
-
lng:
|
|
113
|
-
altitude:
|
|
147
|
+
return r.addEventListener("mousemove", a), () => r.removeEventListener("mousemove", a);
|
|
148
|
+
}, []), H(() => {
|
|
149
|
+
p.current && p.current.pointOfView({
|
|
150
|
+
lat: Z,
|
|
151
|
+
lng: V,
|
|
152
|
+
altitude: E
|
|
114
153
|
}, 1e3);
|
|
115
|
-
}, [
|
|
116
|
-
const
|
|
154
|
+
}, [E, V, Z]);
|
|
155
|
+
const j = o || new W.MeshBasicMaterial({
|
|
117
156
|
color: "#FFF"
|
|
118
|
-
}),
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}),
|
|
125
|
-
|
|
126
|
-
}),
|
|
127
|
-
}, [
|
|
128
|
-
|
|
157
|
+
}), G = dt(() => {
|
|
158
|
+
if (!p.current) return;
|
|
159
|
+
const r = p.current.scene(), a = p.current.camera();
|
|
160
|
+
let c = [];
|
|
161
|
+
r.traverse((h) => {
|
|
162
|
+
h instanceof W.Light && c.push(h);
|
|
163
|
+
}), c = [...c, ...a.children], c.forEach((h) => h.parent?.remove(h)), B.map((h) => Pt(h)).forEach((h, N) => {
|
|
164
|
+
B[N].type !== "ambient" && B[N].position === "camera" ? (a.add(h), B[N].type !== "point" && a.add(h.target)) : r.add(h);
|
|
165
|
+
}), A && (r.fog = new W.Fog(A.color, A.near, A.far));
|
|
166
|
+
}, [B, A]), O = () => {
|
|
167
|
+
we(!0), G();
|
|
129
168
|
};
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
}, [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
const
|
|
135
|
-
return
|
|
136
|
-
}, polygonSideColor: (
|
|
137
|
-
const
|
|
138
|
-
return
|
|
139
|
-
}, polygonStrokeColor: (
|
|
140
|
-
|
|
141
|
-
}, onPolygonClick: (
|
|
142
|
-
const
|
|
143
|
-
(
|
|
144
|
-
}, onPolygonHover: (
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
}, atmosphereColor:
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
lat:
|
|
151
|
-
lng:
|
|
169
|
+
return H(() => {
|
|
170
|
+
q && G();
|
|
171
|
+
}, [q, G]), /* @__PURE__ */ i.jsxs("div", { className: "relative", children: [
|
|
172
|
+
/* @__PURE__ */ i.jsx(mt, { ref: p, height: n, width: e, globeOffset: m, lineHoverPrecision: 0, polygonsData: f, polygonAltitude: (r) => z.includes(r?.properties?.[s]) || r?.properties?.[s] === v || r?.properties?.[s] === S?.id || r?.properties?.[s] === R?.id ? ne : u, polygonCapColor: (r) => {
|
|
173
|
+
const a = v ? r?.properties?.[s] === v ? 1 : F : z.length !== 0 ? z.includes(r?.properties?.[s]) ? 1 : F : 1, c = r?.properties?.[s], y = b.find((N) => N.id === c)?.x, h = y != null ? Y(y) : re;
|
|
174
|
+
return ot(h, `${a}`);
|
|
175
|
+
}, polygonSideColor: (r) => {
|
|
176
|
+
const a = r?.properties?.[s], c = b.find((N) => N.id === a)?.x, y = v ? r?.properties?.[s] === v ? 1 : F : z.length !== 0 ? z.includes(r?.properties?.[s]) ? 1 : F : 1, h = c != null ? Y(c) : re;
|
|
177
|
+
return ot(h, `${y}`);
|
|
178
|
+
}, polygonStrokeColor: (r) => r?.properties?.[s] === S?.id ? ie : w, onGlobeClick: () => {
|
|
179
|
+
L(void 0);
|
|
180
|
+
}, onPolygonClick: (r) => {
|
|
181
|
+
const a = r?.properties?.[s] ? b.find((c) => c.id === r?.properties?.[s]) : void 0;
|
|
182
|
+
(_ || k) && (ut(R, a) && xe && a ? (L(void 0), _?.(void 0)) : (L(a), _?.(a)));
|
|
183
|
+
}, onPolygonHover: (r) => {
|
|
184
|
+
const a = r?.properties?.[s] ? b.find((c) => c.id === r?.properties?.[s]) : void 0;
|
|
185
|
+
pe(a), be?.(a);
|
|
186
|
+
}, atmosphereColor: M, atmosphereAltitude: se, globeCurvatureResolution: J, globeMaterial: j, backgroundColor: "rgba(0, 0, 0, 0)", polygonsTransitionDuration: 100, onGlobeReady: () => {
|
|
187
|
+
if (p.current) {
|
|
188
|
+
p.current.pointOfView({
|
|
189
|
+
lat: Z,
|
|
190
|
+
lng: V
|
|
152
191
|
});
|
|
153
|
-
const
|
|
192
|
+
const r = p.current.scene();
|
|
154
193
|
setTimeout(() => {
|
|
155
|
-
(
|
|
156
|
-
const
|
|
157
|
-
|
|
194
|
+
(r.children[3]?.children[0]?.children[4]?.children || []).forEach((y) => {
|
|
195
|
+
const h = y.children[1];
|
|
196
|
+
h.renderOrder = 2;
|
|
158
197
|
});
|
|
159
198
|
}, 300);
|
|
160
|
-
const
|
|
161
|
-
|
|
199
|
+
const a = p.current.camera();
|
|
200
|
+
r.add(a), O();
|
|
162
201
|
}
|
|
163
202
|
} }),
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
167
|
-
}, children: /* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
width:
|
|
203
|
+
ae === !1 ? null : /* @__PURE__ */ i.jsx("div", { className: lt("absolute left-4 bottom-4 map-color-legend", oe?.colorLegend), children: Ce ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
204
|
+
/* @__PURE__ */ i.jsx("div", { className: "color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]", onClick: () => {
|
|
205
|
+
le(!1);
|
|
206
|
+
}, children: /* @__PURE__ */ i.jsx(bt, {}) }),
|
|
207
|
+
/* @__PURE__ */ i.jsxs("div", { className: "color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]", style: {
|
|
208
|
+
width: D ? void 0 : "340px"
|
|
170
209
|
}, children: [
|
|
171
|
-
|
|
210
|
+
C && C !== "" ? /* @__PURE__ */ i.jsx(et, { size: "xs", marginBottom: "xs", className: "p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300", style: {
|
|
172
211
|
display: "-webkit-box",
|
|
173
212
|
WebkitLineClamp: "1",
|
|
174
213
|
WebkitBoxOrient: "vertical"
|
|
175
|
-
}, children:
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
backgroundColor:
|
|
214
|
+
}, children: C }) : null,
|
|
215
|
+
D ? /* @__PURE__ */ i.jsx("div", { className: "flex flex-col gap-3", children: g.map((r, a) => /* @__PURE__ */ i.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
216
|
+
/* @__PURE__ */ i.jsx("div", { className: "w-2 h-2 rounded-full", style: {
|
|
217
|
+
backgroundColor: l[a % l.length]
|
|
179
218
|
} }),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
] },
|
|
182
|
-
g.map((
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
fill:
|
|
185
|
-
stroke:
|
|
219
|
+
/* @__PURE__ */ i.jsx(et, { size: "sm", marginBottom: "none", leading: "none", children: r })
|
|
220
|
+
] }, a)) }) : /* @__PURE__ */ i.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ i.jsxs("g", { children: [
|
|
221
|
+
g.map((r, a) => /* @__PURE__ */ i.jsxs("g", { className: "cursor-pointer", children: [
|
|
222
|
+
/* @__PURE__ */ i.jsx("rect", { x: a * 320 / l.length + 1, y: 1, width: 320 / l.length - 2, height: 8, style: {
|
|
223
|
+
fill: l[a],
|
|
224
|
+
stroke: l[a]
|
|
186
225
|
} }),
|
|
187
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ i.jsx("text", { x: (a + 1) * 320 / l.length, y: 25, className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs", style: {
|
|
188
227
|
textAnchor: "middle"
|
|
189
|
-
}, children:
|
|
190
|
-
] },
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
fill:
|
|
193
|
-
stroke:
|
|
228
|
+
}, children: yt(r, "NA") })
|
|
229
|
+
] }, a)),
|
|
230
|
+
/* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx("rect", { x: g.length * 320 / l.length + 1, y: 1, width: 320 / l.length - 2, height: 8, style: {
|
|
231
|
+
fill: l[g.length],
|
|
232
|
+
stroke: l[g.length]
|
|
194
233
|
} }) })
|
|
195
234
|
] }) })
|
|
196
235
|
] })
|
|
197
|
-
] }) : /* @__PURE__ */
|
|
198
|
-
|
|
199
|
-
}, children: /* @__PURE__ */
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}, children: /* @__PURE__ */
|
|
204
|
-
__html:
|
|
205
|
-
} : void 0, children: typeof
|
|
236
|
+
] }) : /* @__PURE__ */ i.jsx("button", { type: "button", className: "mb-0 border-0 bg-transparent p-0 self-start", onClick: () => {
|
|
237
|
+
le(!0);
|
|
238
|
+
}, children: /* @__PURE__ */ i.jsx("div", { className: "show-color-legend-button 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-600 border-primary-gray-400 dark:border-primary-gray-500", children: "Show Legend" }) }) }),
|
|
239
|
+
S && P ? /* @__PURE__ */ i.jsx(vt, { data: S, body: P, xPos: ce.x, yPos: ce.y, backgroundStyle: ye?.tooltip, className: oe?.tooltip }) : null,
|
|
240
|
+
k && R !== void 0 ? /* @__PURE__ */ i.jsx(gt, { open: R !== void 0, onClose: () => {
|
|
241
|
+
L(void 0);
|
|
242
|
+
}, children: /* @__PURE__ */ i.jsx("div", { className: "graph-modal-content m-0", dangerouslySetInnerHTML: typeof k == "string" ? {
|
|
243
|
+
__html: xt(k, R)
|
|
244
|
+
} : void 0, children: typeof k == "function" ? k(R) : null }) }) : null
|
|
206
245
|
] });
|
|
207
246
|
}
|
|
208
|
-
function
|
|
209
|
-
const e =
|
|
210
|
-
data:
|
|
211
|
-
mapData:
|
|
212
|
-
graphTitle:
|
|
213
|
-
colors:
|
|
247
|
+
function po(t) {
|
|
248
|
+
const e = ct.c(97), {
|
|
249
|
+
data: d,
|
|
250
|
+
mapData: b,
|
|
251
|
+
graphTitle: x,
|
|
252
|
+
colors: D,
|
|
214
253
|
sources: g,
|
|
215
|
-
graphDescription:
|
|
216
|
-
height:
|
|
217
|
-
width:
|
|
218
|
-
footNote:
|
|
219
|
-
colorDomain:
|
|
220
|
-
colorLegendTitle:
|
|
221
|
-
scaleType:
|
|
222
|
-
padding:
|
|
223
|
-
mapNoDataColor:
|
|
224
|
-
backgroundColor:
|
|
225
|
-
mapBorderColor:
|
|
226
|
-
relativeHeight:
|
|
227
|
-
tooltip:
|
|
228
|
-
graphID:
|
|
229
|
-
mapProperty:
|
|
230
|
-
dataDownload:
|
|
254
|
+
graphDescription: l,
|
|
255
|
+
height: o,
|
|
256
|
+
width: n,
|
|
257
|
+
footNote: f,
|
|
258
|
+
colorDomain: s,
|
|
259
|
+
colorLegendTitle: w,
|
|
260
|
+
scaleType: M,
|
|
261
|
+
padding: P,
|
|
262
|
+
mapNoDataColor: ye,
|
|
263
|
+
backgroundColor: oe,
|
|
264
|
+
mapBorderColor: re,
|
|
265
|
+
relativeHeight: C,
|
|
266
|
+
tooltip: ae,
|
|
267
|
+
graphID: ie,
|
|
268
|
+
mapProperty: k,
|
|
269
|
+
dataDownload: _,
|
|
231
270
|
language: be,
|
|
232
271
|
minHeight: xe,
|
|
233
|
-
theme:
|
|
234
|
-
ariaLabel:
|
|
235
|
-
styles:
|
|
236
|
-
classNames:
|
|
237
|
-
autoRotate:
|
|
238
|
-
enableZoom:
|
|
272
|
+
theme: z,
|
|
273
|
+
ariaLabel: E,
|
|
274
|
+
styles: m,
|
|
275
|
+
classNames: u,
|
|
276
|
+
autoRotate: V,
|
|
277
|
+
enableZoom: Z,
|
|
239
278
|
globeMaterial: se,
|
|
240
|
-
centerPoint:
|
|
241
|
-
atmosphereColor:
|
|
242
|
-
showColorScale:
|
|
243
|
-
resetSelectionOnDoubleClick:
|
|
244
|
-
detailsOnClick:
|
|
245
|
-
onSeriesMouseOver:
|
|
246
|
-
onSeriesMouseClick:
|
|
247
|
-
highlightedIds:
|
|
248
|
-
highlightedAltitude:
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
e[0] !== W ? (Ce = W === void 0 ? [0, 0] : W, e[0] = W, e[1] = Ce) : Ce = e[1];
|
|
261
|
-
const Se = Ce, Te = M === void 0 ? "#999" : M, Ge = P === void 0 ? !0 : P, He = ie === void 0 ? !0 : ie;
|
|
262
|
-
let ke;
|
|
263
|
-
e[2] !== Z ? (ke = Z === void 0 ? [] : Z, e[2] = Z, e[3] = ke) : ke = e[3];
|
|
264
|
-
const Be = ke, Fe = i === void 0 ? 0.1 : i, Ie = k === void 0 ? 1 : k;
|
|
279
|
+
centerPoint: J,
|
|
280
|
+
atmosphereColor: A,
|
|
281
|
+
showColorScale: B,
|
|
282
|
+
resetSelectionOnDoubleClick: ne,
|
|
283
|
+
detailsOnClick: v,
|
|
284
|
+
onSeriesMouseOver: X,
|
|
285
|
+
onSeriesMouseClick: F,
|
|
286
|
+
highlightedIds: q,
|
|
287
|
+
highlightedAltitude: we,
|
|
288
|
+
dimmedOpacity: p,
|
|
289
|
+
scale: R,
|
|
290
|
+
globeOffset: L,
|
|
291
|
+
polygonAltitude: Ce,
|
|
292
|
+
globeCurvatureResolution: le,
|
|
293
|
+
atmosphereAltitude: ce,
|
|
294
|
+
fogSettings: de,
|
|
295
|
+
lights: S,
|
|
296
|
+
selectedId: pe,
|
|
297
|
+
collapseColorScaleByDefault: Y
|
|
298
|
+
} = t, j = b === void 0 ? "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json" : b, G = f === void 0 ? "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." : f, O = M === void 0 ? "threshold" : M, r = ye === void 0 ? te.light.graphNoData : ye, a = oe === void 0 ? !1 : oe, c = re === void 0 ? te.light.grays["gray-500"] : re, y = k === void 0 ? "ISO3" : k, h = _ === void 0 ? !1 : _, N = be === void 0 ? "en" : be, T = xe === void 0 ? 0 : xe, I = z === void 0 ? "light" : z, he = V === void 0 ? !0 : V, Ae = Z === void 0 ? !0 : Z;
|
|
265
299
|
let De;
|
|
266
|
-
e[
|
|
267
|
-
const
|
|
300
|
+
e[0] !== J ? (De = J === void 0 ? [0, 0] : J, e[0] = J, e[1] = De) : De = e[1];
|
|
301
|
+
const Se = De, Be = A === void 0 ? "#999" : A, Fe = B === void 0 ? !0 : B, Ge = ne === void 0 ? !0 : ne;
|
|
268
302
|
let je;
|
|
269
|
-
e[
|
|
303
|
+
e[2] !== q ? (je = q === void 0 ? [] : q, e[2] = q, e[3] = je) : je = e[3];
|
|
304
|
+
const Ie = je, He = we === void 0 ? 0.1 : we, Ue = p === void 0 ? 0.3 : p, qe = R === void 0 ? 1 : R;
|
|
305
|
+
let Ne;
|
|
306
|
+
e[4] !== L ? (Ne = L === void 0 ? [0, 0] : L, e[4] = L, e[5] = Ne) : Ne = e[5];
|
|
307
|
+
const $e = Ne, We = Ce === void 0 ? 0.01 : Ce, _e = le === void 0 ? 4 : le, Ve = ce === void 0 ? 0.15 : ce;
|
|
308
|
+
let ke;
|
|
309
|
+
e[6] !== S ? (ke = S === void 0 ? [{
|
|
270
310
|
type: "ambient",
|
|
271
311
|
color: 4210752,
|
|
272
312
|
intensity: 0.4
|
|
@@ -279,106 +319,106 @@ function to(t) {
|
|
|
279
319
|
y: 10,
|
|
280
320
|
z: 5
|
|
281
321
|
}
|
|
282
|
-
}] :
|
|
283
|
-
const
|
|
322
|
+
}] : S, e[6] = S, e[7] = ke) : ke = e[7];
|
|
323
|
+
const Ze = ke, [Re, rt] = U(void 0), [$, at] = U(0), [me, it] = U(0), Je = Qe(null), st = Qe(null);
|
|
284
324
|
let Le, Oe;
|
|
285
325
|
e[8] === Symbol.for("react.memo_cache_sentinel") ? (Le = () => {
|
|
286
|
-
const
|
|
287
|
-
|
|
326
|
+
const fe = new ResizeObserver((ve) => {
|
|
327
|
+
at(ve[0].target.clientWidth || 620), it(ve[0].target.clientHeight || 480);
|
|
288
328
|
});
|
|
289
|
-
return
|
|
290
|
-
}, Oe = [], e[8] = Le, e[9] = Oe) : (Le = e[8], Oe = e[9]),
|
|
329
|
+
return Je.current && fe.observe(Je.current), () => fe.disconnect();
|
|
330
|
+
}, Oe = [], e[8] = Le, e[9] = Oe) : (Le = e[8], Oe = e[9]), H(Le, Oe);
|
|
331
|
+
let Te;
|
|
332
|
+
e[10] === Symbol.for("react.memo_cache_sentinel") ? (Te = (fe) => {
|
|
333
|
+
rt(fe);
|
|
334
|
+
}, e[10] = Te) : Te = e[10];
|
|
335
|
+
const ue = pt(Te);
|
|
291
336
|
let Me;
|
|
292
|
-
e[
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
e[11] !== w || e[12] !== me ? (Pe = () => {
|
|
298
|
-
typeof w == "string" ? xt(w).then((fe) => {
|
|
299
|
-
if (w === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
|
|
300
|
-
const ot = fe.features.map(Rt);
|
|
301
|
-
me(ot);
|
|
337
|
+
e[11] !== j || e[12] !== ue ? (Me = () => {
|
|
338
|
+
typeof j == "string" ? Nt(j).then((ve) => {
|
|
339
|
+
if (j === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
|
|
340
|
+
const nt = ve.features.map(Ht);
|
|
341
|
+
ue(nt);
|
|
302
342
|
} else
|
|
303
|
-
|
|
304
|
-
}) :
|
|
305
|
-
}, e[11] =
|
|
343
|
+
ue(ve.features);
|
|
344
|
+
}) : ue(j.features);
|
|
345
|
+
}, e[11] = j, e[12] = ue, e[13] = Me) : Me = e[13];
|
|
346
|
+
let Pe;
|
|
347
|
+
e[14] !== j ? (Pe = [j], e[14] = j, e[15] = Pe) : Pe = e[15], H(Me, Pe);
|
|
306
348
|
let ze;
|
|
307
|
-
e[
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
title: p?.title,
|
|
314
|
-
description: p?.description
|
|
349
|
+
e[16] !== s || e[17] !== D?.length || e[18] !== d || e[19] !== O ? (ze = s || (O === "categorical" ? kt(d, "x") : Rt(d.map(It), D?.length || 4)), e[16] = s, e[17] = D?.length, e[18] = d, e[19] = O, e[20] = ze) : ze = e[20];
|
|
350
|
+
const ge = ze, Xe = u?.graphContainer, Ye = m?.graphContainer;
|
|
351
|
+
let K;
|
|
352
|
+
e[21] !== u?.description || e[22] !== u?.title || e[23] !== d || e[24] !== h || e[25] !== l || e[26] !== x || e[27] !== m?.description || e[28] !== m?.title || e[29] !== n ? (K = x || l || h ? /* @__PURE__ */ i.jsx(St, { styles: {
|
|
353
|
+
title: m?.title,
|
|
354
|
+
description: m?.description
|
|
315
355
|
}, classNames: {
|
|
316
|
-
title:
|
|
317
|
-
description:
|
|
318
|
-
}, graphTitle:
|
|
319
|
-
let
|
|
320
|
-
e[31] !==
|
|
321
|
-
height: `${Math.max(
|
|
322
|
-
}, className: "flex items-center justify-center", children: /* @__PURE__ */
|
|
323
|
-
let
|
|
324
|
-
e[
|
|
325
|
-
footnote:
|
|
326
|
-
source:
|
|
356
|
+
title: u?.title,
|
|
357
|
+
description: u?.description
|
|
358
|
+
}, graphTitle: x, graphDescription: l, width: n, graphDownload: void 0, dataDownload: h ? d.map(Gt).filter(Ft).length > 0 ? d.map(Bt).filter(At) : d.filter(Et) : null }) : null, e[21] = u?.description, e[22] = u?.title, e[23] = d, e[24] = h, e[25] = l, e[26] = x, e[27] = m?.description, e[28] = m?.title, e[29] = n, e[30] = K) : K = e[30];
|
|
359
|
+
let Q;
|
|
360
|
+
e[31] !== Ve || e[32] !== Be || e[33] !== he || e[34] !== Se || e[35] !== u || e[36] !== Y || e[37] !== w || e[38] !== D || e[39] !== d || e[40] !== v || e[41] !== Ue || e[42] !== ge || e[43] !== Ae || e[44] !== de || e[45] !== _e || e[46] !== se || e[47] !== $e || e[48] !== o || e[49] !== He || e[50] !== Ie || e[51] !== Ze || e[52] !== c || e[53] !== r || e[54] !== y || e[55] !== Re || e[56] !== T || e[57] !== F || e[58] !== X || e[59] !== We || e[60] !== C || e[61] !== Ge || e[62] !== qe || e[63] !== O || e[64] !== pe || e[65] !== Fe || e[66] !== m || e[67] !== me || e[68] !== $ || e[69] !== I || e[70] !== ae || e[71] !== n ? (Q = /* @__PURE__ */ i.jsx(Lt, { ref: Je, children: $ && me && Re ? /* @__PURE__ */ i.jsx(zt, { data: d, globeOffset: $e, polygonData: Re, colorDomain: ge, width: $, height: me, colors: D || (O === "categorical" ? te[I].sequentialColors[`neutralColorsx0${ge.length}`] : te[I].sequentialColors[`neutralColorsx0${ge.length + 1}`]), mapNoDataColor: r, categorical: O === "categorical", mapBorderColor: c, tooltip: ae, mapProperty: y, styles: m, classNames: u, autoRotate: he === !0 ? 1.5 : he === !1 ? 0 : he, enableZoom: Ae, globeMaterial: se, atmosphereColor: Be, colorLegendTitle: w, showColorScale: Fe, hoverStrokeColor: I === "light" ? te.light.grays["gray-700"] : te.light.grays["gray-300"], highlightedIds: Ie, resetSelectionOnDoubleClick: Ge, detailsOnClick: v, onSeriesMouseOver: X, onSeriesMouseClick: F, scale: qe, polygonAltitude: We, centerLat: Se[0], centerLng: Se[1], atmosphereAltitude: Ve, globeCurvatureResolution: _e, fogSettings: de, lights: Ze, highlightedAltitude: He, selectedId: pe, collapseColorScaleByDefault: Y, dimmedOpacity: Ue }) : /* @__PURE__ */ i.jsx("div", { style: {
|
|
361
|
+
height: `${Math.max(T, o || (C ? T ? (n || $) * C > T ? (n || $) * C : T : (n || $) * C : me))}px`
|
|
362
|
+
}, className: "flex items-center justify-center", children: /* @__PURE__ */ i.jsx(ht, { "aria-label": "Loading graph" }) }) }), e[31] = Ve, e[32] = Be, e[33] = he, e[34] = Se, e[35] = u, e[36] = Y, e[37] = w, e[38] = D, e[39] = d, e[40] = v, e[41] = Ue, e[42] = ge, e[43] = Ae, e[44] = de, e[45] = _e, e[46] = se, e[47] = $e, e[48] = o, e[49] = He, e[50] = Ie, e[51] = Ze, e[52] = c, e[53] = r, e[54] = y, e[55] = Re, e[56] = T, e[57] = F, e[58] = X, e[59] = We, e[60] = C, e[61] = Ge, e[62] = qe, e[63] = O, e[64] = pe, e[65] = Fe, e[66] = m, e[67] = me, e[68] = $, e[69] = I, e[70] = ae, e[71] = n, e[72] = Q) : Q = e[72];
|
|
363
|
+
let ee;
|
|
364
|
+
e[73] !== u?.footnote || e[74] !== u?.source || e[75] !== G || e[76] !== g || e[77] !== m?.footnote || e[78] !== m?.source || e[79] !== n ? (ee = g || G ? /* @__PURE__ */ i.jsx(jt, { styles: {
|
|
365
|
+
footnote: m?.footnote,
|
|
366
|
+
source: m?.source
|
|
327
367
|
}, classNames: {
|
|
328
|
-
footnote:
|
|
329
|
-
source:
|
|
330
|
-
}, sources: g, footNote:
|
|
368
|
+
footnote: u?.footnote,
|
|
369
|
+
source: u?.source
|
|
370
|
+
}, sources: g, footNote: G, width: n }) : null, e[73] = u?.footnote, e[74] = u?.source, e[75] = G, e[76] = g, e[77] = m?.footnote, e[78] = m?.source, e[79] = n, e[80] = ee) : ee = e[80];
|
|
331
371
|
let Ee;
|
|
332
|
-
return e[
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
] }), e[
|
|
372
|
+
return e[81] !== E || e[82] !== a || e[83] !== ie || e[84] !== o || e[85] !== N || e[86] !== T || e[87] !== P || e[88] !== C || e[89] !== Xe || e[90] !== Ye || e[91] !== K || e[92] !== Q || e[93] !== ee || e[94] !== I || e[95] !== n ? (Ee = /* @__PURE__ */ i.jsxs(Ot, { className: Xe, style: Ye, id: ie, ref: st, "aria-label": E, backgroundColor: a, theme: I, language: N, minHeight: T, width: n, height: o, relativeHeight: C, padding: P, children: [
|
|
373
|
+
K,
|
|
374
|
+
Q,
|
|
375
|
+
ee
|
|
376
|
+
] }), e[81] = E, e[82] = a, e[83] = ie, e[84] = o, e[85] = N, e[86] = T, e[87] = P, e[88] = C, e[89] = Xe, e[90] = Ye, e[91] = K, e[92] = Q, e[93] = ee, e[94] = I, e[95] = n, e[96] = Ee) : Ee = e[96], Ee;
|
|
337
377
|
}
|
|
338
|
-
function
|
|
378
|
+
function Et(t) {
|
|
339
379
|
return t !== void 0;
|
|
340
380
|
}
|
|
341
|
-
function
|
|
381
|
+
function At(t) {
|
|
342
382
|
return t !== void 0;
|
|
343
383
|
}
|
|
344
|
-
function
|
|
384
|
+
function Bt(t) {
|
|
345
385
|
return t.data;
|
|
346
386
|
}
|
|
347
|
-
function
|
|
387
|
+
function Ft(t) {
|
|
348
388
|
return t !== void 0;
|
|
349
389
|
}
|
|
350
|
-
function
|
|
390
|
+
function Gt(t) {
|
|
351
391
|
return t.data;
|
|
352
392
|
}
|
|
353
|
-
function
|
|
393
|
+
function It(t) {
|
|
354
394
|
return t.x;
|
|
355
395
|
}
|
|
356
|
-
function
|
|
396
|
+
function Ht(t) {
|
|
357
397
|
if (t.geometry.type === "Polygon") {
|
|
358
|
-
const
|
|
398
|
+
const b = [...t.geometry.coordinates[0]].reverse(), x = {
|
|
359
399
|
...t.geometry,
|
|
360
|
-
coordinates: [
|
|
400
|
+
coordinates: [b]
|
|
361
401
|
};
|
|
362
402
|
return {
|
|
363
403
|
...t,
|
|
364
|
-
geometry:
|
|
404
|
+
geometry: x
|
|
365
405
|
};
|
|
366
406
|
}
|
|
367
407
|
const e = [];
|
|
368
|
-
t.geometry.coordinates.forEach((
|
|
369
|
-
const
|
|
370
|
-
e.push([
|
|
408
|
+
t.geometry.coordinates.forEach((b) => {
|
|
409
|
+
const x = [...b[0]].reverse();
|
|
410
|
+
e.push([x]);
|
|
371
411
|
});
|
|
372
|
-
const
|
|
412
|
+
const d = {
|
|
373
413
|
...t.geometry,
|
|
374
414
|
coordinates: e
|
|
375
415
|
};
|
|
376
416
|
return {
|
|
377
417
|
...t,
|
|
378
|
-
geometry:
|
|
418
|
+
geometry: d
|
|
379
419
|
};
|
|
380
420
|
}
|
|
381
421
|
export {
|
|
382
|
-
|
|
422
|
+
po as ThreeDGlobe
|
|
383
423
|
};
|
|
384
424
|
//# sourceMappingURL=ThreeDGlobe.js.map
|