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