@undp/data-viz 2.3.1 → 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 +2 -2
- package/dist/HybridMap.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
import { j as o, m as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { g as
|
|
4
|
-
import { w as
|
|
5
|
-
import { f as
|
|
6
|
-
import { i as
|
|
7
|
-
import { i as
|
|
8
|
-
import { i as
|
|
9
|
-
import { j as
|
|
10
|
-
import { n as
|
|
11
|
-
import { T as
|
|
12
|
-
import { c as
|
|
13
|
-
import { X as
|
|
14
|
-
import { D as
|
|
15
|
-
import { s as
|
|
16
|
-
import { t as
|
|
17
|
-
import { m as
|
|
18
|
-
import { u as
|
|
19
|
-
import { A as
|
|
20
|
-
import { GraphHeader as
|
|
1
|
+
import { j as o, m as Ot, c as Mt } from "./index-CHPV5EwG-DecW7_qr.js";
|
|
2
|
+
import { useMemo as It, useState as j, useRef as Ae, useEffect as tt, useEffectEvent as zt } from "react";
|
|
3
|
+
import { g as Et, N as At } from "./getSliderMarks-Cvg8zHBU.js";
|
|
4
|
+
import { w as Pt } from "./Spinner--r2RrJV8.js";
|
|
5
|
+
import { f as Bt, p as Lt } from "./parse-Dv4of-PN.js";
|
|
6
|
+
import { i as Wt } from "./index-Bwrro8-q.js";
|
|
7
|
+
import { i as _t, z as Ft, a as Tt, g as $t, b as Ht, c as Rt, d as Gt, e as Vt, f as Ut } from "./index-Dp_SfsUA.js";
|
|
8
|
+
import { i as Xt } from "./index-DCsFBfJ_.js";
|
|
9
|
+
import { j as vt } from "./Typography-hWfh3H0J.js";
|
|
10
|
+
import { n as bt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
11
|
+
import { T as Yt } from "./Tooltip-BRnAz2Gv.js";
|
|
12
|
+
import { c as kt } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
13
|
+
import { X as qt, P as Jt, e as Kt } from "./index-BQYOuXdl.js";
|
|
14
|
+
import { D as Zt } from "./DetailsModal-BMCTgVsk.js";
|
|
15
|
+
import { s as gt } from "./select-DKy99ogv.js";
|
|
16
|
+
import { t as wt } from "./threshold-DFfqcDMa.js";
|
|
17
|
+
import { m as et } from "./proxy-DRuSUlPL.js";
|
|
18
|
+
import { u as Qt } from "./use-in-view-Dl5L8LtP.js";
|
|
19
|
+
import { A as eo } from "./index-CtMBjvtq.js";
|
|
20
|
+
import { GraphHeader as to } from "./GraphHeader.js";
|
|
21
21
|
import { GraphFooter as oo } from "./GraphFooter.js";
|
|
22
|
-
import { Colors as
|
|
22
|
+
import { Colors as yt } from "./Colors.js";
|
|
23
23
|
import { f as ro } from "./fetchAndParseData-BAXhgTDM.js";
|
|
24
|
-
import { g as
|
|
24
|
+
import { g as Ct } from "./getJenks-DTCcQSDi.js";
|
|
25
25
|
import { a as ao, G as no } from "./GraphContainer-CF6ws3pd.js";
|
|
26
26
|
function io(n) {
|
|
27
27
|
const {
|
|
28
|
-
data:
|
|
28
|
+
data: e,
|
|
29
29
|
xDomain: d,
|
|
30
30
|
mapData: L,
|
|
31
|
-
xColorLegendTitle:
|
|
31
|
+
xColorLegendTitle: Pe,
|
|
32
32
|
yDomain: Y,
|
|
33
33
|
yColorLegendTitle: q,
|
|
34
34
|
width: u,
|
|
35
35
|
height: p,
|
|
36
36
|
colors: h,
|
|
37
|
-
scale:
|
|
37
|
+
scale: Be,
|
|
38
38
|
centerPoint: k,
|
|
39
39
|
mapBorderWidth: W,
|
|
40
40
|
mapNoDataColor: J,
|
|
41
|
-
mapBorderColor:
|
|
41
|
+
mapBorderColor: pe,
|
|
42
42
|
tooltip: K,
|
|
43
|
-
onSeriesMouseOver:
|
|
44
|
-
zoomScaleExtend:
|
|
45
|
-
zoomTranslateExtend:
|
|
43
|
+
onSeriesMouseOver: he,
|
|
44
|
+
zoomScaleExtend: ue,
|
|
45
|
+
zoomTranslateExtend: fe,
|
|
46
46
|
highlightedIds: w,
|
|
47
47
|
onSeriesMouseClick: Z,
|
|
48
48
|
mapProperty: N,
|
|
49
|
-
resetSelectionOnDoubleClick:
|
|
49
|
+
resetSelectionOnDoubleClick: Le,
|
|
50
50
|
detailsOnClick: y,
|
|
51
|
-
showColorScale:
|
|
52
|
-
styles:
|
|
51
|
+
showColorScale: ge,
|
|
52
|
+
styles: We,
|
|
53
53
|
classNames: _,
|
|
54
54
|
mapProjection: F,
|
|
55
55
|
zoomInteraction: S,
|
|
56
56
|
animate: O,
|
|
57
57
|
dimmedOpacity: M,
|
|
58
58
|
customLayers: Q,
|
|
59
|
-
collapseColorScaleByDefault:
|
|
60
|
-
zoomAndCenterByHighlightedIds:
|
|
59
|
+
collapseColorScaleByDefault: ye,
|
|
60
|
+
zoomAndCenterByHighlightedIds: xe,
|
|
61
61
|
projectionRotate: T,
|
|
62
|
-
rewindCoordinatesInMapData:
|
|
63
|
-
} = n, x =
|
|
62
|
+
rewindCoordinatesInMapData: ve
|
|
63
|
+
} = n, x = It(() => ve ? _t(L, {
|
|
64
64
|
reverse: !0
|
|
65
|
-
}) : L, [L,
|
|
65
|
+
}) : L, [L, ve]), [_e, be] = j(ye === void 0 ? !(u < 680) : !ye), [$, ke] = j(void 0), [G, l] = j(void 0), [s, ee] = j(void 0), [we, te] = j(void 0), [Ce, H] = j(void 0), D = Ae(null), oe = Qt(D, {
|
|
66
66
|
once: O.once,
|
|
67
67
|
amount: O.amount
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
const
|
|
68
|
+
}), je = Ae(null), R = Ae(null);
|
|
69
|
+
tt(() => {
|
|
70
|
+
const t = gt(je.current), r = gt(D.current), f = (m) => {
|
|
71
71
|
if (S === "noZoom") return !1;
|
|
72
72
|
if (S === "button") return !m.type.includes("wheel");
|
|
73
|
-
const C = m.type === "wheel", v = m.type.startsWith("touch"),
|
|
74
|
-
return v ? !0 : C ? S === "scroll" ? !0 : m.ctrlKey :
|
|
75
|
-
}, b =
|
|
73
|
+
const C = m.type === "wheel", v = m.type.startsWith("touch"), Ie = m.type === "mousedown" || m.type === "mousemove";
|
|
74
|
+
return v ? !0 : C ? S === "scroll" ? !0 : m.ctrlKey : Ie && !m.button && !m.ctrlKey;
|
|
75
|
+
}, b = Ft().scaleExtent(ue).translateExtent(fe || [[-20, -20], [u + 20, p + 20]]).filter(f).on("zoom", ({
|
|
76
76
|
transform: m
|
|
77
77
|
}) => {
|
|
78
|
-
|
|
78
|
+
t.attr("transform", m);
|
|
79
79
|
});
|
|
80
80
|
r.call(b), R.current = b;
|
|
81
81
|
}, [p, u, S]);
|
|
82
|
-
const V =
|
|
82
|
+
const V = Tt({
|
|
83
83
|
...x,
|
|
84
|
-
features:
|
|
84
|
+
features: xe ? x.features.filter(
|
|
85
85
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
-
(
|
|
86
|
+
(t) => (w || []).length === 0 || w.indexOf(t.properties[N]) !== -1
|
|
87
87
|
) : x.features
|
|
88
|
-
}), g =
|
|
88
|
+
}), g = Xt({
|
|
89
89
|
...x,
|
|
90
|
-
features:
|
|
90
|
+
features: xe ? x.features.filter(
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
(
|
|
92
|
+
(t) => (w || []).length === 0 || w.indexOf(t.properties[N]) !== -1
|
|
93
93
|
) : x.features
|
|
94
|
-
}), I = V[2] - V[0],
|
|
94
|
+
}), I = V[2] - V[0], re = V[3] - V[1], De = u * 190 / 960 * 360 / I, Ne = p * 190 / 678 * 180 / re, z = Be * Math.min(De, Ne), Se = F === "mercator" ? $t().rotate(T).center(k || g.geometry.coordinates).translate([u / 2, p / 2]).scale(z) : F === "equalEarth" ? Ht().rotate(T).center(k || g.geometry.coordinates).translate([u / 2, p / 2]).scale(z) : F === "naturalEarth" ? Rt().rotate(T).center(k || g.geometry.coordinates).translate([u / 2, p / 2]).scale(z) : F === "orthographic" ? Gt().rotate(T).center(k || g.geometry.coordinates).translate([u / 2, p / 2]).scale(z) : Vt().rotate(T).center(k || g.geometry.coordinates).translate([u / 2, p / 2]).scale(z), U = Ut().projection(Se), Oe = Array.from({
|
|
95
95
|
length: d.length
|
|
96
|
-
}, (
|
|
96
|
+
}, (t, r) => r), Me = Array.from({
|
|
97
97
|
length: Y.length
|
|
98
|
-
}, (
|
|
98
|
+
}, (t, r) => r), ae = wt().domain(d).range(Oe), ne = wt().domain(Y).range(Me), ie = (t) => {
|
|
99
99
|
if (!D.current || !R.current) return;
|
|
100
|
-
|
|
100
|
+
gt(D.current).call(R.current.scaleBy, t === "in" ? 1.2 : 1 / 1.2);
|
|
101
101
|
};
|
|
102
102
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
103
103
|
/* @__PURE__ */ o.jsxs("div", { className: "relative", children: [
|
|
104
|
-
/* @__PURE__ */ o.jsx(
|
|
105
|
-
Q.filter((
|
|
106
|
-
x.features.map((
|
|
107
|
-
if (!
|
|
108
|
-
const f = U(
|
|
109
|
-
return f ? /* @__PURE__ */ o.jsx(
|
|
110
|
-
stroke:
|
|
104
|
+
/* @__PURE__ */ o.jsx(et.svg, { viewBox: `0 0 ${u} ${p}`, width: `${u}px`, height: `${p}px`, ref: D, direction: "ltr", children: /* @__PURE__ */ o.jsxs("g", { ref: je, children: [
|
|
105
|
+
Q.filter((t) => t.position === "before").map((t) => t.layer),
|
|
106
|
+
x.features.map((t, r) => {
|
|
107
|
+
if (!t.properties?.[N]) return null;
|
|
108
|
+
const f = U(t);
|
|
109
|
+
return f ? /* @__PURE__ */ o.jsx(et.g, { opacity: $ ? M : w.length !== 0 ? w.indexOf(t.properties[N]) !== -1 ? 1 : M : 1, children: /* @__PURE__ */ o.jsx("path", { d: f, style: {
|
|
110
|
+
stroke: pe,
|
|
111
111
|
strokeWidth: W,
|
|
112
112
|
fill: J
|
|
113
113
|
} }) }, r) : null;
|
|
114
114
|
}),
|
|
115
|
-
/* @__PURE__ */ o.jsx(
|
|
115
|
+
/* @__PURE__ */ o.jsx(eo, { children: e.map((t) => {
|
|
116
116
|
const r = x.features.findIndex(
|
|
117
117
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
-
(v) =>
|
|
118
|
+
(v) => t.id === v.properties[N]
|
|
119
119
|
);
|
|
120
120
|
if (r === -1) return null;
|
|
121
121
|
const f = U(x.features[r]);
|
|
122
122
|
if (!f) return null;
|
|
123
|
-
const b =
|
|
124
|
-
return /* @__PURE__ */ o.jsx(
|
|
123
|
+
const b = kt(t.x) ? void 0 : ae(t.x), m = kt(t.y) ? void 0 : ne(t.y), C = b !== void 0 && m !== void 0 ? h[m][b] : J;
|
|
124
|
+
return /* @__PURE__ */ o.jsx(et.g, { className: "undp-map-shapes", variants: {
|
|
125
125
|
initial: {
|
|
126
126
|
opacity: 0
|
|
127
127
|
},
|
|
128
128
|
whileInView: {
|
|
129
|
-
opacity: $ ? $ === C ? 1 : M : w.length !== 0 ? w.indexOf(
|
|
129
|
+
opacity: $ ? $ === C ? 1 : M : w.length !== 0 ? w.indexOf(t.id) !== -1 ? 1 : M : 1,
|
|
130
130
|
transition: {
|
|
131
131
|
duration: O.duration
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
}, initial: "initial", animate:
|
|
134
|
+
}, initial: "initial", animate: oe ? "whileInView" : "initial", exit: {
|
|
135
135
|
opacity: 0,
|
|
136
136
|
transition: {
|
|
137
137
|
duration: O.duration
|
|
138
138
|
}
|
|
139
139
|
}, onMouseEnter: (v) => {
|
|
140
|
-
|
|
140
|
+
ee(t), H(v.clientY), te(v.clientX), he?.(t);
|
|
141
141
|
}, onClick: () => {
|
|
142
|
-
(Z || y) && (
|
|
142
|
+
(Z || y) && (Wt(G, t) && Le ? (l(void 0), Z?.(void 0)) : (l(t), Z?.(t)));
|
|
143
143
|
}, onMouseMove: (v) => {
|
|
144
|
-
|
|
144
|
+
ee(t), H(v.clientY), te(v.clientX);
|
|
145
145
|
}, onMouseLeave: () => {
|
|
146
|
-
|
|
147
|
-
}, children: /* @__PURE__ */ o.jsx(
|
|
146
|
+
ee(void 0), te(void 0), H(void 0), he?.(void 0);
|
|
147
|
+
}, children: /* @__PURE__ */ o.jsx(et.path, { d: f, variants: {
|
|
148
148
|
initial: {
|
|
149
149
|
fill: C,
|
|
150
150
|
opacity: 0
|
|
@@ -156,46 +156,46 @@ function io(n) {
|
|
|
156
156
|
duration: O.duration
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
}, initial: "initial", animate:
|
|
159
|
+
}, initial: "initial", animate: oe ? "whileInView" : "initial", exit: {
|
|
160
160
|
opacity: 0,
|
|
161
161
|
transition: {
|
|
162
162
|
duration: O.duration
|
|
163
163
|
}
|
|
164
164
|
}, className: `${C === J ? "stroke-primary-gray-400 dark:stroke-primary-gray-500" : "stroke-primary-white dark:stroke-primary-gray-650"}`, style: {
|
|
165
|
-
stroke:
|
|
165
|
+
stroke: pe,
|
|
166
166
|
strokeWidth: W
|
|
167
|
-
} }, `${
|
|
167
|
+
} }, `${t.id}`) }, t.id);
|
|
168
168
|
}) }),
|
|
169
169
|
s ? x.features.filter(
|
|
170
170
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
171
|
-
(
|
|
172
|
-
).map((
|
|
171
|
+
(t) => t.properties[N] === s.id
|
|
172
|
+
).map((t, r) => /* @__PURE__ */ o.jsx("path", { d: U(t) || "", className: "stroke-primary-gray-700 dark:stroke-primary-gray-300", style: {
|
|
173
173
|
fill: "none",
|
|
174
174
|
fillOpacity: 0,
|
|
175
175
|
strokeWidth: "0.5"
|
|
176
176
|
} }, r)) : null,
|
|
177
|
-
Q.filter((
|
|
177
|
+
Q.filter((t) => t.position === "after").map((t) => t.layer)
|
|
178
178
|
] }) }),
|
|
179
|
-
|
|
179
|
+
ge === !1 ? null : /* @__PURE__ */ o.jsx("div", { className: Ot("absolute left-4 bottom-4 map-color-legend", _?.colorLegend), children: _e ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
180
180
|
/* @__PURE__ */ o.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: () => {
|
|
181
|
-
|
|
182
|
-
}, children: /* @__PURE__ */ o.jsx(
|
|
181
|
+
be(!1);
|
|
182
|
+
}, children: /* @__PURE__ */ o.jsx(qt, {}) }),
|
|
183
183
|
/* @__PURE__ */ o.jsxs("div", { className: "color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]", style: {
|
|
184
184
|
width: "175px"
|
|
185
185
|
}, children: [
|
|
186
186
|
/* @__PURE__ */ o.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
187
187
|
/* @__PURE__ */ o.jsx("svg", { width: "136px", viewBox: "0 0 136 136", className: "shrink-0", children: /* @__PURE__ */ o.jsxs("g", { children: [
|
|
188
|
-
h.map((
|
|
188
|
+
h.map((t, r) => /* @__PURE__ */ o.jsx("g", { transform: `translate(0,${100 - r * 25})`, children: t.map((f, b) => /* @__PURE__ */ o.jsx("rect", { y: 1, x: b * 25 + 1, fill: f, width: 23, height: 23, strokeWidth: $ === f ? 2 : 0.25, style: {
|
|
189
189
|
cursor: "pointer"
|
|
190
190
|
}, onMouseOver: () => {
|
|
191
|
-
|
|
191
|
+
ke(f);
|
|
192
192
|
}, onMouseLeave: () => {
|
|
193
|
-
|
|
193
|
+
ke(void 0);
|
|
194
194
|
} }, b)) }, r)),
|
|
195
|
-
/* @__PURE__ */ o.jsx("g", { transform: "translate(0,125)", children: d.map((
|
|
196
|
-
Y.map((
|
|
195
|
+
/* @__PURE__ */ o.jsx("g", { transform: "translate(0,125)", children: d.map((t, r) => /* @__PURE__ */ o.jsx("text", { y: 10, x: (r + 1) * 25, fontSize: 10, textAnchor: "middle", children: typeof t == "string" || t < 1 ? t : bt(t, "NA") }, r)) }),
|
|
196
|
+
Y.map((t, r) => /* @__PURE__ */ o.jsx("g", { transform: `translate(${Math.max(Math.min(d.length + 1, 5), 4) * 25 + 10},${100 - r * 25})`, children: /* @__PURE__ */ o.jsx("text", { x: 0, transform: "rotate(-90)", y: 0, fontSize: 10, textAnchor: "middle", children: typeof t == "string" || t < 1 ? t : bt(t, "NA") }) }, r))
|
|
197
197
|
] }) }),
|
|
198
|
-
/* @__PURE__ */ o.jsx(
|
|
198
|
+
/* @__PURE__ */ o.jsx(vt, { marginBottom: "none", size: "xs", className: "leading-normal text-center shrink-0", style: {
|
|
199
199
|
display: "-webkit-box",
|
|
200
200
|
WebkitLineClamp: "1",
|
|
201
201
|
WebkitBoxOrient: "vertical",
|
|
@@ -205,190 +205,190 @@ function io(n) {
|
|
|
205
205
|
transform: "rotate(180deg)"
|
|
206
206
|
}, children: q })
|
|
207
207
|
] }),
|
|
208
|
-
/* @__PURE__ */ o.jsx(
|
|
208
|
+
/* @__PURE__ */ o.jsx(vt, { marginBottom: "none", size: "xs", className: "mt-1 leading-normal text-center", style: {
|
|
209
209
|
display: "-webkit-box",
|
|
210
210
|
WebkitLineClamp: "1",
|
|
211
211
|
width: "8.5rem",
|
|
212
212
|
WebkitBoxOrient: "vertical",
|
|
213
213
|
overflow: "hidden"
|
|
214
|
-
}, children:
|
|
214
|
+
}, children: Pe })
|
|
215
215
|
] })
|
|
216
216
|
] }) : /* @__PURE__ */ o.jsx("button", { type: "button", className: "mb-0 border-0 bg-transparent p-0 self-start", onClick: () => {
|
|
217
|
-
|
|
217
|
+
be(!0);
|
|
218
218
|
}, children: /* @__PURE__ */ o.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" }) }) }),
|
|
219
219
|
S === "button" && /* @__PURE__ */ o.jsxs("div", { className: "absolute left-4 top-4 flex flex-col zoom-buttons", children: [
|
|
220
|
-
/* @__PURE__ */ o.jsx("button", { onClick: () =>
|
|
221
|
-
/* @__PURE__ */ o.jsx("button", { onClick: () =>
|
|
220
|
+
/* @__PURE__ */ o.jsx("button", { onClick: () => ie("in"), className: "leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "+" }),
|
|
221
|
+
/* @__PURE__ */ o.jsx("button", { onClick: () => ie("out"), className: "leading-0 px-2 py-3.5 border text-primary-gray-700 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: "–" })
|
|
222
222
|
] })
|
|
223
223
|
] }),
|
|
224
|
-
s && K &&
|
|
225
|
-
y && G !== void 0 ? /* @__PURE__ */ o.jsx(
|
|
224
|
+
s && K && we && Ce ? /* @__PURE__ */ o.jsx(Yt, { data: s, body: K, xPos: we, yPos: Ce, backgroundStyle: We?.tooltip, className: _?.tooltip }) : null,
|
|
225
|
+
y && G !== void 0 ? /* @__PURE__ */ o.jsx(Zt, { body: y, data: G, setData: l, className: _?.modal }) : null
|
|
226
226
|
] });
|
|
227
227
|
}
|
|
228
228
|
function Ro(n) {
|
|
229
|
-
const
|
|
229
|
+
const e = Mt.c(121), {
|
|
230
230
|
data: d,
|
|
231
231
|
graphTitle: L,
|
|
232
|
-
mapData:
|
|
232
|
+
mapData: Pe,
|
|
233
233
|
colors: Y,
|
|
234
234
|
sources: q,
|
|
235
235
|
graphDescription: u,
|
|
236
236
|
height: p,
|
|
237
237
|
width: h,
|
|
238
|
-
footNote:
|
|
238
|
+
footNote: Be,
|
|
239
239
|
xDomain: k,
|
|
240
240
|
yDomain: W,
|
|
241
241
|
xColorLegendTitle: J,
|
|
242
|
-
yColorLegendTitle:
|
|
242
|
+
yColorLegendTitle: pe,
|
|
243
243
|
tooltip: K,
|
|
244
|
-
scale:
|
|
245
|
-
centerPoint:
|
|
246
|
-
padding:
|
|
244
|
+
scale: he,
|
|
245
|
+
centerPoint: ue,
|
|
246
|
+
padding: fe,
|
|
247
247
|
mapBorderWidth: w,
|
|
248
248
|
mapNoDataColor: Z,
|
|
249
249
|
backgroundColor: N,
|
|
250
|
-
mapBorderColor:
|
|
250
|
+
mapBorderColor: Le,
|
|
251
251
|
relativeHeight: y,
|
|
252
|
-
onSeriesMouseOver:
|
|
253
|
-
isWorldMap:
|
|
252
|
+
onSeriesMouseOver: ge,
|
|
253
|
+
isWorldMap: We,
|
|
254
254
|
zoomScaleExtend: _,
|
|
255
255
|
zoomTranslateExtend: F,
|
|
256
256
|
graphID: S,
|
|
257
257
|
showColorScale: O,
|
|
258
258
|
highlightedIds: M,
|
|
259
259
|
onSeriesMouseClick: Q,
|
|
260
|
-
mapProperty:
|
|
261
|
-
graphDownload:
|
|
260
|
+
mapProperty: ye,
|
|
261
|
+
graphDownload: xe,
|
|
262
262
|
dataDownload: T,
|
|
263
|
-
showAntarctica:
|
|
263
|
+
showAntarctica: ve,
|
|
264
264
|
language: x,
|
|
265
|
-
minHeight:
|
|
266
|
-
theme:
|
|
265
|
+
minHeight: _e,
|
|
266
|
+
theme: be,
|
|
267
267
|
ariaLabel: $,
|
|
268
|
-
resetSelectionOnDoubleClick:
|
|
268
|
+
resetSelectionOnDoubleClick: ke,
|
|
269
269
|
detailsOnClick: G,
|
|
270
270
|
styles: l,
|
|
271
271
|
classNames: s,
|
|
272
|
-
mapProjection:
|
|
273
|
-
zoomInteraction:
|
|
274
|
-
animate:
|
|
275
|
-
dimmedOpacity:
|
|
272
|
+
mapProjection: ee,
|
|
273
|
+
zoomInteraction: we,
|
|
274
|
+
animate: te,
|
|
275
|
+
dimmedOpacity: Ce,
|
|
276
276
|
customLayers: H,
|
|
277
277
|
timeline: D,
|
|
278
|
-
collapseColorScaleByDefault:
|
|
279
|
-
zoomAndCenterByHighlightedIds:
|
|
278
|
+
collapseColorScaleByDefault: oe,
|
|
279
|
+
zoomAndCenterByHighlightedIds: je,
|
|
280
280
|
projectionRotate: R,
|
|
281
281
|
rewindCoordinatesInMapData: V
|
|
282
|
-
} = n, g =
|
|
283
|
-
let
|
|
284
|
-
|
|
285
|
-
const
|
|
282
|
+
} = n, g = Pe === void 0 ? "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json" : Pe, I = Y === void 0 ? yt.light.bivariateColors.colors05x05 : Y, re = Be === 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." : Be, De = J === void 0 ? "X Color key" : J, Ne = pe === void 0 ? "Y Color key" : pe, z = he === void 0 ? 0.95 : he, Se = w === void 0 ? 0.5 : w, U = Z === void 0 ? yt.light.graphNoData : Z, Oe = N === void 0 ? !1 : N, Me = Le === void 0 ? yt.light.grays["gray-500"] : Le, ae = We === void 0 ? !0 : We;
|
|
283
|
+
let ne;
|
|
284
|
+
e[0] !== _ ? (ne = _ === void 0 ? [0.8, 6] : _, e[0] = _, e[1] = ne) : ne = e[1];
|
|
285
|
+
const ie = ne, t = O === void 0 ? !0 : O;
|
|
286
286
|
let r;
|
|
287
|
-
|
|
288
|
-
const f = r, b =
|
|
289
|
-
let
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
let $
|
|
293
|
-
|
|
287
|
+
e[2] !== M ? (r = M === void 0 ? [] : M, e[2] = M, e[3] = r) : r = e[3];
|
|
288
|
+
const f = r, b = ye === void 0 ? "ISO3" : ye, m = xe === void 0 ? !1 : xe, C = T === void 0 ? !1 : T, v = ve === void 0 ? !1 : ve, Ie = x === void 0 ? "en" : x, E = _e === void 0 ? 0 : _e, ot = be === void 0 ? "light" : be, rt = ke === void 0 ? !0 : ke, at = ee === void 0 ? "naturalEarth" : ee, nt = we === void 0 ? "button" : we, Fe = te === void 0 ? !1 : te, it = Ce === void 0 ? 0.3 : Ce;
|
|
289
|
+
let Te;
|
|
290
|
+
e[4] !== H ? (Te = H === void 0 ? [] : H, e[4] = H, e[5] = Te) : Te = e[5];
|
|
291
|
+
const st = Te;
|
|
292
|
+
let $e;
|
|
293
|
+
e[6] !== D ? ($e = D === void 0 ? {
|
|
294
294
|
enabled: !1,
|
|
295
295
|
autoplay: !1,
|
|
296
296
|
showOnlyActiveDate: !0
|
|
297
|
-
} : D,
|
|
298
|
-
const a = $
|
|
299
|
-
let
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
let
|
|
303
|
-
if (
|
|
297
|
+
} : D, e[6] = D, e[7] = $e) : $e = e[7];
|
|
298
|
+
const a = $e, lt = je === void 0 ? !1 : je;
|
|
299
|
+
let He;
|
|
300
|
+
e[8] !== R ? (He = R === void 0 ? [0, 0] : R, e[8] = R, e[9] = He) : He = e[9];
|
|
301
|
+
const ct = He, dt = V === void 0 ? !0 : V, [X, jt] = j(0), [ze, Dt] = j(0), [A, Nt] = j(a.autoplay);
|
|
302
|
+
let Ee;
|
|
303
|
+
if (e[10] !== d || e[11] !== a.dateFormat) {
|
|
304
304
|
let c;
|
|
305
|
-
|
|
305
|
+
e[13] !== a.dateFormat ? (c = (B) => Lt(`${B.date}`, a.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime(), e[13] = a.dateFormat, e[14] = c) : c = e[14], Ee = [...new Set(d.filter(yo).map(c))], Ee.sort(go), e[10] = d, e[11] = a.dateFormat, e[12] = Ee;
|
|
306
306
|
} else
|
|
307
|
-
|
|
308
|
-
const i =
|
|
309
|
-
let
|
|
310
|
-
|
|
307
|
+
Ee = e[12];
|
|
308
|
+
const i = Ee, [P, mt] = j(a.autoplay ? 0 : i.length - 1), [se, St] = j(void 0), pt = Ae(null), xt = Ae(null);
|
|
309
|
+
let Re, Ge;
|
|
310
|
+
e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Re = () => {
|
|
311
311
|
const c = new ResizeObserver((B) => {
|
|
312
|
-
|
|
312
|
+
jt(B[0].target.clientWidth || 620), Dt(B[0].target.clientHeight || 480);
|
|
313
313
|
});
|
|
314
|
-
return
|
|
315
|
-
},
|
|
316
|
-
let
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
const
|
|
321
|
-
let
|
|
322
|
-
|
|
314
|
+
return pt.current && c.observe(pt.current), () => c.disconnect();
|
|
315
|
+
}, Ge = [], e[15] = Re, e[16] = Ge) : (Re = e[15], Ge = e[16]), tt(Re, Ge);
|
|
316
|
+
let Ve;
|
|
317
|
+
e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ve = (c) => {
|
|
318
|
+
St(c);
|
|
319
|
+
}, e[17] = Ve) : Ve = e[17];
|
|
320
|
+
const Ue = zt(Ve);
|
|
321
|
+
let Xe;
|
|
322
|
+
e[18] !== g || e[19] !== Ue ? (Xe = () => {
|
|
323
323
|
typeof g == "string" ? ro(g).then((B) => {
|
|
324
|
-
|
|
325
|
-
}) :
|
|
326
|
-
},
|
|
327
|
-
let
|
|
328
|
-
|
|
329
|
-
let
|
|
330
|
-
|
|
324
|
+
Ue(B);
|
|
325
|
+
}) : Ue(g);
|
|
326
|
+
}, e[18] = g, e[19] = Ue, e[20] = Xe) : Xe = e[20];
|
|
327
|
+
let Ye;
|
|
328
|
+
e[21] !== g ? (Ye = [g], e[21] = g, e[22] = Ye) : Ye = e[22], tt(Xe, Ye);
|
|
329
|
+
let qe, Je;
|
|
330
|
+
e[23] !== A || e[24] !== a.speed || e[25] !== i ? (qe = () => {
|
|
331
331
|
const c = setInterval(() => {
|
|
332
|
-
|
|
332
|
+
mt((B) => B < i.length - 1 ? B + 1 : 0);
|
|
333
333
|
}, (a.speed || 2) * 1e3);
|
|
334
334
|
return A || clearInterval(c), () => clearInterval(c);
|
|
335
|
-
},
|
|
336
|
-
const
|
|
337
|
-
let
|
|
338
|
-
|
|
339
|
-
const
|
|
335
|
+
}, Je = [i, A, a.speed], e[23] = A, e[24] = a.speed, e[25] = i, e[26] = qe, e[27] = Je) : (qe = e[26], Je = e[27]), tt(qe, Je);
|
|
336
|
+
const ht = a.dateFormat || "yyyy";
|
|
337
|
+
let Ke;
|
|
338
|
+
e[28] !== P || e[29] !== ht || e[30] !== a.showOnlyActiveDate || e[31] !== i ? (Ke = Et(i, P, a.showOnlyActiveDate, ht), e[28] = P, e[29] = ht, e[30] = a.showOnlyActiveDate, e[31] = i, e[32] = Ke) : Ke = e[32];
|
|
339
|
+
const Ze = Ke;
|
|
340
340
|
if (k && W && (k.length !== I[0].length - 1 || W.length !== I.length - 1))
|
|
341
341
|
return console.error("the xDomain and yDomain array length don't match to the color array length"), null;
|
|
342
|
-
const
|
|
343
|
-
let
|
|
344
|
-
|
|
342
|
+
const ut = s?.graphContainer, ft = l?.graphContainer;
|
|
343
|
+
let le;
|
|
344
|
+
e[33] !== s?.description || e[34] !== s?.title || e[35] !== d || e[36] !== C || e[37] !== u || e[38] !== m || e[39] !== L || e[40] !== l?.description || e[41] !== l?.title || e[42] !== h ? (le = L || u || m || C ? /* @__PURE__ */ o.jsx(to, { styles: {
|
|
345
345
|
title: l?.title,
|
|
346
346
|
description: l?.description
|
|
347
347
|
}, classNames: {
|
|
348
348
|
title: s?.title,
|
|
349
349
|
description: s?.description
|
|
350
|
-
}, graphTitle: L, graphDescription: u, width: h, graphDownload: m ?
|
|
351
|
-
let
|
|
352
|
-
|
|
350
|
+
}, graphTitle: L, graphDescription: u, width: h, graphDownload: m ? xt : void 0, dataDownload: C ? d.map(fo).filter(uo).length > 0 ? d.map(ho).filter(po) : d.filter(mo) : null }) : null, e[33] = s?.description, e[34] = s?.title, e[35] = d, e[36] = C, e[37] = u, e[38] = m, e[39] = L, e[40] = l?.description, e[41] = l?.title, e[42] = h, e[43] = le) : le = e[43];
|
|
351
|
+
let ce;
|
|
352
|
+
e[44] !== P || e[45] !== Ze || e[46] !== A || e[47] !== a.enabled || e[48] !== i ? (ce = a.enabled && i.length > 0 && Ze ? /* @__PURE__ */ o.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
353
353
|
/* @__PURE__ */ o.jsx("button", { type: "button", onClick: () => {
|
|
354
|
-
|
|
355
|
-
}, className: "p-0 border-0 cursor-pointer bg-transparent", "aria-label": A ? "Click to pause animation" : "Click to play animation", children: A ? /* @__PURE__ */ o.jsx(
|
|
356
|
-
/* @__PURE__ */ o.jsx(
|
|
357
|
-
|
|
354
|
+
Nt(!A);
|
|
355
|
+
}, className: "p-0 border-0 cursor-pointer bg-transparent", "aria-label": A ? "Click to pause animation" : "Click to play animation", children: A ? /* @__PURE__ */ o.jsx(Jt, {}) : /* @__PURE__ */ o.jsx(Kt, {}) }),
|
|
356
|
+
/* @__PURE__ */ o.jsx(At, { min: i[0], max: i[i.length - 1], marks: Ze, step: null, defaultValue: i[i.length - 1], value: i[P], onChangeComplete: (c) => {
|
|
357
|
+
mt(i.indexOf(c));
|
|
358
358
|
}, onChange: (c) => {
|
|
359
|
-
|
|
359
|
+
mt(i.indexOf(c));
|
|
360
360
|
}, "aria-label": "Time slider. Use arrow keys to adjust selected time period." })
|
|
361
|
-
] }) : null,
|
|
362
|
-
let
|
|
363
|
-
|
|
364
|
-
...
|
|
365
|
-
features:
|
|
366
|
-
}, xDomain: k ||
|
|
361
|
+
] }) : null, e[44] = P, e[45] = Ze, e[46] = A, e[47] = a.enabled, e[48] = i, e[49] = ce) : ce = e[49];
|
|
362
|
+
let de;
|
|
363
|
+
e[50] !== Fe || e[51] !== ue || e[52] !== s || e[53] !== oe || e[54] !== I || e[55] !== st || e[56] !== d || e[57] !== G || e[58] !== it || e[59] !== p || e[60] !== f || e[61] !== P || e[62] !== ae || e[63] !== Me || e[64] !== Se || e[65] !== U || e[66] !== at || e[67] !== b || e[68] !== se || e[69] !== E || e[70] !== Q || e[71] !== ge || e[72] !== ct || e[73] !== y || e[74] !== rt || e[75] !== dt || e[76] !== z || e[77] !== v || e[78] !== t || e[79] !== l || e[80] !== ze || e[81] !== X || e[82] !== a.dateFormat || e[83] !== a.enabled || e[84] !== K || e[85] !== i || e[86] !== h || e[87] !== De || e[88] !== k || e[89] !== Ne || e[90] !== W || e[91] !== lt || e[92] !== nt || e[93] !== ie || e[94] !== F ? (de = /* @__PURE__ */ o.jsx(ao, { ref: pt, children: X && ze && se ? /* @__PURE__ */ o.jsx(io, { data: d.filter((c) => a.enabled ? c.date === Bt(new Date(i[P]), a.dateFormat || "yyyy") : c), mapData: v ? se : {
|
|
364
|
+
...se,
|
|
365
|
+
features: se.features.filter(co)
|
|
366
|
+
}, xDomain: k || Ct(d.map(lo), I[0].length), yDomain: W || Ct(d.map(so), I.length), width: X, height: ze, scale: z, centerPoint: ue, colors: I, xColorLegendTitle: De, yColorLegendTitle: Ne, mapBorderWidth: Se, mapNoDataColor: U, mapBorderColor: Me, tooltip: K, onSeriesMouseOver: ge, isWorldMap: ae, zoomScaleExtend: ie, zoomTranslateExtend: F, onSeriesMouseClick: Q, mapProperty: b, highlightedIds: f, resetSelectionOnDoubleClick: rt, styles: l, showColorScale: t, classNames: s, mapProjection: at || (ae ? "naturalEarth" : "mercator"), detailsOnClick: G, zoomInteraction: nt, animate: Fe === !0 ? {
|
|
367
367
|
duration: 0.5,
|
|
368
368
|
once: !0,
|
|
369
369
|
amount: 0.5
|
|
370
|
-
} :
|
|
370
|
+
} : Fe || {
|
|
371
371
|
duration: 0,
|
|
372
372
|
once: !0,
|
|
373
373
|
amount: 0
|
|
374
|
-
}, dimmedOpacity:
|
|
375
|
-
height: `${Math.max(E, p || (y ? E ? (h || X) * y > E ? (h || X) * y : E : (h || X) * y :
|
|
376
|
-
}, className: "flex items-center justify-center", children: /* @__PURE__ */ o.jsx(
|
|
377
|
-
let
|
|
378
|
-
|
|
374
|
+
}, dimmedOpacity: it, customLayers: st, collapseColorScaleByDefault: oe, zoomAndCenterByHighlightedIds: lt, projectionRotate: ct, rewindCoordinatesInMapData: dt }) : /* @__PURE__ */ o.jsx("div", { style: {
|
|
375
|
+
height: `${Math.max(E, p || (y ? E ? (h || X) * y > E ? (h || X) * y : E : (h || X) * y : ze))}px`
|
|
376
|
+
}, className: "flex items-center justify-center", children: /* @__PURE__ */ o.jsx(Pt, { "aria-label": "Loading graph" }) }) }), e[50] = Fe, e[51] = ue, e[52] = s, e[53] = oe, e[54] = I, e[55] = st, e[56] = d, e[57] = G, e[58] = it, e[59] = p, e[60] = f, e[61] = P, e[62] = ae, e[63] = Me, e[64] = Se, e[65] = U, e[66] = at, e[67] = b, e[68] = se, e[69] = E, e[70] = Q, e[71] = ge, e[72] = ct, e[73] = y, e[74] = rt, e[75] = dt, e[76] = z, e[77] = v, e[78] = t, e[79] = l, e[80] = ze, e[81] = X, e[82] = a.dateFormat, e[83] = a.enabled, e[84] = K, e[85] = i, e[86] = h, e[87] = De, e[88] = k, e[89] = Ne, e[90] = W, e[91] = lt, e[92] = nt, e[93] = ie, e[94] = F, e[95] = de) : de = e[95];
|
|
377
|
+
let me;
|
|
378
|
+
e[96] !== s?.footnote || e[97] !== s?.source || e[98] !== re || e[99] !== q || e[100] !== l?.footnote || e[101] !== l?.source || e[102] !== h ? (me = q || re ? /* @__PURE__ */ o.jsx(oo, { styles: {
|
|
379
379
|
footnote: l?.footnote,
|
|
380
380
|
source: l?.source
|
|
381
381
|
}, classNames: {
|
|
382
382
|
footnote: s?.footnote,
|
|
383
383
|
source: s?.source
|
|
384
|
-
}, sources: q, footNote:
|
|
385
|
-
let
|
|
386
|
-
return
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
] }),
|
|
384
|
+
}, sources: q, footNote: re, width: h }) : null, e[96] = s?.footnote, e[97] = s?.source, e[98] = re, e[99] = q, e[100] = l?.footnote, e[101] = l?.source, e[102] = h, e[103] = me) : me = e[103];
|
|
385
|
+
let Qe;
|
|
386
|
+
return e[104] !== $ || e[105] !== Oe || e[106] !== S || e[107] !== p || e[108] !== Ie || e[109] !== E || e[110] !== fe || e[111] !== y || e[112] !== ut || e[113] !== ft || e[114] !== le || e[115] !== ce || e[116] !== de || e[117] !== me || e[118] !== ot || e[119] !== h ? (Qe = /* @__PURE__ */ o.jsxs(no, { className: ut, style: ft, id: S, ref: xt, "aria-label": $, backgroundColor: Oe, theme: ot, language: Ie, minHeight: E, width: h, height: p, relativeHeight: y, padding: fe, children: [
|
|
387
|
+
le,
|
|
388
|
+
ce,
|
|
389
|
+
de,
|
|
390
|
+
me
|
|
391
|
+
] }), e[104] = $, e[105] = Oe, e[106] = S, e[107] = p, e[108] = Ie, e[109] = E, e[110] = fe, e[111] = y, e[112] = ut, e[113] = ft, e[114] = le, e[115] = ce, e[116] = de, e[117] = me, e[118] = ot, e[119] = h, e[120] = Qe) : Qe = e[120], Qe;
|
|
392
392
|
}
|
|
393
393
|
function so(n) {
|
|
394
394
|
return n.y;
|
|
@@ -414,8 +414,8 @@ function uo(n) {
|
|
|
414
414
|
function fo(n) {
|
|
415
415
|
return n.data;
|
|
416
416
|
}
|
|
417
|
-
function go(n,
|
|
418
|
-
return n -
|
|
417
|
+
function go(n, e) {
|
|
418
|
+
return n - e;
|
|
419
419
|
}
|
|
420
420
|
function yo(n) {
|
|
421
421
|
return n.date;
|