@undp/data-viz 1.4.2 → 1.4.3

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