@undp/data-viz 1.4.12 → 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/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
package/dist/ParetoChart.js
CHANGED
|
@@ -1,227 +1,228 @@
|
|
|
1
|
-
import { j as t, m as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { i as
|
|
4
|
-
import { X as
|
|
5
|
-
import { n as
|
|
6
|
-
import { T as
|
|
7
|
-
import { s as
|
|
8
|
-
import { c as
|
|
9
|
-
import { A as
|
|
10
|
-
import { A as
|
|
11
|
-
import { X as
|
|
12
|
-
import { b as
|
|
13
|
-
import { a as
|
|
14
|
-
import { l as $i, c as
|
|
15
|
-
import { c as Ii, s as
|
|
16
|
-
import { u as
|
|
1
|
+
import { j as t, m as _ } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
+
import { useRef as fi, useState as W, useEffect as ji } from "react";
|
|
3
|
+
import { i as gi } from "./index-27yTRcko.js";
|
|
4
|
+
import { X as Ai } from "./Modal-DVVwpKhP.js";
|
|
5
|
+
import { n as oi } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
|
+
import { T as Mi } from "./Tooltip-DyM5snqx.js";
|
|
7
|
+
import { s as Ni } from "./string2HTML-CWHGfz_d.js";
|
|
8
|
+
import { c as di } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
9
|
+
import { A as pi } from "./Axis-Ddg-seDi.js";
|
|
10
|
+
import { A as yi } from "./AxisTitle-BmHLMRJZ.js";
|
|
11
|
+
import { X as ki } from "./XAxesLabels-CaV2q-6H.js";
|
|
12
|
+
import { b as Ci } from "./band-BEjh2CHI.js";
|
|
13
|
+
import { a as bi } from "./linear-DUdu7l2G.js";
|
|
14
|
+
import { l as $i, c as Li } from "./line-CPfhohvF.js";
|
|
15
|
+
import { c as Ii, s as Si, a as Ti, m as Vi } from "./step-BrDul-H4.js";
|
|
16
|
+
import { u as Oi } from "./use-in-view-yS6jzJAp.js";
|
|
17
17
|
import { m as D } from "./proxy-CkpFesk1.js";
|
|
18
|
-
import { A as
|
|
19
|
-
import { GraphFooter as
|
|
20
|
-
import { GraphHeader as
|
|
21
|
-
import { ColorLegend as
|
|
22
|
-
import { Colors as
|
|
23
|
-
import { E as
|
|
24
|
-
function
|
|
18
|
+
import { A as Pi } from "./index-CNvov0eg.js";
|
|
19
|
+
import { GraphFooter as Di } from "./GraphFooter.js";
|
|
20
|
+
import { GraphHeader as Yi } from "./GraphHeader.js";
|
|
21
|
+
import { ColorLegend as Hi } from "./ColorLegend.js";
|
|
22
|
+
import { Colors as ci } from "./Colors.js";
|
|
23
|
+
import { E as Xi } from "./EmptyState-DdTp-Mdn.js";
|
|
24
|
+
function Ei(mi) {
|
|
25
25
|
const {
|
|
26
|
-
data:
|
|
27
|
-
width:
|
|
26
|
+
data: S,
|
|
27
|
+
width: N,
|
|
28
28
|
height: Y,
|
|
29
29
|
barColor: p,
|
|
30
|
-
lineColor:
|
|
30
|
+
lineColor: x,
|
|
31
31
|
axisTitles: s,
|
|
32
|
-
sameAxes:
|
|
33
|
-
rightMargin:
|
|
34
|
-
leftMargin:
|
|
35
|
-
topMargin:
|
|
36
|
-
bottomMargin:
|
|
32
|
+
sameAxes: b,
|
|
33
|
+
rightMargin: q,
|
|
34
|
+
leftMargin: U,
|
|
35
|
+
topMargin: J,
|
|
36
|
+
bottomMargin: xi,
|
|
37
37
|
tooltip: v,
|
|
38
|
-
showValues:
|
|
38
|
+
showValues: K,
|
|
39
39
|
onSeriesMouseOver: H,
|
|
40
|
-
barPadding:
|
|
41
|
-
truncateBy:
|
|
42
|
-
showLabels:
|
|
43
|
-
onSeriesMouseClick:
|
|
44
|
-
resetSelectionOnDoubleClick:
|
|
45
|
-
detailsOnClick:
|
|
46
|
-
noOfTicks:
|
|
47
|
-
lineSuffix:
|
|
48
|
-
barSuffix:
|
|
49
|
-
linePrefix:
|
|
50
|
-
barPrefix:
|
|
40
|
+
barPadding: hi,
|
|
41
|
+
truncateBy: Q,
|
|
42
|
+
showLabels: Z,
|
|
43
|
+
onSeriesMouseClick: w,
|
|
44
|
+
resetSelectionOnDoubleClick: ii,
|
|
45
|
+
detailsOnClick: h,
|
|
46
|
+
noOfTicks: ti,
|
|
47
|
+
lineSuffix: ei,
|
|
48
|
+
barSuffix: B,
|
|
49
|
+
linePrefix: F,
|
|
50
|
+
barPrefix: ai,
|
|
51
51
|
curveType: X,
|
|
52
|
-
styles:
|
|
53
|
-
classNames:
|
|
54
|
-
animate:
|
|
52
|
+
styles: n,
|
|
53
|
+
classNames: o,
|
|
54
|
+
animate: l,
|
|
55
55
|
precision: E,
|
|
56
56
|
customLayers: T,
|
|
57
|
-
naLabel:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
naLabel: k,
|
|
58
|
+
showAxisLabels: si
|
|
59
|
+
} = mi, ri = fi(null), C = Oi(ri, {
|
|
60
|
+
once: l.once,
|
|
61
|
+
amount: l.amount
|
|
62
|
+
}), ui = X === "linear" ? Li : X === "step" ? Ii : X === "stepAfter" ? Si : X === "stepBefore" ? Ti : Vi, [li, $] = W(void 0), [L, V] = W(void 0), [ni, I] = W(void 0), [j, m] = W(void 0), u = {
|
|
63
|
+
top: J,
|
|
64
|
+
bottom: xi,
|
|
65
|
+
left: U + 50,
|
|
66
|
+
right: q + 65
|
|
67
|
+
}, d = N - u.left - u.right, f = Y - u.top - u.bottom, a = S.map((i, M) => ({ ...i, id: `${M}` })), c = Ci().domain(a.map((i) => `${i.id}`)).range([0, d]).paddingInner(hi), G = Math.min(...a.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.min(...a.map((i) => i.bar).filter((i) => i != null)) > 0 ? 0 : Math.min(...a.map((i) => i.bar).filter((i) => i != null)) : 0, A = Math.min(...a.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.min(...a.map((i) => i.line).filter((i) => i != null)) > 0 ? 0 : Math.min(...a.map((i) => i.line).filter((i) => i != null)) : 0, O = Math.max(...a.map((i) => i.bar).filter((i) => i != null)) !== 1 / 0 ? Math.max(...a.map((i) => i.bar).filter((i) => i != null)) : 0, P = Math.max(...a.map((i) => i.line).filter((i) => i != null)) !== 1 / 0 ? Math.max(...a.map((i) => i.line).filter((i) => i != null)) : 0, R = G < A ? G : A, y = O > P ? O : P, r = bi().domain([
|
|
68
|
+
b ? R : G,
|
|
69
|
+
b ? y > 0 ? y : 0 : O > 0 ? O : 0
|
|
70
|
+
]).range([f, 0]).nice(), e = bi().domain([
|
|
71
|
+
b ? R : A,
|
|
72
|
+
b ? y > 0 ? y : 0 : P > 0 ? P : 0
|
|
73
|
+
]).range([f, 0]).nice(), z = $i().defined((i) => !di(i.line)).x((i) => c(`${i.id}`) + c.bandwidth() / 2).y((i) => e(i.line)).curve(ui), vi = r.ticks(ti), wi = e.ticks(ti);
|
|
73
74
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
74
75
|
/* @__PURE__ */ t.jsx(
|
|
75
76
|
D.svg,
|
|
76
77
|
{
|
|
77
|
-
width: `${
|
|
78
|
+
width: `${N}px`,
|
|
78
79
|
height: `${Y}px`,
|
|
79
|
-
viewBox: `0 0 ${
|
|
80
|
+
viewBox: `0 0 ${N} ${Y}`,
|
|
80
81
|
direction: "ltr",
|
|
81
|
-
ref:
|
|
82
|
-
children: /* @__PURE__ */ t.jsxs("g", { transform: `translate(${
|
|
82
|
+
ref: ri,
|
|
83
|
+
children: /* @__PURE__ */ t.jsxs("g", { transform: `translate(${u.left},${u.top})`, children: [
|
|
83
84
|
/* @__PURE__ */ t.jsxs("g", { children: [
|
|
84
|
-
vi.map((i,
|
|
85
|
+
vi.map((i, M) => /* @__PURE__ */ t.jsxs("g", { children: [
|
|
85
86
|
/* @__PURE__ */ t.jsx(
|
|
86
87
|
"line",
|
|
87
88
|
{
|
|
88
|
-
y1:
|
|
89
|
-
y2:
|
|
89
|
+
y1: r(i),
|
|
90
|
+
y2: r(i),
|
|
90
91
|
x1: -15,
|
|
91
92
|
x2: -20,
|
|
92
93
|
style: {
|
|
93
94
|
stroke: p,
|
|
94
95
|
strokeWidth: 1,
|
|
95
|
-
...
|
|
96
|
+
...n?.yAxis?.gridLines || {}
|
|
96
97
|
},
|
|
97
|
-
className:
|
|
98
|
+
className: o?.yAxis?.gridLines
|
|
98
99
|
}
|
|
99
100
|
),
|
|
100
101
|
/* @__PURE__ */ t.jsx(
|
|
101
102
|
"text",
|
|
102
103
|
{
|
|
103
104
|
x: -25,
|
|
104
|
-
y:
|
|
105
|
+
y: r(i),
|
|
105
106
|
dy: "0.33em",
|
|
106
|
-
className:
|
|
107
|
+
className: _("text-xs", o?.yAxis?.labels),
|
|
107
108
|
style: {
|
|
108
109
|
textAnchor: "end",
|
|
109
110
|
fill: p,
|
|
110
|
-
...
|
|
111
|
+
...n?.yAxis?.labels || {}
|
|
111
112
|
},
|
|
112
|
-
children:
|
|
113
|
+
children: oi(i, k, E, ai, B)
|
|
113
114
|
}
|
|
114
115
|
)
|
|
115
|
-
] },
|
|
116
|
+
] }, M)),
|
|
116
117
|
/* @__PURE__ */ t.jsx(
|
|
117
|
-
|
|
118
|
+
pi,
|
|
118
119
|
{
|
|
119
120
|
y1: 0,
|
|
120
121
|
y2: f,
|
|
121
122
|
x1: -15,
|
|
122
123
|
x2: -15,
|
|
123
|
-
classNames: { axis:
|
|
124
|
-
styles: { axis: { stroke: p, ...
|
|
124
|
+
classNames: { axis: o?.xAxis?.axis },
|
|
125
|
+
styles: { axis: { stroke: p, ...n?.xAxis?.axis || {} } }
|
|
125
126
|
}
|
|
126
127
|
),
|
|
127
|
-
/* @__PURE__ */ t.jsx(
|
|
128
|
-
|
|
128
|
+
si ? /* @__PURE__ */ t.jsx(
|
|
129
|
+
yi,
|
|
129
130
|
{
|
|
130
|
-
x: 10 -
|
|
131
|
+
x: 10 - u.left,
|
|
131
132
|
y: f / 2,
|
|
132
|
-
style: { fill: p, ...
|
|
133
|
-
className:
|
|
133
|
+
style: { fill: p, ...n?.yAxis?.title || {} },
|
|
134
|
+
className: o?.yAxis?.title,
|
|
134
135
|
text: s[0].length > 100 ? `${s[0].substring(0, 100)}...` : s[0],
|
|
135
136
|
rotate90: !0
|
|
136
137
|
}
|
|
137
|
-
)
|
|
138
|
+
) : null
|
|
138
139
|
] }),
|
|
139
140
|
/* @__PURE__ */ t.jsxs("g", { children: [
|
|
140
|
-
|
|
141
|
+
wi.map((i, M) => /* @__PURE__ */ t.jsxs("g", { children: [
|
|
141
142
|
/* @__PURE__ */ t.jsx(
|
|
142
143
|
"line",
|
|
143
144
|
{
|
|
144
|
-
y1:
|
|
145
|
-
y2:
|
|
146
|
-
x1:
|
|
147
|
-
x2:
|
|
145
|
+
y1: e(i),
|
|
146
|
+
y2: e(i),
|
|
147
|
+
x1: d + 15,
|
|
148
|
+
x2: d + 20,
|
|
148
149
|
style: {
|
|
149
|
-
stroke:
|
|
150
|
+
stroke: x,
|
|
150
151
|
strokeWidth: 1,
|
|
151
|
-
...
|
|
152
|
+
...n?.yAxis?.gridLines || {}
|
|
152
153
|
},
|
|
153
|
-
className:
|
|
154
|
+
className: o?.yAxis?.gridLines
|
|
154
155
|
}
|
|
155
156
|
),
|
|
156
157
|
/* @__PURE__ */ t.jsx(
|
|
157
158
|
"text",
|
|
158
159
|
{
|
|
159
|
-
x:
|
|
160
|
-
y:
|
|
160
|
+
x: d + 25,
|
|
161
|
+
y: e(i),
|
|
161
162
|
dy: "0.33em",
|
|
162
163
|
dx: -2,
|
|
163
164
|
style: {
|
|
164
165
|
textAnchor: "start",
|
|
165
|
-
fill:
|
|
166
|
-
...
|
|
166
|
+
fill: x,
|
|
167
|
+
...n?.yAxis?.labels || {}
|
|
167
168
|
},
|
|
168
|
-
className:
|
|
169
|
-
children:
|
|
169
|
+
className: _("text-xs", o?.yAxis?.labels),
|
|
170
|
+
children: oi(i, k, E, F, ei)
|
|
170
171
|
}
|
|
171
172
|
)
|
|
172
|
-
] },
|
|
173
|
+
] }, M)),
|
|
173
174
|
/* @__PURE__ */ t.jsx(
|
|
174
|
-
|
|
175
|
+
pi,
|
|
175
176
|
{
|
|
176
177
|
y1: 0,
|
|
177
178
|
y2: f,
|
|
178
|
-
x1:
|
|
179
|
-
x2:
|
|
180
|
-
classNames: { axis:
|
|
181
|
-
styles: { axis: { stroke:
|
|
179
|
+
x1: d + 15,
|
|
180
|
+
x2: d + 15,
|
|
181
|
+
classNames: { axis: o?.xAxis?.axis },
|
|
182
|
+
styles: { axis: { stroke: x, ...n?.xAxis?.axis || {} } }
|
|
182
183
|
}
|
|
183
184
|
),
|
|
184
|
-
/* @__PURE__ */ t.jsx(
|
|
185
|
-
|
|
185
|
+
si ? /* @__PURE__ */ t.jsx(
|
|
186
|
+
yi,
|
|
186
187
|
{
|
|
187
|
-
x:
|
|
188
|
+
x: d + u.right - 15,
|
|
188
189
|
y: f / 2,
|
|
189
|
-
style: { fill:
|
|
190
|
-
className:
|
|
190
|
+
style: { fill: x, ...n?.yAxis?.title || {} },
|
|
191
|
+
className: o?.yAxis?.title,
|
|
191
192
|
text: s[1].length > 100 ? `${s[1].substring(0, 100)}...` : s[1],
|
|
192
193
|
rotate90: !0
|
|
193
194
|
}
|
|
194
|
-
)
|
|
195
|
+
) : null
|
|
195
196
|
] }),
|
|
196
197
|
/* @__PURE__ */ t.jsx(
|
|
197
|
-
|
|
198
|
+
pi,
|
|
198
199
|
{
|
|
199
|
-
y1:
|
|
200
|
-
y2:
|
|
200
|
+
y1: b ? r(0) : f,
|
|
201
|
+
y2: b ? r(0) : f,
|
|
201
202
|
x1: -15,
|
|
202
|
-
x2:
|
|
203
|
-
classNames: { axis:
|
|
204
|
-
styles: { axis:
|
|
203
|
+
x2: d + 15,
|
|
204
|
+
classNames: { axis: o?.xAxis?.axis },
|
|
205
|
+
styles: { axis: n?.xAxis?.axis }
|
|
205
206
|
}
|
|
206
207
|
),
|
|
207
208
|
T.filter((i) => i.position === "before").map((i) => i.layer),
|
|
208
|
-
/* @__PURE__ */ t.jsxs(
|
|
209
|
-
a.map((i,
|
|
209
|
+
/* @__PURE__ */ t.jsxs(Pi, { children: [
|
|
210
|
+
a.map((i, M) => /* @__PURE__ */ t.jsxs(
|
|
210
211
|
D.g,
|
|
211
212
|
{
|
|
212
213
|
className: "undp-viz-g-with-hover",
|
|
213
214
|
opacity: 0.85,
|
|
214
215
|
onMouseEnter: (g) => {
|
|
215
|
-
|
|
216
|
+
$(i), m(g.clientY), I(g.clientX), H?.(i);
|
|
216
217
|
},
|
|
217
218
|
onClick: () => {
|
|
218
|
-
(
|
|
219
|
+
(w || h) && (gi(L, i) && ii ? (V(void 0), w?.(void 0)) : (V(i), w?.(i)));
|
|
219
220
|
},
|
|
220
221
|
onMouseMove: (g) => {
|
|
221
|
-
|
|
222
|
+
$(i), m(g.clientY), I(g.clientX);
|
|
222
223
|
},
|
|
223
224
|
onMouseLeave: () => {
|
|
224
|
-
|
|
225
|
+
$(void 0), I(void 0), m(void 0), H?.(void 0);
|
|
225
226
|
},
|
|
226
227
|
children: [
|
|
227
228
|
/* @__PURE__ */ t.jsx(
|
|
@@ -229,75 +230,75 @@ function Xi(li) {
|
|
|
229
230
|
{
|
|
230
231
|
variants: {
|
|
231
232
|
initial: {
|
|
232
|
-
attrY:
|
|
233
|
+
attrY: r(0),
|
|
233
234
|
height: 0,
|
|
234
235
|
opacity: 1
|
|
235
236
|
},
|
|
236
237
|
whileInView: {
|
|
237
|
-
attrY: i.bar ? i.bar > 0 ?
|
|
238
|
-
height: i.bar ? Math.abs(
|
|
238
|
+
attrY: i.bar ? i.bar > 0 ? r(i.bar) : r(0) : 0,
|
|
239
|
+
height: i.bar ? Math.abs(r(i.bar) - r(0)) : 0,
|
|
239
240
|
opacity: 1,
|
|
240
|
-
transition: { duration:
|
|
241
|
+
transition: { duration: l.duration }
|
|
241
242
|
}
|
|
242
243
|
},
|
|
243
244
|
initial: "initial",
|
|
244
|
-
animate:
|
|
245
|
+
animate: C ? "whileInView" : "initial",
|
|
245
246
|
exit: {
|
|
246
|
-
attrY:
|
|
247
|
+
attrY: r(0),
|
|
247
248
|
height: 0,
|
|
248
249
|
opacity: 0,
|
|
249
|
-
transition: { duration:
|
|
250
|
+
transition: { duration: l.duration }
|
|
250
251
|
},
|
|
251
|
-
x: c(`${
|
|
252
|
+
x: c(`${M}`),
|
|
252
253
|
width: c.bandwidth(),
|
|
253
254
|
style: { fill: p }
|
|
254
255
|
}
|
|
255
256
|
),
|
|
256
|
-
|
|
257
|
+
K && !di(i.bar) ? /* @__PURE__ */ t.jsx(
|
|
257
258
|
D.text,
|
|
258
259
|
{
|
|
259
260
|
x: c(`${i.id}`) + c.bandwidth() / 2,
|
|
260
261
|
exit: {
|
|
261
|
-
attrY:
|
|
262
|
+
attrY: r(0),
|
|
262
263
|
opacity: 0,
|
|
263
|
-
transition: { duration:
|
|
264
|
+
transition: { duration: l.duration }
|
|
264
265
|
},
|
|
265
266
|
variants: {
|
|
266
267
|
initial: {
|
|
267
|
-
attrY:
|
|
268
|
+
attrY: r(0),
|
|
268
269
|
opacity: 0
|
|
269
270
|
},
|
|
270
271
|
whileInView: {
|
|
271
|
-
attrY:
|
|
272
|
+
attrY: r(i.bar || 0),
|
|
272
273
|
opacity: 1,
|
|
273
|
-
transition: { duration:
|
|
274
|
+
transition: { duration: l.duration }
|
|
274
275
|
}
|
|
275
276
|
},
|
|
276
277
|
initial: "initial",
|
|
277
|
-
animate:
|
|
278
|
+
animate: C ? "whileInView" : "initial",
|
|
278
279
|
style: {
|
|
279
280
|
fill: p,
|
|
280
281
|
textAnchor: "middle",
|
|
281
|
-
...
|
|
282
|
+
...n?.graphObjectValues || {}
|
|
282
283
|
},
|
|
283
|
-
className:
|
|
284
|
+
className: _("graph-value text-sm", o?.graphObjectValues),
|
|
284
285
|
dy: i.bar ? i.bar >= 0 ? "-5px" : "1em" : "-5px",
|
|
285
|
-
children:
|
|
286
|
+
children: oi(i.bar, k, E, ai, B)
|
|
286
287
|
}
|
|
287
288
|
) : null,
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
Z ? /* @__PURE__ */ t.jsx(
|
|
290
|
+
ki,
|
|
290
291
|
{
|
|
291
|
-
value: `${i.label}`.length <
|
|
292
|
+
value: `${i.label}`.length < Q ? `${i.label}` : `${`${i.label}`.substring(0, Q)}...`,
|
|
292
293
|
y: f + 5,
|
|
293
294
|
x: c(`${i.id}`),
|
|
294
295
|
width: c.bandwidth(),
|
|
295
|
-
height:
|
|
296
|
-
style:
|
|
297
|
-
className:
|
|
296
|
+
height: u.bottom,
|
|
297
|
+
style: n?.xAxis?.labels,
|
|
298
|
+
className: o?.xAxis?.labels,
|
|
298
299
|
alignment: "top",
|
|
299
|
-
animate:
|
|
300
|
-
isInView:
|
|
300
|
+
animate: l,
|
|
301
|
+
isInView: C
|
|
301
302
|
}
|
|
302
303
|
) : null
|
|
303
304
|
]
|
|
@@ -309,253 +310,255 @@ function Xi(li) {
|
|
|
309
310
|
{
|
|
310
311
|
exit: {
|
|
311
312
|
opacity: 0,
|
|
312
|
-
transition: { duration:
|
|
313
|
+
transition: { duration: l.duration }
|
|
313
314
|
},
|
|
314
315
|
variants: {
|
|
315
316
|
initial: {
|
|
316
|
-
d:
|
|
317
|
+
d: z(a.map((i) => ({ ...i, line: 0 }))),
|
|
317
318
|
opacity: 0
|
|
318
319
|
},
|
|
319
320
|
whileInView: {
|
|
320
|
-
d:
|
|
321
|
+
d: z(a),
|
|
321
322
|
opacity: 1,
|
|
322
|
-
transition: { duration:
|
|
323
|
+
transition: { duration: l.duration }
|
|
323
324
|
}
|
|
324
325
|
},
|
|
325
326
|
initial: "initial",
|
|
326
|
-
animate:
|
|
327
|
+
animate: C ? "whileInView" : "initial",
|
|
327
328
|
style: {
|
|
328
|
-
stroke:
|
|
329
|
+
stroke: x,
|
|
329
330
|
fill: "none",
|
|
330
331
|
strokeWidth: 2
|
|
331
332
|
}
|
|
332
333
|
}
|
|
333
334
|
),
|
|
334
|
-
a.map((i,
|
|
335
|
+
a.map((i, M) => /* @__PURE__ */ t.jsx("g", { children: di(i.line) ? null : /* @__PURE__ */ t.jsxs(
|
|
335
336
|
"g",
|
|
336
337
|
{
|
|
337
338
|
onMouseEnter: (g) => {
|
|
338
|
-
|
|
339
|
+
$(i), m(g.clientY), I(g.clientX), H?.(i);
|
|
339
340
|
},
|
|
340
341
|
onClick: () => {
|
|
341
|
-
(
|
|
342
|
+
(w || h) && (gi(L, i) && ii ? (V(void 0), w?.(void 0)) : (V(i), w?.(i)));
|
|
342
343
|
},
|
|
343
344
|
onMouseMove: (g) => {
|
|
344
|
-
|
|
345
|
+
$(i), m(g.clientY), I(g.clientX);
|
|
345
346
|
},
|
|
346
347
|
onMouseLeave: () => {
|
|
347
|
-
|
|
348
|
+
$(void 0), I(void 0), m(void 0), H?.(void 0);
|
|
348
349
|
},
|
|
349
350
|
children: [
|
|
350
351
|
/* @__PURE__ */ t.jsx(
|
|
351
352
|
D.circle,
|
|
352
353
|
{
|
|
353
354
|
exit: {
|
|
354
|
-
cy:
|
|
355
|
+
cy: e(0),
|
|
355
356
|
opacity: 0,
|
|
356
|
-
transition: { duration:
|
|
357
|
+
transition: { duration: l.duration }
|
|
357
358
|
},
|
|
358
359
|
variants: {
|
|
359
360
|
initial: {
|
|
360
|
-
cy:
|
|
361
|
+
cy: e(0),
|
|
361
362
|
opacity: 0
|
|
362
363
|
},
|
|
363
364
|
whileInView: {
|
|
364
|
-
cy:
|
|
365
|
+
cy: e(i.line),
|
|
365
366
|
opacity: 1,
|
|
366
|
-
transition: { duration:
|
|
367
|
+
transition: { duration: l.duration }
|
|
367
368
|
}
|
|
368
369
|
},
|
|
369
370
|
initial: "initial",
|
|
370
|
-
animate:
|
|
371
|
+
animate: C ? "whileInView" : "initial",
|
|
371
372
|
cx: c(i.id) + c.bandwidth() / 2,
|
|
372
|
-
r:
|
|
373
|
-
style: { fill:
|
|
373
|
+
r: d / a.length < 5 ? 0 : d / a.length < 20 ? 2 : 4,
|
|
374
|
+
style: { fill: x }
|
|
374
375
|
}
|
|
375
376
|
),
|
|
376
|
-
|
|
377
|
+
K ? /* @__PURE__ */ t.jsx(
|
|
377
378
|
D.text,
|
|
378
379
|
{
|
|
379
380
|
x: c(`${i.id}`) + c.bandwidth() / 2,
|
|
380
381
|
exit: {
|
|
381
|
-
y:
|
|
382
|
+
y: e(0),
|
|
382
383
|
opacity: 0,
|
|
383
|
-
transition: { duration:
|
|
384
|
+
transition: { duration: l.duration }
|
|
384
385
|
},
|
|
385
386
|
style: {
|
|
386
|
-
fill:
|
|
387
|
+
fill: x,
|
|
387
388
|
textAnchor: "middle",
|
|
388
|
-
...
|
|
389
|
+
...n?.graphObjectValues || {}
|
|
389
390
|
},
|
|
390
391
|
variants: {
|
|
391
392
|
initial: {
|
|
392
|
-
y:
|
|
393
|
+
y: e(0),
|
|
393
394
|
opacity: 0
|
|
394
395
|
},
|
|
395
396
|
whileInView: {
|
|
396
|
-
y:
|
|
397
|
+
y: e(i.line),
|
|
397
398
|
opacity: 1,
|
|
398
|
-
transition: { duration:
|
|
399
|
+
transition: { duration: l.duration }
|
|
399
400
|
}
|
|
400
401
|
},
|
|
401
402
|
initial: "initial",
|
|
402
|
-
animate:
|
|
403
|
-
className:
|
|
403
|
+
animate: C ? "whileInView" : "initial",
|
|
404
|
+
className: _("graph-value text-sm", o?.graphObjectValues),
|
|
404
405
|
dy: "-5px",
|
|
405
|
-
children:
|
|
406
|
+
children: oi(
|
|
406
407
|
i.line,
|
|
407
|
-
|
|
408
|
+
k,
|
|
408
409
|
E,
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
F,
|
|
411
|
+
ei
|
|
411
412
|
)
|
|
412
413
|
}
|
|
413
414
|
) : null
|
|
414
415
|
]
|
|
415
416
|
}
|
|
416
|
-
) },
|
|
417
|
+
) }, M))
|
|
417
418
|
] }),
|
|
418
419
|
T.filter((i) => i.position === "after").map((i) => i.layer)
|
|
419
420
|
] })
|
|
420
421
|
}
|
|
421
422
|
),
|
|
422
|
-
|
|
423
|
-
|
|
423
|
+
li && v && ni && j ? /* @__PURE__ */ t.jsx(
|
|
424
|
+
Mi,
|
|
424
425
|
{
|
|
425
|
-
data:
|
|
426
|
+
data: li,
|
|
426
427
|
body: v,
|
|
427
|
-
xPos:
|
|
428
|
-
yPos:
|
|
429
|
-
backgroundStyle:
|
|
430
|
-
className:
|
|
428
|
+
xPos: ni,
|
|
429
|
+
yPos: j,
|
|
430
|
+
backgroundStyle: n?.tooltip,
|
|
431
|
+
className: o?.tooltip
|
|
431
432
|
}
|
|
432
433
|
) : null,
|
|
433
|
-
|
|
434
|
-
|
|
434
|
+
h && L !== void 0 ? /* @__PURE__ */ t.jsx(
|
|
435
|
+
Ai,
|
|
435
436
|
{
|
|
436
|
-
open:
|
|
437
|
+
open: L !== void 0,
|
|
437
438
|
onClose: () => {
|
|
438
|
-
|
|
439
|
+
V(void 0);
|
|
439
440
|
},
|
|
440
441
|
children: /* @__PURE__ */ t.jsx(
|
|
441
442
|
"div",
|
|
442
443
|
{
|
|
443
444
|
className: "graph-modal-content m-0",
|
|
444
|
-
dangerouslySetInnerHTML: typeof
|
|
445
|
-
children: typeof
|
|
445
|
+
dangerouslySetInnerHTML: typeof h == "string" ? { __html: Ni(h, L) } : void 0,
|
|
446
|
+
children: typeof h == "function" ? h(L) : null
|
|
446
447
|
}
|
|
447
448
|
)
|
|
448
449
|
}
|
|
449
450
|
) : null
|
|
450
451
|
] });
|
|
451
452
|
}
|
|
452
|
-
function
|
|
453
|
+
function mt(mi) {
|
|
453
454
|
const {
|
|
454
|
-
data:
|
|
455
|
-
graphTitle:
|
|
455
|
+
data: S,
|
|
456
|
+
graphTitle: N,
|
|
456
457
|
sources: Y,
|
|
457
458
|
graphDescription: p,
|
|
458
|
-
height:
|
|
459
|
+
height: x,
|
|
459
460
|
width: s,
|
|
460
|
-
footNote:
|
|
461
|
-
padding:
|
|
462
|
-
lineColor:
|
|
463
|
-
barColor:
|
|
464
|
-
sameAxes:
|
|
461
|
+
footNote: b,
|
|
462
|
+
padding: q,
|
|
463
|
+
lineColor: U = ci.light.categoricalColors.colors[1],
|
|
464
|
+
barColor: J = ci.light.categoricalColors.colors[0],
|
|
465
|
+
sameAxes: xi = !1,
|
|
465
466
|
backgroundColor: v = !1,
|
|
466
|
-
leftMargin:
|
|
467
|
+
leftMargin: K = 80,
|
|
467
468
|
rightMargin: H = 80,
|
|
468
|
-
topMargin:
|
|
469
|
-
bottomMargin:
|
|
470
|
-
lineAxisTitle:
|
|
471
|
-
barAxisTitle:
|
|
472
|
-
tooltip:
|
|
473
|
-
relativeHeight:
|
|
474
|
-
onSeriesMouseOver:
|
|
475
|
-
graphID:
|
|
476
|
-
graphDownload:
|
|
477
|
-
dataDownload:
|
|
478
|
-
barPadding:
|
|
469
|
+
topMargin: hi = 20,
|
|
470
|
+
bottomMargin: Q = 25,
|
|
471
|
+
lineAxisTitle: Z = "Line chart",
|
|
472
|
+
barAxisTitle: w = "Bar graph",
|
|
473
|
+
tooltip: ii,
|
|
474
|
+
relativeHeight: h,
|
|
475
|
+
onSeriesMouseOver: ti,
|
|
476
|
+
graphID: ei,
|
|
477
|
+
graphDownload: B = !1,
|
|
478
|
+
dataDownload: F = !1,
|
|
479
|
+
barPadding: ai = 0.25,
|
|
479
480
|
truncateBy: X = 999,
|
|
480
|
-
showLabels:
|
|
481
|
-
onSeriesMouseClick:
|
|
482
|
-
language:
|
|
481
|
+
showLabels: n = !0,
|
|
482
|
+
onSeriesMouseClick: o,
|
|
483
|
+
language: l = "en",
|
|
483
484
|
colorLegendTitle: E,
|
|
484
485
|
minHeight: T = 0,
|
|
485
|
-
theme:
|
|
486
|
-
ariaLabel:
|
|
487
|
-
resetSelectionOnDoubleClick:
|
|
488
|
-
detailsOnClick:
|
|
489
|
-
showValues:
|
|
490
|
-
noOfTicks:
|
|
486
|
+
theme: k = "light",
|
|
487
|
+
ariaLabel: si,
|
|
488
|
+
resetSelectionOnDoubleClick: ri = !0,
|
|
489
|
+
detailsOnClick: C,
|
|
490
|
+
showValues: ui = !0,
|
|
491
|
+
noOfTicks: li = 5,
|
|
491
492
|
lineSuffix: $ = "",
|
|
492
|
-
barSuffix:
|
|
493
|
-
linePrefix:
|
|
494
|
-
barPrefix:
|
|
495
|
-
curveType:
|
|
496
|
-
styles:
|
|
497
|
-
classNames:
|
|
498
|
-
animate:
|
|
499
|
-
precision:
|
|
500
|
-
customLayers:
|
|
501
|
-
naLabel:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
493
|
+
barSuffix: L = "",
|
|
494
|
+
linePrefix: V = "",
|
|
495
|
+
barPrefix: ni = "",
|
|
496
|
+
curveType: I = "curve",
|
|
497
|
+
styles: j,
|
|
498
|
+
classNames: m,
|
|
499
|
+
animate: u = !1,
|
|
500
|
+
precision: d = 2,
|
|
501
|
+
customLayers: f = [],
|
|
502
|
+
naLabel: a = "NA",
|
|
503
|
+
showColorScale: c = !0,
|
|
504
|
+
showAxisLabels: G = !0
|
|
505
|
+
} = mi, [A, O] = W(0), [P, R] = W(0), y = fi(null), r = fi(null);
|
|
506
|
+
return ji(() => {
|
|
507
|
+
const e = new ResizeObserver((z) => {
|
|
508
|
+
O(s || z[0].target.clientWidth || 620), R(x || z[0].target.clientHeight || 480);
|
|
506
509
|
});
|
|
507
|
-
return
|
|
508
|
-
}, [s,
|
|
510
|
+
return y.current && (R(y.current.clientHeight || 480), O(y.current.clientWidth || 620), s || e.observe(y.current)), () => e.disconnect();
|
|
511
|
+
}, [s, x]), /* @__PURE__ */ t.jsx(
|
|
509
512
|
"div",
|
|
510
513
|
{
|
|
511
|
-
className: `${
|
|
512
|
-
dir:
|
|
514
|
+
className: `${k || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
|
|
515
|
+
dir: l === "he" || l === "ar" ? "rtl" : void 0,
|
|
513
516
|
children: /* @__PURE__ */ t.jsx(
|
|
514
517
|
"div",
|
|
515
518
|
{
|
|
516
|
-
className:
|
|
517
|
-
`${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${
|
|
518
|
-
|
|
519
|
+
className: _(
|
|
520
|
+
`${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l || "en"}`,
|
|
521
|
+
m?.graphContainer
|
|
519
522
|
),
|
|
520
523
|
style: {
|
|
521
|
-
...
|
|
524
|
+
...j?.graphContainer || {},
|
|
522
525
|
...v && v !== !0 ? { backgroundColor: v } : {}
|
|
523
526
|
},
|
|
524
|
-
id:
|
|
525
|
-
ref:
|
|
526
|
-
"aria-label":
|
|
527
|
+
id: ei,
|
|
528
|
+
ref: r,
|
|
529
|
+
"aria-label": si || `${N ? `The graph shows ${N}. ` : ""}This is a pareto chart that shows a variable as bars and another as line chart.${p ? ` ${p}` : ""}`,
|
|
527
530
|
children: /* @__PURE__ */ t.jsx(
|
|
528
531
|
"div",
|
|
529
532
|
{
|
|
530
533
|
className: "flex grow",
|
|
531
|
-
style: { padding: v ?
|
|
534
|
+
style: { padding: v ? q || "1rem" : q || 0 },
|
|
532
535
|
children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
533
|
-
|
|
534
|
-
|
|
536
|
+
N || p || B || F ? /* @__PURE__ */ t.jsx(
|
|
537
|
+
Yi,
|
|
535
538
|
{
|
|
536
539
|
styles: {
|
|
537
|
-
title:
|
|
538
|
-
description:
|
|
540
|
+
title: j?.title,
|
|
541
|
+
description: j?.description
|
|
539
542
|
},
|
|
540
543
|
classNames: {
|
|
541
|
-
title:
|
|
542
|
-
description:
|
|
544
|
+
title: m?.title,
|
|
545
|
+
description: m?.description
|
|
543
546
|
},
|
|
544
|
-
graphTitle:
|
|
547
|
+
graphTitle: N,
|
|
545
548
|
graphDescription: p,
|
|
546
549
|
width: s,
|
|
547
|
-
graphDownload:
|
|
548
|
-
dataDownload:
|
|
550
|
+
graphDownload: B ? r.current : void 0,
|
|
551
|
+
dataDownload: F ? S.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? S.map((e) => e.data).filter((e) => e !== void 0) : S.filter((e) => e !== void 0) : null
|
|
549
552
|
}
|
|
550
553
|
) : null,
|
|
551
|
-
/* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children:
|
|
552
|
-
/* @__PURE__ */ t.jsx(
|
|
553
|
-
|
|
554
|
+
/* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: S.length === 0 ? /* @__PURE__ */ t.jsx(Xi, {}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
555
|
+
c ? null : /* @__PURE__ */ t.jsx(
|
|
556
|
+
Hi,
|
|
554
557
|
{
|
|
555
|
-
colorDomain: [
|
|
558
|
+
colorDomain: [w, Z],
|
|
556
559
|
colors: [
|
|
557
|
-
|
|
558
|
-
|
|
560
|
+
J || ci[k].categoricalColors.colors[0],
|
|
561
|
+
U || ci[k].categoricalColors.colors[1]
|
|
559
562
|
],
|
|
560
563
|
colorLegendTitle: E,
|
|
561
564
|
showNAColor: !1
|
|
@@ -565,61 +568,62 @@ function ct(li) {
|
|
|
565
568
|
"div",
|
|
566
569
|
{
|
|
567
570
|
className: "flex flex-col grow justify-center leading-0",
|
|
568
|
-
ref:
|
|
571
|
+
ref: y,
|
|
569
572
|
"aria-label": "Graph area",
|
|
570
|
-
children: (s ||
|
|
571
|
-
|
|
573
|
+
children: (s || A) && (x || P) ? /* @__PURE__ */ t.jsx(
|
|
574
|
+
Ei,
|
|
572
575
|
{
|
|
573
|
-
data:
|
|
574
|
-
sameAxes:
|
|
575
|
-
lineColor:
|
|
576
|
-
barColor:
|
|
577
|
-
width: s ||
|
|
576
|
+
data: S,
|
|
577
|
+
sameAxes: xi,
|
|
578
|
+
lineColor: U,
|
|
579
|
+
barColor: J,
|
|
580
|
+
width: s || A,
|
|
578
581
|
height: Math.max(
|
|
579
582
|
T,
|
|
580
|
-
|
|
583
|
+
x || (h ? T ? (s || A) * h > T ? (s || A) * h : T : (s || A) * h : P)
|
|
581
584
|
),
|
|
582
585
|
truncateBy: X,
|
|
583
|
-
leftMargin:
|
|
586
|
+
leftMargin: K,
|
|
584
587
|
rightMargin: H,
|
|
585
|
-
topMargin:
|
|
586
|
-
bottomMargin:
|
|
587
|
-
axisTitles: [
|
|
588
|
-
tooltip:
|
|
589
|
-
onSeriesMouseOver:
|
|
590
|
-
barPadding:
|
|
591
|
-
showLabels:
|
|
592
|
-
onSeriesMouseClick:
|
|
593
|
-
resetSelectionOnDoubleClick:
|
|
594
|
-
detailsOnClick:
|
|
595
|
-
noOfTicks:
|
|
588
|
+
topMargin: hi,
|
|
589
|
+
bottomMargin: Q,
|
|
590
|
+
axisTitles: [w, Z],
|
|
591
|
+
tooltip: ii,
|
|
592
|
+
onSeriesMouseOver: ti,
|
|
593
|
+
barPadding: ai,
|
|
594
|
+
showLabels: n,
|
|
595
|
+
onSeriesMouseClick: o,
|
|
596
|
+
resetSelectionOnDoubleClick: ri,
|
|
597
|
+
detailsOnClick: C,
|
|
598
|
+
noOfTicks: li,
|
|
596
599
|
lineSuffix: $,
|
|
597
|
-
barSuffix:
|
|
598
|
-
linePrefix:
|
|
599
|
-
barPrefix:
|
|
600
|
-
curveType:
|
|
601
|
-
showValues:
|
|
602
|
-
styles:
|
|
603
|
-
classNames:
|
|
604
|
-
animate:
|
|
605
|
-
precision:
|
|
606
|
-
customLayers:
|
|
607
|
-
naLabel:
|
|
600
|
+
barSuffix: L,
|
|
601
|
+
linePrefix: V,
|
|
602
|
+
barPrefix: ni,
|
|
603
|
+
curveType: I,
|
|
604
|
+
showValues: ui,
|
|
605
|
+
styles: j,
|
|
606
|
+
classNames: m,
|
|
607
|
+
animate: u === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : u || { duration: 0, once: !0, amount: 0 },
|
|
608
|
+
precision: d,
|
|
609
|
+
customLayers: f,
|
|
610
|
+
naLabel: a,
|
|
611
|
+
showAxisLabels: G
|
|
608
612
|
}
|
|
609
613
|
) : null
|
|
610
614
|
}
|
|
611
615
|
)
|
|
612
616
|
] }) }),
|
|
613
|
-
Y ||
|
|
614
|
-
|
|
617
|
+
Y || b ? /* @__PURE__ */ t.jsx(
|
|
618
|
+
Di,
|
|
615
619
|
{
|
|
616
|
-
styles: { footnote:
|
|
620
|
+
styles: { footnote: j?.footnote, source: j?.source },
|
|
617
621
|
classNames: {
|
|
618
|
-
footnote:
|
|
619
|
-
source:
|
|
622
|
+
footnote: m?.footnote,
|
|
623
|
+
source: m?.source
|
|
620
624
|
},
|
|
621
625
|
sources: Y,
|
|
622
|
-
footNote:
|
|
626
|
+
footNote: b,
|
|
623
627
|
width: s
|
|
624
628
|
}
|
|
625
629
|
) : null
|
|
@@ -632,6 +636,6 @@ function ct(li) {
|
|
|
632
636
|
);
|
|
633
637
|
}
|
|
634
638
|
export {
|
|
635
|
-
|
|
639
|
+
mt as ParetoChart
|
|
636
640
|
};
|
|
637
641
|
//# sourceMappingURL=ParetoChart.js.map
|