@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.
Files changed (47) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.d.ts +2 -0
  4. package/dist/BarGraph.js +1180 -1170
  5. package/dist/BarGraph.js.map +1 -1
  6. package/dist/DumbbellChart.cjs +1 -1
  7. package/dist/DumbbellChart.cjs.map +1 -1
  8. package/dist/DumbbellChart.d.ts +2 -0
  9. package/dist/DumbbellChart.js +354 -345
  10. package/dist/DumbbellChart.js.map +1 -1
  11. package/dist/GraphEl-C0FNZlDn.cjs +2 -0
  12. package/dist/GraphEl-C0FNZlDn.cjs.map +1 -0
  13. package/dist/{GraphEl-BdIyscdt.js → GraphEl-DfPT8ffl.js} +3 -1
  14. package/dist/GraphEl-DfPT8ffl.js.map +1 -0
  15. package/dist/GriddedGraphs.cjs +1 -1
  16. package/dist/GriddedGraphs.d.ts +4 -7
  17. package/dist/GriddedGraphs.js +1 -1
  18. package/dist/GriddedGraphsFromConfig.d.ts +4 -7
  19. package/dist/MultiGraphDashboard.d.ts +4 -7
  20. package/dist/MultiGraphDashboardFromConfig.d.ts +4 -7
  21. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +4 -7
  22. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +4 -7
  23. package/dist/PerformanceIntensiveScrollStory.d.ts +4 -7
  24. package/dist/ScrollStory.d.ts +4 -7
  25. package/dist/SingleGraphDashboard.cjs +1 -1
  26. package/dist/SingleGraphDashboard.d.ts +4 -7
  27. package/dist/SingleGraphDashboard.js +1 -1
  28. package/dist/SingleGraphDashboardFromConfig.d.ts +4 -7
  29. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +4 -7
  30. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +4 -7
  31. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  32. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  33. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +4 -7
  34. package/dist/SingleGraphDashboardThreeDGraphs.js +28 -25
  35. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  36. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +4 -7
  37. package/dist/ThreeDGlobe.cjs +1 -1
  38. package/dist/ThreeDGlobe.cjs.map +1 -1
  39. package/dist/ThreeDGlobe.d.ts +11 -2
  40. package/dist/ThreeDGlobe.js +316 -282
  41. package/dist/ThreeDGlobe.js.map +1 -1
  42. package/dist/Types.d.ts +4 -7
  43. package/dist/index.d.ts +19 -9
  44. package/package.json +1 -1
  45. package/dist/GraphEl-B5gAX1IQ.cjs +0 -2
  46. package/dist/GraphEl-B5gAX1IQ.cjs.map +0 -1
  47. package/dist/GraphEl-BdIyscdt.js.map +0 -1
@@ -1,119 +1,148 @@
1
- import { j as e, m as de } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { useRef as ne, useState as C, useEffect as L } from "react";
3
- import { y as ge } from "./Spinner-C85UF28E.js";
4
- import me from "react-globe.gl";
5
- import { i as pe } from "./index-27yTRcko.js";
6
- import * as he from "three";
7
- import { X as ue } from "./Modal-DVVwpKhP.js";
8
- import { u as se } from "./Typography-Ctgfl1J5.js";
9
- import { T as fe } from "./Tooltip-DyM5snqx.js";
10
- import { n as ye } from "./numberFormattingFunction-14YCbkN2.js";
11
- import { X as xe } from "./index-BmCqpO1B.js";
12
- import { s as ve } from "./string2HTML-CWHGfz_d.js";
13
- import { o as be } from "./ordinal-w9Lu4Stb.js";
14
- import { t as je } from "./threshold-DFfqcDMa.js";
15
- import { GraphHeader as we } from "./GraphHeader.js";
16
- import { GraphFooter as Ce } from "./GraphFooter.js";
17
- import { f as ke } from "./fetchAndParseData-4gsYTy6_.js";
18
- import { Colors as M } from "./Colors.js";
19
- import { g as De } from "./getUniqValue-BtUENB2H.js";
20
- import { g as Ne } from "./getJenks-VhM3GIoC.js";
21
- function Se(V) {
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: h,
24
- autoRotate: g,
23
+ width: p,
24
+ autoRotate: d,
25
25
  data: u,
26
- enableZoom: O,
27
- categorical: k,
28
- colorDomain: c,
29
- colors: r,
30
- globeMaterial: i,
31
- height: E,
32
- polygonData: Z,
33
- mapProperty: d,
34
- mapBorderColor: P,
35
- atmosphereColor: A,
36
- tooltip: B,
37
- styles: x,
38
- classNames: J,
39
- mapNoDataColor: m,
40
- centerPoint: G,
41
- colorLegendTitle: T,
42
- showColorScale: _,
43
- hoverStrokeColor: I,
44
- detailsOnClick: p,
45
- onSeriesMouseClick: l,
46
- onSeriesMouseOver: D,
47
- resetSelectionOnDoubleClick: Y,
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: R,
51
- polygonAltitude: K,
52
- centerLng: W,
53
- centerLat: N
54
- } = V, s = ne(void 0), [b, S] = C(void 0), [Q, z] = C(!(h < 680)), [U, ee] = C({ x: 0, y: 0 }), [v, te] = C(void 0), q = k ? be().domain(c).range(r) : je().domain(c).range(r);
55
- L(() => {
56
- s?.current && (s.current.controls().autoRotate = g !== 0, s.current.controls().enableZoom = O, s.current.controls().autoRotateSpeed = g);
57
- }, [g, O]), L(() => {
58
- s.current && (v ? s.current.controls().autoRotate = !1 : s.current.controls().autoRotate = g !== 0);
59
- }, [v, g]), L(() => {
60
- const o = s.current?.renderer().domElement;
61
- if (!o) return;
62
- const t = (a) => {
63
- ee({ x: a.clientX, y: a.clientY });
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 o.addEventListener("mousemove", t), () => o.removeEventListener("mousemove", t);
66
- }, []), L(() => {
67
- s.current && s.current.pointOfView({ lat: N, lng: W, altitude: y }, 1e3);
68
- }, [y, W, N]);
69
- const F = new he.MeshLambertMaterial({
70
- color: "#fff",
71
- opacity: 1,
72
- transparent: !1,
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 /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
76
- /* @__PURE__ */ e.jsx(
77
- me,
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: s,
80
- width: h,
81
- height: E,
82
- globeOffset: R,
91
+ ref: a,
92
+ width: p,
93
+ height: I,
94
+ globeOffset: j,
83
95
  lineHoverPrecision: 0,
84
- polygonsData: Z,
85
- polygonAltitude: (o) => f.includes(o?.properties?.[d]) ? 0.1 : o?.properties?.[d] === v?.id ? 0.01 : K,
86
- polygonCapColor: (o) => {
87
- const t = o?.properties?.[d], a = u.find((j) => j.id === t)?.x;
88
- return a != null ? q(a) : m;
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: (o) => {
91
- const t = o?.properties?.[d], a = u.find((X) => X.id === t)?.x, j = a != null ? q(a) : m;
92
- return f.includes(o?.properties?.[d]) ? j : "rgba(100,100,100,0)";
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: (o) => o?.properties?.[d] === v?.id ? I : P,
95
- onPolygonClick: (o) => {
96
- const t = o?.properties?.[d] ? u.find((a) => a.id === o?.properties?.[d]) : void 0;
97
- (l || p) && (pe(b, t) && Y && t ? (S(void 0), l?.(void 0)) : (S(t), l?.(t))), S(t), l?.(t);
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: (o) => {
100
- const t = o?.properties?.[d] ? u.find((a) => a.id === o?.properties?.[d]) : void 0;
101
- te(t), D?.(t);
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: A,
104
- globeMaterial: F,
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
- s.current && s.current.pointOfView({
109
- lat: G[0],
110
- lng: G[1]
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
- _ === !1 ? null : /* @__PURE__ */ e.jsx("div", { className: "absolute left-4 bottom-4", children: Q ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
116
- /* @__PURE__ */ e.jsx(
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
- z(!1);
162
+ X(!1);
134
163
  },
135
- children: /* @__PURE__ */ e.jsx(xe, {})
164
+ children: /* @__PURE__ */ t.jsx(je, {})
136
165
  }
137
166
  ),
138
- /* @__PURE__ */ e.jsxs(
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: k ? void 0 : "340px"
173
+ width: M ? void 0 : "340px"
145
174
  },
146
175
  children: [
147
- T && T !== "" ? /* @__PURE__ */ e.jsx(
148
- se,
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: T
187
+ children: H
159
188
  }
160
189
  ) : null,
161
- k ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3", children: c.map((o, t) => /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
162
- /* @__PURE__ */ e.jsx(
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: r[t % r.length] }
195
+ style: { backgroundColor: i[o % i.length] }
167
196
  }
168
197
  ),
169
- /* @__PURE__ */ e.jsx(se, { size: "sm", marginBottom: "none", leading: "none", children: o })
170
- ] }, t)) }) : /* @__PURE__ */ e.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ e.jsxs("g", { children: [
171
- c.map((o, t) => /* @__PURE__ */ e.jsxs("g", { className: "cursor-pointer", children: [
172
- /* @__PURE__ */ e.jsx(
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: t * 320 / r.length + 1,
204
+ x: o * 320 / i.length + 1,
176
205
  y: 1,
177
- width: 320 / r.length - 2,
206
+ width: 320 / i.length - 2,
178
207
  height: 8,
179
208
  style: {
180
- fill: r[t],
181
- stroke: r[t]
209
+ fill: i[o],
210
+ stroke: i[o]
182
211
  }
183
212
  }
184
213
  ),
185
- /* @__PURE__ */ e.jsx(
214
+ /* @__PURE__ */ t.jsx(
186
215
  "text",
187
216
  {
188
- x: (t + 1) * 320 / r.length,
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: ye(o, "NA")
221
+ children: be(e, "NA")
193
222
  }
194
223
  )
195
- ] }, t)),
196
- /* @__PURE__ */ e.jsx("g", { children: /* @__PURE__ */ e.jsx(
224
+ ] }, o)),
225
+ /* @__PURE__ */ t.jsx("g", { children: /* @__PURE__ */ t.jsx(
197
226
  "rect",
198
227
  {
199
- x: c.length * 320 / r.length + 1,
228
+ x: l.length * 320 / i.length + 1,
200
229
  y: 1,
201
- width: 320 / r.length - 2,
230
+ width: 320 / i.length - 2,
202
231
  height: 8,
203
232
  style: {
204
- fill: r[c.length],
205
- stroke: r[c.length]
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__ */ e.jsx(
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
- z(!0);
248
+ X(!0);
220
249
  },
221
- children: /* @__PURE__ */ e.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" })
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
- v && B ? /* @__PURE__ */ e.jsx(
225
- fe,
253
+ w && z ? /* @__PURE__ */ t.jsx(
254
+ ve,
226
255
  {
227
- data: v,
228
- body: B,
229
- xPos: U.x,
230
- yPos: U.y,
231
- backgroundStyle: x?.tooltip,
232
- className: J?.tooltip
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
- p && b !== void 0 ? /* @__PURE__ */ e.jsx(
236
- ue,
264
+ f && D !== void 0 ? /* @__PURE__ */ t.jsx(
265
+ xe,
237
266
  {
238
- open: b !== void 0,
267
+ open: D !== void 0,
239
268
  onClose: () => {
240
- S(void 0);
269
+ P(void 0);
241
270
  },
242
- children: /* @__PURE__ */ e.jsx(
271
+ children: /* @__PURE__ */ t.jsx(
243
272
  "div",
244
273
  {
245
274
  className: "graph-modal-content m-0",
246
- dangerouslySetInnerHTML: typeof p == "string" ? { __html: ve(p, b) } : void 0,
247
- children: typeof p == "function" ? p(b) : null
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 Ve(V) {
283
+ function _e(_) {
255
284
  const {
256
- data: h,
257
- mapData: g = "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",
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: O,
260
- sources: k,
261
- graphDescription: c,
262
- height: r,
263
- width: i,
264
- footNote: E = "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.",
265
- colorDomain: Z,
266
- colorLegendTitle: d,
267
- scaleType: P = "threshold",
268
- padding: A,
269
- mapNoDataColor: B = M.light.graphNoData,
270
- backgroundColor: x = !1,
271
- mapBorderColor: J = M.light.grays["gray-500"],
272
- relativeHeight: m,
273
- tooltip: G,
274
- graphID: T,
275
- mapProperty: _ = "ISO3",
276
- dataDownload: I = !1,
277
- language: p = "en",
278
- minHeight: l = 0,
279
- theme: D = "light",
280
- ariaLabel: Y,
281
- styles: f,
282
- classNames: y,
283
- autoRotate: R = !0,
284
- enableZoom: K = !0,
285
- globeMaterial: W,
286
- centerPoint: N = [0, 0],
287
- atmosphereColor: s = "#999",
288
- showColorScale: b = !0,
289
- resetSelectionOnDoubleClick: S = !0,
290
- detailsOnClick: Q,
291
- onSeriesMouseOver: z,
292
- onSeriesMouseClick: U,
293
- highlightedIds: ee = [],
294
- scale: v = 1,
295
- globeOffset: te = [0, 0],
296
- polygonAltitude: q = 0.01
297
- } = V, [F, o] = C(void 0), [t, a] = C(0), [j, X] = C(0), H = ne(null);
298
- L(() => {
299
- const n = new ResizeObserver(($) => {
300
- a(i || $[0].target.clientWidth || 760), X(r || $[0].target.clientHeight || 480);
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 H.current && (X(H.current.clientHeight || 480), a(H.current.clientWidth || 760), i || n.observe(H.current)), () => n.disconnect();
303
- }, [i, r]), L(() => {
304
- typeof g == "string" ? ke(g).then(($) => {
305
- if (g === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
306
- const le = $.features.map((w) => {
307
- if (w.geometry.type === "Polygon") {
308
- const re = [...w.geometry.coordinates[0]].reverse(), ae = { ...w.geometry, coordinates: [re] };
309
- return { ...w, geometry: ae };
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 ie = [];
312
- w.geometry.coordinates.forEach((re) => {
313
- const ae = [...re[0]].reverse();
314
- ie.push([ae]);
343
+ const ce = [];
344
+ N.geometry.coordinates.forEach((ne) => {
345
+ const le = [...ne[0]].reverse();
346
+ ce.push([le]);
315
347
  });
316
- const ce = { ...w.geometry, coordinates: ie };
317
- return { ...w, geometry: ce };
348
+ const me = { ...N.geometry, coordinates: ce };
349
+ return { ...N, geometry: me };
318
350
  });
319
- o(le);
320
- } else o($.features);
321
- }) : o(g.features);
322
- }, [g]);
323
- const oe = Z || (P === "categorical" ? De(h, "x") : Ne(
324
- h.map((n) => n.x),
325
- O?.length || 4
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__ */ e.jsx(
359
+ return /* @__PURE__ */ t.jsx(
328
360
  "div",
329
361
  {
330
- className: `${D || "light"} flex ${i ? "w-fit grow-0" : "w-full grow"}`,
331
- dir: p === "he" || p === "ar" ? "rtl" : void 0,
332
- children: /* @__PURE__ */ e.jsx(
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: de(
336
- `${x ? x === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${p || "en"}`,
337
- y?.graphContainer
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
- ...f?.graphContainer || {},
341
- ...x && x !== !0 ? { backgroundColor: x } : {}
372
+ ...y?.graphContainer || {},
373
+ ...v && v !== !0 ? { backgroundColor: v } : {}
342
374
  },
343
- id: T,
344
- "aria-label": Y || `${u ? `The graph shows ${u}. ` : ""}This is a map.${c ? ` ${c}` : ""}`,
345
- children: /* @__PURE__ */ e.jsx(
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: x ? A || "1rem" : A || 0 },
350
- children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
351
- u || c || I ? /* @__PURE__ */ e.jsx(
352
- we,
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: c,
364
- width: i,
395
+ graphDescription: l,
396
+ width: s,
365
397
  graphDownload: void 0,
366
- dataDownload: I ? h.map((n) => n.data).filter((n) => n !== void 0).length > 0 ? h.map((n) => n.data).filter((n) => n !== void 0) : h.filter((n) => n !== void 0) : null
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__ */ e.jsx(
401
+ /* @__PURE__ */ t.jsx(
370
402
  "div",
371
403
  {
372
404
  className: "flex flex-col grow justify-center leading-0",
373
- ref: H,
405
+ ref: k,
374
406
  "aria-label": "Map area",
375
- children: (i || t) && (r || j) && F ? /* @__PURE__ */ e.jsx(
376
- Se,
407
+ children: (s || r) && (i || x) && e ? /* @__PURE__ */ t.jsx(
408
+ Oe,
377
409
  {
378
- data: h,
379
- globeOffset: te,
380
- polygonData: F,
381
- colorDomain: oe,
382
- width: i || t,
410
+ data: p,
411
+ globeOffset: re,
412
+ polygonData: e,
413
+ colorDomain: se,
414
+ width: s || r,
383
415
  height: Math.max(
384
- l,
385
- r || (m ? l ? (i || t) * m > l ? (i || t) * m : l : (i || t) * m : j)
416
+ h,
417
+ i || (g ? h ? (s || r) * g > h ? (s || r) * g : h : (s || r) * g : x)
386
418
  ),
387
- colors: O || (P === "categorical" ? M[D].sequentialColors[`neutralColorsx0${oe.length}`] : M[D].sequentialColors[`neutralColorsx0${oe.length + 1}`]),
388
- mapNoDataColor: B,
389
- categorical: P === "categorical",
390
- mapBorderColor: J,
391
- tooltip: G,
392
- mapProperty: _,
393
- styles: f,
394
- classNames: y,
395
- autoRotate: R === !0 ? 1.5 : R === !1 ? 0 : R,
396
- enableZoom: K,
397
- globeMaterial: W,
398
- atmosphereColor: s,
399
- centerPoint: N,
400
- colorLegendTitle: d,
401
- showColorScale: b,
402
- hoverStrokeColor: D === "light" ? M.light.grays["gray-700"] : M.light.grays["gray-300"],
403
- highlightedIds: ee,
404
- resetSelectionOnDoubleClick: S,
405
- detailsOnClick: Q,
406
- onSeriesMouseOver: z,
407
- onSeriesMouseClick: U,
408
- scale: v,
409
- polygonAltitude: q,
410
- centerLat: N[0],
411
- centerLng: N[1]
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__ */ e.jsx(
447
+ ) : /* @__PURE__ */ t.jsx(
414
448
  "div",
415
449
  {
416
450
  style: {
417
451
  height: `${Math.max(
418
- l,
419
- r || (m ? l ? (i || t) * m > l ? (i || t) * m : l : (i || t) * m : j)
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__ */ e.jsx(ge, { "aria-label": "Loading graph" })
457
+ children: /* @__PURE__ */ t.jsx(ue, { "aria-label": "Loading graph" })
424
458
  }
425
459
  )
426
460
  }
427
461
  ),
428
- k || E ? /* @__PURE__ */ e.jsx(
429
- Ce,
462
+ M || I ? /* @__PURE__ */ t.jsx(
463
+ Ne,
430
464
  {
431
- styles: { footnote: f?.footnote, source: f?.source },
465
+ styles: { footnote: y?.footnote, source: y?.source },
432
466
  classNames: {
433
- footnote: y?.footnote,
434
- source: y?.source
467
+ footnote: j?.footnote,
468
+ source: j?.source
435
469
  },
436
- sources: k,
437
- footNote: E,
438
- width: i
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
- Ve as ThreeDGlobe
484
+ _e as ThreeDGlobe
451
485
  };
452
486
  //# sourceMappingURL=ThreeDGlobe.js.map