@undp/data-viz 2.0.1 → 2.0.3
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.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +107 -106
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +2 -2
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +2 -2
- package/dist/{GraphEl-D5MUfp45.cjs → GraphEl-D5RBCD7p.cjs} +2 -2
- package/dist/{GraphEl-D5MUfp45.cjs.map → GraphEl-D5RBCD7p.cjs.map} +1 -1
- package/dist/{GraphEl-BZne2JIx.js → GraphEl-VtiYqELy.js} +2 -2
- package/dist/{GraphEl-BZne2JIx.js.map → GraphEl-VtiYqELy.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +2 -2
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/XAxesLabels-Bt5NZBmX.cjs +2 -0
- package/dist/XAxesLabels-Bt5NZBmX.cjs.map +1 -0
- package/dist/XAxesLabels-Dy8E1SEo.js +63 -0
- package/dist/XAxesLabels-Dy8E1SEo.js.map +1 -0
- package/dist/YAxesLabels-DesLesUP.cjs +2 -0
- package/dist/YAxesLabels-DesLesUP.cjs.map +1 -0
- package/dist/YAxesLabels-a57ZRv-0.js +61 -0
- package/dist/YAxesLabels-a57ZRv-0.js.map +1 -0
- package/dist/imageDownload-BU4qnxJP.js +991 -0
- package/dist/imageDownload-BU4qnxJP.js.map +1 -0
- package/dist/imageDownload-NYXbvKob.cjs +15 -0
- package/dist/imageDownload-NYXbvKob.cjs.map +1 -0
- package/dist/{index-Ceppbd8C.js → index-B2LQV7Tk.js} +109 -116
- package/dist/index-B2LQV7Tk.js.map +1 -0
- package/dist/index-xRHRLDIp.cjs +2 -0
- package/dist/index-xRHRLDIp.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/readme.md +1 -1
- package/dist/XAxesLabels-D5X8jngD.cjs +0 -2
- package/dist/XAxesLabels-D5X8jngD.cjs.map +0 -1
- package/dist/XAxesLabels-DNO0KmjL.js +0 -73
- package/dist/XAxesLabels-DNO0KmjL.js.map +0 -1
- package/dist/YAxesLabels-DcS85Beo.cjs +0 -2
- package/dist/YAxesLabels-DcS85Beo.cjs.map +0 -1
- package/dist/YAxesLabels-Dnnng49-.js +0 -70
- package/dist/YAxesLabels-Dnnng49-.js.map +0 -1
- package/dist/imageDownload-BX6SILNZ.js +0 -497
- package/dist/imageDownload-BX6SILNZ.js.map +0 -1
- package/dist/imageDownload-CgDcm1Sj.cjs +0 -3
- package/dist/imageDownload-CgDcm1Sj.cjs.map +0 -1
- package/dist/index-C6LorfZ-.cjs +0 -2
- package/dist/index-C6LorfZ-.cjs.map +0 -1
- package/dist/index-Ceppbd8C.js.map +0 -1
package/dist/BeeSwarmChart.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { c as Ft, j as i, m as Yt } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
2
|
import { useRef as Dt, useState as E, useEffect as Ht } from "react";
|
|
3
3
|
import { i as Gt } from "./index-Bwrro8-q.js";
|
|
4
|
-
import { o as
|
|
5
|
-
import { l as
|
|
4
|
+
import { o as Bt } from "./index-BZQYSqar.js";
|
|
5
|
+
import { l as zt } from "./Modal-DGcuAHyK.js";
|
|
6
6
|
import { w as It } from "./Spinner-D7rnnwnA.js";
|
|
7
|
+
import { j as le } from "./Typography-PxtFcnJb.js";
|
|
7
8
|
import { n as Wt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
9
|
import { T as qt } from "./Tooltip-CwWUegPB.js";
|
|
9
10
|
import { c as x } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
@@ -11,26 +12,26 @@ import { g as Zt } from "./getTextColorBasedOnBgColor-CDY808zi.js";
|
|
|
11
12
|
import { Colors as xt } from "./Colors.js";
|
|
12
13
|
import { s as Ut } from "./string2HTML-DhG75NqA.js";
|
|
13
14
|
import { A as Jt } from "./Axis-CRyfcLjc.js";
|
|
14
|
-
import { R as
|
|
15
|
-
import { Y as
|
|
16
|
-
import { X as
|
|
15
|
+
import { R as ae, a as ce } from "./ReferenceLine-2XCwHXQ4.js";
|
|
16
|
+
import { Y as ue } from "./YTicksAndGridLines-Blepl7XF.js";
|
|
17
|
+
import { X as me } from "./XTicksAndGridLines-CObVFSm4.js";
|
|
17
18
|
import { s as Kt } from "./pow-DE4c7dbW.js";
|
|
18
19
|
import { a as Qt } from "./linear-BwnDd9KF.js";
|
|
19
20
|
import { f as _t, a as te, b as ee, c as oe, d as ie } from "./y-BqfogMAB.js";
|
|
20
21
|
import { u as Xt } from "./uniqBy-BHy4I8PK.js";
|
|
21
|
-
import { GraphHeader as
|
|
22
|
-
import { a as
|
|
23
|
-
import { E as
|
|
24
|
-
import { ColorLegendWithMouseOver as
|
|
25
|
-
import { GraphFooter as
|
|
26
|
-
function
|
|
22
|
+
import { GraphHeader as fe } from "./GraphHeader.js";
|
|
23
|
+
import { a as pe, G as de } from "./GraphContainer-CRqzdKu2.js";
|
|
24
|
+
import { E as he } from "./EmptyState-BZo1BbAn.js";
|
|
25
|
+
import { ColorLegendWithMouseOver as ge } from "./ColorLegendWithMouseOver.js";
|
|
26
|
+
import { GraphFooter as xe } from "./GraphFooter.js";
|
|
27
|
+
function ve(e) {
|
|
27
28
|
const t = Ft.c(27), {
|
|
28
29
|
data: n,
|
|
29
30
|
circleColors: v,
|
|
30
31
|
showTicks: ht,
|
|
31
32
|
width: S,
|
|
32
33
|
height: A,
|
|
33
|
-
colorDomain:
|
|
34
|
+
colorDomain: z,
|
|
34
35
|
topMargin: P,
|
|
35
36
|
bottomMargin: _,
|
|
36
37
|
leftMargin: tt,
|
|
@@ -65,15 +66,15 @@ function xe(e) {
|
|
|
65
66
|
left: ot,
|
|
66
67
|
right: it
|
|
67
68
|
}, t[0] = X, t[1] = ot, t[2] = it, t[3] = ct, t[4] = F) : F = t[4];
|
|
68
|
-
const m = F, f = S - m.left - m.right, nt = A - m.top - m.bottom, H = n.filter(
|
|
69
|
+
const m = F, f = S - m.left - m.right, nt = A - m.top - m.bottom, H = n.filter(Ye).length === 0 ? n : Bt(n.filter(Xe), "radius", "desc");
|
|
69
70
|
let Q;
|
|
70
|
-
t[5] !== n || t[6] !== q || t[7] !== V ? (Q = x(q) ? Math.max(...n.filter(
|
|
71
|
+
t[5] !== n || t[6] !== q || t[7] !== V ? (Q = x(q) ? Math.max(...n.filter(Re).map(Pe)) < 0 && !V ? 0 : Math.max(...n.filter(Ee).map(He)) : q, t[5] = n, t[6] = q, t[7] = V, t[8] = Q) : Q = t[8];
|
|
71
72
|
const G = Q;
|
|
72
|
-
let
|
|
73
|
-
t[9] !== n || t[10] !== Z || t[11] !== V ? (
|
|
74
|
-
const d =
|
|
73
|
+
let B;
|
|
74
|
+
t[9] !== n || t[10] !== Z || t[11] !== V ? (B = x(Z) ? Math.min(...n.filter(Fe).map(Ve)) >= 0 && !V ? 0 : Math.min(...n.filter(Te).map(Ae)) : Z, t[9] = n, t[10] = Z, t[11] = V, t[12] = B) : B = t[12];
|
|
75
|
+
const d = B, s = n.filter(Se).length !== n.length ? Kt().domain([0, x(W) ? Math.max(...n.map(Le).filter(Ne)) : W]).range([0.25, p]).nice() : void 0, l = Qt().domain([d, G]).range([nt, 0]).nice(), y = l.ticks(w);
|
|
75
76
|
Ht(() => {
|
|
76
|
-
const r = H.map(
|
|
77
|
+
const r = H.map($e).filter(De);
|
|
77
78
|
_t(r).force("y", ee((o) => l(o.position)).strength(5)).force("x", te((o) => f / 2).strength(1)).force("collide", oe((o) => s ? s(o.radius || 0) + 1 : p + 1)).force("charge", ie().strength(-15)).alphaDecay(0.05).tick(1e4).on("tick", () => {
|
|
78
79
|
u(r);
|
|
79
80
|
}).on("end", () => {
|
|
@@ -94,7 +95,7 @@ function xe(e) {
|
|
|
94
95
|
axis: j?.xAxis?.axis,
|
|
95
96
|
label: j?.yAxis?.labels
|
|
96
97
|
} }),
|
|
97
|
-
/* @__PURE__ */ i.jsx(
|
|
98
|
+
/* @__PURE__ */ i.jsx(ue, { values: y.filter(we), y: y.filter(ke).map((r) => l(r)), x1: 0 - m.left, x2: f + m.right, styles: {
|
|
98
99
|
gridLines: j?.yAxis?.gridLines,
|
|
99
100
|
labels: j?.yAxis?.labels
|
|
100
101
|
}, classNames: {
|
|
@@ -102,8 +103,8 @@ function xe(e) {
|
|
|
102
103
|
labels: c?.yAxis?.labels
|
|
103
104
|
}, suffix: h, prefix: R, labelType: "secondary", showGridLines: !0, labelPos: "vertical", precision: at })
|
|
104
105
|
] }) : null,
|
|
105
|
-
pt.filter(
|
|
106
|
-
mt.map((r) => /* @__PURE__ */ i.jsxs("g", { className: "undp-viz-g-with-hover", transform: `translate(${r.x},${r.y})`, opacity: g ? r.color && v[
|
|
106
|
+
pt.filter(Ce).map(Oe),
|
|
107
|
+
mt.map((r) => /* @__PURE__ */ i.jsxs("g", { className: "undp-viz-g-with-hover", transform: `translate(${r.x},${r.y})`, opacity: g ? r.color && v[z.indexOf(r.color)] === g ? 1 : lt : gt.length !== 0 ? gt.indexOf(r.label) !== -1 ? 0.85 : lt : 0.85, onMouseEnter: (o) => {
|
|
107
108
|
Y(r), K(o.clientY), U(o.clientX), st?.(r);
|
|
108
109
|
}, onMouseMove: (o) => {
|
|
109
110
|
Y(r), K(o.clientY), U(o.clientX);
|
|
@@ -112,16 +113,16 @@ function xe(e) {
|
|
|
112
113
|
}, onMouseLeave: () => {
|
|
113
114
|
Y(void 0), U(void 0), K(void 0), st?.(void 0);
|
|
114
115
|
}, children: [
|
|
115
|
-
/* @__PURE__ */ i.jsx("circle", { cx: 0, cy: 0, r: s ? s(r.radius || 0) : p, fill: n.filter(
|
|
116
|
+
/* @__PURE__ */ i.jsx("circle", { cx: 0, cy: 0, r: s ? s(r.radius || 0) : p, fill: n.filter(je).length === 0 ? v[0] : r.color ? v[z.indexOf(r.color)] : xt.gray }),
|
|
116
117
|
(s ? s(r.radius || 0) : p) > 10 && et ? /* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx("foreignObject", { y: 0 - (s ? s(r.radius || 0) : p), x: 0 - (s ? s(r.radius || 0) : p), width: 2 * (s ? s(r.radius || 0) : p), height: 2 * (s ? s(r.radius || 0) : p), children: /* @__PURE__ */ i.jsx("div", { className: "flex flex-col justify-center items-center h-inherit py-0 px-1.5", children: et ? /* @__PURE__ */ i.jsx("p", { className: Yt("text-center leading-none m-0", c?.graphObjectValues), style: {
|
|
117
118
|
fontSize: `${Math.min(Math.max(Math.round((s ? s(r.radius || 0) : p) / 4), 10), Math.max(Math.round((s ? s(r.radius || 0) : p) * 12 / `${r.label}`.length), 10), 20)}px`,
|
|
118
119
|
hyphens: "auto",
|
|
119
|
-
color: Zt(n.filter(
|
|
120
|
+
color: Zt(n.filter(Me).length === 0 ? v[0] : r.color ? v[z.indexOf(r.color)] : xt.gray),
|
|
120
121
|
...j?.graphObjectValues || {}
|
|
121
122
|
}, children: r.label }) : null }) }) }) : null
|
|
122
123
|
] }, r.label)),
|
|
123
|
-
T ? /* @__PURE__ */ i.jsx(i.Fragment, { children: T.map((r, o) => /* @__PURE__ */ i.jsx(
|
|
124
|
-
pt.filter(
|
|
124
|
+
T ? /* @__PURE__ */ i.jsx(i.Fragment, { children: T.map((r, o) => /* @__PURE__ */ i.jsx(ce, { text: r.text, color: r.color, y: l(r.value), x1: 0 - m.left, x2: f + m.right, classNames: r.classNames, styles: r.styles, isInView: !0 }, o)) }) : null,
|
|
125
|
+
pt.filter(be).map(ye)
|
|
125
126
|
] }) }) : /* @__PURE__ */ i.jsx("div", { style: {
|
|
126
127
|
width: `${S}px`,
|
|
127
128
|
height: `${A}px`
|
|
@@ -129,7 +130,7 @@ function xe(e) {
|
|
|
129
130
|
let L;
|
|
130
131
|
t[13] !== c?.tooltip || t[14] !== a || t[15] !== J || t[16] !== ut || t[17] !== j?.tooltip || t[18] !== I ? (L = ut && I && a && J ? /* @__PURE__ */ i.jsx(qt, { data: ut, body: I, xPos: a, yPos: J, backgroundStyle: j?.tooltip, className: c?.tooltip }) : null, t[13] = c?.tooltip, t[14] = a, t[15] = J, t[16] = ut, t[17] = j?.tooltip, t[18] = I, t[19] = L) : L = t[19];
|
|
131
132
|
let O;
|
|
132
|
-
t[20] !== M || t[21] !== D ? (O = M && D !== void 0 ? /* @__PURE__ */ i.jsx(
|
|
133
|
+
t[20] !== M || t[21] !== D ? (O = M && D !== void 0 ? /* @__PURE__ */ i.jsx(zt, { open: D !== void 0, onClose: () => {
|
|
133
134
|
$(void 0);
|
|
134
135
|
}, children: /* @__PURE__ */ i.jsx("div", { className: "graph-modal-content m-0", dangerouslySetInnerHTML: typeof M == "string" ? {
|
|
135
136
|
__html: Ut(M, D)
|
|
@@ -141,34 +142,34 @@ function xe(e) {
|
|
|
141
142
|
O
|
|
142
143
|
] }), t[23] = N, t[24] = L, t[25] = O, t[26] = C) : C = t[26], C;
|
|
143
144
|
}
|
|
144
|
-
function ve(e) {
|
|
145
|
-
return e.layer;
|
|
146
|
-
}
|
|
147
145
|
function ye(e) {
|
|
148
|
-
return e.
|
|
146
|
+
return e.layer;
|
|
149
147
|
}
|
|
150
148
|
function be(e) {
|
|
151
|
-
return e.
|
|
149
|
+
return e.position === "after";
|
|
152
150
|
}
|
|
153
151
|
function Me(e) {
|
|
154
152
|
return e.color;
|
|
155
153
|
}
|
|
156
154
|
function je(e) {
|
|
157
|
-
return e.
|
|
155
|
+
return e.color;
|
|
158
156
|
}
|
|
159
157
|
function Oe(e) {
|
|
160
|
-
return e.
|
|
158
|
+
return e.layer;
|
|
161
159
|
}
|
|
162
160
|
function Ce(e) {
|
|
163
|
-
return e
|
|
161
|
+
return e.position === "before";
|
|
164
162
|
}
|
|
165
163
|
function ke(e) {
|
|
166
164
|
return e !== 0;
|
|
167
165
|
}
|
|
168
166
|
function we(e) {
|
|
169
|
-
return e
|
|
167
|
+
return e !== 0;
|
|
170
168
|
}
|
|
171
169
|
function De(e) {
|
|
170
|
+
return e.position;
|
|
171
|
+
}
|
|
172
|
+
function $e(e) {
|
|
172
173
|
return {
|
|
173
174
|
...e,
|
|
174
175
|
...e.data && {
|
|
@@ -178,53 +179,53 @@ function De(e) {
|
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
181
|
}
|
|
181
|
-
function $e(e) {
|
|
182
|
-
return e != null;
|
|
183
|
-
}
|
|
184
182
|
function Ne(e) {
|
|
185
|
-
return e
|
|
183
|
+
return e != null;
|
|
186
184
|
}
|
|
187
185
|
function Le(e) {
|
|
188
|
-
return e.radius
|
|
186
|
+
return e.radius;
|
|
189
187
|
}
|
|
190
188
|
function Se(e) {
|
|
191
|
-
return e.
|
|
189
|
+
return e.radius === void 0 || e.radius === null;
|
|
192
190
|
}
|
|
193
191
|
function Ae(e) {
|
|
194
|
-
return
|
|
192
|
+
return e.position;
|
|
195
193
|
}
|
|
196
194
|
function Te(e) {
|
|
197
|
-
return e.position;
|
|
195
|
+
return !x(e.position);
|
|
198
196
|
}
|
|
199
197
|
function Ve(e) {
|
|
200
|
-
return
|
|
198
|
+
return e.position;
|
|
201
199
|
}
|
|
202
200
|
function Fe(e) {
|
|
203
|
-
return e.position;
|
|
201
|
+
return !x(e.position);
|
|
204
202
|
}
|
|
205
203
|
function He(e) {
|
|
206
|
-
return
|
|
204
|
+
return e.position;
|
|
207
205
|
}
|
|
208
206
|
function Ee(e) {
|
|
209
|
-
return e.position;
|
|
207
|
+
return !x(e.position);
|
|
210
208
|
}
|
|
211
209
|
function Pe(e) {
|
|
212
|
-
return
|
|
210
|
+
return e.position;
|
|
213
211
|
}
|
|
214
212
|
function Re(e) {
|
|
215
|
-
return !x(e.
|
|
213
|
+
return !x(e.position);
|
|
216
214
|
}
|
|
217
215
|
function Xe(e) {
|
|
218
216
|
return !x(e.radius);
|
|
219
217
|
}
|
|
220
218
|
function Ye(e) {
|
|
219
|
+
return !x(e.radius);
|
|
220
|
+
}
|
|
221
|
+
function Ge(e) {
|
|
221
222
|
const t = Ft.c(27), {
|
|
222
223
|
data: n,
|
|
223
224
|
circleColors: v,
|
|
224
225
|
showTicks: ht,
|
|
225
226
|
width: S,
|
|
226
227
|
height: A,
|
|
227
|
-
colorDomain:
|
|
228
|
+
colorDomain: z,
|
|
228
229
|
topMargin: P,
|
|
229
230
|
bottomMargin: _,
|
|
230
231
|
leftMargin: tt,
|
|
@@ -260,21 +261,21 @@ function Ye(e) {
|
|
|
260
261
|
left: it,
|
|
261
262
|
right: dt
|
|
262
263
|
}, t[0] = ot, t[1] = it, t[2] = dt, t[3] = X, t[4] = m) : m = t[4];
|
|
263
|
-
const f = m, nt = S - f.left - f.right, H = A - f.top - f.bottom, Q = n.filter(
|
|
264
|
+
const f = m, nt = S - f.left - f.right, H = A - f.top - f.bottom, Q = n.filter(mo).length === 0 ? n : Bt(n.filter(uo), "radius", "desc");
|
|
264
265
|
let G;
|
|
265
|
-
t[5] !== n || t[6] !== p || t[7] !== T ? (G = x(p) ? Math.max(...n.filter(
|
|
266
|
-
const
|
|
266
|
+
t[5] !== n || t[6] !== p || t[7] !== T ? (G = x(p) ? Math.max(...n.filter(co).map(ao)) < 0 && !T ? 0 : Math.max(...n.filter(lo).map(so)) : p, t[5] = n, t[6] = p, t[7] = T, t[8] = G) : G = t[8];
|
|
267
|
+
const B = G;
|
|
267
268
|
let d;
|
|
268
|
-
t[9] !== n || t[10] !== W || t[11] !== T ? (d = x(W) ? Math.min(...n.filter(
|
|
269
|
-
const s = d, l = n.filter(
|
|
269
|
+
t[9] !== n || t[10] !== W || t[11] !== T ? (d = x(W) ? Math.min(...n.filter(ro).map(no)) >= 0 && !T ? 0 : Math.min(...n.filter(io).map(oo)) : W, t[9] = n, t[10] = W, t[11] = T, t[12] = d) : d = t[12];
|
|
270
|
+
const s = d, l = n.filter(eo).length !== n.length ? Kt().domain([0, x(V) ? Math.max(...n.map(to).filter(_e)) : V]).range([0.25, g]).nice() : void 0, y = Qt().domain([s, B]).range([0, nt]).nice(), N = y.ticks(lt);
|
|
270
271
|
Ht(() => {
|
|
271
|
-
const o = Q.map(
|
|
272
|
+
const o = Q.map(Qe).filter(Ke);
|
|
272
273
|
_t(o).force("x", te((b) => y(b.position)).strength(5)).force("y", ee((b) => H / 2).strength(1)).force("collide", oe((b) => l ? l(b.radius || 0) + 1 : g + 1)).force("charge", ie().strength(-15)).alphaDecay(0.05).tick(1e4).on("tick", () => {
|
|
273
274
|
a(o);
|
|
274
275
|
}).on("end", () => {
|
|
275
276
|
a(o);
|
|
276
277
|
});
|
|
277
|
-
}, [n, g, H, nt, s,
|
|
278
|
+
}, [n, g, H, nt, s, B, Q, y, l]);
|
|
278
279
|
const L = u ? /* @__PURE__ */ i.jsx("svg", { width: `${S}px`, height: `${A}px`, viewBox: `0 0 ${S} ${A}`, direction: "ltr", ref: ut, children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${f.left},${f.top})`, children: [
|
|
279
280
|
ht ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
280
281
|
/* @__PURE__ */ i.jsx(Jt, { x1: y(s < 0 ? 0 : s), x2: y(s < 0 ? 0 : s), y1: 0 - f.top, y2: H + f.bottom, label: Wt(s < 0 ? 0 : s, "NA", pt, j, M), labelPos: {
|
|
@@ -289,7 +290,7 @@ function Ye(e) {
|
|
|
289
290
|
axis: c?.xAxis?.axis,
|
|
290
291
|
label: c?.yAxis?.labels
|
|
291
292
|
} }),
|
|
292
|
-
/* @__PURE__ */ i.jsx(
|
|
293
|
+
/* @__PURE__ */ i.jsx(me, { values: N.filter(Je), x: N.filter(Ue).map((o) => y(o)), y1: 0 - X, y2: H + f.bottom, styles: {
|
|
293
294
|
gridLines: c?.xAxis?.gridLines,
|
|
294
295
|
labels: c?.xAxis?.labels
|
|
295
296
|
}, classNames: {
|
|
@@ -297,8 +298,8 @@ function Ye(e) {
|
|
|
297
298
|
labels: w?.xAxis?.labels
|
|
298
299
|
}, suffix: M, prefix: j, labelType: "secondary", showGridLines: !0, precision: pt })
|
|
299
300
|
] }) : null,
|
|
300
|
-
ct.filter(
|
|
301
|
-
u.map((o) => /* @__PURE__ */ i.jsxs("g", { className: "undp-viz-g-with-hover", transform: `translate(${o.x},${o.y})`, opacity: st ? o.color && v[
|
|
301
|
+
ct.filter(Ze).map(qe),
|
|
302
|
+
u.map((o) => /* @__PURE__ */ i.jsxs("g", { className: "undp-viz-g-with-hover", transform: `translate(${o.x},${o.y})`, opacity: st ? o.color && v[z.indexOf(o.color)] === st ? 1 : at : q.length !== 0 ? q.indexOf(o.label) !== -1 ? 0.85 : at : 0.85, onMouseEnter: (b) => {
|
|
302
303
|
D(o), F(b.clientY), J(b.clientX), et?.(o);
|
|
303
304
|
}, onMouseMove: (b) => {
|
|
304
305
|
D(o), F(b.clientY), J(b.clientX);
|
|
@@ -307,16 +308,16 @@ function Ye(e) {
|
|
|
307
308
|
}, onMouseLeave: () => {
|
|
308
309
|
D(void 0), J(void 0), F(void 0), et?.(void 0);
|
|
309
310
|
}, children: [
|
|
310
|
-
/* @__PURE__ */ i.jsx("circle", { cx: 0, cy: 0, fill: n.filter(
|
|
311
|
-
(l ? l(o.radius || 0) : g) > 10 && h ? /* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx("foreignObject", { y: 0 - (l ? l(o.radius || 0) : g), x: 0 - (l ? l(o.radius || 0) : g), width: 2 * (l ? l(o.radius || 0) : g), height: 2 * (l ? l(o.radius || 0) : g), children: /* @__PURE__ */ i.jsx("div", { className: "flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5", children: h ? /* @__PURE__ */ i.jsx(
|
|
311
|
+
/* @__PURE__ */ i.jsx("circle", { cx: 0, cy: 0, fill: n.filter(We).length === 0 ? v[0] : o.color ? v[z.indexOf(o.color)] : xt.gray, radius: l ? l(o.radius || 0) : g }),
|
|
312
|
+
(l ? l(o.radius || 0) : g) > 10 && h ? /* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx("foreignObject", { y: 0 - (l ? l(o.radius || 0) : g), x: 0 - (l ? l(o.radius || 0) : g), width: 2 * (l ? l(o.radius || 0) : g), height: 2 * (l ? l(o.radius || 0) : g), children: /* @__PURE__ */ i.jsx("div", { className: "flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5", children: h ? /* @__PURE__ */ i.jsx(le, { className: Yt("text-center leading-none m-0", w?.graphObjectValues), marginBottom: "none", style: {
|
|
312
313
|
fontSize: `${Math.min(Math.max(Math.round((l ? l(o.radius || 0) : g) / 4), 10), Math.max(Math.round((l ? l(o.radius || 0) : g) * 12 / `${o.label}`.length), 10), 20)}px`,
|
|
313
|
-
color: Zt(n.filter(
|
|
314
|
+
color: Zt(n.filter(Ie).length === 0 ? v[0] : o.color ? v[z.indexOf(o.color)] : xt.gray),
|
|
314
315
|
hyphens: "auto",
|
|
315
316
|
...c?.graphObjectValues || {}
|
|
316
317
|
}, children: o.label }) : null }) }) }) : null
|
|
317
318
|
] }, o.label)),
|
|
318
|
-
I ? /* @__PURE__ */ i.jsx(i.Fragment, { children: I.map((o, b) => /* @__PURE__ */ i.jsx(
|
|
319
|
-
ct.filter(ze).map(
|
|
319
|
+
I ? /* @__PURE__ */ i.jsx(i.Fragment, { children: I.map((o, b) => /* @__PURE__ */ i.jsx(ae, { text: o.text, color: o.color, x: y(o.value), y1: 0 - f.top, y2: H + f.bottom, textSide: y(o.value) > nt * 0.75 || gt ? "left" : "right", classNames: o.classNames, styles: o.styles, isInView: !0 }, b)) }) : null,
|
|
320
|
+
ct.filter(ze).map(Be)
|
|
320
321
|
] }) }) : /* @__PURE__ */ i.jsx("div", { style: {
|
|
321
322
|
width: `${S}px`,
|
|
322
323
|
height: `${A}px`
|
|
@@ -324,7 +325,7 @@ function Ye(e) {
|
|
|
324
325
|
let O;
|
|
325
326
|
t[13] !== w?.tooltip || t[14] !== U || t[15] !== K || t[16] !== Y || t[17] !== c?.tooltip || t[18] !== R ? (O = Y && R && U && K ? /* @__PURE__ */ i.jsx(qt, { data: Y, body: R, xPos: U, yPos: K, backgroundStyle: c?.tooltip, className: w?.tooltip }) : null, t[13] = w?.tooltip, t[14] = U, t[15] = K, t[16] = Y, t[17] = c?.tooltip, t[18] = R, t[19] = O) : O = t[19];
|
|
326
327
|
let C;
|
|
327
|
-
t[20] !== k || t[21] !== $ ? (C = k && $ !== void 0 ? /* @__PURE__ */ i.jsx(
|
|
328
|
+
t[20] !== k || t[21] !== $ ? (C = k && $ !== void 0 ? /* @__PURE__ */ i.jsx(zt, { open: $ !== void 0, onClose: () => {
|
|
328
329
|
mt(void 0);
|
|
329
330
|
}, children: /* @__PURE__ */ i.jsx("div", { className: "graph-modal-content m-0", dangerouslySetInnerHTML: typeof k == "string" ? {
|
|
330
331
|
__html: Ut(k, $)
|
|
@@ -336,34 +337,34 @@ function Ye(e) {
|
|
|
336
337
|
C
|
|
337
338
|
] }), t[23] = L, t[24] = O, t[25] = C, t[26] = r) : r = t[26], r;
|
|
338
339
|
}
|
|
339
|
-
function
|
|
340
|
+
function Be(e) {
|
|
340
341
|
return e.layer;
|
|
341
342
|
}
|
|
342
343
|
function ze(e) {
|
|
343
344
|
return e.position === "after";
|
|
344
345
|
}
|
|
345
|
-
function Be(e) {
|
|
346
|
-
return e.color;
|
|
347
|
-
}
|
|
348
346
|
function Ie(e) {
|
|
349
347
|
return e.color;
|
|
350
348
|
}
|
|
351
349
|
function We(e) {
|
|
352
|
-
return e.
|
|
350
|
+
return e.color;
|
|
353
351
|
}
|
|
354
352
|
function qe(e) {
|
|
355
|
-
return e.
|
|
353
|
+
return e.layer;
|
|
356
354
|
}
|
|
357
355
|
function Ze(e) {
|
|
358
|
-
return e
|
|
356
|
+
return e.position === "before";
|
|
359
357
|
}
|
|
360
358
|
function Ue(e) {
|
|
361
359
|
return e !== 0;
|
|
362
360
|
}
|
|
363
361
|
function Je(e) {
|
|
364
|
-
return e
|
|
362
|
+
return e !== 0;
|
|
365
363
|
}
|
|
366
364
|
function Ke(e) {
|
|
365
|
+
return e.position;
|
|
366
|
+
}
|
|
367
|
+
function Qe(e) {
|
|
367
368
|
return {
|
|
368
369
|
...e,
|
|
369
370
|
...e.data && {
|
|
@@ -373,53 +374,53 @@ function Ke(e) {
|
|
|
373
374
|
}
|
|
374
375
|
};
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
+
function _e(e) {
|
|
377
378
|
return e != null;
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
+
function to(e) {
|
|
380
381
|
return e.radius;
|
|
381
382
|
}
|
|
382
|
-
function
|
|
383
|
+
function eo(e) {
|
|
383
384
|
return e.radius === void 0 || e.radius === null;
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
+
function oo(e) {
|
|
386
387
|
return e.position;
|
|
387
388
|
}
|
|
388
|
-
function
|
|
389
|
+
function io(e) {
|
|
389
390
|
return !x(e.position);
|
|
390
391
|
}
|
|
391
|
-
function
|
|
392
|
+
function no(e) {
|
|
392
393
|
return e.position;
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
+
function ro(e) {
|
|
395
396
|
return !x(e.position);
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
+
function so(e) {
|
|
398
399
|
return e.position;
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function lo(e) {
|
|
401
402
|
return !x(e.position);
|
|
402
403
|
}
|
|
403
|
-
function
|
|
404
|
+
function ao(e) {
|
|
404
405
|
return e.position;
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
+
function co(e) {
|
|
407
408
|
return !x(e.position);
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function uo(e) {
|
|
410
411
|
return !x(e.radius);
|
|
411
412
|
}
|
|
412
|
-
function
|
|
413
|
+
function mo(e) {
|
|
413
414
|
return !x(e.radius);
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function qo(e) {
|
|
416
417
|
const t = Ft.c(79), {
|
|
417
418
|
data: n,
|
|
418
419
|
graphTitle: v,
|
|
419
420
|
topMargin: ht,
|
|
420
421
|
bottomMargin: S,
|
|
421
422
|
leftMargin: A,
|
|
422
|
-
rightMargin:
|
|
423
|
+
rightMargin: z,
|
|
423
424
|
colors: P,
|
|
424
425
|
sources: _,
|
|
425
426
|
graphDescription: tt,
|
|
@@ -465,10 +466,10 @@ function Io(e) {
|
|
|
465
466
|
} = e, m = Z === void 0 ? 5 : Z, f = gt === void 0 ? !0 : gt, nt = ft === void 0 ? !0 : ft;
|
|
466
467
|
let H;
|
|
467
468
|
t[0] !== c ? (H = c === void 0 ? [] : c, t[0] = c, t[1] = H) : H = t[1];
|
|
468
|
-
const Q = H, G = at === void 0 ? !1 : at,
|
|
469
|
+
const Q = H, G = at === void 0 ? !1 : at, B = pt === void 0 ? !1 : pt, d = ct === void 0 ? !1 : ct, s = X === void 0 ? "en" : X, l = ot === void 0 ? !0 : ot, y = it === void 0 ? 0 : it, N = dt === void 0 ? "light" : dt, L = ut === void 0 ? !0 : ut, O = D === void 0 ? "vertical" : D, C = $ === void 0 ? "" : $, r = mt === void 0 ? "" : mt, o = U === void 0 ? 5 : U, b = J === void 0 ? 0.3 : J, $t = K === void 0 ? 2 : K;
|
|
469
470
|
let Mt;
|
|
470
471
|
t[2] !== F ? (Mt = F === void 0 ? [] : F, t[2] = F, t[3] = Mt) : Mt = t[3];
|
|
471
|
-
const Nt = Mt, [jt, ne] = E(0), [Ot, re] = E(0), [Lt, se] = E(void 0), St = Dt(null), Et = Dt(null), At = O === "horizontal" ?
|
|
472
|
+
const Nt = Mt, [jt, ne] = E(0), [Ot, re] = E(0), [Lt, se] = E(void 0), St = Dt(null), Et = Dt(null), At = O === "horizontal" ? Ge : ve;
|
|
472
473
|
let Ct, kt;
|
|
473
474
|
t[4] === Symbol.for("react.memo_cache_sentinel") ? (Ct = () => {
|
|
474
475
|
const Pt = new ResizeObserver((Rt) => {
|
|
@@ -478,20 +479,20 @@ function Io(e) {
|
|
|
478
479
|
}, kt = [], t[4] = Ct, t[5] = kt) : (Ct = t[4], kt = t[5]), Ht(Ct, kt);
|
|
479
480
|
const Tt = a?.graphContainer, Vt = u?.graphContainer;
|
|
480
481
|
let vt;
|
|
481
|
-
t[6] !== a?.description || t[7] !== a?.title || t[8] !== n || t[9] !== d || t[10] !== tt || t[11] !==
|
|
482
|
+
t[6] !== a?.description || t[7] !== a?.title || t[8] !== n || t[9] !== d || t[10] !== tt || t[11] !== B || t[12] !== v || t[13] !== u?.description || t[14] !== u?.title || t[15] !== h ? (vt = v || tt || B || d ? /* @__PURE__ */ i.jsx(fe, { styles: {
|
|
482
483
|
title: u?.title,
|
|
483
484
|
description: u?.description
|
|
484
485
|
}, classNames: {
|
|
485
486
|
title: a?.title,
|
|
486
487
|
description: a?.description
|
|
487
|
-
}, graphTitle: v, graphDescription: tt, width: h, graphDownload:
|
|
488
|
+
}, graphTitle: v, graphDescription: tt, width: h, graphDownload: B ? Et : void 0, dataDownload: d ? n.map(bo).filter(yo).length > 0 ? n.map(vo).filter(xo) : n.filter(go) : null }) : null, t[6] = a?.description, t[7] = a?.title, t[8] = n, t[9] = d, t[10] = tt, t[11] = B, t[12] = v, t[13] = u?.description, t[14] = u?.title, t[15] = h, t[16] = vt) : vt = t[16];
|
|
488
489
|
let yt;
|
|
489
|
-
t[17] !== At || t[18] !== S || t[19] !== a || t[20] !== et || t[21] !== I || t[22] !== P || t[23] !== Nt || t[24] !== n || t[25] !== Y || t[26] !== b || t[27] !== Q || t[28] !== A || t[29] !== k || t[30] !== M || t[31] !== j || t[32] !== o || t[33] !== w || t[34] !== V || t[35] !== $t || t[36] !== r || t[37] !== m || t[38] !== p || t[39] !== L || t[40] !==
|
|
490
|
-
W !== !1 && n.filter(
|
|
491
|
-
/* @__PURE__ */ i.jsx(
|
|
492
|
-
] }), t[17] = At, t[18] = S, t[19] = a, t[20] = et, t[21] = I, t[22] = P, t[23] = Nt, t[24] = n, t[25] = Y, t[26] = b, t[27] = Q, t[28] = A, t[29] = k, t[30] = M, t[31] = j, t[32] = o, t[33] = w, t[34] = V, t[35] = $t, t[36] = r, t[37] = m, t[38] = p, t[39] = L, t[40] =
|
|
490
|
+
t[17] !== At || t[18] !== S || t[19] !== a || t[20] !== et || t[21] !== I || t[22] !== P || t[23] !== Nt || t[24] !== n || t[25] !== Y || t[26] !== b || t[27] !== Q || t[28] !== A || t[29] !== k || t[30] !== M || t[31] !== j || t[32] !== o || t[33] !== w || t[34] !== V || t[35] !== $t || t[36] !== r || t[37] !== m || t[38] !== p || t[39] !== L || t[40] !== z || t[41] !== Lt || t[42] !== W || t[43] !== f || t[44] !== l || t[45] !== nt || t[46] !== u || t[47] !== C || t[48] !== Ot || t[49] !== jt || t[50] !== N || t[51] !== g || t[52] !== ht || t[53] !== h ? (yt = n.length === 0 ? /* @__PURE__ */ i.jsx(he, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
491
|
+
W !== !1 && n.filter(ho).length !== 0 ? /* @__PURE__ */ i.jsx(ge, { width: h, colorLegendTitle: I, colors: P || xt[N].categoricalColors.colors, colorDomain: et || Xt(n, "color", !0), setSelectedColor: se, showNAColor: l, className: a?.colorLegend }) : null,
|
|
492
|
+
/* @__PURE__ */ i.jsx(pe, { ref: St, children: jt && Ot ? /* @__PURE__ */ i.jsx(At, { data: n, circleColors: n.filter(po).length === 0 ? P ? [P] : [xt.primaryColors["blue-600"]] : P || xt[N].categoricalColors.colors, colorDomain: n.filter(fo).length === 0 ? [] : et || Xt(n, "color", !0), width: jt, selectedColor: Lt, height: Ot, showTicks: nt, leftMargin: A, rightMargin: z, topMargin: ht, bottomMargin: S, showLabels: f, tooltip: g, onSeriesMouseOver: V, refValues: p, startFromZero: !1, radius: m, maxRadiusValue: k, maxValue: M, minValue: j, highlightedDataPoints: Q, onSeriesMouseClick: w, resetSelectionOnDoubleClick: L, detailsOnClick: Y, styles: u, classNames: a, suffix: C, prefix: r, noOfTicks: o || 5, dimmedOpacity: b, precision: $t, customLayers: Nt }) : null })
|
|
493
|
+
] }), t[17] = At, t[18] = S, t[19] = a, t[20] = et, t[21] = I, t[22] = P, t[23] = Nt, t[24] = n, t[25] = Y, t[26] = b, t[27] = Q, t[28] = A, t[29] = k, t[30] = M, t[31] = j, t[32] = o, t[33] = w, t[34] = V, t[35] = $t, t[36] = r, t[37] = m, t[38] = p, t[39] = L, t[40] = z, t[41] = Lt, t[42] = W, t[43] = f, t[44] = l, t[45] = nt, t[46] = u, t[47] = C, t[48] = Ot, t[49] = jt, t[50] = N, t[51] = g, t[52] = ht, t[53] = h, t[54] = yt) : yt = t[54];
|
|
493
494
|
let bt;
|
|
494
|
-
t[55] !== a?.footnote || t[56] !== a?.source || t[57] !== R || t[58] !== _ || t[59] !== u?.footnote || t[60] !== u?.source || t[61] !== h ? (bt = _ || R ? /* @__PURE__ */ i.jsx(
|
|
495
|
+
t[55] !== a?.footnote || t[56] !== a?.source || t[57] !== R || t[58] !== _ || t[59] !== u?.footnote || t[60] !== u?.source || t[61] !== h ? (bt = _ || R ? /* @__PURE__ */ i.jsx(xe, { styles: {
|
|
495
496
|
footnote: u?.footnote,
|
|
496
497
|
source: u?.source
|
|
497
498
|
}, classNames: {
|
|
@@ -499,15 +500,12 @@ function Io(e) {
|
|
|
499
500
|
source: a?.source
|
|
500
501
|
}, sources: _, footNote: R, width: h }) : null, t[55] = a?.footnote, t[56] = a?.source, t[57] = R, t[58] = _, t[59] = u?.footnote, t[60] = u?.source, t[61] = h, t[62] = bt) : bt = t[62];
|
|
501
502
|
let wt;
|
|
502
|
-
return t[63] !== lt || t[64] !== G || t[65] !== q || t[66] !== rt || t[67] !== s || t[68] !== y || t[69] !== st || t[70] !== T || t[71] !== Tt || t[72] !== Vt || t[73] !== vt || t[74] !== yt || t[75] !== bt || t[76] !== N || t[77] !== h ? (wt = /* @__PURE__ */ i.jsxs(
|
|
503
|
+
return t[63] !== lt || t[64] !== G || t[65] !== q || t[66] !== rt || t[67] !== s || t[68] !== y || t[69] !== st || t[70] !== T || t[71] !== Tt || t[72] !== Vt || t[73] !== vt || t[74] !== yt || t[75] !== bt || t[76] !== N || t[77] !== h ? (wt = /* @__PURE__ */ i.jsxs(de, { className: Tt, style: Vt, id: q, ref: Et, "aria-label": lt, backgroundColor: G, theme: N, language: s, minHeight: y, width: h, height: rt, relativeHeight: T, padding: st, children: [
|
|
503
504
|
vt,
|
|
504
505
|
yt,
|
|
505
506
|
bt
|
|
506
507
|
] }), t[63] = lt, t[64] = G, t[65] = q, t[66] = rt, t[67] = s, t[68] = y, t[69] = st, t[70] = T, t[71] = Tt, t[72] = Vt, t[73] = vt, t[74] = yt, t[75] = bt, t[76] = N, t[77] = h, t[78] = wt) : wt = t[78], wt;
|
|
507
508
|
}
|
|
508
|
-
function mo(e) {
|
|
509
|
-
return e.color;
|
|
510
|
-
}
|
|
511
509
|
function fo(e) {
|
|
512
510
|
return e.color;
|
|
513
511
|
}
|
|
@@ -515,21 +513,24 @@ function po(e) {
|
|
|
515
513
|
return e.color;
|
|
516
514
|
}
|
|
517
515
|
function ho(e) {
|
|
518
|
-
return e
|
|
516
|
+
return e.color;
|
|
519
517
|
}
|
|
520
518
|
function go(e) {
|
|
521
519
|
return e !== void 0;
|
|
522
520
|
}
|
|
523
521
|
function xo(e) {
|
|
524
|
-
return e
|
|
522
|
+
return e !== void 0;
|
|
525
523
|
}
|
|
526
524
|
function vo(e) {
|
|
527
|
-
return e
|
|
525
|
+
return e.data;
|
|
528
526
|
}
|
|
529
527
|
function yo(e) {
|
|
528
|
+
return e !== void 0;
|
|
529
|
+
}
|
|
530
|
+
function bo(e) {
|
|
530
531
|
return e.data;
|
|
531
532
|
}
|
|
532
533
|
export {
|
|
533
|
-
|
|
534
|
+
qo as BeeSwarmChart
|
|
534
535
|
};
|
|
535
536
|
//# sourceMappingURL=BeeSwarmChart.js.map
|