@undp/data-viz 2.0.5 → 2.0.7

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 (70) hide show
  1. package/dist/BulletChart.cjs +1 -1
  2. package/dist/BulletChart.cjs.map +1 -1
  3. package/dist/BulletChart.d.ts +2 -0
  4. package/dist/BulletChart.js +515 -508
  5. package/dist/BulletChart.js.map +1 -1
  6. package/dist/ChoroplethMap.cjs +1 -1
  7. package/dist/ChoroplethMap.cjs.map +1 -1
  8. package/dist/ChoroplethMap.js +68 -68
  9. package/dist/ChoroplethMap.js.map +1 -1
  10. package/dist/GraphEl-BcKU0bG1.cjs +2 -0
  11. package/dist/GraphEl-BcKU0bG1.cjs.map +1 -0
  12. package/dist/{GraphEl-VtiYqELy.js → GraphEl-CGq1EWRn.js} +70 -8
  13. package/dist/GraphEl-CGq1EWRn.js.map +1 -0
  14. package/dist/GriddedGraphs.cjs +1 -1
  15. package/dist/GriddedGraphs.d.ts +6 -1
  16. package/dist/GriddedGraphs.js +2 -2
  17. package/dist/GriddedGraphsFromConfig.d.ts +6 -1
  18. package/dist/HybridMap.cjs +2 -0
  19. package/dist/HybridMap.cjs.map +1 -0
  20. package/dist/HybridMap.d.ts +211 -0
  21. package/dist/HybridMap.js +599 -0
  22. package/dist/HybridMap.js.map +1 -0
  23. package/dist/MultiGraphDashboard.d.ts +6 -1
  24. package/dist/MultiGraphDashboardFromConfig.d.ts +6 -1
  25. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +6 -1
  26. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +6 -1
  27. package/dist/PerformanceIntensiveScrollStory.d.ts +6 -1
  28. package/dist/ScrollStory.d.ts +6 -1
  29. package/dist/SingleGraphDashboard.cjs +1 -1
  30. package/dist/SingleGraphDashboard.d.ts +6 -1
  31. package/dist/SingleGraphDashboard.js +2 -2
  32. package/dist/SingleGraphDashboardFromConfig.d.ts +6 -1
  33. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +5 -0
  34. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +5 -0
  35. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  36. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +5 -0
  37. package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
  38. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +5 -0
  39. package/dist/ThreeDGlobe.cjs.map +1 -1
  40. package/dist/ThreeDGlobe.d.ts +1 -1
  41. package/dist/ThreeDGlobe.js.map +1 -1
  42. package/dist/Types.d.ts +17 -1
  43. package/dist/getSchema.cjs +1 -1
  44. package/dist/getSchema.cjs.map +1 -1
  45. package/dist/getSchema.d.ts +3 -3
  46. package/dist/getSchema.js +4 -0
  47. package/dist/getSchema.js.map +1 -1
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.ts +356 -221
  50. package/dist/index.js +163 -161
  51. package/dist/index.js.map +1 -1
  52. package/dist/transformData.cjs +1 -1
  53. package/dist/transformData.d.ts +1 -1
  54. package/dist/transformData.js +2 -2
  55. package/dist/{transformDataForAggregation-CE3bAlHU.js → transformDataForAggregation-CjwEAUOR.js} +62 -31
  56. package/dist/transformDataForAggregation-CjwEAUOR.js.map +1 -0
  57. package/dist/transformDataForAggregation-DAGK2BZy.cjs +2 -0
  58. package/dist/transformDataForAggregation-DAGK2BZy.cjs.map +1 -0
  59. package/dist/{transformDataForGraphFromFile-DaJHQCsL.cjs → transformDataForGraphFromFile-B1zJSPRP.cjs} +2 -2
  60. package/dist/{transformDataForGraphFromFile-DaJHQCsL.cjs.map → transformDataForGraphFromFile-B1zJSPRP.cjs.map} +1 -1
  61. package/dist/{transformDataForGraphFromFile-BExxcITV.js → transformDataForGraphFromFile-D5TMQYYd.js} +2 -2
  62. package/dist/{transformDataForGraphFromFile-BExxcITV.js.map → transformDataForGraphFromFile-D5TMQYYd.js.map} +1 -1
  63. package/dist/validateSchema.d.ts +1 -1
  64. package/package.json +6 -1
  65. package/dist/GraphEl-D5RBCD7p.cjs +0 -2
  66. package/dist/GraphEl-D5RBCD7p.cjs.map +0 -1
  67. package/dist/GraphEl-VtiYqELy.js.map +0 -1
  68. package/dist/transformDataForAggregation-CE3bAlHU.js.map +0 -1
  69. package/dist/transformDataForAggregation-KXGm6flX.cjs +0 -2
  70. package/dist/transformDataForAggregation-KXGm6flX.cjs.map +0 -1
@@ -0,0 +1,599 @@
1
+ import { _ as Ie, m as Ce, b as Ne, j as r, c as Le } from "./index-CHPV5EwG-Curnpaqc.js";
2
+ import * as ze from "react";
3
+ import Pe, { useState as L, useRef as Ft, useEffect as ae, useEffectEvent as _e } from "react";
4
+ import { p as Be, f as Ve } from "./parse-DlCRUFh_.js";
5
+ import { g as Te, N as We } from "./getSliderMarks-HIDJ0_Cd.js";
6
+ import { w as Ae } from "./Spinner-D7rnnwnA.js";
7
+ import { i as we } from "./index-Bwrro8-q.js";
8
+ import { z as Fe, t as He, g as Re, a as qe, b as Ge, c as Ue, d as Xe } from "./zoom-C9MFjAaV.js";
9
+ import { l as Ye } from "./Modal-DGcuAHyK.js";
10
+ import { j as xe } from "./Typography-PxtFcnJb.js";
11
+ import { t as Je } from "./index-GEsywGxz.js";
12
+ import { n as ke } from "./Source-DwTHB8fn.js";
13
+ import { w as Ke } from "./index-Dzc_aaI9-Bb7gobH_.js";
14
+ import { T as Ze } from "./Tooltip-CwWUegPB.js";
15
+ import { s as Qe } from "./string2HTML-DhG75NqA.js";
16
+ import { X as to, P as eo, e as oo } from "./index-D491FEn1.js";
17
+ import { s as ro } from "./pow-DE4c7dbW.js";
18
+ import { o as ao } from "./ordinal-P77xw8aL.js";
19
+ import { t as io } from "./threshold-Bgr20hik.js";
20
+ import { s as ve } from "./select-DKy99ogv.js";
21
+ import { c as ie } from "./checkIfNullOrUndefined-DmfiKkNw.js";
22
+ import { n as no } from "./numberFormattingFunction-14YCbkN2.js";
23
+ import { u as lo } from "./use-in-view-Cxa7y1TH.js";
24
+ import { m as ut } from "./proxy-BxkFHwUw.js";
25
+ import { A as so } from "./index-BqfRwk1n.js";
26
+ import { GraphFooter as co } from "./GraphFooter.js";
27
+ import { GraphHeader as mo } from "./GraphHeader.js";
28
+ import { Colors as St } from "./Colors.js";
29
+ import { f as po } from "./fetchAndParseData-BpqkBPQL.js";
30
+ import { u as uo } from "./uniqBy-BHy4I8PK.js";
31
+ import { a as ho, G as go } from "./GraphContainer-CRqzdKu2.js";
32
+ import { s as fo } from "./sort-BIvMlUH1.js";
33
+ import { g as yo } from "./getUniqValue-BKHCm3zE.js";
34
+ import { g as xo } from "./getJenks-BbngDoBQ.js";
35
+ import { a as vo } from "./init-BJFW6EwE.js";
36
+ var bo = "Separator", je = "horizontal", wo = ["horizontal", "vertical"], De = ze.forwardRef((i, t) => {
37
+ const { decorative: e, orientation: p = je, ...v } = i, n = ko(p) ? p : je, b = e ? { role: "none" } : { "aria-orientation": n === "vertical" ? n : void 0, role: "separator" };
38
+ return /* @__PURE__ */ Ne.jsx(
39
+ Ke.div,
40
+ {
41
+ "data-orientation": n,
42
+ ...b,
43
+ ...v,
44
+ ref: t
45
+ }
46
+ );
47
+ });
48
+ De.displayName = bo;
49
+ function ko(i) {
50
+ return wo.includes(i);
51
+ }
52
+ var $e = De;
53
+ const Se = Pe.forwardRef((i, t) => {
54
+ const e = Ie.c(14);
55
+ let p, v, n, b;
56
+ e[0] !== i ? ({
57
+ className: p,
58
+ variant: n,
59
+ orientation: b,
60
+ ...v
61
+ } = i, e[0] = i, e[1] = p, e[2] = v, e[3] = n, e[4] = b) : (p = e[1], v = e[2], n = e[3], b = e[4]);
62
+ const w = n === void 0 ? "dark" : n, c = b === void 0 ? "horizontal" : b, u = c === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", S = w === "dark" ? "bg-primary-gray-600 dark:bg-primary-gray-200" : "bg-primary-gray-400 dark:bg-primary-gray-550";
63
+ let N;
64
+ e[5] !== p || e[6] !== u || e[7] !== S ? (N = Ce(u, S, p), e[5] = p, e[6] = u, e[7] = S, e[8] = N) : N = e[8];
65
+ let z;
66
+ return e[9] !== c || e[10] !== v || e[11] !== t || e[12] !== N ? (z = /* @__PURE__ */ Ne.jsx($e, { ...v, ref: t, orientation: c, className: N }), e[9] = c, e[10] = v, e[11] = t, e[12] = N, e[13] = z) : z = e[13], z;
67
+ });
68
+ Se.displayName = $e.displayName;
69
+ function jo(i) {
70
+ const {
71
+ data: t,
72
+ colors: e,
73
+ mapData: p,
74
+ mapColorLegendTitle: v,
75
+ colorDomain: n,
76
+ radius: b,
77
+ height: w,
78
+ width: c,
79
+ scale: u,
80
+ centerPoint: S,
81
+ tooltip: N,
82
+ showLabels: z,
83
+ mapBorderWidth: tt,
84
+ mapBorderColor: et,
85
+ mapNoDataColor: ht,
86
+ onSeriesMouseOver: J,
87
+ showColorScale: Mt,
88
+ zoomScaleExtend: Ht,
89
+ zoomTranslateExtend: Rt,
90
+ highlightedDataPoints: Ot,
91
+ onSeriesMouseClick: A,
92
+ resetSelectionOnDoubleClick: Et,
93
+ detailsOnClick: O,
94
+ styles: E,
95
+ classNames: gt,
96
+ mapProjection: ot,
97
+ zoomInteraction: K,
98
+ animate: g,
99
+ dimmedOpacity: F,
100
+ customLayers: ft,
101
+ maxRadiusValue: yt,
102
+ categorical: rt,
103
+ dotColor: Z,
104
+ collapseColorScaleByDefault: It,
105
+ highlightedIds: at,
106
+ mapProperty: xt,
107
+ dotLegendTitle: vt,
108
+ dotBorderColor: Lt,
109
+ labelColor: zt
110
+ } = i, [P, _] = L(void 0), [y, f] = L(It === void 0 ? !(c < 680) : !It), it = Ft(null), [H, Q] = L(void 0), [Pt, I] = L(void 0), [nt, R] = L(void 0), [bt, q] = L(void 0), B = Ft(null), G = lo(B, {
111
+ once: g.once,
112
+ amount: g.amount
113
+ }), wt = Ft(null), V = t.filter((o) => o.radius === void 0 || o.radius === null).length !== t.length ? ro().domain([0, yt]).range([0.25, b]).nice() : void 0, qt = rt ? ao().domain(n).range(e) : io().domain(n).range(e);
114
+ ae(() => {
115
+ const o = ve(wt.current), a = ve(B.current), M = (d) => {
116
+ if (K === "noZoom") return !1;
117
+ if (K === "button") return !d.type.includes("wheel");
118
+ const s = d.type === "wheel", k = d.type.startsWith("touch"), m = d.type === "mousedown" || d.type === "mousemove";
119
+ return k ? !0 : s ? K === "scroll" ? !0 : d.ctrlKey : m && !d.button && !d.ctrlKey;
120
+ }, l = Fe().scaleExtent(Ht).translateExtent(Rt || [[-20, -20], [c + 20, w + 20]]).filter(M).on("zoom", ({
121
+ transform: d
122
+ }) => {
123
+ o.attr("transform", d);
124
+ });
125
+ a.call(l), it.current = l;
126
+ }, [w, c, K]);
127
+ const D = He(p), T = Je(p), U = D[2] - D[0], _t = D[3] - D[1], Bt = c * 190 / 960 * 360 / U, Vt = w * 190 / 678 * 180 / _t, X = u * Math.min(Bt, Vt), W = ot === "mercator" ? Re().rotate([0, 0]).center(S || T.geometry.coordinates).translate([c / 2, w / 2]).scale(X) : ot === "equalEarth" ? qe().rotate([0, 0]).center(S || T.geometry.coordinates).translate([c / 2, w / 2]).scale(X) : ot === "naturalEarth" ? Ge().rotate([0, 0]).center(S || T.geometry.coordinates).translate([c / 2, w / 2]).scale(X) : ot === "orthographic" ? Ue().rotate([0, 0]).center(S || T.geometry.coordinates).translate([c / 2, w / 2]).scale(X) : Xe().rotate([0, 0]).center(S || T.geometry.coordinates).translate([c / 2, w / 2]).scale(X), kt = (o) => {
128
+ if (!B.current || !it.current) return;
129
+ ve(B.current).call(it.current.scaleBy, o === "in" ? 1.2 : 1 / 1.2);
130
+ };
131
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
132
+ /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
133
+ /* @__PURE__ */ r.jsx(ut.svg, { width: `${c}px`, height: `${w}px`, viewBox: `0 0 ${c} ${w}`, ref: B, direction: "ltr", children: /* @__PURE__ */ r.jsxs("g", { ref: wt, children: [
134
+ ft.filter((o) => o.position === "before").map((o) => o.layer),
135
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
136
+ p.features.map((o, a) => t.findIndex((l) => l.id === o.properties[xt]) !== -1 ? null : /* @__PURE__ */ r.jsx("g", { opacity: P ? F : at.length !== 0 ? at.indexOf(o.properties[xt]) !== -1 ? 1 : F : 1, children: o.geometry.type === "MultiPolygon" ? (
137
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
+ o.geometry.coordinates.map((l, d) => {
139
+ let s = "";
140
+ return l.forEach((k) => {
141
+ let m = " M";
142
+ k.forEach((h, lt) => {
143
+ const $ = W([h[0], h[1]]);
144
+ lt !== k.length - 1 ? m = `${m}${$[0]} ${$[1]}L` : m = `${m}${$[0]} ${$[1]}`;
145
+ }), s += m;
146
+ }), /* @__PURE__ */ r.jsx("path", { d: s, style: {
147
+ stroke: et,
148
+ strokeWidth: tt,
149
+ fill: ht
150
+ } }, d);
151
+ })
152
+ ) : (
153
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
154
+ o.geometry.coordinates.map((l, d) => {
155
+ let s = "M";
156
+ return l.forEach((k, m) => {
157
+ const h = W([k[0], k[1]]);
158
+ m !== l.length - 1 ? s = `${s}${h[0]} ${h[1]}L` : s = `${s}${h[0]} ${h[1]}`;
159
+ }), /* @__PURE__ */ r.jsx("path", { d: s, style: {
160
+ stroke: et,
161
+ strokeWidth: tt,
162
+ fill: ht
163
+ } }, d);
164
+ })
165
+ ) }, a)),
166
+ /* @__PURE__ */ r.jsxs(so, { children: [
167
+ t.filter((o) => o.id).map((o) => {
168
+ const a = p.features.findIndex(
169
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
170
+ (l) => o.id === l.properties[xt]
171
+ ), M = ie(o.x) ? ht : (
172
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
173
+ qt(o.x)
174
+ );
175
+ return /* @__PURE__ */ r.jsx(ut.g, { variants: {
176
+ initial: {
177
+ opacity: 0
178
+ },
179
+ whileInView: {
180
+ opacity: P ? P === M ? 1 : F : at.length !== 0 ? at.indexOf(o.id) !== -1 ? 1 : F : 1,
181
+ transition: {
182
+ duration: g.duration
183
+ }
184
+ }
185
+ }, initial: "initial", animate: G ? "whileInView" : "initial", exit: {
186
+ opacity: 0,
187
+ transition: {
188
+ duration: g.duration
189
+ }
190
+ }, onMouseEnter: (l) => {
191
+ I(o), q(l.clientY), R(l.clientX), J?.(o);
192
+ }, onMouseMove: (l) => {
193
+ I(o), q(l.clientY), R(l.clientX);
194
+ }, onMouseLeave: () => {
195
+ I(void 0), R(void 0), q(void 0), J?.(void 0);
196
+ }, onClick: () => {
197
+ (A || O) && (we(H, o) && Et ? (Q(void 0), A?.(void 0)) : (Q(o), A?.(o)));
198
+ }, children: a === -1 ? null : p.features[a].geometry.type === "MultiPolygon" ? p.features[a].geometry.coordinates.map(
199
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
+ (l, d) => {
201
+ let s = "";
202
+ return l.forEach((k) => {
203
+ let m = " M";
204
+ k.forEach((h, lt) => {
205
+ const $ = W([h[0], h[1]]);
206
+ lt !== k.length - 1 ? m = `${m}${$[0]} ${$[1]}L` : m = `${m}${$[0]} ${$[1]}`;
207
+ }), s += m;
208
+ }), /* @__PURE__ */ r.jsx(ut.path, { d: s, variants: {
209
+ initial: {
210
+ fill: M,
211
+ opacity: 0
212
+ },
213
+ whileInView: {
214
+ fill: M,
215
+ opacity: 1,
216
+ transition: {
217
+ duration: g.duration
218
+ }
219
+ }
220
+ }, initial: "initial", animate: G ? "whileInView" : "initial", exit: {
221
+ opacity: 0,
222
+ transition: {
223
+ duration: g.duration
224
+ }
225
+ }, style: {
226
+ stroke: et,
227
+ strokeWidth: tt
228
+ } }, `${o.id}-${d}`);
229
+ }
230
+ ) : p.features[a].geometry.coordinates.map(
231
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
232
+ (l, d) => {
233
+ let s = "M";
234
+ return l.forEach((k, m) => {
235
+ const h = W([k[0], k[1]]);
236
+ m !== l.length - 1 ? s = `${s}${h[0]} ${h[1]}L` : s = `${s}${h[0]} ${h[1]}`;
237
+ }), /* @__PURE__ */ r.jsx(ut.path, { d: s, variants: {
238
+ initial: {
239
+ fill: M,
240
+ opacity: 0
241
+ },
242
+ whileInView: {
243
+ fill: M,
244
+ opacity: 1,
245
+ transition: {
246
+ duration: g.duration
247
+ }
248
+ }
249
+ }, initial: "initial", animate: G ? "whileInView" : "initial", exit: {
250
+ opacity: 0,
251
+ transition: {
252
+ duration: g.duration
253
+ }
254
+ }, style: {
255
+ stroke: et,
256
+ strokeWidth: tt
257
+ } }, `${o.id}-${d}`);
258
+ }
259
+ ) }, o.id);
260
+ }),
261
+ t.filter((o) => !ie(o.lat) && !ie(o.long)).map((o) => /* @__PURE__ */ r.jsxs(ut.g, { variants: {
262
+ initial: {
263
+ opacity: 0
264
+ },
265
+ whileInView: {
266
+ opacity: Ot.length !== 0 ? Ot.indexOf(o.label || "") !== -1 ? 1 : F : 1,
267
+ transition: {
268
+ duration: g.duration
269
+ }
270
+ }
271
+ }, initial: "initial", animate: G ? "whileInView" : "initial", exit: {
272
+ opacity: 0,
273
+ transition: {
274
+ duration: g.duration
275
+ }
276
+ }, onMouseEnter: (a) => {
277
+ I(o), q(a.clientY), R(a.clientX), J?.(o);
278
+ }, onMouseMove: (a) => {
279
+ I(o), q(a.clientY), R(a.clientX);
280
+ }, onMouseLeave: () => {
281
+ I(void 0), R(void 0), q(void 0), J?.(void 0);
282
+ }, onClick: () => {
283
+ (A || O) && (we(H, o) && Et ? (Q(void 0), A?.(void 0)) : (Q(o), A?.(o)));
284
+ }, transform: `translate(${W([o.long, o.lat])[0]},${W([o.long, o.lat])[1]})`, children: [
285
+ /* @__PURE__ */ r.jsx(ut.circle, { cx: 0, cy: 0, variants: {
286
+ initial: {
287
+ r: 0,
288
+ fill: Z,
289
+ stroke: Lt || Z
290
+ },
291
+ whileInView: {
292
+ r: V ? V(o.radius || 0) : b,
293
+ fill: Z,
294
+ stroke: Lt || Z,
295
+ transition: {
296
+ duration: g.duration
297
+ }
298
+ }
299
+ }, initial: "initial", animate: G ? "whileInView" : "initial", exit: {
300
+ r: 0,
301
+ transition: {
302
+ duration: g.duration
303
+ }
304
+ }, style: {
305
+ fillOpacity: 0.8
306
+ } }),
307
+ z && o.label ? /* @__PURE__ */ r.jsx(ut.text, { variants: {
308
+ initial: {
309
+ opacity: 0,
310
+ x: V ? V(o.radius || 0) : b
311
+ },
312
+ whileInView: {
313
+ opacity: 1,
314
+ x: V ? V(o.radius || 0) : b,
315
+ transition: {
316
+ duration: g.duration
317
+ }
318
+ }
319
+ }, initial: "initial", animate: G ? "whileInView" : "initial", exit: {
320
+ opacity: 0,
321
+ transition: {
322
+ duration: g.duration
323
+ }
324
+ }, y: 0, className: "text-sm", style: {
325
+ textAnchor: "start",
326
+ fill: zt || "#000"
327
+ }, dx: 4, dy: 5, children: o.label }) : null
328
+ ] }, o.label || `${o.lat}-${o.long}`))
329
+ ] }),
330
+ ft.filter((o) => o.position === "after").map((o) => o.layer)
331
+ ] }) }),
332
+ Mt === !1 ? null : /* @__PURE__ */ r.jsx("div", { className: Ce("absolute left-4 bottom-4 map-color-legend", gt?.colorLegend), children: y ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
333
+ /* @__PURE__ */ r.jsx("div", { className: "color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]", onClick: () => {
334
+ f(!1);
335
+ }, children: /* @__PURE__ */ r.jsx(to, {}) }),
336
+ /* @__PURE__ */ r.jsxs("div", { className: "color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]", style: {
337
+ width: rt ? void 0 : "340px"
338
+ }, children: [
339
+ vt && vt !== "" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
340
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
341
+ /* @__PURE__ */ r.jsx("div", { className: "w-3 h-3 rounded-full", style: {
342
+ backgroundColor: Z
343
+ } }),
344
+ /* @__PURE__ */ r.jsx(xe, { size: "xs", marginBottom: "none", className: "p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300", style: {
345
+ display: "-webkit-box",
346
+ WebkitLineClamp: "1",
347
+ WebkitBoxOrient: "vertical"
348
+ }, children: vt })
349
+ ] }),
350
+ /* @__PURE__ */ r.jsx(ke, { size: "xl" }),
351
+ /* @__PURE__ */ r.jsx(Se, {}),
352
+ /* @__PURE__ */ r.jsx(ke, { size: "xl" })
353
+ ] }) : null,
354
+ v && v !== "" ? /* @__PURE__ */ r.jsx(xe, { size: "xs", marginBottom: "xs", className: "p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300", style: {
355
+ display: "-webkit-box",
356
+ WebkitLineClamp: "1",
357
+ WebkitBoxOrient: "vertical"
358
+ }, children: v }) : null,
359
+ rt ? /* @__PURE__ */ r.jsx("div", { className: "flex flex-col gap-3", children: n.map((o, a) => /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 items-center", onMouseOver: () => {
360
+ _(e[a % e.length]);
361
+ }, onMouseLeave: () => {
362
+ _(void 0);
363
+ }, children: [
364
+ /* @__PURE__ */ r.jsx("div", { className: "w-2 h-2 rounded-full", style: {
365
+ backgroundColor: e[a % e.length]
366
+ } }),
367
+ /* @__PURE__ */ r.jsx(xe, { size: "sm", marginBottom: "none", leading: "none", children: o })
368
+ ] }, a)) }) : /* @__PURE__ */ r.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ r.jsxs("g", { children: [
369
+ n.map((o, a) => /* @__PURE__ */ r.jsxs("g", { onMouseOver: () => {
370
+ _(e[a]);
371
+ }, onMouseLeave: () => {
372
+ _(void 0);
373
+ }, className: "cursor-pointer", children: [
374
+ /* @__PURE__ */ r.jsx("rect", { x: a * 320 / e.length + 1, y: 1, width: 320 / e.length - 2, height: 8, className: P === e[a] ? "stroke-primary-gray-700 dark:stroke-primary-gray-300" : "", style: {
375
+ fill: e[a],
376
+ ...P === e[a] ? {} : {
377
+ stroke: e[a]
378
+ }
379
+ } }),
380
+ /* @__PURE__ */ r.jsx("text", { x: (a + 1) * 320 / e.length, y: 25, className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs", style: {
381
+ textAnchor: "middle"
382
+ }, children: no(o, "NA") })
383
+ ] }, a)),
384
+ /* @__PURE__ */ r.jsx("g", { children: /* @__PURE__ */ r.jsx("rect", { onMouseOver: () => {
385
+ _(e[n.length]);
386
+ }, onMouseLeave: () => {
387
+ _(void 0);
388
+ }, x: n.length * 320 / e.length + 1, y: 1, width: 320 / e.length - 2, height: 8, className: `cursor-pointer ${P === e[n.length] ? "stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300" : ""}`, style: {
389
+ fill: e[n.length],
390
+ ...P === e[n.length] ? {} : {
391
+ stroke: e[n.length]
392
+ }
393
+ } }) })
394
+ ] }) })
395
+ ] })
396
+ ] }) : /* @__PURE__ */ r.jsx("button", { type: "button", className: "mb-0 border-0 bg-transparent p-0 self-start map-legend-button", onClick: () => {
397
+ f(!0);
398
+ }, children: /* @__PURE__ */ r.jsx("div", { className: "show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500", children: "Show Legend" }) }) }),
399
+ K === "button" && /* @__PURE__ */ r.jsxs("div", { className: "absolute left-4 top-4 flex flex-col zoom-buttons", children: [
400
+ /* @__PURE__ */ r.jsx("button", { onClick: () => kt("in"), className: "leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "+" }),
401
+ /* @__PURE__ */ r.jsx("button", { onClick: () => kt("out"), className: "leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "–" })
402
+ ] })
403
+ ] }),
404
+ O && H !== void 0 ? /* @__PURE__ */ r.jsx(Ye, { open: H !== void 0, onClose: () => {
405
+ Q(void 0);
406
+ }, children: /* @__PURE__ */ r.jsx("div", { className: "graph-modal-content m-0", dangerouslySetInnerHTML: typeof O == "string" ? {
407
+ __html: Qe(O, H)
408
+ } : void 0, children: typeof O == "function" ? O(H) : null }) }) : null,
409
+ Pt && N && nt && bt ? /* @__PURE__ */ r.jsx(Ze, { data: Pt, body: N, xPos: nt, yPos: bt, backgroundStyle: E?.tooltip, className: gt?.tooltip }) : null
410
+ ] });
411
+ }
412
+ function hr(i) {
413
+ const t = Le.c(116), {
414
+ data: e,
415
+ mapData: p,
416
+ graphTitle: v,
417
+ colors: n,
418
+ sources: b,
419
+ graphDescription: w,
420
+ height: c,
421
+ width: u,
422
+ footNote: S,
423
+ mapColorLegendTitle: N,
424
+ colorDomain: z,
425
+ choroplethScaleType: tt,
426
+ radius: et,
427
+ scale: ht,
428
+ centerPoint: J,
429
+ padding: Mt,
430
+ mapBorderWidth: Ht,
431
+ mapNoDataColor: Rt,
432
+ backgroundColor: Ot,
433
+ showLabels: A,
434
+ mapBorderColor: Et,
435
+ tooltip: O,
436
+ relativeHeight: E,
437
+ onSeriesMouseOver: gt,
438
+ isWorldMap: ot,
439
+ showColorScale: K,
440
+ zoomScaleExtend: g,
441
+ zoomTranslateExtend: F,
442
+ graphID: ft,
443
+ highlightedDataPoints: yt,
444
+ onSeriesMouseClick: rt,
445
+ graphDownload: Z,
446
+ dataDownload: It,
447
+ showAntarctica: at,
448
+ language: xt,
449
+ minHeight: vt,
450
+ theme: Lt,
451
+ ariaLabel: zt,
452
+ resetSelectionOnDoubleClick: P,
453
+ detailsOnClick: _,
454
+ styles: y,
455
+ classNames: f,
456
+ mapProjection: it,
457
+ zoomInteraction: H,
458
+ animate: Q,
459
+ dimmedOpacity: Pt,
460
+ customLayers: I,
461
+ maxRadiusValue: nt,
462
+ timeline: R,
463
+ collapseColorScaleByDefault: bt,
464
+ dotColor: q,
465
+ highlightedIds: B,
466
+ mapProperty: G,
467
+ dotLegendTitle: wt,
468
+ dotBorderColor: V,
469
+ labelColor: qt
470
+ } = i, D = p === void 0 ? "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json" : p, T = S === void 0 ? "The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries." : S, U = tt === void 0 ? "threshold" : tt, _t = et === void 0 ? 5 : et, Bt = ht === void 0 ? 0.95 : ht, Vt = Ht === void 0 ? 0.5 : Ht, X = Rt === void 0 ? St.light.graphNoData : Rt, W = Ot === void 0 ? !1 : Ot, kt = A === void 0 ? !1 : A, o = Et === void 0 ? St.light.grays["gray-500"] : Et, a = ot === void 0 ? !0 : ot, M = K === void 0 ? !0 : K;
471
+ let l;
472
+ t[0] !== g ? (l = g === void 0 ? [0.8, 6] : g, t[0] = g, t[1] = l) : l = t[1];
473
+ const d = l;
474
+ let s;
475
+ t[2] !== yt ? (s = yt === void 0 ? [] : yt, t[2] = yt, t[3] = s) : s = t[3];
476
+ const k = s, m = Z === void 0 ? !1 : Z, h = It === void 0 ? !1 : It, lt = at === void 0 ? !1 : at, $ = xt === void 0 ? "en" : xt, Y = vt === void 0 ? 0 : vt, st = Lt === void 0 ? "light" : Lt, ne = P === void 0 ? !0 : P, le = H === void 0 ? "button" : H, Gt = Q === void 0 ? !1 : Q, se = Pt === void 0 ? 0.3 : Pt;
477
+ let Ut;
478
+ t[4] !== I ? (Ut = I === void 0 ? [] : I, t[4] = I, t[5] = Ut) : Ut = t[5];
479
+ const ce = Ut, C = R === void 0 ? {
480
+ enabled: !1,
481
+ autoplay: !1,
482
+ showOnlyActiveDate: !0
483
+ } : R, de = q === void 0 ? St.primaryColors["blue-600"] : q;
484
+ let Xt;
485
+ t[6] !== B ? (Xt = B === void 0 ? [] : B, t[6] = B, t[7] = Xt) : Xt = t[7];
486
+ const me = Xt, pe = G === void 0 ? "ISO3" : G, ue = qt === void 0 ? St.primaryColors["blue-600"] : qt, [ct, Me] = L(0), [Tt, Oe] = L(0), [dt, he] = L(C.autoplay), x = fo(uo(e, "date", !0).map((j) => Be(`${j}`, C.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()), Lo), [mt, Wt] = L(C.autoplay ? 0 : x.length - 1), [jt, Ee] = L(void 0), ge = Ft(null), be = Ft(null);
487
+ let Yt;
488
+ t[8] !== U || t[9] !== z || t[10] !== n?.length || t[11] !== e ? (Yt = z || (U === "categorical" ? yo(e, "x") : xo(e.map(Io), n?.length || 4)), t[8] = U, t[9] = z, t[10] = n?.length, t[11] = e, t[12] = Yt) : Yt = t[12];
489
+ const At = Yt;
490
+ let Jt, Kt;
491
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (Jt = () => {
492
+ const j = new ResizeObserver((pt) => {
493
+ Me(pt[0].target.clientWidth || 620), Oe(pt[0].target.clientHeight || 480);
494
+ });
495
+ return ge.current && j.observe(ge.current), () => j.disconnect();
496
+ }, Kt = [], t[13] = Jt, t[14] = Kt) : (Jt = t[13], Kt = t[14]), ae(Jt, Kt);
497
+ let Zt;
498
+ t[15] === Symbol.for("react.memo_cache_sentinel") ? (Zt = (j) => {
499
+ Ee(j);
500
+ }, t[15] = Zt) : Zt = t[15];
501
+ const Qt = _e(Zt);
502
+ let te;
503
+ t[16] !== D || t[17] !== Qt ? (te = () => {
504
+ typeof D == "string" ? po(D).then((pt) => {
505
+ Qt(pt);
506
+ }) : Qt(D);
507
+ }, t[16] = D, t[17] = Qt, t[18] = te) : te = t[18];
508
+ let ee;
509
+ t[19] !== D ? (ee = [D], t[19] = D, t[20] = ee) : ee = t[20], ae(te, ee), ae(() => {
510
+ const j = setInterval(() => {
511
+ Wt((pt) => pt < x.length - 1 ? pt + 1 : 0);
512
+ }, (C.speed || 2) * 1e3);
513
+ return dt || clearInterval(j), () => clearInterval(j);
514
+ }, [x, dt, C.speed]);
515
+ const oe = Te(x, mt, C.showOnlyActiveDate, C.dateFormat || "yyyy"), fe = f?.graphContainer, ye = y?.graphContainer;
516
+ let Ct;
517
+ t[21] !== f?.description || t[22] !== f?.title || t[23] !== e || t[24] !== h || t[25] !== w || t[26] !== m || t[27] !== v || t[28] !== y?.description || t[29] !== y?.title || t[30] !== u ? (Ct = v || w || m || h ? /* @__PURE__ */ r.jsx(mo, { styles: {
518
+ title: y?.title,
519
+ description: y?.description
520
+ }, classNames: {
521
+ title: f?.title,
522
+ description: f?.description
523
+ }, graphTitle: v, graphDescription: w, width: u, graphDownload: m ? be : void 0, dataDownload: h ? e.map(Eo).filter(Oo).length > 0 ? e.map(Mo).filter(So) : e.filter($o) : null }) : null, t[21] = f?.description, t[22] = f?.title, t[23] = e, t[24] = h, t[25] = w, t[26] = m, t[27] = v, t[28] = y?.description, t[29] = y?.title, t[30] = u, t[31] = Ct) : Ct = t[31];
524
+ let Nt;
525
+ t[32] !== mt || t[33] !== oe || t[34] !== dt || t[35] !== Wt || t[36] !== he || t[37] !== C.enabled || t[38] !== x ? (Nt = C.enabled && x.length > 0 && oe ? /* @__PURE__ */ r.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
526
+ /* @__PURE__ */ r.jsx("button", { type: "button", onClick: () => {
527
+ he(!dt);
528
+ }, className: "p-0 border-0 cursor-pointer bg-transparent", "aria-label": dt ? "Click to pause animation" : "Click to play animation", children: dt ? /* @__PURE__ */ r.jsx(eo, {}) : /* @__PURE__ */ r.jsx(oo, {}) }),
529
+ /* @__PURE__ */ r.jsx(We, { min: x[0], max: x[x.length - 1], marks: oe, step: null, defaultValue: x[x.length - 1], value: x[mt], onChangeComplete: (j) => {
530
+ Wt(x.indexOf(j));
531
+ }, onChange: (j) => {
532
+ Wt(x.indexOf(j));
533
+ }, "aria-label": "Time slider. Use arrow keys to adjust selected time period." })
534
+ ] }) : null, t[32] = mt, t[33] = oe, t[34] = dt, t[35] = Wt, t[36] = he, t[37] = C.enabled, t[38] = x, t[39] = Nt) : Nt = t[39];
535
+ let Dt;
536
+ t[40] !== Gt || t[41] !== J || t[42] !== U || t[43] !== f || t[44] !== bt || t[45] !== n || t[46] !== ce || t[47] !== e || t[48] !== _ || t[49] !== se || t[50] !== At || t[51] !== V || t[52] !== de || t[53] !== wt || t[54] !== c || t[55] !== k || t[56] !== me || t[57] !== mt || t[58] !== a || t[59] !== ue || t[60] !== o || t[61] !== Vt || t[62] !== N || t[63] !== X || t[64] !== it || t[65] !== pe || t[66] !== jt || t[67] !== nt || t[68] !== Y || t[69] !== rt || t[70] !== gt || t[71] !== _t || t[72] !== E || t[73] !== ne || t[74] !== Bt || t[75] !== lt || t[76] !== M || t[77] !== kt || t[78] !== y || t[79] !== Tt || t[80] !== ct || t[81] !== st || t[82] !== C.dateFormat || t[83] !== C.enabled || t[84] !== O || t[85] !== x || t[86] !== u || t[87] !== le || t[88] !== d || t[89] !== F ? (Dt = /* @__PURE__ */ r.jsx(ho, { ref: ge, children: ct && Tt && jt ? /* @__PURE__ */ r.jsx(jo, { dotColor: de, data: e.filter((j) => C.enabled ? j.date === Ve(new Date(x[mt]), C.dateFormat || "yyyy") : j), mapData: lt ? jt : {
537
+ ...jt,
538
+ features: jt.features.filter(Do)
539
+ }, colorDomain: At, width: ct, height: Tt, scale: Bt, centerPoint: J, colors: n || (U === "categorical" ? St[st].sequentialColors[`neutralColorsx0${At.length}`] : St[st].sequentialColors[`neutralColorsx0${At.length + 1}`]), mapColorLegendTitle: N, radius: _t, categorical: U === "categorical", mapBorderWidth: Vt, mapNoDataColor: X, mapBorderColor: o, tooltip: O, onSeriesMouseOver: gt, showLabels: kt, isWorldMap: a, showColorScale: M, zoomScaleExtend: d, zoomTranslateExtend: F, onSeriesMouseClick: rt, highlightedDataPoints: k, resetSelectionOnDoubleClick: ne, styles: y, classNames: f, zoomInteraction: le, detailsOnClick: _, mapProjection: it || (a ? "naturalEarth" : "mercator"), animate: Gt === !0 ? {
540
+ duration: 0.5,
541
+ once: !0,
542
+ amount: 0.5
543
+ } : Gt || {
544
+ duration: 0,
545
+ once: !0,
546
+ amount: 0
547
+ }, dimmedOpacity: se, customLayers: ce, maxRadiusValue: ie(nt) ? Math.max(...e.map(No).filter(Co)) : nt, collapseColorScaleByDefault: bt, highlightedIds: me, mapProperty: pe, dotLegendTitle: wt, dotBorderColor: V, labelColor: ue }) : /* @__PURE__ */ r.jsx("div", { style: {
548
+ height: `${Math.max(Y, c || (E ? Y ? (u || ct) * E > Y ? (u || ct) * E : Y : (u || ct) * E : Tt))}px`
549
+ }, className: "flex items-center justify-center", children: /* @__PURE__ */ r.jsx(Ae, { "aria-label": "Loading graph" }) }) }), t[40] = Gt, t[41] = J, t[42] = U, t[43] = f, t[44] = bt, t[45] = n, t[46] = ce, t[47] = e, t[48] = _, t[49] = se, t[50] = At, t[51] = V, t[52] = de, t[53] = wt, t[54] = c, t[55] = k, t[56] = me, t[57] = mt, t[58] = a, t[59] = ue, t[60] = o, t[61] = Vt, t[62] = N, t[63] = X, t[64] = it, t[65] = pe, t[66] = jt, t[67] = nt, t[68] = Y, t[69] = rt, t[70] = gt, t[71] = _t, t[72] = E, t[73] = ne, t[74] = Bt, t[75] = lt, t[76] = M, t[77] = kt, t[78] = y, t[79] = Tt, t[80] = ct, t[81] = st, t[82] = C.dateFormat, t[83] = C.enabled, t[84] = O, t[85] = x, t[86] = u, t[87] = le, t[88] = d, t[89] = F, t[90] = Dt) : Dt = t[90];
550
+ let $t;
551
+ t[91] !== f?.footnote || t[92] !== f?.source || t[93] !== T || t[94] !== b || t[95] !== y?.footnote || t[96] !== y?.source || t[97] !== u ? ($t = b || T ? /* @__PURE__ */ r.jsx(co, { styles: {
552
+ footnote: y?.footnote,
553
+ source: y?.source
554
+ }, classNames: {
555
+ footnote: f?.footnote,
556
+ source: f?.source
557
+ }, sources: b, footNote: T, width: u }) : null, t[91] = f?.footnote, t[92] = f?.source, t[93] = T, t[94] = b, t[95] = y?.footnote, t[96] = y?.source, t[97] = u, t[98] = $t) : $t = t[98];
558
+ let re;
559
+ return t[99] !== zt || t[100] !== W || t[101] !== ft || t[102] !== c || t[103] !== $ || t[104] !== Y || t[105] !== Mt || t[106] !== E || t[107] !== fe || t[108] !== ye || t[109] !== Ct || t[110] !== Nt || t[111] !== Dt || t[112] !== $t || t[113] !== st || t[114] !== u ? (re = /* @__PURE__ */ r.jsxs(go, { className: fe, style: ye, id: ft, ref: be, "aria-label": zt, backgroundColor: W, theme: st, language: $, minHeight: Y, width: u, height: c, relativeHeight: E, padding: Mt, children: [
560
+ Ct,
561
+ Nt,
562
+ Dt,
563
+ $t
564
+ ] }), t[99] = zt, t[100] = W, t[101] = ft, t[102] = c, t[103] = $, t[104] = Y, t[105] = Mt, t[106] = E, t[107] = fe, t[108] = ye, t[109] = Ct, t[110] = Nt, t[111] = Dt, t[112] = $t, t[113] = st, t[114] = u, t[115] = re) : re = t[115], re;
565
+ }
566
+ function Co(i) {
567
+ return i != null;
568
+ }
569
+ function No(i) {
570
+ return i.radius;
571
+ }
572
+ function Do(i) {
573
+ return i.properties.NAME !== "Antarctica";
574
+ }
575
+ function $o(i) {
576
+ return i !== void 0;
577
+ }
578
+ function So(i) {
579
+ return i !== void 0;
580
+ }
581
+ function Mo(i) {
582
+ return i.data;
583
+ }
584
+ function Oo(i) {
585
+ return i !== void 0;
586
+ }
587
+ function Eo(i) {
588
+ return i.data;
589
+ }
590
+ function Io(i) {
591
+ return i.x;
592
+ }
593
+ function Lo(i, t) {
594
+ return vo(i, t);
595
+ }
596
+ export {
597
+ hr as HybridMap
598
+ };
599
+ //# sourceMappingURL=HybridMap.js.map