@undp/data-viz 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +195 -195
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +1 -1
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +1 -1
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +145 -142
- package/dist/HybridMap.js.map +1 -1
- package/package.json +1 -1
package/dist/HybridMap.js
CHANGED
|
@@ -30,7 +30,7 @@ import { a as So, G as Mo } from "./GraphContainer-CF6ws3pd.js";
|
|
|
30
30
|
import { g as Oo } from "./getUniqValue-DsqSii6M.js";
|
|
31
31
|
import { g as Io } from "./getJenks-DTCcQSDi.js";
|
|
32
32
|
var zo = "Separator", Ve = "horizontal", Eo = ["horizontal", "vertical"], _e = He.forwardRef((r, t) => {
|
|
33
|
-
const { decorative: e, orientation:
|
|
33
|
+
const { decorative: e, orientation: b = Ve, ...g } = r, n = Po(b) ? b : Ve, f = e ? { role: "none" } : { "aria-orientation": n === "vertical" ? n : void 0, role: "separator" };
|
|
34
34
|
return /* @__PURE__ */ Be.jsx(
|
|
35
35
|
po.div,
|
|
36
36
|
{
|
|
@@ -48,33 +48,33 @@ function Po(r) {
|
|
|
48
48
|
var $e = _e;
|
|
49
49
|
const Ae = Ue.forwardRef((r, t) => {
|
|
50
50
|
const e = Ge.c(14);
|
|
51
|
-
let
|
|
51
|
+
let b, g, n, f;
|
|
52
52
|
e[0] !== r ? ({
|
|
53
|
-
className:
|
|
53
|
+
className: b,
|
|
54
54
|
variant: n,
|
|
55
55
|
orientation: f,
|
|
56
56
|
...g
|
|
57
|
-
} = r, e[0] = r, e[1] =
|
|
58
|
-
const y = n === void 0 ? "dark" : n,
|
|
59
|
-
let
|
|
60
|
-
e[5] !==
|
|
57
|
+
} = r, e[0] = r, e[1] = b, e[2] = g, e[3] = n, e[4] = f) : (b = e[1], g = e[2], n = e[3], f = e[4]);
|
|
58
|
+
const y = n === void 0 ? "dark" : n, l = f === void 0 ? "horizontal" : f, u = l === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", k = y === "dark" ? "bg-primary-gray-600 dark:bg-primary-gray-200" : "bg-primary-gray-400 dark:bg-primary-gray-550";
|
|
59
|
+
let w;
|
|
60
|
+
e[5] !== b || e[6] !== u || e[7] !== k ? (w = ze(u, k, b), e[5] = b, e[6] = u, e[7] = k, e[8] = w) : w = e[8];
|
|
61
61
|
let M;
|
|
62
|
-
return e[9] !==
|
|
62
|
+
return e[9] !== l || e[10] !== g || e[11] !== t || e[12] !== w ? (M = /* @__PURE__ */ Be.jsx($e, { ...g, ref: t, orientation: l, className: w }), e[9] = l, e[10] = g, e[11] = t, e[12] = w, e[13] = M) : M = e[13], M;
|
|
63
63
|
});
|
|
64
64
|
Ae.displayName = $e.displayName;
|
|
65
65
|
function Lo(r) {
|
|
66
66
|
const {
|
|
67
67
|
data: t,
|
|
68
68
|
colors: e,
|
|
69
|
-
mapData:
|
|
69
|
+
mapData: b,
|
|
70
70
|
mapColorLegendTitle: g,
|
|
71
71
|
colorDomain: n,
|
|
72
72
|
radius: f,
|
|
73
73
|
height: y,
|
|
74
|
-
width:
|
|
74
|
+
width: l,
|
|
75
75
|
scale: u,
|
|
76
|
-
centerPoint:
|
|
77
|
-
tooltip:
|
|
76
|
+
centerPoint: k,
|
|
77
|
+
tooltip: w,
|
|
78
78
|
showLabels: M,
|
|
79
79
|
mapBorderWidth: kt,
|
|
80
80
|
mapBorderColor: Ct,
|
|
@@ -87,55 +87,55 @@ function Lo(r) {
|
|
|
87
87
|
onSeriesMouseClick: P,
|
|
88
88
|
resetSelectionOnDoubleClick: Mt,
|
|
89
89
|
detailsOnClick: H,
|
|
90
|
-
styles:
|
|
90
|
+
styles: C,
|
|
91
91
|
classNames: U,
|
|
92
|
-
mapProjection:
|
|
92
|
+
mapProjection: Q,
|
|
93
93
|
zoomInteraction: X,
|
|
94
94
|
animate: x,
|
|
95
95
|
dimmedOpacity: L,
|
|
96
96
|
customLayers: st,
|
|
97
97
|
maxRadiusValue: ct,
|
|
98
|
-
categorical:
|
|
98
|
+
categorical: tt,
|
|
99
99
|
dotColor: Y,
|
|
100
100
|
collapseColorScaleByDefault: Ot,
|
|
101
|
-
highlightedIds:
|
|
101
|
+
highlightedIds: et,
|
|
102
102
|
mapProperty: dt,
|
|
103
103
|
dotLegendTitle: mt,
|
|
104
104
|
dotBorderColor: It,
|
|
105
105
|
labelColor: zt,
|
|
106
106
|
projectionRotate: J,
|
|
107
107
|
rewindCoordinatesInMapData: pt
|
|
108
|
-
} = r, d = Xe(() => pt ? eo(
|
|
108
|
+
} = r, d = Xe(() => pt ? eo(b, {
|
|
109
109
|
reverse: !0
|
|
110
|
-
}) :
|
|
110
|
+
}) : b, [b, pt]), [s, V] = S(void 0), [Ht, Et] = S(Ot === void 0 ? !(l < 680) : !Ot), ut = Rt(null), [B, O] = S(void 0), [ot, I] = S(void 0), [Pt, D] = S(void 0), [Lt, z] = S(void 0), _ = Rt(null), K = jo(_, {
|
|
111
111
|
once: x.once,
|
|
112
112
|
amount: x.amount
|
|
113
|
-
}),
|
|
113
|
+
}), at = Rt(null), $ = t.filter((o) => o.radius === void 0 || o.radius === null).length !== t.length ? xo().domain([0, ct]).range([0.25, f]).nice() : void 0, E = tt ? vo().domain(n).range(e) : bo().domain(n).range(e);
|
|
114
114
|
de(() => {
|
|
115
|
-
const o = Ie(
|
|
115
|
+
const o = Ie(at.current), i = Ie(_.current), v = (m) => {
|
|
116
116
|
if (X === "noZoom") return !1;
|
|
117
117
|
if (X === "button") return !m.type.includes("wheel");
|
|
118
118
|
const gt = m.type === "wheel", ft = m.type.startsWith("touch"), At = m.type === "mousedown" || m.type === "mousemove";
|
|
119
119
|
return ft ? !0 : gt ? X === "scroll" ? !0 : m.ctrlKey : At && !m.button && !m.ctrlKey;
|
|
120
|
-
}, N = oo().scaleExtent(Gt).translateExtent(qt || [[-20, -20], [
|
|
120
|
+
}, N = oo().scaleExtent(Gt).translateExtent(qt || [[-20, -20], [l + 20, y + 20]]).filter(v).on("zoom", ({
|
|
121
121
|
transform: m
|
|
122
122
|
}) => {
|
|
123
123
|
o.attr("transform", m);
|
|
124
124
|
});
|
|
125
125
|
i.call(N), ut.current = N;
|
|
126
|
-
}, [y,
|
|
127
|
-
const A = ao(d),
|
|
126
|
+
}, [y, l, X]);
|
|
127
|
+
const A = ao(d), j = mo(d), Vt = A[2] - A[0], Bt = A[3] - A[1], _t = l * 190 / 960 * 360 / Vt, $t = y * 190 / 678 * 180 / Bt, F = u * Math.min(_t, $t), Z = Q === "mercator" ? ro().rotate(J).center(k || j.geometry.coordinates).translate([l / 2, y / 2]).scale(F) : Q === "equalEarth" ? io().rotate(J).center(k || j.geometry.coordinates).translate([l / 2, y / 2]).scale(F) : Q === "naturalEarth" ? no().rotate(J).center(k || j.geometry.coordinates).translate([l / 2, y / 2]).scale(F) : Q === "orthographic" ? lo().rotate(J).center(k || j.geometry.coordinates).translate([l / 2, y / 2]).scale(F) : so().rotate(J).center(k || j.geometry.coordinates).translate([l / 2, y / 2]).scale(F), ht = co().projection(Z), rt = (o) => {
|
|
128
128
|
if (!_.current || !ut.current) return;
|
|
129
129
|
Ie(_.current).call(ut.current.scaleBy, o === "in" ? 1.2 : 1 / 1.2);
|
|
130
130
|
};
|
|
131
131
|
return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
132
132
|
/* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
|
|
133
|
-
/* @__PURE__ */ a.jsx(lt.svg, { width: `${
|
|
133
|
+
/* @__PURE__ */ a.jsx(lt.svg, { width: `${l}px`, height: `${y}px`, viewBox: `0 0 ${l} ${y}`, ref: _, direction: "ltr", children: /* @__PURE__ */ a.jsxs("g", { ref: at, children: [
|
|
134
134
|
st.filter((o) => o.position === "before").map((o) => o.layer),
|
|
135
135
|
d.features.map((o, i) => {
|
|
136
136
|
if (!o.properties?.[dt]) return null;
|
|
137
|
-
const
|
|
138
|
-
return
|
|
137
|
+
const v = ht(o);
|
|
138
|
+
return v ? /* @__PURE__ */ a.jsx(lt.g, { opacity: s ? L : et.length !== 0 ? et.indexOf(o.properties[dt]) !== -1 ? 1 : L : 1, children: /* @__PURE__ */ a.jsx("path", { d: v, style: {
|
|
139
139
|
stroke: Ct,
|
|
140
140
|
strokeWidth: kt,
|
|
141
141
|
fill: Dt
|
|
@@ -148,18 +148,18 @@ function Lo(r) {
|
|
|
148
148
|
(m) => o.id === m.properties[dt]
|
|
149
149
|
);
|
|
150
150
|
if (i === -1) return null;
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
151
|
+
const v = ht(d.features[i]);
|
|
152
|
+
if (!v) return null;
|
|
153
153
|
const N = me(o.x) ? Dt : (
|
|
154
154
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
155
|
E(o.x)
|
|
156
156
|
);
|
|
157
|
-
return /* @__PURE__ */ a.jsx(lt.g, { variants: {
|
|
157
|
+
return /* @__PURE__ */ a.jsx(lt.g, { className: "undp-map-shapes", variants: {
|
|
158
158
|
initial: {
|
|
159
159
|
opacity: 0
|
|
160
160
|
},
|
|
161
161
|
whileInView: {
|
|
162
|
-
opacity:
|
|
162
|
+
opacity: s ? s === N ? 1 : L : et.length !== 0 ? et.indexOf(o.id) !== -1 ? 1 : L : 1,
|
|
163
163
|
transition: {
|
|
164
164
|
duration: x.duration
|
|
165
165
|
}
|
|
@@ -170,14 +170,14 @@ function Lo(r) {
|
|
|
170
170
|
duration: x.duration
|
|
171
171
|
}
|
|
172
172
|
}, onMouseEnter: (m) => {
|
|
173
|
-
I(o), z(m.clientY),
|
|
173
|
+
I(o), z(m.clientY), D(m.clientX), q?.(o);
|
|
174
174
|
}, onMouseMove: (m) => {
|
|
175
|
-
I(o), z(m.clientY),
|
|
175
|
+
I(o), z(m.clientY), D(m.clientX);
|
|
176
176
|
}, onMouseLeave: () => {
|
|
177
|
-
I(void 0),
|
|
177
|
+
I(void 0), D(void 0), z(void 0), q?.(void 0);
|
|
178
178
|
}, onClick: () => {
|
|
179
179
|
(P || H) && (Pe(B, o) && Mt ? (O(void 0), P?.(void 0)) : (O(o), P?.(o)));
|
|
180
|
-
}, children: /* @__PURE__ */ a.jsx(lt.path, { d:
|
|
180
|
+
}, children: /* @__PURE__ */ a.jsx(lt.path, { d: v, variants: {
|
|
181
181
|
initial: {
|
|
182
182
|
fill: N,
|
|
183
183
|
opacity: 0
|
|
@@ -199,75 +199,78 @@ function Lo(r) {
|
|
|
199
199
|
strokeWidth: kt
|
|
200
200
|
} }, `${o.id}`) }, o.id);
|
|
201
201
|
}),
|
|
202
|
-
t.filter((o) => !me(o.lat) && !me(o.long)).map((o) =>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
whileInView: {
|
|
207
|
-
opacity: St.length !== 0 ? St.indexOf(o.label || "") !== -1 ? 1 : L : 1,
|
|
208
|
-
transition: {
|
|
209
|
-
duration: x.duration
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}, initial: "initial", animate: K ? "whileInView" : "initial", exit: {
|
|
213
|
-
opacity: 0,
|
|
214
|
-
transition: {
|
|
215
|
-
duration: x.duration
|
|
216
|
-
}
|
|
217
|
-
}, onMouseEnter: (i) => {
|
|
218
|
-
I(o), z(i.clientY), C(i.clientX), q?.(o);
|
|
219
|
-
}, onMouseMove: (i) => {
|
|
220
|
-
I(o), z(i.clientY), C(i.clientX);
|
|
221
|
-
}, onMouseLeave: () => {
|
|
222
|
-
I(void 0), C(void 0), z(void 0), q?.(void 0);
|
|
223
|
-
}, onClick: () => {
|
|
224
|
-
(P || H) && (Pe(B, o) && Mt ? (O(void 0), P?.(void 0)) : (O(o), P?.(o)));
|
|
225
|
-
}, transform: `translate(${at([o.long, o.lat])[0]},${at([o.long, o.lat])[1]})`, children: [
|
|
226
|
-
/* @__PURE__ */ a.jsx(lt.circle, { cx: 0, cy: 0, variants: {
|
|
202
|
+
t.filter((o) => !me(o.lat) && !me(o.long)).map((o) => {
|
|
203
|
+
const i = Z([o.long, o.lat])[0] > 0.6 * l ? -1 : 1;
|
|
204
|
+
return /* @__PURE__ */ a.jsxs(lt.g, { className: "undp-map-dots", variants: {
|
|
227
205
|
initial: {
|
|
228
|
-
|
|
229
|
-
fill: Y,
|
|
230
|
-
stroke: It || Y
|
|
206
|
+
opacity: 0
|
|
231
207
|
},
|
|
232
208
|
whileInView: {
|
|
233
|
-
|
|
234
|
-
fill: Y,
|
|
235
|
-
stroke: It || Y,
|
|
209
|
+
opacity: St.length !== 0 ? St.indexOf(o.label || "") !== -1 ? 1 : L : 1,
|
|
236
210
|
transition: {
|
|
237
211
|
duration: x.duration
|
|
238
212
|
}
|
|
239
213
|
}
|
|
240
214
|
}, initial: "initial", animate: K ? "whileInView" : "initial", exit: {
|
|
241
|
-
|
|
215
|
+
opacity: 0,
|
|
242
216
|
transition: {
|
|
243
217
|
duration: x.duration
|
|
244
218
|
}
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
219
|
+
}, onMouseEnter: (v) => {
|
|
220
|
+
I(o), z(v.clientY), D(v.clientX), q?.(o);
|
|
221
|
+
}, onMouseMove: (v) => {
|
|
222
|
+
I(o), z(v.clientY), D(v.clientX);
|
|
223
|
+
}, onMouseLeave: () => {
|
|
224
|
+
I(void 0), D(void 0), z(void 0), q?.(void 0);
|
|
225
|
+
}, onClick: () => {
|
|
226
|
+
(P || H) && (Pe(B, o) && Mt ? (O(void 0), P?.(void 0)) : (O(o), P?.(o)));
|
|
227
|
+
}, transform: `translate(${Z([o.long, o.lat])[0]},${Z([o.long, o.lat])[1]})`, children: [
|
|
228
|
+
/* @__PURE__ */ a.jsx(lt.circle, { cx: 0, cy: 0, variants: {
|
|
229
|
+
initial: {
|
|
230
|
+
r: 0,
|
|
231
|
+
fill: Y,
|
|
232
|
+
stroke: It || Y
|
|
233
|
+
},
|
|
234
|
+
whileInView: {
|
|
235
|
+
r: $ ? $(o.radius || 0) : f,
|
|
236
|
+
fill: Y,
|
|
237
|
+
stroke: It || Y,
|
|
238
|
+
transition: {
|
|
239
|
+
duration: x.duration
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}, initial: "initial", animate: K ? "whileInView" : "initial", exit: {
|
|
243
|
+
r: 0,
|
|
244
|
+
transition: {
|
|
245
|
+
duration: x.duration
|
|
246
|
+
}
|
|
247
|
+
}, style: {
|
|
248
|
+
fillOpacity: 0.8
|
|
249
|
+
} }),
|
|
250
|
+
M && o.label ? /* @__PURE__ */ a.jsx(lt.text, { variants: {
|
|
251
|
+
initial: {
|
|
252
|
+
opacity: 0,
|
|
253
|
+
x: i * ($ ? $(o.radius || 0) : f)
|
|
254
|
+
},
|
|
255
|
+
whileInView: {
|
|
256
|
+
opacity: 1,
|
|
257
|
+
x: i * ($ ? $(o.radius || 0) : f),
|
|
258
|
+
transition: {
|
|
259
|
+
duration: x.duration
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}, initial: "initial", animate: K ? "whileInView" : "initial", exit: {
|
|
250
263
|
opacity: 0,
|
|
251
|
-
x: $ ? $(o.radius || 0) : f
|
|
252
|
-
},
|
|
253
|
-
whileInView: {
|
|
254
|
-
opacity: 1,
|
|
255
|
-
x: $ ? $(o.radius || 0) : f,
|
|
256
264
|
transition: {
|
|
257
265
|
duration: x.duration
|
|
258
266
|
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
textAnchor: "start",
|
|
267
|
-
fill: zt || "#000",
|
|
268
|
-
...k?.graphObjectValues || {}
|
|
269
|
-
}, dx: 4, dy: 5, children: o.label }) : null
|
|
270
|
-
] }, o.label || `${o.lat}-${o.long}`))
|
|
267
|
+
}, y: 0, className: ze("text-sm", U?.graphObjectValues), style: {
|
|
268
|
+
textAnchor: i === -1 ? "end" : "start",
|
|
269
|
+
fill: zt || "#000",
|
|
270
|
+
...C?.graphObjectValues || {}
|
|
271
|
+
}, dx: i * 4, dy: 5, children: o.label }) : null
|
|
272
|
+
] }, o.label || `${o.lat}-${o.long}`);
|
|
273
|
+
})
|
|
271
274
|
] }),
|
|
272
275
|
st.filter((o) => o.position === "after").map((o) => o.layer)
|
|
273
276
|
] }) }),
|
|
@@ -276,7 +279,7 @@ function Lo(r) {
|
|
|
276
279
|
Et(!1);
|
|
277
280
|
}, children: /* @__PURE__ */ a.jsx(ho, {}) }),
|
|
278
281
|
/* @__PURE__ */ a.jsxs("div", { className: "color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]", style: {
|
|
279
|
-
width:
|
|
282
|
+
width: tt ? void 0 : "340px"
|
|
280
283
|
}, children: [
|
|
281
284
|
mt && mt !== "" ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
282
285
|
/* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -298,7 +301,7 @@ function Lo(r) {
|
|
|
298
301
|
WebkitLineClamp: "1",
|
|
299
302
|
WebkitBoxOrient: "vertical"
|
|
300
303
|
}, children: g }) : null,
|
|
301
|
-
|
|
304
|
+
tt ? /* @__PURE__ */ a.jsx("div", { className: "flex flex-col gap-3", children: n.map((o, i) => /* @__PURE__ */ a.jsxs("div", { className: "flex gap-2 items-center", onMouseOver: () => {
|
|
302
305
|
V(e[i % e.length]);
|
|
303
306
|
}, onMouseLeave: () => {
|
|
304
307
|
V(void 0);
|
|
@@ -313,9 +316,9 @@ function Lo(r) {
|
|
|
313
316
|
}, onMouseLeave: () => {
|
|
314
317
|
V(void 0);
|
|
315
318
|
}, className: "cursor-pointer", children: [
|
|
316
|
-
/* @__PURE__ */ a.jsx("rect", { x: i * 320 / e.length + 1, y: 1, width: 320 / e.length - 2, height: 8, className:
|
|
319
|
+
/* @__PURE__ */ a.jsx("rect", { x: i * 320 / e.length + 1, y: 1, width: 320 / e.length - 2, height: 8, className: s === e[i] ? "stroke-primary-gray-700 dark:stroke-primary-gray-300" : "", style: {
|
|
317
320
|
fill: e[i],
|
|
318
|
-
...
|
|
321
|
+
...s === e[i] ? {} : {
|
|
319
322
|
stroke: e[i]
|
|
320
323
|
}
|
|
321
324
|
} }),
|
|
@@ -327,9 +330,9 @@ function Lo(r) {
|
|
|
327
330
|
V(e[n.length]);
|
|
328
331
|
}, onMouseLeave: () => {
|
|
329
332
|
V(void 0);
|
|
330
|
-
}, x: n.length * 320 / e.length + 1, y: 1, width: 320 / e.length - 2, height: 8, className: `cursor-pointer ${
|
|
333
|
+
}, x: n.length * 320 / e.length + 1, y: 1, width: 320 / e.length - 2, height: 8, className: `cursor-pointer ${s === e[n.length] ? "stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300" : ""}`, style: {
|
|
331
334
|
fill: e[n.length],
|
|
332
|
-
...
|
|
335
|
+
...s === e[n.length] ? {} : {
|
|
333
336
|
stroke: e[n.length]
|
|
334
337
|
}
|
|
335
338
|
} }) })
|
|
@@ -344,21 +347,21 @@ function Lo(r) {
|
|
|
344
347
|
] })
|
|
345
348
|
] }),
|
|
346
349
|
H && B !== void 0 ? /* @__PURE__ */ a.jsx(yo, { body: H, data: B, setData: O, className: U?.modal }) : null,
|
|
347
|
-
|
|
350
|
+
ot && w && Pt && Lt ? /* @__PURE__ */ a.jsx(uo, { data: ot, body: w, xPos: Pt, yPos: Lt, backgroundStyle: C?.tooltip, className: U?.tooltip }) : null
|
|
348
351
|
] });
|
|
349
352
|
}
|
|
350
353
|
function ja(r) {
|
|
351
354
|
const t = qe.c(135), {
|
|
352
355
|
data: e,
|
|
353
|
-
mapData:
|
|
356
|
+
mapData: b,
|
|
354
357
|
graphTitle: g,
|
|
355
358
|
colors: n,
|
|
356
359
|
sources: f,
|
|
357
360
|
graphDescription: y,
|
|
358
|
-
height:
|
|
361
|
+
height: l,
|
|
359
362
|
width: u,
|
|
360
|
-
footNote:
|
|
361
|
-
mapColorLegendTitle:
|
|
363
|
+
footNote: k,
|
|
364
|
+
mapColorLegendTitle: w,
|
|
362
365
|
colorDomain: M,
|
|
363
366
|
choroplethScaleType: kt,
|
|
364
367
|
radius: Ct,
|
|
@@ -371,18 +374,18 @@ function ja(r) {
|
|
|
371
374
|
showLabels: P,
|
|
372
375
|
mapBorderColor: Mt,
|
|
373
376
|
tooltip: H,
|
|
374
|
-
relativeHeight:
|
|
377
|
+
relativeHeight: C,
|
|
375
378
|
onSeriesMouseOver: U,
|
|
376
|
-
isWorldMap:
|
|
379
|
+
isWorldMap: Q,
|
|
377
380
|
showColorScale: X,
|
|
378
381
|
zoomScaleExtend: x,
|
|
379
382
|
zoomTranslateExtend: L,
|
|
380
383
|
graphID: st,
|
|
381
384
|
highlightedDataPoints: ct,
|
|
382
|
-
onSeriesMouseClick:
|
|
385
|
+
onSeriesMouseClick: tt,
|
|
383
386
|
graphDownload: Y,
|
|
384
387
|
dataDownload: Ot,
|
|
385
|
-
showAntarctica:
|
|
388
|
+
showAntarctica: et,
|
|
386
389
|
language: dt,
|
|
387
390
|
minHeight: mt,
|
|
388
391
|
theme: It,
|
|
@@ -390,55 +393,55 @@ function ja(r) {
|
|
|
390
393
|
resetSelectionOnDoubleClick: J,
|
|
391
394
|
detailsOnClick: pt,
|
|
392
395
|
styles: d,
|
|
393
|
-
classNames:
|
|
396
|
+
classNames: s,
|
|
394
397
|
mapProjection: V,
|
|
395
398
|
zoomInteraction: Ht,
|
|
396
399
|
animate: Et,
|
|
397
400
|
dimmedOpacity: ut,
|
|
398
401
|
customLayers: B,
|
|
399
402
|
maxRadiusValue: O,
|
|
400
|
-
timeline:
|
|
403
|
+
timeline: ot,
|
|
401
404
|
collapseColorScaleByDefault: I,
|
|
402
405
|
dotColor: Pt,
|
|
403
|
-
highlightedIds:
|
|
406
|
+
highlightedIds: D,
|
|
404
407
|
mapProperty: Lt,
|
|
405
408
|
dotLegendTitle: z,
|
|
406
409
|
dotBorderColor: _,
|
|
407
410
|
labelColor: K,
|
|
408
|
-
projectionRotate:
|
|
411
|
+
projectionRotate: at,
|
|
409
412
|
rewindCoordinatesInMapData: $
|
|
410
|
-
} = r, E =
|
|
413
|
+
} = r, E = b === void 0 ? "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json" : b, A = k === 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." : k, j = kt === void 0 ? "threshold" : kt, Vt = Ct === void 0 ? 5 : Ct, Bt = Dt === void 0 ? 0.95 : Dt, _t = Gt === void 0 ? 0.5 : Gt, $t = qt === void 0 ? jt.light.graphNoData : qt, F = St === void 0 ? !1 : St, Z = P === void 0 ? !1 : P, ht = Mt === void 0 ? jt.light.grays["gray-500"] : Mt, rt = Q === void 0 ? !0 : Q, o = X === void 0 ? !0 : X;
|
|
411
414
|
let i;
|
|
412
415
|
t[0] !== x ? (i = x === void 0 ? [0.8, 6] : x, t[0] = x, t[1] = i) : i = t[1];
|
|
413
|
-
const
|
|
416
|
+
const v = i;
|
|
414
417
|
let N;
|
|
415
418
|
t[2] !== ct ? (N = ct === void 0 ? [] : ct, t[2] = ct, t[3] = N) : N = t[3];
|
|
416
|
-
const m = N, gt = Y === void 0 ? !1 : Y, ft = Ot === void 0 ? !1 : Ot, At =
|
|
419
|
+
const m = N, gt = Y === void 0 ? !1 : Y, ft = Ot === void 0 ? !1 : Ot, At = et === void 0 ? !1 : et, pe = dt === void 0 ? "en" : dt, T = mt === void 0 ? 0 : mt, it = It === void 0 ? "light" : It, ue = J === void 0 ? !0 : J, he = V === void 0 ? "naturalEarth" : V, ge = Ht === void 0 ? "button" : Ht, Ut = Et === void 0 ? !1 : Et, fe = ut === void 0 ? 0.3 : ut;
|
|
417
420
|
let Xt;
|
|
418
421
|
t[4] !== B ? (Xt = B === void 0 ? [] : B, t[4] = B, t[5] = Xt) : Xt = t[5];
|
|
419
422
|
const ye = Xt;
|
|
420
423
|
let Yt;
|
|
421
|
-
t[6] !==
|
|
424
|
+
t[6] !== ot ? (Yt = ot === void 0 ? {
|
|
422
425
|
enabled: !1,
|
|
423
426
|
autoplay: !1,
|
|
424
427
|
showOnlyActiveDate: !0
|
|
425
|
-
} :
|
|
426
|
-
const
|
|
428
|
+
} : ot, t[6] = ot, t[7] = Yt) : Yt = t[7];
|
|
429
|
+
const c = Yt, xe = Pt === void 0 ? jt.primaryColors["blue-600"] : Pt;
|
|
427
430
|
let Jt;
|
|
428
|
-
t[8] !==
|
|
431
|
+
t[8] !== D ? (Jt = D === void 0 ? [] : D, t[8] = D, t[9] = Jt) : Jt = t[9];
|
|
429
432
|
const ve = Jt, be = Lt === void 0 ? "ISO3" : Lt, we = K === void 0 ? jt.primaryColors["blue-600"] : K;
|
|
430
433
|
let Kt;
|
|
431
|
-
t[10] !==
|
|
432
|
-
const je = Kt, ke = $ === void 0 ? !0 : $, [nt, Fe] = S(0), [Ft, Te] = S(0), [W, We] = S(
|
|
434
|
+
t[10] !== at ? (Kt = at === void 0 ? [0, 0] : at, t[10] = at, t[11] = Kt) : Kt = t[11];
|
|
435
|
+
const je = Kt, ke = $ === void 0 ? !0 : $, [nt, Fe] = S(0), [Ft, Te] = S(0), [W, We] = S(c.autoplay);
|
|
433
436
|
let Tt;
|
|
434
|
-
if (t[12] !== e || t[13] !==
|
|
437
|
+
if (t[12] !== e || t[13] !== c.dateFormat) {
|
|
435
438
|
let h;
|
|
436
|
-
t[15] !==
|
|
439
|
+
t[15] !== c.dateFormat ? (h = (G) => Ke(`${G.date}`, c.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime(), t[15] = c.dateFormat, t[16] = h) : h = t[16], Tt = [...new Set(e.filter(qo).map(h))], Tt.sort(Go), t[12] = e, t[13] = c.dateFormat, t[14] = Tt;
|
|
437
440
|
} else
|
|
438
441
|
Tt = t[14];
|
|
439
|
-
const p = Tt, [R, Ce] = S(
|
|
442
|
+
const p = Tt, [R, Ce] = S(c.autoplay ? 0 : p.length - 1), [yt, Re] = S(void 0), De = Rt(null), Ee = Rt(null);
|
|
440
443
|
let Zt;
|
|
441
|
-
t[17] !==
|
|
444
|
+
t[17] !== j || t[18] !== M || t[19] !== n?.length || t[20] !== e ? (Zt = M || (j === "categorical" ? Oo(e, "x") : Io(e.map(Ro), n?.length || 4)), t[17] = j, t[18] = M, t[19] = n?.length, t[20] = e, t[21] = Zt) : Zt = t[21];
|
|
442
445
|
const Wt = Zt;
|
|
443
446
|
let Qt, te;
|
|
444
447
|
t[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Qt = () => {
|
|
@@ -461,26 +464,26 @@ function ja(r) {
|
|
|
461
464
|
let re;
|
|
462
465
|
t[28] !== E ? (re = [E], t[28] = E, t[29] = re) : re = t[29], de(ae, re);
|
|
463
466
|
let ie, ne;
|
|
464
|
-
t[30] !== W || t[31] !==
|
|
467
|
+
t[30] !== W || t[31] !== c.speed || t[32] !== p ? (ie = () => {
|
|
465
468
|
const h = setInterval(() => {
|
|
466
469
|
Ce((G) => G < p.length - 1 ? G + 1 : 0);
|
|
467
|
-
}, (
|
|
470
|
+
}, (c.speed || 2) * 1e3);
|
|
468
471
|
return W || clearInterval(h), () => clearInterval(h);
|
|
469
|
-
}, ne = [p, W,
|
|
470
|
-
const Ne =
|
|
472
|
+
}, ne = [p, W, c.speed], t[30] = W, t[31] = c.speed, t[32] = p, t[33] = ie, t[34] = ne) : (ie = t[33], ne = t[34]), de(ie, ne);
|
|
473
|
+
const Ne = c.dateFormat || "yyyy";
|
|
471
474
|
let le;
|
|
472
|
-
t[35] !== R || t[36] !== Ne || t[37] !==
|
|
473
|
-
const se = le, Se =
|
|
475
|
+
t[35] !== R || t[36] !== Ne || t[37] !== c.showOnlyActiveDate || t[38] !== p ? (le = Ze(p, R, c.showOnlyActiveDate, Ne), t[35] = R, t[36] = Ne, t[37] = c.showOnlyActiveDate, t[38] = p, t[39] = le) : le = t[39];
|
|
476
|
+
const se = le, Se = s?.graphContainer, Me = d?.graphContainer;
|
|
474
477
|
let xt;
|
|
475
|
-
t[40] !==
|
|
478
|
+
t[40] !== s?.description || t[41] !== s?.title || t[42] !== e || t[43] !== ft || t[44] !== y || t[45] !== gt || t[46] !== g || t[47] !== d?.description || t[48] !== d?.title || t[49] !== u ? (xt = g || y || gt || ft ? /* @__PURE__ */ a.jsx(Do, { styles: {
|
|
476
479
|
title: d?.title,
|
|
477
480
|
description: d?.description
|
|
478
481
|
}, classNames: {
|
|
479
|
-
title:
|
|
480
|
-
description:
|
|
481
|
-
}, graphTitle: g, graphDescription: y, width: u, graphDownload: gt ? Ee : void 0, dataDownload: ft ? e.map(Wo).filter(To).length > 0 ? e.map(Fo).filter(Ao) : e.filter($o) : null }) : null, t[40] =
|
|
482
|
+
title: s?.title,
|
|
483
|
+
description: s?.description
|
|
484
|
+
}, graphTitle: g, graphDescription: y, width: u, graphDownload: gt ? Ee : void 0, dataDownload: ft ? e.map(Wo).filter(To).length > 0 ? e.map(Fo).filter(Ao) : e.filter($o) : null }) : null, t[40] = s?.description, t[41] = s?.title, t[42] = e, t[43] = ft, t[44] = y, t[45] = gt, t[46] = g, t[47] = d?.description, t[48] = d?.title, t[49] = u, t[50] = xt) : xt = t[50];
|
|
482
485
|
let vt;
|
|
483
|
-
t[51] !== R || t[52] !== se || t[53] !== W || t[54] !==
|
|
486
|
+
t[51] !== R || t[52] !== se || t[53] !== W || t[54] !== c.enabled || t[55] !== p ? (vt = c.enabled && p.length > 0 && se ? /* @__PURE__ */ a.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
484
487
|
/* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => {
|
|
485
488
|
We(!W);
|
|
486
489
|
}, className: "p-0 border-0 cursor-pointer bg-transparent", "aria-label": W ? "Click to pause animation" : "Click to play animation", children: W ? /* @__PURE__ */ a.jsx(go, {}) : /* @__PURE__ */ a.jsx(fo, {}) }),
|
|
@@ -489,12 +492,12 @@ function ja(r) {
|
|
|
489
492
|
}, onChange: (h) => {
|
|
490
493
|
Ce(p.indexOf(h));
|
|
491
494
|
}, "aria-label": "Time slider. Use arrow keys to adjust selected time period." })
|
|
492
|
-
] }) : null, t[51] = R, t[52] = se, t[53] = W, t[54] =
|
|
495
|
+
] }) : null, t[51] = R, t[52] = se, t[53] = W, t[54] = c.enabled, t[55] = p, t[56] = vt) : vt = t[56];
|
|
493
496
|
let bt;
|
|
494
|
-
t[57] !== Ut || t[58] !== q || t[59] !==
|
|
497
|
+
t[57] !== Ut || t[58] !== q || t[59] !== j || t[60] !== s || t[61] !== I || t[62] !== n || t[63] !== ye || t[64] !== e || t[65] !== pt || t[66] !== fe || t[67] !== Wt || t[68] !== _ || t[69] !== xe || t[70] !== z || t[71] !== l || t[72] !== m || t[73] !== ve || t[74] !== R || t[75] !== rt || t[76] !== we || t[77] !== ht || t[78] !== _t || t[79] !== w || t[80] !== $t || t[81] !== he || t[82] !== be || t[83] !== yt || t[84] !== O || t[85] !== T || t[86] !== tt || t[87] !== U || t[88] !== je || t[89] !== Vt || t[90] !== C || t[91] !== ue || t[92] !== ke || t[93] !== Bt || t[94] !== At || t[95] !== o || t[96] !== Z || t[97] !== d || t[98] !== Ft || t[99] !== nt || t[100] !== it || t[101] !== c.dateFormat || t[102] !== c.enabled || t[103] !== H || t[104] !== p || t[105] !== u || t[106] !== ge || t[107] !== v || t[108] !== L ? (bt = /* @__PURE__ */ a.jsx(So, { ref: De, children: nt && Ft && yt ? /* @__PURE__ */ a.jsx(Lo, { dotColor: xe, data: e.filter((h) => c.enabled ? h.date === Je(new Date(p[R]), c.dateFormat || "yyyy") : h), mapData: At ? yt : {
|
|
495
498
|
...yt,
|
|
496
499
|
features: yt.features.filter(_o)
|
|
497
|
-
}, colorDomain: Wt, width: nt, height: Ft, scale: Bt, centerPoint: q, colors: n || (
|
|
500
|
+
}, colorDomain: Wt, width: nt, height: Ft, scale: Bt, centerPoint: q, colors: n || (j === "categorical" ? jt[it].sequentialColors[`neutralColorsx0${Wt.length}`] : jt[it].sequentialColors[`neutralColorsx0${Wt.length + 1}`]), mapColorLegendTitle: w, radius: Vt, categorical: j === "categorical", mapBorderWidth: _t, mapNoDataColor: $t, mapBorderColor: ht, tooltip: H, onSeriesMouseOver: U, showLabels: Z, isWorldMap: rt, showColorScale: o, zoomScaleExtend: v, zoomTranslateExtend: L, onSeriesMouseClick: tt, highlightedDataPoints: m, resetSelectionOnDoubleClick: ue, styles: d, classNames: s, zoomInteraction: ge, detailsOnClick: pt, mapProjection: he || (rt ? "naturalEarth" : "mercator"), animate: Ut === !0 ? {
|
|
498
501
|
duration: 0.5,
|
|
499
502
|
once: !0,
|
|
500
503
|
amount: 0.5
|
|
@@ -503,23 +506,23 @@ function ja(r) {
|
|
|
503
506
|
once: !0,
|
|
504
507
|
amount: 0
|
|
505
508
|
}, dimmedOpacity: fe, customLayers: ye, maxRadiusValue: me(O) ? Math.max(...e.map(Bo).filter(Vo)) : O, collapseColorScaleByDefault: I, highlightedIds: ve, mapProperty: be, dotLegendTitle: z, dotBorderColor: _, labelColor: we, projectionRotate: je, rewindCoordinatesInMapData: ke }) : /* @__PURE__ */ a.jsx("div", { style: {
|
|
506
|
-
height: `${Math.max(T,
|
|
507
|
-
}, className: "flex items-center justify-center", children: /* @__PURE__ */ a.jsx(to, { "aria-label": "Loading graph" }) }) }), t[57] = Ut, t[58] = q, t[59] =
|
|
509
|
+
height: `${Math.max(T, l || (C ? T ? (u || nt) * C > T ? (u || nt) * C : T : (u || nt) * C : Ft))}px`
|
|
510
|
+
}, className: "flex items-center justify-center", children: /* @__PURE__ */ a.jsx(to, { "aria-label": "Loading graph" }) }) }), t[57] = Ut, t[58] = q, t[59] = j, t[60] = s, t[61] = I, t[62] = n, t[63] = ye, t[64] = e, t[65] = pt, t[66] = fe, t[67] = Wt, t[68] = _, t[69] = xe, t[70] = z, t[71] = l, t[72] = m, t[73] = ve, t[74] = R, t[75] = rt, t[76] = we, t[77] = ht, t[78] = _t, t[79] = w, t[80] = $t, t[81] = he, t[82] = be, t[83] = yt, t[84] = O, t[85] = T, t[86] = tt, t[87] = U, t[88] = je, t[89] = Vt, t[90] = C, t[91] = ue, t[92] = ke, t[93] = Bt, t[94] = At, t[95] = o, t[96] = Z, t[97] = d, t[98] = Ft, t[99] = nt, t[100] = it, t[101] = c.dateFormat, t[102] = c.enabled, t[103] = H, t[104] = p, t[105] = u, t[106] = ge, t[107] = v, t[108] = L, t[109] = bt) : bt = t[109];
|
|
508
511
|
let wt;
|
|
509
|
-
t[110] !==
|
|
512
|
+
t[110] !== s?.footnote || t[111] !== s?.source || t[112] !== A || t[113] !== f || t[114] !== d?.footnote || t[115] !== d?.source || t[116] !== u ? (wt = f || A ? /* @__PURE__ */ a.jsx(Co, { styles: {
|
|
510
513
|
footnote: d?.footnote,
|
|
511
514
|
source: d?.source
|
|
512
515
|
}, classNames: {
|
|
513
|
-
footnote:
|
|
514
|
-
source:
|
|
515
|
-
}, sources: f, footNote: A, width: u }) : null, t[110] =
|
|
516
|
+
footnote: s?.footnote,
|
|
517
|
+
source: s?.source
|
|
518
|
+
}, sources: f, footNote: A, width: u }) : null, t[110] = s?.footnote, t[111] = s?.source, t[112] = A, t[113] = f, t[114] = d?.footnote, t[115] = d?.source, t[116] = u, t[117] = wt) : wt = t[117];
|
|
516
519
|
let ce;
|
|
517
|
-
return t[118] !== zt || t[119] !== F || t[120] !== st || t[121] !==
|
|
520
|
+
return t[118] !== zt || t[119] !== F || t[120] !== st || t[121] !== l || t[122] !== pe || t[123] !== T || t[124] !== Nt || t[125] !== C || t[126] !== Se || t[127] !== Me || t[128] !== xt || t[129] !== vt || t[130] !== bt || t[131] !== wt || t[132] !== it || t[133] !== u ? (ce = /* @__PURE__ */ a.jsxs(Mo, { className: Se, style: Me, id: st, ref: Ee, "aria-label": zt, backgroundColor: F, theme: it, language: pe, minHeight: T, width: u, height: l, relativeHeight: C, padding: Nt, children: [
|
|
518
521
|
xt,
|
|
519
522
|
vt,
|
|
520
523
|
bt,
|
|
521
524
|
wt
|
|
522
|
-
] }), t[118] = zt, t[119] = F, t[120] = st, t[121] =
|
|
525
|
+
] }), t[118] = zt, t[119] = F, t[120] = st, t[121] = l, t[122] = pe, t[123] = T, t[124] = Nt, t[125] = C, t[126] = Se, t[127] = Me, t[128] = xt, t[129] = vt, t[130] = bt, t[131] = wt, t[132] = it, t[133] = u, t[134] = ce) : ce = t[134], ce;
|
|
523
526
|
}
|
|
524
527
|
function Vo(r) {
|
|
525
528
|
return r != null;
|