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