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