@undp/data-viz 1.4.11 → 1.4.13
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/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.d.ts +3 -1
- package/dist/DualAxisLineChart.js +232 -229
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/{GraphEl-s3ctz7oA.js → GraphEl-B3xVlimz.js} +5 -1
- package/dist/GraphEl-B3xVlimz.js.map +1 -0
- package/dist/GraphEl-DO-juRN8.cjs +2 -0
- package/dist/GraphEl-DO-juRN8.cjs.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.d.ts +4 -0
- package/dist/ParetoChart.js +310 -306
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +73 -71
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/Types.d.ts +1 -0
- package/dist/index.d.ts +8 -1
- package/package.json +1 -1
- package/dist/GraphEl-OzC-icbr.cjs +0 -2
- package/dist/GraphEl-OzC-icbr.cjs.map +0 -1
- package/dist/GraphEl-s3ctz7oA.js.map +0 -1
|
@@ -1,138 +1,139 @@
|
|
|
1
1
|
import { j as i, m as k } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { p as G, f as
|
|
4
|
-
import { s as
|
|
5
|
-
import { n as
|
|
6
|
-
import { T as
|
|
7
|
-
import { c as
|
|
8
|
-
import { X as
|
|
9
|
-
import { A as
|
|
10
|
-
import { A as
|
|
11
|
-
import { H as
|
|
12
|
-
import { t as
|
|
13
|
-
import { a as
|
|
14
|
-
import { l as
|
|
15
|
-
import { c as
|
|
16
|
-
import { s as
|
|
17
|
-
import { a as
|
|
18
|
-
import { p as
|
|
19
|
-
import { u as
|
|
2
|
+
import { useRef as lt, useState as P, useEffect as ft } from "react";
|
|
3
|
+
import { p as G, f as $t } from "./parse-DlCRUFh_.js";
|
|
4
|
+
import { s as It } from "./index-DxagiOHo.js";
|
|
5
|
+
import { n as ot } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
|
+
import { T as Tt } from "./Tooltip-DyM5snqx.js";
|
|
7
|
+
import { c as g } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
|
+
import { X as Vt } from "./XTicksAndGridLines-Bn9u5gOM.js";
|
|
9
|
+
import { A as gt } from "./Axis-Ddg-seDi.js";
|
|
10
|
+
import { A as At } from "./AxisTitle-BmHLMRJZ.js";
|
|
11
|
+
import { H as Ot } from "./index-Cdcfp4nk.js";
|
|
12
|
+
import { t as St } from "./time-BzJP5SPC.js";
|
|
13
|
+
import { a as bt } from "./linear-DUdu7l2G.js";
|
|
14
|
+
import { l as Nt, c as Ct } from "./line-CPfhohvF.js";
|
|
15
|
+
import { c as Ft, s as Ht, a as Pt, m as Wt } from "./step-BrDul-H4.js";
|
|
16
|
+
import { s as Xt } from "./select-DKy99ogv.js";
|
|
17
|
+
import { a as Et } from "./init-BhZylTFx.js";
|
|
18
|
+
import { p as Yt } from "./pointer-CWRWOsrb.js";
|
|
19
|
+
import { u as Gt } from "./use-in-view-yS6jzJAp.js";
|
|
20
20
|
import { m as N } from "./proxy-CkpFesk1.js";
|
|
21
|
-
import { GraphFooter as
|
|
22
|
-
import { GraphHeader as
|
|
23
|
-
import { ColorLegend as
|
|
24
|
-
import { Colors as
|
|
25
|
-
import { E as
|
|
26
|
-
function
|
|
21
|
+
import { GraphFooter as Rt } from "./GraphFooter.js";
|
|
22
|
+
import { GraphHeader as Bt } from "./GraphHeader.js";
|
|
23
|
+
import { ColorLegend as zt } from "./ColorLegend.js";
|
|
24
|
+
import { Colors as kt } from "./Colors.js";
|
|
25
|
+
import { E as Ut } from "./EmptyState-DdTp-Mdn.js";
|
|
26
|
+
function qt(ct) {
|
|
27
27
|
const {
|
|
28
|
-
data:
|
|
28
|
+
data: L,
|
|
29
29
|
width: A,
|
|
30
|
-
height:
|
|
30
|
+
height: V,
|
|
31
31
|
lineColors: s,
|
|
32
|
-
labels:
|
|
32
|
+
labels: u,
|
|
33
33
|
sameAxes: m,
|
|
34
34
|
dateFormat: f,
|
|
35
35
|
showValues: R,
|
|
36
|
-
noOfXTicks:
|
|
37
|
-
rightMargin:
|
|
36
|
+
noOfXTicks: mt,
|
|
37
|
+
rightMargin: xt,
|
|
38
38
|
leftMargin: B,
|
|
39
39
|
topMargin: z,
|
|
40
|
-
bottomMargin:
|
|
40
|
+
bottomMargin: ht,
|
|
41
41
|
tooltip: v,
|
|
42
|
-
highlightAreaSettings:
|
|
42
|
+
highlightAreaSettings: yt,
|
|
43
43
|
onSeriesMouseOver: W,
|
|
44
44
|
animate: a,
|
|
45
45
|
strokeWidth: U,
|
|
46
46
|
showDots: X,
|
|
47
47
|
noOfYTicks: q,
|
|
48
|
-
lineSuffixes:
|
|
49
|
-
linePrefixes:
|
|
48
|
+
lineSuffixes: O,
|
|
49
|
+
linePrefixes: S,
|
|
50
50
|
minDate: J,
|
|
51
|
-
maxDate:
|
|
52
|
-
curveType:
|
|
51
|
+
maxDate: D,
|
|
52
|
+
curveType: C,
|
|
53
53
|
styles: o,
|
|
54
54
|
classNames: n,
|
|
55
55
|
precision: b,
|
|
56
|
-
customLayers: E
|
|
57
|
-
|
|
56
|
+
customLayers: E,
|
|
57
|
+
showAxisLabels: K
|
|
58
|
+
} = ct, Q = lt(null), y = Gt(Q, {
|
|
58
59
|
once: a.once,
|
|
59
60
|
amount: a.amount
|
|
60
|
-
}), [
|
|
61
|
-
|
|
62
|
-
if (
|
|
61
|
+
}), [d, F] = P(!1);
|
|
62
|
+
ft(() => {
|
|
63
|
+
if (y && !d) {
|
|
63
64
|
const t = setTimeout(
|
|
64
65
|
() => {
|
|
65
|
-
|
|
66
|
+
F(!0);
|
|
66
67
|
},
|
|
67
68
|
(a.duration + 0.5) * 1e3
|
|
68
69
|
);
|
|
69
70
|
return () => clearTimeout(t);
|
|
70
71
|
}
|
|
71
|
-
}, [
|
|
72
|
-
const
|
|
72
|
+
}, [y, d, a.duration]);
|
|
73
|
+
const Z = C === "linear" ? Ct : C === "step" ? Ft : C === "stepAfter" ? Ht : C === "stepBefore" ? Pt : Wt, [M, _] = P(void 0), [tt, it] = P(void 0), [et, at] = P(void 0), h = {
|
|
73
74
|
top: z,
|
|
74
|
-
bottom:
|
|
75
|
+
bottom: ht,
|
|
75
76
|
left: B + 50,
|
|
76
|
-
right:
|
|
77
|
-
}, w =
|
|
78
|
-
|
|
77
|
+
right: xt + 65
|
|
78
|
+
}, w = lt(null), e = It(
|
|
79
|
+
L.map((t) => ({
|
|
79
80
|
...t,
|
|
80
81
|
date: G(`${t.date}`, f, /* @__PURE__ */ new Date())
|
|
81
82
|
})),
|
|
82
83
|
"date"
|
|
83
|
-
),
|
|
84
|
+
), dt = yt.map((t) => ({
|
|
84
85
|
...t,
|
|
85
86
|
coordinates: [
|
|
86
87
|
t.coordinates[0] === null ? null : G(`${t.coordinates[0]}`, f, /* @__PURE__ */ new Date()),
|
|
87
88
|
t.coordinates[1] === null ? null : G(`${t.coordinates[1]}`, f, /* @__PURE__ */ new Date())
|
|
88
89
|
]
|
|
89
|
-
})), x = A -
|
|
90
|
+
})), x = A - h.left - h.right, r = V - h.top - h.bottom, st = J ? G(`${J}`, f, /* @__PURE__ */ new Date()) : e[0].date, nt = D ? G(`${D}`, f, /* @__PURE__ */ new Date()) : e[e.length - 1].date, H = Math.min(...e.map((t) => t.y1).filter((t) => t != null)) !== 1 / 0 ? Math.min(...e.map((t) => t.y2).filter((t) => t != null)) > 0 ? 0 : Math.min(...e.map((t) => t.y1).filter((t) => t != null)) : 0, j = Math.min(...e.map((t) => t.y2).filter((t) => t != null)) !== 1 / 0 ? Math.min(...e.map((t) => t.y2).filter((t) => t != null)) > 0 ? 0 : Math.min(...e.map((t) => t.y2).filter((t) => t != null)) : 0, $ = Math.max(...e.map((t) => t.y1).filter((t) => t != null)) !== 1 / 0 ? Math.max(...e.map((t) => t.y1).filter((t) => t != null)) : 0, l = Math.max(...e.map((t) => t.y2).filter((t) => t != null)) !== 1 / 0 ? Math.max(...e.map((t) => t.y2).filter((t) => t != null)) : 0, Y = H < j ? H : j, rt = $ > l ? $ : l, c = St().domain([st, nt]).range([0, x]), I = bt().domain([
|
|
90
91
|
m ? Y : H,
|
|
91
|
-
m ?
|
|
92
|
-
]).range([r, 0]).nice(),
|
|
92
|
+
m ? rt > 0 ? rt : 0 : $ > 0 ? $ : 0
|
|
93
|
+
]).range([r, 0]).nice(), p = bt().domain([
|
|
93
94
|
m ? Y : j,
|
|
94
|
-
m ?
|
|
95
|
-
]).range([r, 0]).nice(),
|
|
96
|
-
return
|
|
97
|
-
const t = (
|
|
98
|
-
const
|
|
99
|
-
e.map((
|
|
100
|
-
c.invert(
|
|
95
|
+
m ? rt > 0 ? rt : 0 : l > 0 ? l : 0
|
|
96
|
+
]).range([r, 0]).nice(), vt = Nt().defined((t) => !g(t.y1)).x((t) => c(t.date)).y((t) => I(t.y1)).curve(Z), ut = Nt().defined((t) => !g(t.y2)).x((t) => c(t.date)).y((t) => p(t.y2)).curve(Z), Lt = I.ticks(q), Dt = p.ticks(q), wt = c.ticks(mt);
|
|
97
|
+
return ft(() => {
|
|
98
|
+
const t = (pt) => {
|
|
99
|
+
const jt = e[Et(
|
|
100
|
+
e.map((Mt) => Mt.date),
|
|
101
|
+
c.invert(Yt(pt)[0]),
|
|
101
102
|
0
|
|
102
103
|
)];
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
104
|
+
_(jt || e[e.length - 1]), W?.(jt || e[e.length - 1]), at(pt.clientY), it(pt.clientX);
|
|
105
|
+
}, T = () => {
|
|
106
|
+
_(void 0), it(void 0), at(void 0), W?.(void 0);
|
|
106
107
|
};
|
|
107
|
-
|
|
108
|
+
Xt(w.current).on("mousemove", t).on("mouseout", T);
|
|
108
109
|
}, [c, e, W]), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
109
110
|
/* @__PURE__ */ i.jsx(
|
|
110
111
|
N.svg,
|
|
111
112
|
{
|
|
112
113
|
width: `${A}px`,
|
|
113
|
-
height: `${
|
|
114
|
-
viewBox: `0 0 ${A} ${
|
|
114
|
+
height: `${V}px`,
|
|
115
|
+
viewBox: `0 0 ${A} ${V}`,
|
|
115
116
|
direction: "ltr",
|
|
116
|
-
ref:
|
|
117
|
-
children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${
|
|
117
|
+
ref: Q,
|
|
118
|
+
children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${h.left},${h.top})`, children: [
|
|
118
119
|
/* @__PURE__ */ i.jsx(
|
|
119
|
-
|
|
120
|
+
Ot,
|
|
120
121
|
{
|
|
121
|
-
areaSettings:
|
|
122
|
+
areaSettings: dt,
|
|
122
123
|
width: x,
|
|
123
124
|
height: r,
|
|
124
125
|
scale: c,
|
|
125
126
|
animate: a,
|
|
126
|
-
isInView:
|
|
127
|
+
isInView: y
|
|
127
128
|
}
|
|
128
129
|
),
|
|
129
130
|
/* @__PURE__ */ i.jsxs("g", { children: [
|
|
130
|
-
|
|
131
|
+
Lt.map((t, T) => /* @__PURE__ */ i.jsxs("g", { children: [
|
|
131
132
|
/* @__PURE__ */ i.jsx(
|
|
132
133
|
"line",
|
|
133
134
|
{
|
|
134
|
-
y1:
|
|
135
|
-
y2:
|
|
135
|
+
y1: I(t),
|
|
136
|
+
y2: I(t),
|
|
136
137
|
x1: -15,
|
|
137
138
|
x2: -20,
|
|
138
139
|
style: {
|
|
@@ -147,7 +148,7 @@ function Ut(ot) {
|
|
|
147
148
|
"text",
|
|
148
149
|
{
|
|
149
150
|
x: -25,
|
|
150
|
-
y:
|
|
151
|
+
y: I(t),
|
|
151
152
|
dy: "0.33em",
|
|
152
153
|
className: k("text-xs", n?.yAxis?.labels),
|
|
153
154
|
style: {
|
|
@@ -155,12 +156,12 @@ function Ut(ot) {
|
|
|
155
156
|
fill: s[0],
|
|
156
157
|
...o?.yAxis?.labels || {}
|
|
157
158
|
},
|
|
158
|
-
children:
|
|
159
|
+
children: ot(t, "NA", b, S[0], O[0])
|
|
159
160
|
}
|
|
160
161
|
)
|
|
161
|
-
] },
|
|
162
|
+
] }, T)),
|
|
162
163
|
/* @__PURE__ */ i.jsx(
|
|
163
|
-
|
|
164
|
+
gt,
|
|
164
165
|
{
|
|
165
166
|
y1: 0,
|
|
166
167
|
y2: r,
|
|
@@ -170,25 +171,25 @@ function Ut(ot) {
|
|
|
170
171
|
styles: { axis: { stroke: s[0], ...o?.xAxis?.axis || {} } }
|
|
171
172
|
}
|
|
172
173
|
),
|
|
173
|
-
/* @__PURE__ */ i.jsx(
|
|
174
|
-
|
|
174
|
+
K ? /* @__PURE__ */ i.jsx(
|
|
175
|
+
At,
|
|
175
176
|
{
|
|
176
|
-
x: 10 -
|
|
177
|
+
x: 10 - h.left,
|
|
177
178
|
y: r / 2,
|
|
178
179
|
style: { fill: s[0], ...o?.yAxis?.title || {} },
|
|
179
180
|
className: n?.yAxis?.title,
|
|
180
|
-
text:
|
|
181
|
+
text: u[0].length > 100 ? `${u[0].substring(0, 100)}...` : u[0],
|
|
181
182
|
rotate90: !0
|
|
182
183
|
}
|
|
183
|
-
)
|
|
184
|
+
) : null
|
|
184
185
|
] }),
|
|
185
186
|
/* @__PURE__ */ i.jsxs("g", { children: [
|
|
186
|
-
Dt.map((t,
|
|
187
|
+
Dt.map((t, T) => /* @__PURE__ */ i.jsxs("g", { children: [
|
|
187
188
|
/* @__PURE__ */ i.jsx(
|
|
188
189
|
"line",
|
|
189
190
|
{
|
|
190
|
-
y1:
|
|
191
|
-
y2:
|
|
191
|
+
y1: p(t),
|
|
192
|
+
y2: p(t),
|
|
192
193
|
x1: x + 15,
|
|
193
194
|
x2: x + 20,
|
|
194
195
|
style: {
|
|
@@ -203,7 +204,7 @@ function Ut(ot) {
|
|
|
203
204
|
"text",
|
|
204
205
|
{
|
|
205
206
|
x: x + 25,
|
|
206
|
-
y:
|
|
207
|
+
y: p(t),
|
|
207
208
|
dy: "0.33em",
|
|
208
209
|
dx: -2,
|
|
209
210
|
style: {
|
|
@@ -212,12 +213,12 @@ function Ut(ot) {
|
|
|
212
213
|
...o?.yAxis?.labels || {}
|
|
213
214
|
},
|
|
214
215
|
className: k("text-xs", n?.yAxis?.labels),
|
|
215
|
-
children:
|
|
216
|
+
children: ot(t, "NA", b, S[1], O[1])
|
|
216
217
|
}
|
|
217
218
|
)
|
|
218
|
-
] },
|
|
219
|
+
] }, T)),
|
|
219
220
|
/* @__PURE__ */ i.jsx(
|
|
220
|
-
|
|
221
|
+
gt,
|
|
221
222
|
{
|
|
222
223
|
y1: 0,
|
|
223
224
|
y2: r,
|
|
@@ -227,21 +228,21 @@ function Ut(ot) {
|
|
|
227
228
|
styles: { axis: { stroke: s[1], ...o?.xAxis?.axis || {} } }
|
|
228
229
|
}
|
|
229
230
|
),
|
|
230
|
-
/* @__PURE__ */ i.jsx(
|
|
231
|
-
|
|
231
|
+
K ? /* @__PURE__ */ i.jsx(
|
|
232
|
+
At,
|
|
232
233
|
{
|
|
233
|
-
x: x +
|
|
234
|
+
x: x + h.right - 15,
|
|
234
235
|
y: r / 2,
|
|
235
236
|
style: { fill: s[1], ...o?.yAxis?.title || {} },
|
|
236
237
|
className: n?.yAxis?.title,
|
|
237
|
-
text:
|
|
238
|
+
text: u[1].length > 100 ? `${u[1].substring(0, 100)}...` : u[1],
|
|
238
239
|
rotate90: !0
|
|
239
240
|
}
|
|
240
|
-
)
|
|
241
|
+
) : null
|
|
241
242
|
] }),
|
|
242
243
|
/* @__PURE__ */ i.jsxs("g", { children: [
|
|
243
244
|
/* @__PURE__ */ i.jsx(
|
|
244
|
-
|
|
245
|
+
gt,
|
|
245
246
|
{
|
|
246
247
|
y1: r,
|
|
247
248
|
y2: r,
|
|
@@ -252,10 +253,10 @@ function Ut(ot) {
|
|
|
252
253
|
}
|
|
253
254
|
),
|
|
254
255
|
/* @__PURE__ */ i.jsx(
|
|
255
|
-
|
|
256
|
+
Vt,
|
|
256
257
|
{
|
|
257
|
-
values:
|
|
258
|
-
x:
|
|
258
|
+
values: wt.map((t) => $t(t, f)),
|
|
259
|
+
x: wt.map((t) => c(t)),
|
|
259
260
|
y1: 0,
|
|
260
261
|
y2: r,
|
|
261
262
|
styles: {
|
|
@@ -289,18 +290,18 @@ function Ut(ot) {
|
|
|
289
290
|
variants: {
|
|
290
291
|
initial: {
|
|
291
292
|
pathLength: 0,
|
|
292
|
-
d:
|
|
293
|
+
d: vt(
|
|
293
294
|
e.filter(
|
|
294
|
-
(t) => !
|
|
295
|
+
(t) => !g(t.y1)
|
|
295
296
|
)
|
|
296
297
|
) || "",
|
|
297
298
|
opacity: 1
|
|
298
299
|
},
|
|
299
300
|
whileInView: {
|
|
300
301
|
pathLength: 1,
|
|
301
|
-
d:
|
|
302
|
+
d: vt(
|
|
302
303
|
e.filter(
|
|
303
|
-
(t) => !
|
|
304
|
+
(t) => !g(t.y1)
|
|
304
305
|
)
|
|
305
306
|
) || "",
|
|
306
307
|
opacity: 1,
|
|
@@ -308,15 +309,15 @@ function Ut(ot) {
|
|
|
308
309
|
}
|
|
309
310
|
},
|
|
310
311
|
initial: "initial",
|
|
311
|
-
animate:
|
|
312
|
+
animate: y ? "whileInView" : "initial"
|
|
312
313
|
}
|
|
313
314
|
),
|
|
314
315
|
/* @__PURE__ */ i.jsx(
|
|
315
316
|
N.path,
|
|
316
317
|
{
|
|
317
|
-
d:
|
|
318
|
+
d: ut(
|
|
318
319
|
e.filter(
|
|
319
|
-
(t) => !
|
|
320
|
+
(t) => !g(t.y2)
|
|
320
321
|
)
|
|
321
322
|
) || "",
|
|
322
323
|
style: {
|
|
@@ -328,18 +329,18 @@ function Ut(ot) {
|
|
|
328
329
|
variants: {
|
|
329
330
|
initial: {
|
|
330
331
|
pathLength: 0,
|
|
331
|
-
d:
|
|
332
|
+
d: ut(
|
|
332
333
|
e.filter(
|
|
333
|
-
(t) => !
|
|
334
|
+
(t) => !g(t.y2)
|
|
334
335
|
)
|
|
335
336
|
) || "",
|
|
336
337
|
opacity: 1
|
|
337
338
|
},
|
|
338
339
|
whileInView: {
|
|
339
340
|
pathLength: 1,
|
|
340
|
-
d:
|
|
341
|
+
d: ut(
|
|
341
342
|
e.filter(
|
|
342
|
-
(t) => !
|
|
343
|
+
(t) => !g(t.y2)
|
|
343
344
|
)
|
|
344
345
|
) || "",
|
|
345
346
|
opacity: 1,
|
|
@@ -347,16 +348,16 @@ function Ut(ot) {
|
|
|
347
348
|
}
|
|
348
349
|
},
|
|
349
350
|
initial: "initial",
|
|
350
|
-
animate:
|
|
351
|
+
animate: y ? "whileInView" : "initial"
|
|
351
352
|
}
|
|
352
353
|
),
|
|
353
|
-
|
|
354
|
+
M ? /* @__PURE__ */ i.jsx(
|
|
354
355
|
"line",
|
|
355
356
|
{
|
|
356
357
|
y1: 0,
|
|
357
358
|
y2: r,
|
|
358
|
-
x1: c(
|
|
359
|
-
x2: c(
|
|
359
|
+
x1: c(M.date),
|
|
360
|
+
x2: c(M.date),
|
|
360
361
|
className: k(
|
|
361
362
|
"undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",
|
|
362
363
|
n?.mouseOverLine
|
|
@@ -365,8 +366,8 @@ function Ut(ot) {
|
|
|
365
366
|
}
|
|
366
367
|
) : null
|
|
367
368
|
] }),
|
|
368
|
-
/* @__PURE__ */ i.jsx("g", { children: e.map((t,
|
|
369
|
-
|
|
369
|
+
/* @__PURE__ */ i.jsx("g", { children: e.map((t, T) => /* @__PURE__ */ i.jsxs(N.g, { children: [
|
|
370
|
+
g(t.y1) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
370
371
|
X ? /* @__PURE__ */ i.jsx(
|
|
371
372
|
N.circle,
|
|
372
373
|
{
|
|
@@ -374,25 +375,25 @@ function Ut(ot) {
|
|
|
374
375
|
style: { fill: s[0] },
|
|
375
376
|
exit: { opacity: 0, transition: { duration: a.duration } },
|
|
376
377
|
variants: {
|
|
377
|
-
initial: { opacity: 0, cx: c(t.date), cy:
|
|
378
|
+
initial: { opacity: 0, cx: c(t.date), cy: I(t.y1) },
|
|
378
379
|
whileInView: {
|
|
379
380
|
opacity: 1,
|
|
380
381
|
transition: {
|
|
381
|
-
duration:
|
|
382
|
-
delay:
|
|
382
|
+
duration: d ? a.duration : 0.5,
|
|
383
|
+
delay: d ? 0 : a.duration
|
|
383
384
|
},
|
|
384
385
|
cx: c(t.date),
|
|
385
|
-
cy:
|
|
386
|
+
cy: I(t.y1)
|
|
386
387
|
}
|
|
387
388
|
},
|
|
388
389
|
initial: "initial",
|
|
389
|
-
animate:
|
|
390
|
+
animate: y ? "whileInView" : "initial"
|
|
390
391
|
}
|
|
391
392
|
) : null,
|
|
392
393
|
R ? /* @__PURE__ */ i.jsx(
|
|
393
394
|
N.text,
|
|
394
395
|
{
|
|
395
|
-
dy:
|
|
396
|
+
dy: g(t.y2) || t.y2 < t.y1 ? -8 : "1em",
|
|
396
397
|
style: {
|
|
397
398
|
fill: s[0],
|
|
398
399
|
textAnchor: "middle",
|
|
@@ -404,30 +405,30 @@ function Ut(ot) {
|
|
|
404
405
|
),
|
|
405
406
|
exit: { opacity: 0, transition: { duration: a.duration } },
|
|
406
407
|
variants: {
|
|
407
|
-
initial: { opacity: 0, x: c(t.date), y:
|
|
408
|
+
initial: { opacity: 0, x: c(t.date), y: p(t.y1) },
|
|
408
409
|
whileInView: {
|
|
409
410
|
opacity: 1,
|
|
410
411
|
x: c(t.date),
|
|
411
|
-
y:
|
|
412
|
+
y: p(t.y1),
|
|
412
413
|
transition: {
|
|
413
|
-
duration:
|
|
414
|
-
delay:
|
|
414
|
+
duration: d ? a.duration : 0.5,
|
|
415
|
+
delay: d ? 0 : a.duration
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
418
|
},
|
|
418
419
|
initial: "initial",
|
|
419
|
-
animate:
|
|
420
|
-
children:
|
|
420
|
+
animate: y ? "whileInView" : "initial",
|
|
421
|
+
children: ot(
|
|
421
422
|
t.y1,
|
|
422
423
|
"NA",
|
|
423
424
|
b,
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
S[0],
|
|
426
|
+
O[0]
|
|
426
427
|
)
|
|
427
428
|
}
|
|
428
429
|
) : null
|
|
429
430
|
] }),
|
|
430
|
-
|
|
431
|
+
g(t.y2) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
431
432
|
X ? /* @__PURE__ */ i.jsx(
|
|
432
433
|
N.circle,
|
|
433
434
|
{
|
|
@@ -435,25 +436,25 @@ function Ut(ot) {
|
|
|
435
436
|
style: { fill: s[1] },
|
|
436
437
|
exit: { opacity: 0, transition: { duration: a.duration } },
|
|
437
438
|
variants: {
|
|
438
|
-
initial: { opacity: 0, cx: c(t.date), cy:
|
|
439
|
+
initial: { opacity: 0, cx: c(t.date), cy: p(t.y2) },
|
|
439
440
|
whileInView: {
|
|
440
441
|
opacity: 1,
|
|
441
442
|
transition: {
|
|
442
|
-
duration:
|
|
443
|
-
delay:
|
|
443
|
+
duration: d ? a.duration : 0.5,
|
|
444
|
+
delay: d ? 0 : a.duration
|
|
444
445
|
},
|
|
445
446
|
cx: c(t.date),
|
|
446
|
-
cy:
|
|
447
|
+
cy: p(t.y2)
|
|
447
448
|
}
|
|
448
449
|
},
|
|
449
450
|
initial: "initial",
|
|
450
|
-
animate:
|
|
451
|
+
animate: y ? "whileInView" : "initial"
|
|
451
452
|
}
|
|
452
453
|
) : null,
|
|
453
454
|
R ? /* @__PURE__ */ i.jsx(
|
|
454
455
|
N.text,
|
|
455
456
|
{
|
|
456
|
-
dy:
|
|
457
|
+
dy: g(t.y1) || t.y1 < t.y2 ? -8 : "1em",
|
|
457
458
|
style: {
|
|
458
459
|
fill: s[1],
|
|
459
460
|
textAnchor: "middle",
|
|
@@ -465,30 +466,30 @@ function Ut(ot) {
|
|
|
465
466
|
),
|
|
466
467
|
exit: { opacity: 0, transition: { duration: a.duration } },
|
|
467
468
|
variants: {
|
|
468
|
-
initial: { opacity: 0, x: c(t.date), y:
|
|
469
|
+
initial: { opacity: 0, x: c(t.date), y: p(t.y2) },
|
|
469
470
|
whileInView: {
|
|
470
471
|
opacity: 1,
|
|
471
472
|
x: c(t.date),
|
|
472
|
-
y:
|
|
473
|
+
y: p(t.y2),
|
|
473
474
|
transition: {
|
|
474
|
-
duration:
|
|
475
|
-
delay:
|
|
475
|
+
duration: d ? a.duration : 0.5,
|
|
476
|
+
delay: d ? 0 : a.duration
|
|
476
477
|
}
|
|
477
478
|
}
|
|
478
479
|
},
|
|
479
480
|
initial: "initial",
|
|
480
|
-
animate:
|
|
481
|
-
children:
|
|
481
|
+
animate: y ? "whileInView" : "initial",
|
|
482
|
+
children: ot(
|
|
482
483
|
t.y2,
|
|
483
484
|
"NA",
|
|
484
485
|
b,
|
|
485
|
-
|
|
486
|
-
|
|
486
|
+
S[1],
|
|
487
|
+
O[1]
|
|
487
488
|
)
|
|
488
489
|
}
|
|
489
490
|
) : null
|
|
490
491
|
] })
|
|
491
|
-
] },
|
|
492
|
+
] }, T)) }),
|
|
492
493
|
E.filter((t) => t.position === "after").map((t) => t.layer),
|
|
493
494
|
/* @__PURE__ */ i.jsx(
|
|
494
495
|
"rect",
|
|
@@ -505,94 +506,95 @@ function Ut(ot) {
|
|
|
505
506
|
] })
|
|
506
507
|
}
|
|
507
508
|
),
|
|
508
|
-
|
|
509
|
-
|
|
509
|
+
M && v && tt && et ? /* @__PURE__ */ i.jsx(
|
|
510
|
+
Tt,
|
|
510
511
|
{
|
|
511
|
-
data:
|
|
512
|
+
data: M,
|
|
512
513
|
body: v,
|
|
513
|
-
xPos:
|
|
514
|
-
yPos:
|
|
514
|
+
xPos: tt,
|
|
515
|
+
yPos: et,
|
|
515
516
|
backgroundStyle: o?.tooltip,
|
|
516
517
|
className: n?.tooltip
|
|
517
518
|
}
|
|
518
519
|
) : null
|
|
519
520
|
] });
|
|
520
521
|
}
|
|
521
|
-
function
|
|
522
|
+
function wi(ct) {
|
|
522
523
|
const {
|
|
523
|
-
data:
|
|
524
|
+
data: L,
|
|
524
525
|
graphTitle: A,
|
|
525
|
-
sources:
|
|
526
|
+
sources: V,
|
|
526
527
|
graphDescription: s,
|
|
527
|
-
height:
|
|
528
|
+
height: u,
|
|
528
529
|
width: m,
|
|
529
530
|
footNote: f,
|
|
530
531
|
noOfXTicks: R = 10,
|
|
531
|
-
dateFormat:
|
|
532
|
-
showValues:
|
|
532
|
+
dateFormat: mt = "yyyy",
|
|
533
|
+
showValues: xt = !1,
|
|
533
534
|
padding: B,
|
|
534
535
|
lineColors: z = [
|
|
535
|
-
|
|
536
|
-
|
|
536
|
+
kt.light.categoricalColors.colors[0],
|
|
537
|
+
kt.light.categoricalColors.colors[1]
|
|
537
538
|
],
|
|
538
|
-
sameAxes:
|
|
539
|
+
sameAxes: ht = !1,
|
|
539
540
|
backgroundColor: v = !1,
|
|
540
|
-
leftMargin:
|
|
541
|
+
leftMargin: yt = 80,
|
|
541
542
|
rightMargin: W = 80,
|
|
542
543
|
topMargin: a = 20,
|
|
543
544
|
bottomMargin: U = 25,
|
|
544
545
|
labels: X,
|
|
545
546
|
lineSuffixes: q = ["", ""],
|
|
546
|
-
linePrefixes:
|
|
547
|
-
tooltip:
|
|
547
|
+
linePrefixes: O = ["", ""],
|
|
548
|
+
tooltip: S,
|
|
548
549
|
highlightAreaSettings: J = [],
|
|
549
|
-
relativeHeight:
|
|
550
|
-
onSeriesMouseOver:
|
|
550
|
+
relativeHeight: D,
|
|
551
|
+
onSeriesMouseOver: C,
|
|
551
552
|
graphID: o,
|
|
552
553
|
graphDownload: n = !1,
|
|
553
554
|
dataDownload: b = !1,
|
|
554
555
|
animate: E = !1,
|
|
555
556
|
strokeWidth: K = 2,
|
|
556
|
-
showDots:
|
|
557
|
-
language:
|
|
558
|
-
showColorScale:
|
|
559
|
-
minHeight:
|
|
560
|
-
colorLegendTitle:
|
|
561
|
-
theme:
|
|
562
|
-
ariaLabel:
|
|
563
|
-
noOfYTicks:
|
|
564
|
-
maxDate:
|
|
565
|
-
minDate:
|
|
566
|
-
curveType:
|
|
567
|
-
styles:
|
|
568
|
-
classNames:
|
|
569
|
-
precision:
|
|
570
|
-
customLayers:
|
|
571
|
-
|
|
572
|
-
|
|
557
|
+
showDots: Q = !0,
|
|
558
|
+
language: y = "en",
|
|
559
|
+
showColorScale: d = !0,
|
|
560
|
+
minHeight: F = 0,
|
|
561
|
+
colorLegendTitle: Z,
|
|
562
|
+
theme: M = "light",
|
|
563
|
+
ariaLabel: _,
|
|
564
|
+
noOfYTicks: tt = 5,
|
|
565
|
+
maxDate: it,
|
|
566
|
+
minDate: et,
|
|
567
|
+
curveType: at = "curve",
|
|
568
|
+
styles: h,
|
|
569
|
+
classNames: w,
|
|
570
|
+
precision: e = 2,
|
|
571
|
+
customLayers: dt = [],
|
|
572
|
+
showAxisLabels: x = !0
|
|
573
|
+
} = ct, [r, st] = P(0), [nt, H] = P(0), j = lt(null), $ = lt(null);
|
|
574
|
+
return ft(() => {
|
|
573
575
|
const l = new ResizeObserver((Y) => {
|
|
574
|
-
|
|
576
|
+
st(m || Y[0].target.clientWidth || 620), H(u || Y[0].target.clientHeight || 480);
|
|
575
577
|
});
|
|
576
|
-
return j.current && (H(j.current.clientHeight || 480),
|
|
577
|
-
}, [m,
|
|
578
|
+
return j.current && (H(j.current.clientHeight || 480), st(j.current.clientWidth || 620), m || l.observe(j.current)), () => l.disconnect();
|
|
579
|
+
}, [m, u]), /* @__PURE__ */ i.jsx(
|
|
578
580
|
"div",
|
|
579
581
|
{
|
|
580
|
-
className: `${
|
|
581
|
-
dir:
|
|
582
|
+
className: `${M || "light"} flex ${m ? "w-fit grow-0" : "w-full grow"}`,
|
|
583
|
+
dir: y === "he" || y === "ar" ? "rtl" : void 0,
|
|
582
584
|
children: /* @__PURE__ */ i.jsx(
|
|
583
585
|
"div",
|
|
584
586
|
{
|
|
585
587
|
className: k(
|
|
586
|
-
`${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${
|
|
587
|
-
|
|
588
|
+
`${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${y || "en"}`,
|
|
589
|
+
w?.graphContainer
|
|
588
590
|
),
|
|
589
591
|
style: {
|
|
590
|
-
...
|
|
592
|
+
...h?.graphContainer || {},
|
|
591
593
|
...v && v !== !0 ? { backgroundColor: v } : {}
|
|
592
594
|
},
|
|
593
595
|
id: o,
|
|
594
|
-
ref:
|
|
595
|
-
"aria-label":
|
|
596
|
+
ref: $,
|
|
597
|
+
"aria-label": _ || `${A ? `The graph shows ${A}. ` : ""}This is a line chart that show trends for two datasets over time.${s ? ` ${s}` : ""}`,
|
|
596
598
|
children: /* @__PURE__ */ i.jsx(
|
|
597
599
|
"div",
|
|
598
600
|
{
|
|
@@ -600,29 +602,29 @@ function vi(ot) {
|
|
|
600
602
|
style: { padding: v ? B || "1rem" : B || 0 },
|
|
601
603
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
602
604
|
A || s || n || b ? /* @__PURE__ */ i.jsx(
|
|
603
|
-
|
|
605
|
+
Bt,
|
|
604
606
|
{
|
|
605
607
|
styles: {
|
|
606
|
-
title:
|
|
607
|
-
description:
|
|
608
|
+
title: h?.title,
|
|
609
|
+
description: h?.description
|
|
608
610
|
},
|
|
609
611
|
classNames: {
|
|
610
|
-
title:
|
|
611
|
-
description:
|
|
612
|
+
title: w?.title,
|
|
613
|
+
description: w?.description
|
|
612
614
|
},
|
|
613
615
|
graphTitle: A,
|
|
614
616
|
graphDescription: s,
|
|
615
617
|
width: m,
|
|
616
|
-
graphDownload: n ?
|
|
617
|
-
dataDownload: b ?
|
|
618
|
+
graphDownload: n ? $.current : void 0,
|
|
619
|
+
dataDownload: b ? L.map((l) => l.data).filter((l) => l !== void 0).length > 0 ? L.map((l) => l.data).filter((l) => l !== void 0) : L.filter((l) => l !== void 0) : null
|
|
618
620
|
}
|
|
619
621
|
) : null,
|
|
620
|
-
/* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children:
|
|
621
|
-
|
|
622
|
-
|
|
622
|
+
/* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: L.length === 0 ? /* @__PURE__ */ i.jsx(Ut, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
623
|
+
d ? null : /* @__PURE__ */ i.jsx(
|
|
624
|
+
zt,
|
|
623
625
|
{
|
|
624
626
|
colorDomain: X,
|
|
625
|
-
colorLegendTitle:
|
|
627
|
+
colorLegendTitle: Z,
|
|
626
628
|
colors: z,
|
|
627
629
|
showNAColor: !1
|
|
628
630
|
}
|
|
@@ -633,55 +635,56 @@ function vi(ot) {
|
|
|
633
635
|
className: "flex flex-col grow justify-center leading-0",
|
|
634
636
|
ref: j,
|
|
635
637
|
"aria-label": "Graph area",
|
|
636
|
-
children: (m || r) && (
|
|
637
|
-
|
|
638
|
+
children: (m || r) && (u || nt) ? /* @__PURE__ */ i.jsx(
|
|
639
|
+
qt,
|
|
638
640
|
{
|
|
639
|
-
data:
|
|
640
|
-
sameAxes:
|
|
641
|
+
data: L,
|
|
642
|
+
sameAxes: ht,
|
|
641
643
|
lineColors: z,
|
|
642
644
|
width: m || r,
|
|
643
645
|
height: Math.max(
|
|
644
|
-
|
|
645
|
-
|
|
646
|
+
F,
|
|
647
|
+
u || (D ? F ? (m || r) * D > F ? (m || r) * D : F : (m || r) * D : nt)
|
|
646
648
|
),
|
|
647
|
-
dateFormat:
|
|
648
|
-
showValues:
|
|
649
|
+
dateFormat: mt,
|
|
650
|
+
showValues: xt,
|
|
649
651
|
noOfXTicks: R,
|
|
650
|
-
leftMargin:
|
|
652
|
+
leftMargin: yt,
|
|
651
653
|
rightMargin: W,
|
|
652
654
|
topMargin: a,
|
|
653
655
|
bottomMargin: U,
|
|
654
656
|
labels: X,
|
|
655
657
|
highlightAreaSettings: J,
|
|
656
|
-
tooltip:
|
|
657
|
-
onSeriesMouseOver:
|
|
658
|
+
tooltip: S,
|
|
659
|
+
onSeriesMouseOver: C,
|
|
658
660
|
animate: E === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : E || { duration: 0, once: !0, amount: 0 },
|
|
659
661
|
strokeWidth: K,
|
|
660
|
-
showDots:
|
|
661
|
-
noOfYTicks:
|
|
662
|
+
showDots: Q,
|
|
663
|
+
noOfYTicks: tt,
|
|
662
664
|
lineSuffixes: q,
|
|
663
|
-
linePrefixes:
|
|
664
|
-
minDate:
|
|
665
|
-
maxDate:
|
|
666
|
-
curveType:
|
|
667
|
-
styles:
|
|
668
|
-
classNames:
|
|
669
|
-
precision:
|
|
670
|
-
customLayers:
|
|
665
|
+
linePrefixes: O,
|
|
666
|
+
minDate: et,
|
|
667
|
+
maxDate: it,
|
|
668
|
+
curveType: at,
|
|
669
|
+
styles: h,
|
|
670
|
+
classNames: w,
|
|
671
|
+
precision: e,
|
|
672
|
+
customLayers: dt,
|
|
673
|
+
showAxisLabels: x
|
|
671
674
|
}
|
|
672
675
|
) : null
|
|
673
676
|
}
|
|
674
677
|
)
|
|
675
678
|
] }) }),
|
|
676
|
-
|
|
677
|
-
|
|
679
|
+
V || f ? /* @__PURE__ */ i.jsx(
|
|
680
|
+
Rt,
|
|
678
681
|
{
|
|
679
|
-
styles: { footnote:
|
|
682
|
+
styles: { footnote: h?.footnote, source: h?.source },
|
|
680
683
|
classNames: {
|
|
681
|
-
footnote:
|
|
682
|
-
source:
|
|
684
|
+
footnote: w?.footnote,
|
|
685
|
+
source: w?.source
|
|
683
686
|
},
|
|
684
|
-
sources:
|
|
687
|
+
sources: V,
|
|
685
688
|
footNote: f,
|
|
686
689
|
width: m
|
|
687
690
|
}
|
|
@@ -695,6 +698,6 @@ function vi(ot) {
|
|
|
695
698
|
);
|
|
696
699
|
}
|
|
697
700
|
export {
|
|
698
|
-
|
|
701
|
+
wi as DualAxisLineChart
|
|
699
702
|
};
|
|
700
703
|
//# sourceMappingURL=DualAxisLineChart.js.map
|