@undp/data-viz 1.5.7 → 1.5.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 +650 -648
- package/dist/BarGraph.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +210 -208
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +42 -40
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +122 -120
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +133 -113
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +274 -274
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +194 -174
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +160 -161
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +77 -66
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +166 -161
- package/dist/ParetoChart.js.map +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +253 -241
- package/dist/RadarChart.js.map +1 -1
- package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-C2--oMQq.js} +10 -9
- package/dist/RegressionLine-C2--oMQq.js.map +1 -0
- package/dist/RegressionLine-Dj0GSiAp.cjs +2 -0
- package/dist/RegressionLine-Dj0GSiAp.cjs.map +1 -0
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +130 -129
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +43 -38
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +113 -109
- package/dist/SlopeChart.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +282 -270
- package/dist/StripChart.js.map +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +20 -21
- package/dist/UnitChart.js.map +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
- package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
- package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as i, m as k } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as ot, useState as P, useEffect as gt } from "react";
|
|
3
3
|
import { p as G, f as $t } from "./parse-DlCRUFh_.js";
|
|
4
4
|
import { o as It } from "./index-DvVprvy6.js";
|
|
5
|
-
import { n as
|
|
5
|
+
import { n as lt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
6
|
import { T as Tt } from "./Tooltip-CVCGWyzw.js";
|
|
7
|
-
import { c as
|
|
7
|
+
import { c as f } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
8
|
import { X as Vt } from "./XTicksAndGridLines-Bn9u5gOM.js";
|
|
9
|
-
import { A as
|
|
9
|
+
import { A as ft } from "./Axis-Ddg-seDi.js";
|
|
10
10
|
import { A as At } from "./AxisTitle-BmHLMRJZ.js";
|
|
11
11
|
import { H as Ot } from "./index-DKCxu1Gh.js";
|
|
12
12
|
import { t as St } from "./time-BzJP5SPC.js";
|
|
@@ -28,10 +28,10 @@ function qt(ct) {
|
|
|
28
28
|
data: L,
|
|
29
29
|
width: A,
|
|
30
30
|
height: V,
|
|
31
|
-
lineColors:
|
|
31
|
+
lineColors: a,
|
|
32
32
|
labels: u,
|
|
33
|
-
sameAxes:
|
|
34
|
-
dateFormat:
|
|
33
|
+
sameAxes: l,
|
|
34
|
+
dateFormat: g,
|
|
35
35
|
showValues: R,
|
|
36
36
|
noOfXTicks: mt,
|
|
37
37
|
rightMargin: xt,
|
|
@@ -41,7 +41,7 @@ function qt(ct) {
|
|
|
41
41
|
tooltip: v,
|
|
42
42
|
highlightAreaSettings: yt,
|
|
43
43
|
onSeriesMouseOver: W,
|
|
44
|
-
animate:
|
|
44
|
+
animate: s,
|
|
45
45
|
strokeWidth: U,
|
|
46
46
|
showDots: X,
|
|
47
47
|
noOfYTicks: q,
|
|
@@ -50,52 +50,52 @@ function qt(ct) {
|
|
|
50
50
|
minDate: J,
|
|
51
51
|
maxDate: D,
|
|
52
52
|
curveType: C,
|
|
53
|
-
styles:
|
|
53
|
+
styles: o,
|
|
54
54
|
classNames: n,
|
|
55
55
|
precision: b,
|
|
56
56
|
customLayers: E,
|
|
57
57
|
showAxisLabels: K
|
|
58
|
-
} = ct, Q =
|
|
59
|
-
once:
|
|
60
|
-
amount:
|
|
58
|
+
} = ct, Q = ot(null), y = Gt(Q, {
|
|
59
|
+
once: s.once,
|
|
60
|
+
amount: s.amount
|
|
61
61
|
}), [d, F] = P(!1);
|
|
62
|
-
|
|
62
|
+
gt(() => {
|
|
63
63
|
if (y && !d) {
|
|
64
64
|
const t = setTimeout(
|
|
65
65
|
() => {
|
|
66
66
|
F(!0);
|
|
67
67
|
},
|
|
68
|
-
(
|
|
68
|
+
(s.duration + 0.5) * 1e3
|
|
69
69
|
);
|
|
70
70
|
return () => clearTimeout(t);
|
|
71
71
|
}
|
|
72
|
-
}, [y, d,
|
|
72
|
+
}, [y, d, s.duration]);
|
|
73
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 = {
|
|
74
74
|
top: z,
|
|
75
75
|
bottom: ht,
|
|
76
76
|
left: B + 50,
|
|
77
77
|
right: xt + 65
|
|
78
|
-
}, w =
|
|
78
|
+
}, w = ot(null), e = It(
|
|
79
79
|
L.map((t) => ({
|
|
80
80
|
...t,
|
|
81
|
-
date: G(`${t.date}`,
|
|
81
|
+
date: G(`${t.date}`, g, /* @__PURE__ */ new Date())
|
|
82
82
|
})),
|
|
83
83
|
["date"],
|
|
84
84
|
["asc"]
|
|
85
85
|
), dt = yt.map((t) => ({
|
|
86
86
|
...t,
|
|
87
87
|
coordinates: [
|
|
88
|
-
t.coordinates[0] === null ? null : G(`${t.coordinates[0]}`,
|
|
89
|
-
t.coordinates[1] === null ? null : G(`${t.coordinates[1]}`,
|
|
88
|
+
t.coordinates[0] === null ? null : G(`${t.coordinates[0]}`, g, /* @__PURE__ */ new Date()),
|
|
89
|
+
t.coordinates[1] === null ? null : G(`${t.coordinates[1]}`, g, /* @__PURE__ */ new Date())
|
|
90
90
|
]
|
|
91
|
-
})), x = A - h.left - h.right, r = V - h.top - h.bottom, st = J ? G(`${J}`,
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
})), x = A - h.left - h.right, r = V - h.top - h.bottom, st = J ? G(`${J}`, g, /* @__PURE__ */ new Date()) : e[0].date, nt = D ? G(`${D}`, g, /* @__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, c = 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 = $ > c ? $ : c, m = St().domain([st, nt]).range([0, x]), I = bt().domain([
|
|
92
|
+
l ? Y : H,
|
|
93
|
+
l ? rt > 0 ? rt : 0 : $ > 0 ? $ : 0
|
|
94
94
|
]).range([r, 0]).nice(), p = bt().domain([
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
]).range([r, 0]).nice(), vt = Nt().defined((t) => !
|
|
98
|
-
return
|
|
95
|
+
l ? Y : j,
|
|
96
|
+
l ? rt > 0 ? rt : 0 : c > 0 ? c : 0
|
|
97
|
+
]).range([r, 0]).nice(), vt = Nt().defined((t) => !f(t.y1)).x((t) => m(t.date)).y((t) => I(t.y1)).curve(Z), ut = Nt().defined((t) => !f(t.y2)).x((t) => m(t.date)).y((t) => p(t.y2)).curve(Z), Lt = I.ticks(q), Dt = p.ticks(q), wt = m.ticks(mt);
|
|
98
|
+
return gt(() => {
|
|
99
99
|
const t = (pt) => {
|
|
100
100
|
const jt = e[Et(
|
|
101
101
|
e.map((Mt) => Mt.date),
|
|
@@ -124,7 +124,7 @@ function qt(ct) {
|
|
|
124
124
|
width: x,
|
|
125
125
|
height: r,
|
|
126
126
|
scale: m,
|
|
127
|
-
animate:
|
|
127
|
+
animate: s,
|
|
128
128
|
isInView: y
|
|
129
129
|
}
|
|
130
130
|
),
|
|
@@ -138,9 +138,9 @@ function qt(ct) {
|
|
|
138
138
|
x1: -15,
|
|
139
139
|
x2: -20,
|
|
140
140
|
style: {
|
|
141
|
-
stroke:
|
|
141
|
+
stroke: a[0],
|
|
142
142
|
strokeWidth: 1,
|
|
143
|
-
...
|
|
143
|
+
...o?.yAxis?.gridLines || {}
|
|
144
144
|
},
|
|
145
145
|
className: n?.yAxis?.gridLines
|
|
146
146
|
}
|
|
@@ -154,22 +154,22 @@ function qt(ct) {
|
|
|
154
154
|
className: k("text-xs", n?.yAxis?.labels),
|
|
155
155
|
style: {
|
|
156
156
|
textAnchor: "end",
|
|
157
|
-
fill:
|
|
158
|
-
...
|
|
157
|
+
fill: a[0],
|
|
158
|
+
...o?.yAxis?.labels || {}
|
|
159
159
|
},
|
|
160
|
-
children:
|
|
160
|
+
children: lt(t, "NA", b, S[0], O[0])
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
] }, T)),
|
|
164
164
|
/* @__PURE__ */ i.jsx(
|
|
165
|
-
|
|
165
|
+
ft,
|
|
166
166
|
{
|
|
167
167
|
y1: 0,
|
|
168
168
|
y2: r,
|
|
169
169
|
x1: -15,
|
|
170
170
|
x2: -15,
|
|
171
171
|
classNames: { axis: n?.xAxis?.axis },
|
|
172
|
-
styles: { axis: { stroke:
|
|
172
|
+
styles: { axis: { stroke: a[0], ...o?.xAxis?.axis || {} } }
|
|
173
173
|
}
|
|
174
174
|
),
|
|
175
175
|
K ? /* @__PURE__ */ i.jsx(
|
|
@@ -177,7 +177,7 @@ function qt(ct) {
|
|
|
177
177
|
{
|
|
178
178
|
x: 10 - h.left,
|
|
179
179
|
y: r / 2,
|
|
180
|
-
style: { fill:
|
|
180
|
+
style: { fill: a[0], ...o?.yAxis?.title || {} },
|
|
181
181
|
className: n?.yAxis?.title,
|
|
182
182
|
text: u[0].length > 100 ? `${u[0].substring(0, 100)}...` : u[0],
|
|
183
183
|
rotate90: !0
|
|
@@ -194,9 +194,9 @@ function qt(ct) {
|
|
|
194
194
|
x1: x + 15,
|
|
195
195
|
x2: x + 20,
|
|
196
196
|
style: {
|
|
197
|
-
stroke:
|
|
197
|
+
stroke: a[1],
|
|
198
198
|
strokeWidth: 1,
|
|
199
|
-
...
|
|
199
|
+
...o?.yAxis?.gridLines || {}
|
|
200
200
|
},
|
|
201
201
|
className: n?.yAxis?.gridLines
|
|
202
202
|
}
|
|
@@ -210,23 +210,23 @@ function qt(ct) {
|
|
|
210
210
|
dx: -2,
|
|
211
211
|
style: {
|
|
212
212
|
textAnchor: "start",
|
|
213
|
-
fill:
|
|
214
|
-
...
|
|
213
|
+
fill: a[1],
|
|
214
|
+
...o?.yAxis?.labels || {}
|
|
215
215
|
},
|
|
216
216
|
className: k("text-xs", n?.yAxis?.labels),
|
|
217
|
-
children:
|
|
217
|
+
children: lt(t, "NA", b, S[1], O[1])
|
|
218
218
|
}
|
|
219
219
|
)
|
|
220
220
|
] }, T)),
|
|
221
221
|
/* @__PURE__ */ i.jsx(
|
|
222
|
-
|
|
222
|
+
ft,
|
|
223
223
|
{
|
|
224
224
|
y1: 0,
|
|
225
225
|
y2: r,
|
|
226
226
|
x1: x + 15,
|
|
227
227
|
x2: x + 15,
|
|
228
228
|
classNames: { axis: n?.xAxis?.axis },
|
|
229
|
-
styles: { axis: { stroke:
|
|
229
|
+
styles: { axis: { stroke: a[1], ...o?.xAxis?.axis || {} } }
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
232
|
K ? /* @__PURE__ */ i.jsx(
|
|
@@ -234,7 +234,7 @@ function qt(ct) {
|
|
|
234
234
|
{
|
|
235
235
|
x: x + h.right - 15,
|
|
236
236
|
y: r / 2,
|
|
237
|
-
style: { fill:
|
|
237
|
+
style: { fill: a[1], ...o?.yAxis?.title || {} },
|
|
238
238
|
className: n?.yAxis?.title,
|
|
239
239
|
text: u[1].length > 100 ? `${u[1].substring(0, 100)}...` : u[1],
|
|
240
240
|
rotate90: !0
|
|
@@ -243,26 +243,26 @@ function qt(ct) {
|
|
|
243
243
|
] }),
|
|
244
244
|
/* @__PURE__ */ i.jsxs("g", { children: [
|
|
245
245
|
/* @__PURE__ */ i.jsx(
|
|
246
|
-
|
|
246
|
+
ft,
|
|
247
247
|
{
|
|
248
248
|
y1: r,
|
|
249
249
|
y2: r,
|
|
250
250
|
x1: -15,
|
|
251
251
|
x2: x + 15,
|
|
252
252
|
classNames: { axis: n?.xAxis?.axis },
|
|
253
|
-
styles: { axis:
|
|
253
|
+
styles: { axis: o?.xAxis?.axis }
|
|
254
254
|
}
|
|
255
255
|
),
|
|
256
256
|
/* @__PURE__ */ i.jsx(
|
|
257
257
|
Vt,
|
|
258
258
|
{
|
|
259
|
-
values: wt.map((t) => $t(t,
|
|
259
|
+
values: wt.map((t) => $t(t, g)),
|
|
260
260
|
x: wt.map((t) => m(t)),
|
|
261
261
|
y1: 0,
|
|
262
262
|
y2: r,
|
|
263
263
|
styles: {
|
|
264
|
-
gridLines:
|
|
265
|
-
labels:
|
|
264
|
+
gridLines: o?.xAxis?.gridLines,
|
|
265
|
+
labels: o?.xAxis?.labels
|
|
266
266
|
},
|
|
267
267
|
classNames: {
|
|
268
268
|
gridLines: k("opacity-0", n?.xAxis?.gridLines),
|
|
@@ -283,17 +283,17 @@ function qt(ct) {
|
|
|
283
283
|
N.path,
|
|
284
284
|
{
|
|
285
285
|
style: {
|
|
286
|
-
stroke:
|
|
286
|
+
stroke: a[0],
|
|
287
287
|
strokeWidth: U,
|
|
288
288
|
fill: "none"
|
|
289
289
|
},
|
|
290
|
-
exit: { opacity: 0, transition: { duration:
|
|
290
|
+
exit: { opacity: 0, transition: { duration: s.duration } },
|
|
291
291
|
variants: {
|
|
292
292
|
initial: {
|
|
293
293
|
pathLength: 0,
|
|
294
294
|
d: vt(
|
|
295
295
|
e.filter(
|
|
296
|
-
(t) => !
|
|
296
|
+
(t) => !f(t.y1)
|
|
297
297
|
)
|
|
298
298
|
) || "",
|
|
299
299
|
opacity: 1
|
|
@@ -302,11 +302,11 @@ function qt(ct) {
|
|
|
302
302
|
pathLength: 1,
|
|
303
303
|
d: vt(
|
|
304
304
|
e.filter(
|
|
305
|
-
(t) => !
|
|
305
|
+
(t) => !f(t.y1)
|
|
306
306
|
)
|
|
307
307
|
) || "",
|
|
308
308
|
opacity: 1,
|
|
309
|
-
transition: { duration:
|
|
309
|
+
transition: { duration: s.duration }
|
|
310
310
|
}
|
|
311
311
|
},
|
|
312
312
|
initial: "initial",
|
|
@@ -318,21 +318,21 @@ function qt(ct) {
|
|
|
318
318
|
{
|
|
319
319
|
d: ut(
|
|
320
320
|
e.filter(
|
|
321
|
-
(t) => !
|
|
321
|
+
(t) => !f(t.y2)
|
|
322
322
|
)
|
|
323
323
|
) || "",
|
|
324
324
|
style: {
|
|
325
|
-
stroke:
|
|
325
|
+
stroke: a[1],
|
|
326
326
|
strokeWidth: U,
|
|
327
327
|
fill: "none"
|
|
328
328
|
},
|
|
329
|
-
exit: { opacity: 0, transition: { duration:
|
|
329
|
+
exit: { opacity: 0, transition: { duration: s.duration } },
|
|
330
330
|
variants: {
|
|
331
331
|
initial: {
|
|
332
332
|
pathLength: 0,
|
|
333
333
|
d: ut(
|
|
334
334
|
e.filter(
|
|
335
|
-
(t) => !
|
|
335
|
+
(t) => !f(t.y2)
|
|
336
336
|
)
|
|
337
337
|
) || "",
|
|
338
338
|
opacity: 1
|
|
@@ -341,11 +341,11 @@ function qt(ct) {
|
|
|
341
341
|
pathLength: 1,
|
|
342
342
|
d: ut(
|
|
343
343
|
e.filter(
|
|
344
|
-
(t) => !
|
|
344
|
+
(t) => !f(t.y2)
|
|
345
345
|
)
|
|
346
346
|
) || "",
|
|
347
347
|
opacity: 1,
|
|
348
|
-
transition: { duration:
|
|
348
|
+
transition: { duration: s.duration }
|
|
349
349
|
}
|
|
350
350
|
},
|
|
351
351
|
initial: "initial",
|
|
@@ -363,25 +363,30 @@ function qt(ct) {
|
|
|
363
363
|
"undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",
|
|
364
364
|
n?.mouseOverLine
|
|
365
365
|
),
|
|
366
|
-
style:
|
|
366
|
+
style: o?.mouseOverLine
|
|
367
367
|
}
|
|
368
368
|
) : null
|
|
369
369
|
] }),
|
|
370
370
|
/* @__PURE__ */ i.jsx("g", { children: e.map((t, T) => /* @__PURE__ */ i.jsxs(N.g, { children: [
|
|
371
|
-
|
|
371
|
+
f(t.y1) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
372
372
|
X ? /* @__PURE__ */ i.jsx(
|
|
373
373
|
N.circle,
|
|
374
374
|
{
|
|
375
375
|
r: x / e.length < 5 ? 0 : x / e.length < 20 ? 2 : 4,
|
|
376
|
-
|
|
377
|
-
exit: { opacity: 0, transition: { duration: a.duration } },
|
|
376
|
+
exit: { opacity: 0, transition: { duration: s.duration } },
|
|
378
377
|
variants: {
|
|
379
|
-
initial: {
|
|
378
|
+
initial: {
|
|
379
|
+
opacity: 0,
|
|
380
|
+
cx: m(t.date),
|
|
381
|
+
cy: I(t.y1),
|
|
382
|
+
fill: a[0]
|
|
383
|
+
},
|
|
380
384
|
whileInView: {
|
|
381
385
|
opacity: 1,
|
|
386
|
+
fill: a[0],
|
|
382
387
|
transition: {
|
|
383
|
-
duration: d ?
|
|
384
|
-
delay: d ? 0 :
|
|
388
|
+
duration: d ? s.duration : 0.5,
|
|
389
|
+
delay: d ? 0 : s.duration
|
|
385
390
|
},
|
|
386
391
|
cx: m(t.date),
|
|
387
392
|
cy: I(t.y1)
|
|
@@ -394,32 +399,37 @@ function qt(ct) {
|
|
|
394
399
|
R ? /* @__PURE__ */ i.jsx(
|
|
395
400
|
N.text,
|
|
396
401
|
{
|
|
397
|
-
dy:
|
|
402
|
+
dy: f(t.y2) || t.y2 < t.y1 ? -8 : "1em",
|
|
398
403
|
style: {
|
|
399
|
-
fill: s[0],
|
|
400
404
|
textAnchor: "middle",
|
|
401
|
-
...
|
|
405
|
+
...o?.graphObjectValues || {}
|
|
402
406
|
},
|
|
403
407
|
className: k(
|
|
404
408
|
"graph-value graph-value-line-1 text-xs font-bold",
|
|
405
409
|
n?.graphObjectValues
|
|
406
410
|
),
|
|
407
|
-
exit: { opacity: 0, transition: { duration:
|
|
411
|
+
exit: { opacity: 0, transition: { duration: s.duration } },
|
|
408
412
|
variants: {
|
|
409
|
-
initial: {
|
|
413
|
+
initial: {
|
|
414
|
+
opacity: 0,
|
|
415
|
+
x: m(t.date),
|
|
416
|
+
y: p(t.y1),
|
|
417
|
+
fill: a[0]
|
|
418
|
+
},
|
|
410
419
|
whileInView: {
|
|
411
420
|
opacity: 1,
|
|
412
421
|
x: m(t.date),
|
|
422
|
+
fill: a[0],
|
|
413
423
|
y: p(t.y1),
|
|
414
424
|
transition: {
|
|
415
|
-
duration: d ?
|
|
416
|
-
delay: d ? 0 :
|
|
425
|
+
duration: d ? s.duration : 0.5,
|
|
426
|
+
delay: d ? 0 : s.duration
|
|
417
427
|
}
|
|
418
428
|
}
|
|
419
429
|
},
|
|
420
430
|
initial: "initial",
|
|
421
431
|
animate: y ? "whileInView" : "initial",
|
|
422
|
-
children:
|
|
432
|
+
children: lt(
|
|
423
433
|
t.y1,
|
|
424
434
|
"NA",
|
|
425
435
|
b,
|
|
@@ -429,21 +439,26 @@ function qt(ct) {
|
|
|
429
439
|
}
|
|
430
440
|
) : null
|
|
431
441
|
] }),
|
|
432
|
-
|
|
442
|
+
f(t.y2) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
433
443
|
X ? /* @__PURE__ */ i.jsx(
|
|
434
444
|
N.circle,
|
|
435
445
|
{
|
|
436
446
|
r: x / e.length < 5 ? 0 : x / e.length < 20 ? 2 : 4,
|
|
437
|
-
|
|
438
|
-
exit: { opacity: 0, transition: { duration: a.duration } },
|
|
447
|
+
exit: { opacity: 0, transition: { duration: s.duration } },
|
|
439
448
|
variants: {
|
|
440
|
-
initial: {
|
|
449
|
+
initial: {
|
|
450
|
+
opacity: 0,
|
|
451
|
+
cx: m(t.date),
|
|
452
|
+
cy: p(t.y2),
|
|
453
|
+
fill: a[1]
|
|
454
|
+
},
|
|
441
455
|
whileInView: {
|
|
442
456
|
opacity: 1,
|
|
443
457
|
transition: {
|
|
444
|
-
duration: d ?
|
|
445
|
-
delay: d ? 0 :
|
|
458
|
+
duration: d ? s.duration : 0.5,
|
|
459
|
+
delay: d ? 0 : s.duration
|
|
446
460
|
},
|
|
461
|
+
fill: a[1],
|
|
447
462
|
cx: m(t.date),
|
|
448
463
|
cy: p(t.y2)
|
|
449
464
|
}
|
|
@@ -455,32 +470,37 @@ function qt(ct) {
|
|
|
455
470
|
R ? /* @__PURE__ */ i.jsx(
|
|
456
471
|
N.text,
|
|
457
472
|
{
|
|
458
|
-
dy:
|
|
473
|
+
dy: f(t.y1) || t.y1 < t.y2 ? -8 : "1em",
|
|
459
474
|
style: {
|
|
460
|
-
fill: s[1],
|
|
461
475
|
textAnchor: "middle",
|
|
462
|
-
...
|
|
476
|
+
...o?.graphObjectValues || {}
|
|
463
477
|
},
|
|
464
478
|
className: k(
|
|
465
479
|
"graph-value graph-value-line-2 text-xs font-bold",
|
|
466
480
|
n?.graphObjectValues
|
|
467
481
|
),
|
|
468
|
-
exit: { opacity: 0, transition: { duration:
|
|
482
|
+
exit: { opacity: 0, transition: { duration: s.duration } },
|
|
469
483
|
variants: {
|
|
470
|
-
initial: {
|
|
484
|
+
initial: {
|
|
485
|
+
opacity: 0,
|
|
486
|
+
x: m(t.date),
|
|
487
|
+
y: p(t.y2),
|
|
488
|
+
fill: a[1]
|
|
489
|
+
},
|
|
471
490
|
whileInView: {
|
|
472
491
|
opacity: 1,
|
|
473
492
|
x: m(t.date),
|
|
474
493
|
y: p(t.y2),
|
|
494
|
+
fill: a[1],
|
|
475
495
|
transition: {
|
|
476
|
-
duration: d ?
|
|
477
|
-
delay: d ? 0 :
|
|
496
|
+
duration: d ? s.duration : 0.5,
|
|
497
|
+
delay: d ? 0 : s.duration
|
|
478
498
|
}
|
|
479
499
|
}
|
|
480
500
|
},
|
|
481
501
|
initial: "initial",
|
|
482
502
|
animate: y ? "whileInView" : "initial",
|
|
483
|
-
children:
|
|
503
|
+
children: lt(
|
|
484
504
|
t.y2,
|
|
485
505
|
"NA",
|
|
486
506
|
b,
|
|
@@ -514,7 +534,7 @@ function qt(ct) {
|
|
|
514
534
|
body: v,
|
|
515
535
|
xPos: tt,
|
|
516
536
|
yPos: et,
|
|
517
|
-
backgroundStyle:
|
|
537
|
+
backgroundStyle: o?.tooltip,
|
|
518
538
|
className: n?.tooltip
|
|
519
539
|
}
|
|
520
540
|
) : null
|
|
@@ -525,10 +545,10 @@ function wi(ct) {
|
|
|
525
545
|
data: L,
|
|
526
546
|
graphTitle: A,
|
|
527
547
|
sources: V,
|
|
528
|
-
graphDescription:
|
|
548
|
+
graphDescription: a,
|
|
529
549
|
height: u,
|
|
530
|
-
width:
|
|
531
|
-
footNote:
|
|
550
|
+
width: l,
|
|
551
|
+
footNote: g,
|
|
532
552
|
noOfXTicks: R = 10,
|
|
533
553
|
dateFormat: mt = "yyyy",
|
|
534
554
|
showValues: xt = !1,
|
|
@@ -541,7 +561,7 @@ function wi(ct) {
|
|
|
541
561
|
backgroundColor: v = !1,
|
|
542
562
|
leftMargin: yt = 80,
|
|
543
563
|
rightMargin: W = 80,
|
|
544
|
-
topMargin:
|
|
564
|
+
topMargin: s = 20,
|
|
545
565
|
bottomMargin: U = 25,
|
|
546
566
|
labels: X,
|
|
547
567
|
lineSuffixes: q = ["", ""],
|
|
@@ -550,7 +570,7 @@ function wi(ct) {
|
|
|
550
570
|
highlightAreaSettings: J = [],
|
|
551
571
|
relativeHeight: D,
|
|
552
572
|
onSeriesMouseOver: C,
|
|
553
|
-
graphID:
|
|
573
|
+
graphID: o,
|
|
554
574
|
graphDownload: n = !1,
|
|
555
575
|
dataDownload: b = !1,
|
|
556
576
|
animate: E = !1,
|
|
@@ -571,39 +591,39 @@ function wi(ct) {
|
|
|
571
591
|
precision: e = 2,
|
|
572
592
|
customLayers: dt = [],
|
|
573
593
|
showAxisLabels: x = !0
|
|
574
|
-
} = ct, [r, st] = P(0), [nt, H] = P(0), j =
|
|
575
|
-
return
|
|
594
|
+
} = ct, [r, st] = P(0), [nt, H] = P(0), j = ot(null), $ = ot(null);
|
|
595
|
+
return gt(() => {
|
|
576
596
|
const c = new ResizeObserver((Y) => {
|
|
577
|
-
st(
|
|
597
|
+
st(l || Y[0].target.clientWidth || 620), H(u || Y[0].target.clientHeight || 480);
|
|
578
598
|
});
|
|
579
|
-
return j.current && (H(j.current.clientHeight || 480), st(j.current.clientWidth || 620),
|
|
580
|
-
}, [
|
|
599
|
+
return j.current && (H(j.current.clientHeight || 480), st(j.current.clientWidth || 620), l || c.observe(j.current)), () => c.disconnect();
|
|
600
|
+
}, [l, u]), /* @__PURE__ */ i.jsx(
|
|
581
601
|
"div",
|
|
582
602
|
{
|
|
583
|
-
className: `${M || "light"} flex ${
|
|
603
|
+
className: `${M || "light"} flex ${l ? "w-fit grow-0" : "w-full grow"}`,
|
|
584
604
|
dir: y === "he" || y === "ar" ? "rtl" : void 0,
|
|
585
605
|
children: /* @__PURE__ */ i.jsx(
|
|
586
606
|
"div",
|
|
587
607
|
{
|
|
588
608
|
className: k(
|
|
589
609
|
`${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"}`,
|
|
590
|
-
|
|
610
|
+
l ? "w-fit" : "w-full",
|
|
591
611
|
w?.graphContainer
|
|
592
612
|
),
|
|
593
613
|
style: {
|
|
594
614
|
...h?.graphContainer || {},
|
|
595
615
|
...v && v !== !0 ? { backgroundColor: v } : {}
|
|
596
616
|
},
|
|
597
|
-
id:
|
|
617
|
+
id: o,
|
|
598
618
|
ref: $,
|
|
599
|
-
"aria-label": _ || `${A ? `The graph shows ${A}. ` : ""}This is a line chart that show trends for two datasets over time.${
|
|
619
|
+
"aria-label": _ || `${A ? `The graph shows ${A}. ` : ""}This is a line chart that show trends for two datasets over time.${a ? ` ${a}` : ""}`,
|
|
600
620
|
children: /* @__PURE__ */ i.jsx(
|
|
601
621
|
"div",
|
|
602
622
|
{
|
|
603
623
|
className: "flex grow",
|
|
604
624
|
style: { padding: v ? B || "1rem" : B || 0 },
|
|
605
625
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
606
|
-
A ||
|
|
626
|
+
A || a || n || b ? /* @__PURE__ */ i.jsx(
|
|
607
627
|
Bt,
|
|
608
628
|
{
|
|
609
629
|
styles: {
|
|
@@ -615,8 +635,8 @@ function wi(ct) {
|
|
|
615
635
|
description: w?.description
|
|
616
636
|
},
|
|
617
637
|
graphTitle: A,
|
|
618
|
-
graphDescription:
|
|
619
|
-
width:
|
|
638
|
+
graphDescription: a,
|
|
639
|
+
width: l,
|
|
620
640
|
graphDownload: n ? $.current : void 0,
|
|
621
641
|
dataDownload: b ? L.map((c) => c.data).filter((c) => c !== void 0).length > 0 ? L.map((c) => c.data).filter((c) => c !== void 0) : L.filter((c) => c !== void 0) : null
|
|
622
642
|
}
|
|
@@ -637,23 +657,23 @@ function wi(ct) {
|
|
|
637
657
|
className: "flex flex-col grow justify-center leading-0",
|
|
638
658
|
ref: j,
|
|
639
659
|
"aria-label": "Graph area",
|
|
640
|
-
children: (
|
|
660
|
+
children: (l || r) && (u || nt) ? /* @__PURE__ */ i.jsx(
|
|
641
661
|
qt,
|
|
642
662
|
{
|
|
643
663
|
data: L,
|
|
644
664
|
sameAxes: ht,
|
|
645
665
|
lineColors: z,
|
|
646
|
-
width:
|
|
666
|
+
width: l || r,
|
|
647
667
|
height: Math.max(
|
|
648
668
|
F,
|
|
649
|
-
u || (D ? F ? (
|
|
669
|
+
u || (D ? F ? (l || r) * D > F ? (l || r) * D : F : (l || r) * D : nt)
|
|
650
670
|
),
|
|
651
671
|
dateFormat: mt,
|
|
652
672
|
showValues: xt,
|
|
653
673
|
noOfXTicks: R,
|
|
654
674
|
leftMargin: yt,
|
|
655
675
|
rightMargin: W,
|
|
656
|
-
topMargin:
|
|
676
|
+
topMargin: s,
|
|
657
677
|
bottomMargin: U,
|
|
658
678
|
labels: X,
|
|
659
679
|
highlightAreaSettings: J,
|
|
@@ -678,7 +698,7 @@ function wi(ct) {
|
|
|
678
698
|
}
|
|
679
699
|
)
|
|
680
700
|
] }) }),
|
|
681
|
-
V ||
|
|
701
|
+
V || g ? /* @__PURE__ */ i.jsx(
|
|
682
702
|
Rt,
|
|
683
703
|
{
|
|
684
704
|
styles: { footnote: h?.footnote, source: h?.source },
|
|
@@ -687,8 +707,8 @@ function wi(ct) {
|
|
|
687
707
|
source: w?.source
|
|
688
708
|
},
|
|
689
709
|
sources: V,
|
|
690
|
-
footNote:
|
|
691
|
-
width:
|
|
710
|
+
footNote: g,
|
|
711
|
+
width: l
|
|
692
712
|
}
|
|
693
713
|
) : null
|
|
694
714
|
] })
|