@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
package/dist/RadarChart.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { j as n, m as
|
|
1
|
+
import { j as n, m as L } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useRef as ut, useState as j, useEffect as kt } from "react";
|
|
3
|
-
import { i as
|
|
4
|
-
import { X as
|
|
3
|
+
import { i as It } from "./index-Bwrro8-q.js";
|
|
4
|
+
import { X as jt } from "./Modal-DVVwpKhP.js";
|
|
5
5
|
import { T as Ct } from "./Tooltip-CVCGWyzw.js";
|
|
6
|
-
import { Colors as
|
|
7
|
-
import { n as
|
|
8
|
-
import { s as
|
|
9
|
-
import { c as
|
|
6
|
+
import { Colors as v } from "./Colors.js";
|
|
7
|
+
import { n as ft } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
|
+
import { s as Pt } from "./string2HTML-oFCROsus.js";
|
|
9
|
+
import { c as T } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
10
10
|
import { a as xt } from "./linear-DUdu7l2G.js";
|
|
11
|
-
import { c as
|
|
12
|
-
import { u as
|
|
13
|
-
import { m as
|
|
11
|
+
import { c as Nt, l as Ot } from "./line-CPfhohvF.js";
|
|
12
|
+
import { u as St } from "./use-in-view-yS6jzJAp.js";
|
|
13
|
+
import { m as Y } from "./proxy-CkpFesk1.js";
|
|
14
14
|
import { A as Tt } from "./index-CNvov0eg.js";
|
|
15
15
|
import { GraphFooter as $t } from "./GraphFooter.js";
|
|
16
16
|
import { GraphHeader as Dt } from "./GraphHeader.js";
|
|
17
17
|
import { E as Vt } from "./EmptyState-DdTp-Mdn.js";
|
|
18
|
-
import { ColorLegendWithMouseOver as
|
|
19
|
-
import { u as
|
|
20
|
-
var
|
|
18
|
+
import { ColorLegendWithMouseOver as At } from "./ColorLegendWithMouseOver.js";
|
|
19
|
+
import { u as pt } from "./uniqBy-BHy4I8PK.js";
|
|
20
|
+
var Et = _t(Nt);
|
|
21
21
|
function gt(t) {
|
|
22
22
|
this._curve = t;
|
|
23
23
|
}
|
|
@@ -44,16 +44,16 @@ function _t(t) {
|
|
|
44
44
|
}
|
|
45
45
|
return e._curve = t, e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Lt(t) {
|
|
48
48
|
var e = t.curve;
|
|
49
49
|
return t.angle = t.x, delete t.x, t.radius = t.y, delete t.y, t.curve = function(s) {
|
|
50
50
|
return arguments.length ? e(_t(s)) : e()._curve;
|
|
51
51
|
}, t;
|
|
52
52
|
}
|
|
53
53
|
function Ht() {
|
|
54
|
-
return
|
|
54
|
+
return Lt(Ot().curve(Et));
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function nt() {
|
|
57
57
|
}
|
|
58
58
|
function dt(t, e, s) {
|
|
59
59
|
t._context.bezierCurveTo(
|
|
@@ -108,19 +108,19 @@ yt.prototype = {
|
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
(function t(e) {
|
|
111
|
-
function s(
|
|
112
|
-
return new yt(
|
|
111
|
+
function s(o) {
|
|
112
|
+
return new yt(o, e);
|
|
113
113
|
}
|
|
114
|
-
return s.tension = function(
|
|
115
|
-
return t(+
|
|
114
|
+
return s.tension = function(o) {
|
|
115
|
+
return t(+o);
|
|
116
116
|
}, s;
|
|
117
117
|
})(0);
|
|
118
118
|
function vt(t, e) {
|
|
119
119
|
this._context = t, this._k = (1 - e) / 6;
|
|
120
120
|
}
|
|
121
121
|
vt.prototype = {
|
|
122
|
-
areaStart:
|
|
123
|
-
areaEnd:
|
|
122
|
+
areaStart: nt,
|
|
123
|
+
areaEnd: nt,
|
|
124
124
|
lineStart: function() {
|
|
125
125
|
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
|
|
126
126
|
},
|
|
@@ -159,19 +159,19 @@ vt.prototype = {
|
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
161
|
const Rt = function t(e) {
|
|
162
|
-
function s(
|
|
163
|
-
return new vt(
|
|
162
|
+
function s(o) {
|
|
163
|
+
return new vt(o, e);
|
|
164
164
|
}
|
|
165
|
-
return s.tension = function(
|
|
166
|
-
return t(+
|
|
165
|
+
return s.tension = function(o) {
|
|
166
|
+
return t(+o);
|
|
167
167
|
}, s;
|
|
168
168
|
}(0);
|
|
169
169
|
function Mt(t) {
|
|
170
170
|
this._context = t;
|
|
171
171
|
}
|
|
172
172
|
Mt.prototype = {
|
|
173
|
-
areaStart:
|
|
174
|
-
areaEnd:
|
|
173
|
+
areaStart: nt,
|
|
174
|
+
areaEnd: nt,
|
|
175
175
|
lineStart: function() {
|
|
176
176
|
this._point = 0;
|
|
177
177
|
},
|
|
@@ -189,83 +189,83 @@ function Ft(t) {
|
|
|
189
189
|
const {
|
|
190
190
|
data: e,
|
|
191
191
|
radius: s,
|
|
192
|
-
lineColors:
|
|
193
|
-
tooltip:
|
|
194
|
-
onSeriesMouseOver:
|
|
195
|
-
onSeriesMouseClick:
|
|
196
|
-
colorDomain:
|
|
197
|
-
detailsOnClick:
|
|
192
|
+
lineColors: o,
|
|
193
|
+
tooltip: C,
|
|
194
|
+
onSeriesMouseOver: H,
|
|
195
|
+
onSeriesMouseClick: M,
|
|
196
|
+
colorDomain: h,
|
|
197
|
+
detailsOnClick: w,
|
|
198
198
|
styles: _,
|
|
199
|
-
classNames:
|
|
200
|
-
selectedColor:
|
|
201
|
-
axisLabels:
|
|
202
|
-
strokeWidth:
|
|
199
|
+
classNames: f,
|
|
200
|
+
selectedColor: $,
|
|
201
|
+
axisLabels: z,
|
|
202
|
+
strokeWidth: q,
|
|
203
203
|
showValues: at,
|
|
204
|
-
showDots:
|
|
205
|
-
rightMargin:
|
|
206
|
-
topMargin:
|
|
207
|
-
bottomMargin:
|
|
208
|
-
leftMargin:
|
|
209
|
-
curveType:
|
|
210
|
-
noOfTicks:
|
|
211
|
-
minValue:
|
|
212
|
-
maxValue:
|
|
204
|
+
showDots: ot,
|
|
205
|
+
rightMargin: rt,
|
|
206
|
+
topMargin: B,
|
|
207
|
+
bottomMargin: st,
|
|
208
|
+
leftMargin: R,
|
|
209
|
+
curveType: U,
|
|
210
|
+
noOfTicks: J,
|
|
211
|
+
minValue: D,
|
|
212
|
+
maxValue: V,
|
|
213
213
|
resetSelectionOnDoubleClick: lt,
|
|
214
214
|
fillShape: c,
|
|
215
|
-
highlightedLines:
|
|
215
|
+
highlightedLines: p,
|
|
216
216
|
animate: d,
|
|
217
217
|
dimmedOpacity: g,
|
|
218
|
-
precision:
|
|
219
|
-
customLayers:
|
|
220
|
-
} = t,
|
|
218
|
+
precision: P,
|
|
219
|
+
customLayers: K
|
|
220
|
+
} = t, Q = ut(null), A = St(Q, {
|
|
221
221
|
once: d.once,
|
|
222
222
|
amount: d.amount
|
|
223
|
-
}),
|
|
224
|
-
top:
|
|
225
|
-
left:
|
|
223
|
+
}), b = U === "linear" ? Wt : Rt, k = {
|
|
224
|
+
top: B,
|
|
225
|
+
left: R
|
|
226
226
|
}, y = Math.min(
|
|
227
|
-
(2 * s -
|
|
228
|
-
(2 * s -
|
|
229
|
-
), [
|
|
227
|
+
(2 * s - R - rt) / 2,
|
|
228
|
+
(2 * s - B - st) / 2
|
|
229
|
+
), [I, W] = j(void 0), [N, F] = j(void 0), [Z, G] = j(void 0), [tt, X] = j(void 0), l = xt().domain([0, e[0].values.length]).range([0, 2 * Math.PI]), it = T(V) ? Math.max(
|
|
230
230
|
...e.map(
|
|
231
|
-
(i) => Math.max(...i.values.filter((a) => !
|
|
231
|
+
(i) => Math.max(...i.values.filter((a) => !T(a)))
|
|
232
232
|
)
|
|
233
233
|
) < 0 ? 0 : Math.max(
|
|
234
234
|
...e.map(
|
|
235
|
-
(i) => Math.max(...i.values.filter((a) => !
|
|
235
|
+
(i) => Math.max(...i.values.filter((a) => !T(a)))
|
|
236
236
|
)
|
|
237
|
-
) :
|
|
237
|
+
) : V, ct = T(D) ? Math.min(
|
|
238
238
|
...e.map(
|
|
239
|
-
(i) => Math.min(...i.values.filter((a) => !
|
|
239
|
+
(i) => Math.min(...i.values.filter((a) => !T(a)))
|
|
240
240
|
)
|
|
241
241
|
) >= 0 ? 0 : Math.min(
|
|
242
242
|
...e.map(
|
|
243
|
-
(i) => Math.min(...i.values.filter((a) => !
|
|
243
|
+
(i) => Math.min(...i.values.filter((a) => !T(a)))
|
|
244
244
|
)
|
|
245
|
-
) :
|
|
245
|
+
) : D, x = xt().domain([ct, it]).range([0, y]).nice(), ht = x.ticks(J), O = Ht().radius((i) => x(i)).angle((i, a) => l(a)).curve(b);
|
|
246
246
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
247
247
|
/* @__PURE__ */ n.jsx(
|
|
248
|
-
|
|
248
|
+
Y.svg,
|
|
249
249
|
{
|
|
250
250
|
width: `${s * 2}px`,
|
|
251
251
|
height: `${s * 2}px`,
|
|
252
252
|
viewBox: `0 0 ${s * 2} ${s * 2}`,
|
|
253
253
|
direction: "ltr",
|
|
254
|
-
ref:
|
|
255
|
-
children: /* @__PURE__ */ n.jsxs("g", { transform: `translate(${
|
|
256
|
-
|
|
254
|
+
ref: Q,
|
|
255
|
+
children: /* @__PURE__ */ n.jsxs("g", { transform: `translate(${k.left},${k.top})`, children: [
|
|
256
|
+
K.filter((i) => i.position === "before").map((i) => i.layer),
|
|
257
257
|
/* @__PURE__ */ n.jsxs("g", { transform: `translate(${y},${y})`, children: [
|
|
258
|
-
|
|
258
|
+
z.map((i, a) => /* @__PURE__ */ n.jsxs("g", { children: [
|
|
259
259
|
/* @__PURE__ */ n.jsx(
|
|
260
260
|
"line",
|
|
261
261
|
{
|
|
262
262
|
x1: 0,
|
|
263
263
|
y1: 0,
|
|
264
|
-
x2: Math.cos(
|
|
265
|
-
y2: Math.sin(
|
|
266
|
-
className:
|
|
264
|
+
x2: Math.cos(l(a) - Math.PI / 2) * y,
|
|
265
|
+
y2: Math.sin(l(a) - Math.PI / 2) * y,
|
|
266
|
+
className: L(
|
|
267
267
|
"stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",
|
|
268
|
-
|
|
268
|
+
f?.xAxis?.axis
|
|
269
269
|
),
|
|
270
270
|
style: _?.xAxis?.axis
|
|
271
271
|
},
|
|
@@ -274,16 +274,16 @@ function Ft(t) {
|
|
|
274
274
|
/* @__PURE__ */ n.jsx(
|
|
275
275
|
"text",
|
|
276
276
|
{
|
|
277
|
-
x: Math.cos(
|
|
278
|
-
y: Math.sin(
|
|
277
|
+
x: Math.cos(l(a) - Math.PI / 2) * (y + 6),
|
|
278
|
+
y: Math.sin(l(a) - Math.PI / 2) * (y + 6),
|
|
279
279
|
style: {
|
|
280
|
-
textAnchor: Math.cos(
|
|
280
|
+
textAnchor: Math.cos(l(a) - Math.PI / 2) < 0 ? "end" : Math.cos(l(a) - Math.PI / 2) < 1e-5 ? "middle" : "start",
|
|
281
281
|
..._?.xAxis?.labels || ""
|
|
282
282
|
},
|
|
283
|
-
dy: Math.sin(
|
|
284
|
-
className:
|
|
283
|
+
dy: Math.sin(l(a) - Math.PI / 2) < 0 ? 0 : Math.sin(l(a) - Math.PI / 2) < 1e-5 ? 5 : 10,
|
|
284
|
+
className: L(
|
|
285
285
|
"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",
|
|
286
|
-
|
|
286
|
+
f?.xAxis?.labels
|
|
287
287
|
),
|
|
288
288
|
children: i
|
|
289
289
|
}
|
|
@@ -293,10 +293,10 @@ function Ft(t) {
|
|
|
293
293
|
/* @__PURE__ */ n.jsx(
|
|
294
294
|
"path",
|
|
295
295
|
{
|
|
296
|
-
d:
|
|
297
|
-
className:
|
|
296
|
+
d: O(Array(z.length).fill(i)) || "",
|
|
297
|
+
className: L(
|
|
298
298
|
"stroke-primary-gray-500 dark:stroke-primary-gray-550",
|
|
299
|
-
|
|
299
|
+
f?.xAxis?.gridLines
|
|
300
300
|
),
|
|
301
301
|
style: {
|
|
302
302
|
..._?.xAxis?.gridLines,
|
|
@@ -308,159 +308,171 @@ function Ft(t) {
|
|
|
308
308
|
"foreignObject",
|
|
309
309
|
{
|
|
310
310
|
x: -25,
|
|
311
|
-
y: Math.sin(-Math.PI / 2) *
|
|
311
|
+
y: Math.sin(-Math.PI / 2) * x(i) > -1e-4 ? Math.sin(-Math.PI / 2) * x(i) - 7 : Math.sin(-Math.PI / 2) * x(i) - 5,
|
|
312
312
|
width: 50,
|
|
313
313
|
height: 12,
|
|
314
314
|
children: /* @__PURE__ */ n.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ n.jsx(
|
|
315
315
|
"p",
|
|
316
316
|
{
|
|
317
|
-
className:
|
|
317
|
+
className: L(
|
|
318
318
|
"fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",
|
|
319
|
-
|
|
319
|
+
f?.xAxis?.labels
|
|
320
320
|
),
|
|
321
321
|
style: _?.xAxis?.labels,
|
|
322
|
-
children:
|
|
322
|
+
children: ft(i, "NA", P)
|
|
323
323
|
}
|
|
324
324
|
) })
|
|
325
325
|
}
|
|
326
326
|
)
|
|
327
327
|
] }, a)),
|
|
328
328
|
/* @__PURE__ */ n.jsx(Tt, { children: e.map((i, a) => /* @__PURE__ */ n.jsxs(
|
|
329
|
-
|
|
329
|
+
Y.g,
|
|
330
330
|
{
|
|
331
331
|
variants: {
|
|
332
332
|
initial: {
|
|
333
|
-
opacity:
|
|
333
|
+
opacity: I ? i.label === I.label ? 1 : g : $ ? i.color && o[h.indexOf(i.color)] === $ ? 1 : g : p.length !== 0 ? i.label && p.indexOf(i.label) !== -1 ? 1 : 0.3 : 1
|
|
334
334
|
},
|
|
335
335
|
whileInView: {
|
|
336
|
-
opacity:
|
|
336
|
+
opacity: I ? i.label === I.label ? 1 : g : $ ? i.color && o[h.indexOf(i.color)] === $ ? 1 : g : p.length !== 0 ? i.label && p.indexOf(i.label) !== -1 ? 1 : g : 1,
|
|
337
337
|
transition: { duration: d.duration }
|
|
338
338
|
}
|
|
339
339
|
},
|
|
340
340
|
initial: "initial",
|
|
341
|
-
animate:
|
|
341
|
+
animate: A ? "whileInView" : "initial",
|
|
342
342
|
exit: { opacity: 0, transition: { duration: d.duration } },
|
|
343
|
-
onMouseEnter: (
|
|
344
|
-
|
|
343
|
+
onMouseEnter: (r) => {
|
|
344
|
+
W(i), X(r.clientY), G(r.clientX), H?.(i);
|
|
345
345
|
},
|
|
346
|
-
onMouseMove: (
|
|
347
|
-
|
|
346
|
+
onMouseMove: (r) => {
|
|
347
|
+
W(i), X(r.clientY), G(r.clientX);
|
|
348
348
|
},
|
|
349
349
|
onMouseLeave: () => {
|
|
350
|
-
|
|
350
|
+
W(void 0), G(void 0), X(void 0), H?.(void 0);
|
|
351
351
|
},
|
|
352
352
|
onClick: () => {
|
|
353
|
-
(
|
|
353
|
+
(M || w) && (It(N, i) && lt ? (F(void 0), M?.(void 0)) : (F(i), M?.(i)));
|
|
354
354
|
},
|
|
355
355
|
children: [
|
|
356
356
|
/* @__PURE__ */ n.jsx(
|
|
357
|
-
|
|
357
|
+
Y.path,
|
|
358
358
|
{
|
|
359
|
-
d:
|
|
359
|
+
d: O(i.values) || "",
|
|
360
360
|
variants: {
|
|
361
|
-
initial: {
|
|
361
|
+
initial: {
|
|
362
|
+
d: O(i.values.map((r) => 0)) || "",
|
|
363
|
+
stroke: e.filter((r) => r.color).length === 0 ? o[0] : i.color ? o[h.indexOf(i.color)] : v.gray,
|
|
364
|
+
fill: c ? e.filter((r) => r.color).length === 0 ? o[0] : i.color ? o[h.indexOf(i.color)] : v.gray : "none",
|
|
365
|
+
strokeWidth: q
|
|
366
|
+
},
|
|
362
367
|
whileInView: {
|
|
363
|
-
d:
|
|
364
|
-
transition: { duration: d.duration }
|
|
368
|
+
d: O(i.values) || "",
|
|
369
|
+
transition: { duration: d.duration },
|
|
370
|
+
stroke: e.filter((r) => r.color).length === 0 ? o[0] : i.color ? o[h.indexOf(i.color)] : v.gray,
|
|
371
|
+
fill: c ? e.filter((r) => r.color).length === 0 ? o[0] : i.color ? o[h.indexOf(i.color)] : v.gray : "none",
|
|
372
|
+
strokeWidth: q
|
|
365
373
|
}
|
|
366
374
|
},
|
|
367
375
|
initial: "initial",
|
|
368
|
-
animate:
|
|
376
|
+
animate: A ? "whileInView" : "initial",
|
|
369
377
|
exit: { opacity: 0, transition: { duration: d.duration } },
|
|
370
378
|
style: {
|
|
371
|
-
|
|
372
|
-
fill: c ? e.filter((o) => o.color).length === 0 ? l[0] : i.color ? l[u.indexOf(i.color)] : L.gray : "none",
|
|
373
|
-
fillOpacity: 0.1,
|
|
374
|
-
strokeWidth: nt
|
|
379
|
+
fillOpacity: 0.1
|
|
375
380
|
}
|
|
376
381
|
}
|
|
377
382
|
),
|
|
378
|
-
/* @__PURE__ */ n.jsx("g", { children: i.values.map((
|
|
379
|
-
|
|
380
|
-
|
|
383
|
+
/* @__PURE__ */ n.jsx("g", { children: i.values.map((r, m) => /* @__PURE__ */ n.jsx("g", { children: T(r) ? null : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
384
|
+
ot ? /* @__PURE__ */ n.jsx(
|
|
385
|
+
Y.circle,
|
|
381
386
|
{
|
|
382
|
-
cx: Math.cos(r(x) - Math.PI / 2) * p(o),
|
|
383
|
-
cy: Math.sin(r(x) - Math.PI / 2) * p(o),
|
|
384
387
|
r: 4,
|
|
385
|
-
style: {
|
|
386
|
-
fill: e.filter((tt) => tt.color).length === 0 ? l[0] : i.color ? l[u.indexOf(i.color)] : L.gray
|
|
387
|
-
},
|
|
388
388
|
variants: {
|
|
389
|
-
initial: {
|
|
389
|
+
initial: {
|
|
390
|
+
cx: 0,
|
|
391
|
+
cy: 0,
|
|
392
|
+
opacity: 0,
|
|
393
|
+
fill: e.filter((E) => E.color).length === 0 ? o[0] : i.color ? o[h.indexOf(i.color)] : v.gray
|
|
394
|
+
},
|
|
390
395
|
whileInView: {
|
|
391
|
-
cx: Math.cos(
|
|
392
|
-
cy: Math.sin(
|
|
396
|
+
cx: Math.cos(l(m) - Math.PI / 2) * x(r),
|
|
397
|
+
cy: Math.sin(l(m) - Math.PI / 2) * x(r),
|
|
393
398
|
opacity: 1,
|
|
394
|
-
transition: { duration: d.duration }
|
|
399
|
+
transition: { duration: d.duration },
|
|
400
|
+
fill: e.filter((E) => E.color).length === 0 ? o[0] : i.color ? o[h.indexOf(i.color)] : v.gray
|
|
395
401
|
}
|
|
396
402
|
},
|
|
397
403
|
initial: "initial",
|
|
398
|
-
animate:
|
|
404
|
+
animate: A ? "whileInView" : "initial",
|
|
399
405
|
exit: { opacity: 0, transition: { duration: d.duration } }
|
|
400
406
|
}
|
|
401
407
|
) : null,
|
|
402
408
|
at ? /* @__PURE__ */ n.jsx(
|
|
403
|
-
|
|
409
|
+
Y.text,
|
|
404
410
|
{
|
|
405
|
-
x: Math.cos(r(x) - Math.PI / 2) * (p(o) + 6),
|
|
406
|
-
y: Math.sin(r(x) - Math.PI / 2) * (p(o) + 6),
|
|
407
411
|
style: {
|
|
408
|
-
fill: l[a],
|
|
409
|
-
textAnchor: Math.cos(r(x) - Math.PI / 2) < 0 ? "end" : Math.cos(r(x) - Math.PI / 2) < 1e-5 ? "middle" : "start",
|
|
410
412
|
..._?.graphObjectValues || {}
|
|
411
413
|
},
|
|
412
|
-
dy: Math.sin(
|
|
413
|
-
className:
|
|
414
|
+
dy: Math.sin(l(m) - Math.PI / 2) < 0 ? 10 : (Math.sin(l(m) - Math.PI / 2) < 1e-5, 0),
|
|
415
|
+
className: L(
|
|
414
416
|
"graph-value text-xs font-bold",
|
|
415
|
-
|
|
417
|
+
f?.graphObjectValues
|
|
416
418
|
),
|
|
417
419
|
variants: {
|
|
418
|
-
initial: {
|
|
420
|
+
initial: {
|
|
421
|
+
opacity: 0,
|
|
422
|
+
x: Math.cos(l(m) - Math.PI / 2) * (x(r) + 6),
|
|
423
|
+
y: Math.sin(l(m) - Math.PI / 2) * (x(r) + 6),
|
|
424
|
+
fill: o[a],
|
|
425
|
+
textAnchor: Math.cos(l(m) - Math.PI / 2) < 0 ? "end" : Math.cos(l(m) - Math.PI / 2) < 1e-5 ? "middle" : "start"
|
|
426
|
+
},
|
|
419
427
|
whileInView: {
|
|
420
428
|
opacity: 1,
|
|
429
|
+
x: Math.cos(l(m) - Math.PI / 2) * (x(r) + 6),
|
|
430
|
+
y: Math.sin(l(m) - Math.PI / 2) * (x(r) + 6),
|
|
431
|
+
fill: o[a],
|
|
432
|
+
textAnchor: Math.cos(l(m) - Math.PI / 2) < 0 ? "end" : Math.cos(l(m) - Math.PI / 2) < 1e-5 ? "middle" : "start",
|
|
421
433
|
transition: { duration: d.duration }
|
|
422
434
|
}
|
|
423
435
|
},
|
|
424
436
|
initial: "initial",
|
|
425
|
-
animate:
|
|
437
|
+
animate: A ? "whileInView" : "initial",
|
|
426
438
|
exit: { opacity: 0, transition: { duration: d.duration } },
|
|
427
|
-
children:
|
|
439
|
+
children: ft(r, "NA", P)
|
|
428
440
|
}
|
|
429
441
|
) : null
|
|
430
|
-
] }) },
|
|
442
|
+
] }) }, m)) })
|
|
431
443
|
]
|
|
432
444
|
},
|
|
433
445
|
i.label || a
|
|
434
446
|
)) })
|
|
435
447
|
] }),
|
|
436
|
-
|
|
448
|
+
K.filter((i) => i.position === "after").map((i) => i.layer)
|
|
437
449
|
] })
|
|
438
450
|
}
|
|
439
451
|
),
|
|
440
|
-
|
|
452
|
+
I && C && Z && tt ? /* @__PURE__ */ n.jsx(
|
|
441
453
|
Ct,
|
|
442
454
|
{
|
|
443
|
-
data:
|
|
444
|
-
body:
|
|
445
|
-
xPos:
|
|
446
|
-
yPos:
|
|
455
|
+
data: I,
|
|
456
|
+
body: C,
|
|
457
|
+
xPos: Z,
|
|
458
|
+
yPos: tt,
|
|
447
459
|
backgroundStyle: _?.tooltip,
|
|
448
|
-
className:
|
|
460
|
+
className: f?.tooltip
|
|
449
461
|
}
|
|
450
462
|
) : null,
|
|
451
|
-
|
|
452
|
-
|
|
463
|
+
w && N !== void 0 ? /* @__PURE__ */ n.jsx(
|
|
464
|
+
jt,
|
|
453
465
|
{
|
|
454
466
|
open: N !== void 0,
|
|
455
467
|
onClose: () => {
|
|
456
|
-
|
|
468
|
+
F(void 0);
|
|
457
469
|
},
|
|
458
470
|
children: /* @__PURE__ */ n.jsx(
|
|
459
471
|
"div",
|
|
460
472
|
{
|
|
461
473
|
className: "graph-modal-content m-0",
|
|
462
|
-
dangerouslySetInnerHTML: typeof
|
|
463
|
-
children: typeof
|
|
474
|
+
dangerouslySetInnerHTML: typeof w == "string" ? { __html: Pt(w, N) } : void 0,
|
|
475
|
+
children: typeof w == "function" ? w(N) : null
|
|
464
476
|
}
|
|
465
477
|
)
|
|
466
478
|
}
|
|
@@ -471,108 +483,108 @@ function li(t) {
|
|
|
471
483
|
const {
|
|
472
484
|
graphTitle: e,
|
|
473
485
|
colors: s,
|
|
474
|
-
sources:
|
|
475
|
-
graphDescription:
|
|
476
|
-
footNote:
|
|
477
|
-
radius:
|
|
478
|
-
data:
|
|
479
|
-
showColorScale:
|
|
486
|
+
sources: o,
|
|
487
|
+
graphDescription: C,
|
|
488
|
+
footNote: H,
|
|
489
|
+
radius: M,
|
|
490
|
+
data: h,
|
|
491
|
+
showColorScale: w = !0,
|
|
480
492
|
padding: _,
|
|
481
|
-
backgroundColor:
|
|
482
|
-
tooltip:
|
|
483
|
-
onSeriesMouseOver:
|
|
484
|
-
graphID:
|
|
493
|
+
backgroundColor: f = !1,
|
|
494
|
+
tooltip: $,
|
|
495
|
+
onSeriesMouseOver: z,
|
|
496
|
+
graphID: q,
|
|
485
497
|
onSeriesMouseClick: at,
|
|
486
|
-
topMargin:
|
|
487
|
-
bottomMargin:
|
|
488
|
-
leftMargin:
|
|
489
|
-
rightMargin:
|
|
490
|
-
graphDownload:
|
|
491
|
-
dataDownload:
|
|
492
|
-
colorDomain:
|
|
493
|
-
language:
|
|
494
|
-
theme:
|
|
498
|
+
topMargin: ot = 75,
|
|
499
|
+
bottomMargin: rt = 75,
|
|
500
|
+
leftMargin: B = 75,
|
|
501
|
+
rightMargin: st = 75,
|
|
502
|
+
graphDownload: R = !1,
|
|
503
|
+
dataDownload: U = !1,
|
|
504
|
+
colorDomain: J,
|
|
505
|
+
language: D = "en",
|
|
506
|
+
theme: V = "light",
|
|
495
507
|
highlightedLines: lt = [],
|
|
496
508
|
width: c,
|
|
497
|
-
height:
|
|
509
|
+
height: p,
|
|
498
510
|
minHeight: d = 0,
|
|
499
511
|
strokeWidth: g = 2,
|
|
500
|
-
relativeHeight:
|
|
501
|
-
ariaLabel:
|
|
502
|
-
colorLegendTitle:
|
|
503
|
-
detailsOnClick:
|
|
504
|
-
styles:
|
|
505
|
-
classNames:
|
|
512
|
+
relativeHeight: P,
|
|
513
|
+
ariaLabel: K,
|
|
514
|
+
colorLegendTitle: Q,
|
|
515
|
+
detailsOnClick: A,
|
|
516
|
+
styles: b,
|
|
517
|
+
classNames: k,
|
|
506
518
|
showNAColor: y = !0,
|
|
507
|
-
axisLabels:
|
|
508
|
-
showDots:
|
|
519
|
+
axisLabels: I,
|
|
520
|
+
showDots: W = !0,
|
|
509
521
|
showValues: N = !1,
|
|
510
|
-
curveType:
|
|
511
|
-
noOfTicks:
|
|
512
|
-
minValue:
|
|
513
|
-
maxValue:
|
|
514
|
-
fillShape:
|
|
515
|
-
resetSelectionOnDoubleClick:
|
|
516
|
-
animate:
|
|
522
|
+
curveType: F = "curve",
|
|
523
|
+
noOfTicks: Z = 5,
|
|
524
|
+
minValue: G,
|
|
525
|
+
maxValue: tt,
|
|
526
|
+
fillShape: X = !1,
|
|
527
|
+
resetSelectionOnDoubleClick: l = !0,
|
|
528
|
+
animate: it = !1,
|
|
517
529
|
dimmedOpacity: ct = 0.3,
|
|
518
|
-
precision:
|
|
530
|
+
precision: x = 2,
|
|
519
531
|
customLayers: ht = []
|
|
520
|
-
} = t, [
|
|
532
|
+
} = t, [O, i] = j(0), [a, r] = j(0), [m, E] = j(0), [wt, bt] = j(void 0), S = ut(null), mt = ut(null);
|
|
521
533
|
return kt(() => {
|
|
522
|
-
const
|
|
523
|
-
|
|
534
|
+
const u = new ResizeObserver((et) => {
|
|
535
|
+
r(c || et[0].target.clientWidth || 420), E(p || et[0].target.clientHeight || 420), i(
|
|
524
536
|
(Math.min(
|
|
525
|
-
c ||
|
|
526
|
-
|
|
537
|
+
c || et[0].target.clientWidth || 620,
|
|
538
|
+
p || et[0].target.clientHeight || 480
|
|
527
539
|
) || 420) / 2
|
|
528
540
|
);
|
|
529
541
|
});
|
|
530
|
-
return S.current && (
|
|
542
|
+
return S.current && (E(S.current.clientHeight || 420), r(S.current.clientWidth || 420), i(
|
|
531
543
|
(Math.min(S.current.clientWidth, S.current.clientHeight) || 420) / 2
|
|
532
|
-
), (!c || !
|
|
533
|
-
}, [c,
|
|
544
|
+
), (!c || !M) && u.observe(S.current)), () => u.disconnect();
|
|
545
|
+
}, [c, p, M]), /* @__PURE__ */ n.jsx(
|
|
534
546
|
"div",
|
|
535
547
|
{
|
|
536
|
-
className: `${
|
|
537
|
-
dir:
|
|
548
|
+
className: `${V || "light"} flex ${c ? "w-fit grow-0" : "w-full grow"}`,
|
|
549
|
+
dir: D === "he" || D === "ar" ? "rtl" : void 0,
|
|
538
550
|
children: /* @__PURE__ */ n.jsx(
|
|
539
551
|
"div",
|
|
540
552
|
{
|
|
541
|
-
className:
|
|
542
|
-
`${
|
|
553
|
+
className: L(
|
|
554
|
+
`${f ? f === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${D || "en"}`,
|
|
543
555
|
c ? "w-fit" : "w-full",
|
|
544
|
-
|
|
556
|
+
k?.graphContainer
|
|
545
557
|
),
|
|
546
558
|
style: {
|
|
547
|
-
...
|
|
559
|
+
...b?.graphContainer || {},
|
|
548
560
|
minHeight: "inherit",
|
|
549
|
-
...
|
|
561
|
+
...f && f !== !0 ? { backgroundColor: f } : {}
|
|
550
562
|
},
|
|
551
|
-
id:
|
|
563
|
+
id: q,
|
|
552
564
|
ref: mt,
|
|
553
|
-
"aria-label":
|
|
565
|
+
"aria-label": K || `${e ? `The graph shows ${e}. ` : ""}This is a donut or pie chart chart. ${C ? ` ${C}` : ""}`,
|
|
554
566
|
children: /* @__PURE__ */ n.jsx(
|
|
555
567
|
"div",
|
|
556
568
|
{
|
|
557
569
|
className: "flex grow",
|
|
558
|
-
style: { padding:
|
|
570
|
+
style: { padding: f ? _ || "1rem" : _ || 0 },
|
|
559
571
|
children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-2 w-full grow justify-between", children: [
|
|
560
|
-
e ||
|
|
572
|
+
e || C || R || U ? /* @__PURE__ */ n.jsx(
|
|
561
573
|
Dt,
|
|
562
574
|
{
|
|
563
575
|
styles: {
|
|
564
|
-
title: w?.title,
|
|
565
|
-
description: w?.description
|
|
566
|
-
},
|
|
567
|
-
classNames: {
|
|
568
576
|
title: b?.title,
|
|
569
577
|
description: b?.description
|
|
570
578
|
},
|
|
579
|
+
classNames: {
|
|
580
|
+
title: k?.title,
|
|
581
|
+
description: k?.description
|
|
582
|
+
},
|
|
571
583
|
graphTitle: e,
|
|
572
|
-
graphDescription:
|
|
584
|
+
graphDescription: C,
|
|
573
585
|
width: c,
|
|
574
|
-
graphDownload:
|
|
575
|
-
dataDownload:
|
|
586
|
+
graphDownload: R ? mt.current : void 0,
|
|
587
|
+
dataDownload: U ? h.map((u) => u.data).filter((u) => u !== void 0).length > 0 ? h.map((u) => u.data).filter((u) => u !== void 0) : h.filter((u) => u !== void 0) : null
|
|
576
588
|
}
|
|
577
589
|
) : null,
|
|
578
590
|
/* @__PURE__ */ n.jsx(
|
|
@@ -582,14 +594,14 @@ function li(t) {
|
|
|
582
594
|
style: {
|
|
583
595
|
width: c ? `${c}px` : "100%"
|
|
584
596
|
},
|
|
585
|
-
children:
|
|
586
|
-
|
|
587
|
-
|
|
597
|
+
children: h.length === 0 ? /* @__PURE__ */ n.jsx(Vt, {}) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
598
|
+
w && h.filter((u) => u.color).length !== 0 ? /* @__PURE__ */ n.jsx(
|
|
599
|
+
At,
|
|
588
600
|
{
|
|
589
601
|
width: c,
|
|
590
|
-
colorLegendTitle:
|
|
591
|
-
colors: s ||
|
|
592
|
-
colorDomain:
|
|
602
|
+
colorLegendTitle: Q,
|
|
603
|
+
colors: s || v[V].categoricalColors.colors,
|
|
604
|
+
colorDomain: J || pt(h, "color", !0),
|
|
593
605
|
setSelectedColor: bt,
|
|
594
606
|
showNAColor: y
|
|
595
607
|
}
|
|
@@ -600,44 +612,44 @@ function li(t) {
|
|
|
600
612
|
className: `flex ${c ? "grow-0" : "grow"} items-center justify-center leading-0`,
|
|
601
613
|
style: {
|
|
602
614
|
width: c ? `${c}px` : "100%",
|
|
603
|
-
height:
|
|
615
|
+
height: p ? `${Math.max(
|
|
604
616
|
d,
|
|
605
|
-
|
|
617
|
+
p || (P ? d ? (c || a) * P > d ? (c || a) * P : d : (c || a) * P : m)
|
|
606
618
|
)}px` : "auto"
|
|
607
619
|
},
|
|
608
620
|
ref: S,
|
|
609
621
|
"aria-label": "Graph area",
|
|
610
|
-
children: /* @__PURE__ */ n.jsx("div", { className: "w-full flex justify-center leading-0", children:
|
|
622
|
+
children: /* @__PURE__ */ n.jsx("div", { className: "w-full flex justify-center leading-0", children: M || O ? /* @__PURE__ */ n.jsx(
|
|
611
623
|
Ft,
|
|
612
624
|
{
|
|
613
|
-
data:
|
|
614
|
-
lineColors:
|
|
615
|
-
radius:
|
|
616
|
-
tooltip:
|
|
617
|
-
colorDomain:
|
|
618
|
-
onSeriesMouseOver:
|
|
625
|
+
data: h,
|
|
626
|
+
lineColors: h.filter((u) => u.color).length === 0 ? s ? [s] : [v.primaryColors["blue-600"]] : s || v[V].categoricalColors.colors,
|
|
627
|
+
radius: M || O,
|
|
628
|
+
tooltip: $,
|
|
629
|
+
colorDomain: J || pt(h, "color", !0),
|
|
630
|
+
onSeriesMouseOver: z,
|
|
619
631
|
onSeriesMouseClick: at,
|
|
620
|
-
styles:
|
|
621
|
-
detailsOnClick:
|
|
632
|
+
styles: b,
|
|
633
|
+
detailsOnClick: A,
|
|
622
634
|
selectedColor: wt,
|
|
623
|
-
axisLabels:
|
|
635
|
+
axisLabels: I,
|
|
624
636
|
strokeWidth: g,
|
|
625
637
|
showValues: N,
|
|
626
|
-
showDots:
|
|
627
|
-
topMargin:
|
|
628
|
-
bottomMargin:
|
|
629
|
-
leftMargin:
|
|
630
|
-
rightMargin:
|
|
631
|
-
curveType:
|
|
632
|
-
noOfTicks:
|
|
633
|
-
minValue:
|
|
634
|
-
maxValue:
|
|
635
|
-
fillShape:
|
|
638
|
+
showDots: W,
|
|
639
|
+
topMargin: ot,
|
|
640
|
+
bottomMargin: rt,
|
|
641
|
+
leftMargin: B,
|
|
642
|
+
rightMargin: st,
|
|
643
|
+
curveType: F,
|
|
644
|
+
noOfTicks: Z,
|
|
645
|
+
minValue: G,
|
|
646
|
+
maxValue: tt,
|
|
647
|
+
fillShape: X,
|
|
636
648
|
highlightedLines: lt,
|
|
637
|
-
resetSelectionOnDoubleClick:
|
|
638
|
-
animate:
|
|
649
|
+
resetSelectionOnDoubleClick: l,
|
|
650
|
+
animate: it === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : it || { duration: 0, once: !0, amount: 0 },
|
|
639
651
|
dimmedOpacity: ct,
|
|
640
|
-
precision:
|
|
652
|
+
precision: x,
|
|
641
653
|
customLayers: ht
|
|
642
654
|
}
|
|
643
655
|
) : null })
|
|
@@ -646,16 +658,16 @@ function li(t) {
|
|
|
646
658
|
] })
|
|
647
659
|
}
|
|
648
660
|
),
|
|
649
|
-
|
|
661
|
+
o || H ? /* @__PURE__ */ n.jsx(
|
|
650
662
|
$t,
|
|
651
663
|
{
|
|
652
|
-
styles: { footnote:
|
|
664
|
+
styles: { footnote: b?.footnote, source: b?.source },
|
|
653
665
|
classNames: {
|
|
654
|
-
footnote:
|
|
655
|
-
source:
|
|
666
|
+
footnote: k?.footnote,
|
|
667
|
+
source: k?.source
|
|
656
668
|
},
|
|
657
|
-
sources:
|
|
658
|
-
footNote:
|
|
669
|
+
sources: o,
|
|
670
|
+
footNote: H,
|
|
659
671
|
width: c
|
|
660
672
|
}
|
|
661
673
|
) : /* @__PURE__ */ n.jsx("div", {})
|