@divami-artefacts/ai-design-system 1.0.37 → 1.0.39
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/canvas/CanvasTooltip.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +354 -343
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -88,15 +88,15 @@ function S(e, t, n, r, i = h(u.t1, .08)) {
|
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/canvas/CanvasTooltip.tsx
|
|
91
|
-
function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
92
|
-
let
|
|
91
|
+
function C({ visible: e, x: t, y: n, content: i, parentW: o, parentH: l }) {
|
|
92
|
+
let d = a(null);
|
|
93
93
|
if (r(() => {
|
|
94
|
-
let r =
|
|
94
|
+
let r = d.current;
|
|
95
95
|
if (!r) return;
|
|
96
|
-
let a = r.offsetWidth, s =
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
r.style.setProperty("--tooltip-accent",
|
|
96
|
+
let a = r.offsetWidth, s = r.offsetHeight, c = o ?? 400, f = l ?? 800, p = t + 14, m = n - s - 14;
|
|
97
|
+
p + a > c - 4 && (p = t - a - 14), m < 4 && (m = n + 14), p < 4 && (p = 4), m + s > f - 4 && (m = f - s - 4), r.style.transform = `translate(${p}px, ${m}px)`, r.style.opacity = e ? "1" : "0";
|
|
98
|
+
let h = i && typeof i == "object" && i.color ? i.color : u.blue;
|
|
99
|
+
r.style.setProperty("--tooltip-accent", h ?? u.blue);
|
|
100
100
|
}, [
|
|
101
101
|
e,
|
|
102
102
|
t,
|
|
@@ -104,9 +104,9 @@ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
|
104
104
|
o,
|
|
105
105
|
i
|
|
106
106
|
]), !i) return null;
|
|
107
|
-
let
|
|
107
|
+
let f = typeof i == "object", p = f ? i.label : null, m = f ? i.value : i, h = f ? i.sublabel : null;
|
|
108
108
|
return /* @__PURE__ */ c("div", {
|
|
109
|
-
ref:
|
|
109
|
+
ref: d,
|
|
110
110
|
style: {
|
|
111
111
|
position: "absolute",
|
|
112
112
|
top: 0,
|
|
@@ -124,7 +124,7 @@ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
|
124
124
|
fontFamily: "'Satoshi Variable', 'DM Sans', sans-serif"
|
|
125
125
|
},
|
|
126
126
|
children: [
|
|
127
|
-
|
|
127
|
+
p && /* @__PURE__ */ s("div", {
|
|
128
128
|
style: {
|
|
129
129
|
fontSize: 14,
|
|
130
130
|
fontWeight: 400,
|
|
@@ -133,7 +133,7 @@ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
|
133
133
|
whiteSpace: "nowrap",
|
|
134
134
|
lineHeight: "20px"
|
|
135
135
|
},
|
|
136
|
-
children:
|
|
136
|
+
children: p
|
|
137
137
|
}),
|
|
138
138
|
/* @__PURE__ */ s("div", {
|
|
139
139
|
style: {
|
|
@@ -143,9 +143,9 @@ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
|
143
143
|
whiteSpace: "nowrap",
|
|
144
144
|
lineHeight: "22px"
|
|
145
145
|
},
|
|
146
|
-
children:
|
|
146
|
+
children: m
|
|
147
147
|
}),
|
|
148
|
-
|
|
148
|
+
h && /* @__PURE__ */ s("div", {
|
|
149
149
|
style: {
|
|
150
150
|
fontSize: 14,
|
|
151
151
|
fontWeight: 400,
|
|
@@ -154,7 +154,7 @@ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
|
154
154
|
whiteSpace: "nowrap",
|
|
155
155
|
lineHeight: "20px"
|
|
156
156
|
},
|
|
157
|
-
children:
|
|
157
|
+
children: h
|
|
158
158
|
})
|
|
159
159
|
]
|
|
160
160
|
});
|
|
@@ -166,22 +166,20 @@ function w(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
|
|
|
166
166
|
x: -1,
|
|
167
167
|
y: -1,
|
|
168
168
|
over: !1
|
|
169
|
-
}), u = a(null), d = a([]), f
|
|
169
|
+
}), u = a(null), d = a([]), [f, p] = o({
|
|
170
170
|
visible: !1,
|
|
171
171
|
x: 0,
|
|
172
172
|
y: 0,
|
|
173
173
|
content: null
|
|
174
|
-
}),
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}, []), g = t(() => {
|
|
184
|
-
f.current && clearTimeout(f.current), m((e) => e.visible ? {
|
|
174
|
+
}), m = t((e, t, n) => {
|
|
175
|
+
p({
|
|
176
|
+
visible: !0,
|
|
177
|
+
x: e,
|
|
178
|
+
y: t,
|
|
179
|
+
content: n
|
|
180
|
+
});
|
|
181
|
+
}, []), h = t(() => {
|
|
182
|
+
p((e) => e.visible ? {
|
|
185
183
|
visible: !1,
|
|
186
184
|
x: e.x,
|
|
187
185
|
y: e.y,
|
|
@@ -200,13 +198,13 @@ function w(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
|
|
|
200
198
|
break;
|
|
201
199
|
}
|
|
202
200
|
let f = u.current;
|
|
203
|
-
u.current = s ? s.id : null, t.style.cursor = s ? "pointer" : "default", s ?
|
|
201
|
+
u.current = s ? s.id : null, t.style.cursor = s ? "pointer" : "default", s ? m((e.clientX - n.left) * a, (e.clientY - n.top) * o, s.data) : f && h();
|
|
204
202
|
}, a = () => {
|
|
205
203
|
l.current = {
|
|
206
204
|
x: -1,
|
|
207
205
|
y: -1,
|
|
208
206
|
over: !1
|
|
209
|
-
}, u.current && (u.current = null, t.style.cursor = "default",
|
|
207
|
+
}, u.current && (u.current = null, t.style.cursor = "default", h());
|
|
210
208
|
}, o = () => {
|
|
211
209
|
if (u.current && s) {
|
|
212
210
|
let e = d.current.find((e) => e.id === u.current);
|
|
@@ -214,7 +212,7 @@ function w(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
|
|
|
214
212
|
}
|
|
215
213
|
};
|
|
216
214
|
return t.addEventListener("mousemove", n), t.addEventListener("mouseleave", a), t.addEventListener("click", o), () => {
|
|
217
|
-
t.removeEventListener("mousemove", n), t.removeEventListener("mouseleave", a), t.removeEventListener("click", o)
|
|
215
|
+
t.removeEventListener("mousemove", n), t.removeEventListener("mouseleave", a), t.removeEventListener("click", o);
|
|
218
216
|
};
|
|
219
217
|
}, [
|
|
220
218
|
e,
|
|
@@ -222,14 +220,14 @@ function w(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
|
|
|
222
220
|
i,
|
|
223
221
|
c,
|
|
224
222
|
s,
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
m,
|
|
224
|
+
h
|
|
227
225
|
]), {
|
|
228
226
|
mouseRef: l,
|
|
229
227
|
hoveredRef: u,
|
|
230
|
-
tooltip:
|
|
231
|
-
showTooltip:
|
|
232
|
-
hideTooltip:
|
|
228
|
+
tooltip: f,
|
|
229
|
+
showTooltip: m,
|
|
230
|
+
hideTooltip: h,
|
|
233
231
|
hitZonesRef: d
|
|
234
232
|
};
|
|
235
233
|
}
|
|
@@ -511,41 +509,40 @@ function ue(e, t, n) {
|
|
|
511
509
|
return r + "…";
|
|
512
510
|
}
|
|
513
511
|
function de({ items: e = [], "data-testid": t }) {
|
|
514
|
-
let r = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), [m, g] = o(!1), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), S = i(() => [..._].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [_]),
|
|
512
|
+
let r = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), [m, g] = o(!1), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), S = i(() => [..._].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [_]), O = i(() => m ? S : S.slice(0, ce), [S, m]), k = O.length, A = oe + se + k * z + Math.max(0, k - 1) * ae, { hoveredRef: j, tooltip: M, hitZonesRef: N } = w(r, {
|
|
515
513
|
width: R,
|
|
516
|
-
height:
|
|
514
|
+
height: A
|
|
517
515
|
});
|
|
518
516
|
return n(() => {
|
|
519
517
|
let e = r.current;
|
|
520
518
|
if (!e) return;
|
|
521
|
-
let t = v(e, R,
|
|
519
|
+
let t = v(e, R, A);
|
|
522
520
|
l.current = 0;
|
|
523
|
-
let n = R * .
|
|
521
|
+
let n = R * .08, i = R - 150 - n, a, o = () => {
|
|
524
522
|
l.current++;
|
|
525
523
|
let e = l.current;
|
|
526
|
-
t.clearRect(0, 0, R,
|
|
527
|
-
let n = t ===
|
|
524
|
+
t.clearRect(0, 0, R, A), t.letterSpacing = f.letterSpacing, N.current = [], d.current.forEach((e, t) => {
|
|
525
|
+
let n = t === j.current ? 1 : 0, r = e + (n - e) * .12;
|
|
528
526
|
Math.abs(r - n) < .005 ? n === 0 ? d.current.delete(t) : d.current.set(t, 1) : d.current.set(t, r);
|
|
529
|
-
}),
|
|
530
|
-
let
|
|
531
|
-
t.fillStyle = h(
|
|
532
|
-
let
|
|
533
|
-
if (
|
|
534
|
-
let e = t.createLinearGradient(
|
|
535
|
-
e.addColorStop(0, h(
|
|
527
|
+
}), j.current && !d.current.has(j.current) && d.current.set(j.current, 0), b(t, R, A, e, 40, h(u.blue, .04)), O.forEach((n, r) => {
|
|
528
|
+
let a = le[r % le.length], o = d.current.get(n.id) ?? 0, s = oe + r * (z + ae);
|
|
529
|
+
t.fillStyle = h(a, .04 + o * .04), t.beginPath(), t.roundRect(150, s, i, z, 3), t.fill(), t.strokeStyle = h(a, .08), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(150, s + z / 2), t.lineTo(150 + i, s + z / 2), t.stroke(), t.setLineDash([]);
|
|
530
|
+
let c = (n.percentage ?? 0) / 100, l = 150 + i * Math.min(c, c * D(Math.min(1, e * .005)));
|
|
531
|
+
if (l > 154) {
|
|
532
|
+
let e = t.createLinearGradient(150, 0, l, 0);
|
|
533
|
+
e.addColorStop(0, h(a, .02)), e.addColorStop(1, h(a, .25 + o * .15)), t.fillStyle = e, t.beginPath(), t.roundRect(150, s + 2, l - 150, z - 4, 2), t.fill();
|
|
536
534
|
}
|
|
537
|
-
y(t,
|
|
538
|
-
let
|
|
539
|
-
label:
|
|
540
|
-
value: `${
|
|
541
|
-
|
|
542
|
-
color: o
|
|
535
|
+
y(t, l, s + z / 2, 18 + o * 8, a, .3 + o * .2), t.beginPath(), t.arc(l, s + z / 2, 5 + o * 2, 0, Math.PI * 2), t.fillStyle = h(a, .9), t.fill();
|
|
536
|
+
let u = {
|
|
537
|
+
label: n.name,
|
|
538
|
+
value: `${n.percentage ?? 0}%`,
|
|
539
|
+
color: a
|
|
543
540
|
};
|
|
544
|
-
|
|
545
|
-
}), t.strokeStyle = h(u.t3, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(
|
|
541
|
+
E(N.current, n.id, 0, s, 150 + i, z, u), T(N.current, n.id, l, s + z / 2, 14, u), t.font = p.font, t.fillStyle = h(a, .9 + o * .1), t.textAlign = "left", t.textBaseline = "middle", t.fillText(`${n.percentage ?? 0}%`, l + 10, s + z / 2), t.font = `${o > 0 ? "bold " : ""}` + f.font, t.fillStyle = o > 0 ? a : f.color, t.textAlign = "right", t.fillText(ue(t, n.abbreviation ?? n.name ?? "", 134), 142, s + z / 2);
|
|
542
|
+
}), t.strokeStyle = h(u.t3, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(150 + i, oe), t.lineTo(150 + i, oe + (k - 1) * (z + ae) + z), t.stroke(), x(t, R, A, e, .015), a = requestAnimationFrame(o);
|
|
546
543
|
};
|
|
547
|
-
return
|
|
548
|
-
}, [
|
|
544
|
+
return o(), () => cancelAnimationFrame(a);
|
|
545
|
+
}, [O, A]), S.length === 0 ? /* @__PURE__ */ s(L, {
|
|
549
546
|
width: R,
|
|
550
547
|
height: 160,
|
|
551
548
|
"data-testid": t
|
|
@@ -560,14 +557,14 @@ function de({ items: e = [], "data-testid": t }) {
|
|
|
560
557
|
"aria-label": "Commitment race — contractors ranked by commitment percentage",
|
|
561
558
|
style: {
|
|
562
559
|
width: R,
|
|
563
|
-
height:
|
|
560
|
+
height: A,
|
|
564
561
|
display: "block",
|
|
565
562
|
borderRadius: 8
|
|
566
563
|
}
|
|
567
564
|
}), /* @__PURE__ */ s(C, {
|
|
568
|
-
...
|
|
565
|
+
...M,
|
|
569
566
|
parentW: R,
|
|
570
|
-
parentH:
|
|
567
|
+
parentH: A
|
|
571
568
|
})]
|
|
572
569
|
}), _.length > ce && /* @__PURE__ */ s("div", {
|
|
573
570
|
style: { marginTop: 8 },
|
|
@@ -817,15 +814,20 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
817
814
|
return he(n, Ce, D, (e, t) => {
|
|
818
815
|
N(r.current, j.current), F.current = [], b.forEach((n, i) => {
|
|
819
816
|
let a = Ee[i % Ee.length], o = M(t, i, x, O), s = V.top + i * (H + 8), c = V.left + De, l = r.current.get(n.id) ?? 0, d = Math.max(n.base ?? 0, 0), m = Math.max(n.total ?? 0, 0), g = d / S * k * o, _ = m / S * k * o, v = _ - g;
|
|
820
|
-
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(Oe(e, n.name ?? "", De - 16), c - 8, s + H / 2),
|
|
817
|
+
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(Oe(e, n.name ?? "", De - 16), c - 8, s + H / 2), E(F.current, n.id, 0, s, c, H, {
|
|
818
|
+
label: n.name,
|
|
819
|
+
value: `${n.totalLabel ?? ke(n.total ?? 0)} total`,
|
|
820
|
+
sublabel: `Base ${n.baseLabel ?? ke(n.base ?? 0)} + Var ${n.variationLabel ?? ke(n.variation ?? 0)} · ${n.percentage ?? 0}% committed`,
|
|
821
|
+
color: a
|
|
822
|
+
}), e.fillStyle = h(u.bd, .25), e.beginPath(), e.roundRect(c, s, k, H, 4), e.fill(), g > 0 && (l > 0 && y(e, c + g / 2, s + H / 2, g * .3, a, .1 * l), e.fillStyle = h(a, .5 + l * .15), e.beginPath(), e.roundRect(c, s, g, H, 4), e.fill()), v > 2 && (e.fillStyle = h(a, .22 + l * .08), e.beginPath(), e.roundRect(c + g, s, v, H, [
|
|
821
823
|
0,
|
|
822
824
|
4,
|
|
823
825
|
4,
|
|
824
826
|
0
|
|
825
827
|
]), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(a, .55), e.lineWidth = 1, e.beginPath(), e.moveTo(c + g, s + 3), e.lineTo(c + g, s + H - 3), e.stroke(), e.setLineDash([])), l > 0 && _ > 0 && (e.strokeStyle = h(a, .5 * l), e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.roundRect(c, s, _, H, 4), e.stroke()), o > .35 && (e.globalAlpha = Math.min(1, (o - .35) / .4), e.font = p.font, e.fillStyle = l > 0 ? a : p.color, e.textAlign = "left", e.textBaseline = "middle", e.fillText(n.totalLabel ?? ke(n.total ?? 0), c + _ + 6, s + H / 2), e.globalAlpha = 1), E(F.current, n.id, c, s, Math.max(_, 1), H, {
|
|
826
828
|
label: n.name,
|
|
827
|
-
value:
|
|
828
|
-
sublabel:
|
|
829
|
+
value: n.totalLabel ?? ke(n.total ?? 0),
|
|
830
|
+
sublabel: `${n.baseLabel ?? ke(n.base ?? 0)} + ${n.variationLabel ?? ke(n.variation ?? 0)} · ${n.percentage ?? 0}%`,
|
|
829
831
|
color: a
|
|
830
832
|
});
|
|
831
833
|
});
|
|
@@ -899,14 +901,8 @@ function U(e, t = 1) {
|
|
|
899
901
|
}
|
|
900
902
|
//#endregion
|
|
901
903
|
//#region src/components/rankedCardLeaderboard/RankedCardLeaderboard.tsx
|
|
902
|
-
var Me = 780, W = 240, Ne = 12, Pe = 10, Fe = 5, Ie = (Me - 2 * Ne - (Fe - 1) * Pe) / Fe
|
|
903
|
-
|
|
904
|
-
"Elevated risk",
|
|
905
|
-
"Moderate exposure",
|
|
906
|
-
"Moderate exposure",
|
|
907
|
-
"Low exposure"
|
|
908
|
-
];
|
|
909
|
-
function Re({ items: e = [], "data-testid": t }) {
|
|
904
|
+
var Me = 780, W = 240, Ne = 12, Pe = 10, Fe = 5, Ie = (Me - 2 * Ne - (Fe - 1) * Pe) / Fe;
|
|
905
|
+
function Le({ items: e = [], "data-testid": t }) {
|
|
910
906
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), m = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), g = m.reduce((e, t) => e + (t.count ?? 0), 0), _ = Math.min(Fe, m.length), b = _ > 0 ? 2 * Ne + _ * Ie + (_ - 1) * Pe : Me, { hoveredRef: S, tooltip: T, hitZonesRef: D } = w(r, {
|
|
911
907
|
width: b,
|
|
912
908
|
height: W
|
|
@@ -935,11 +931,11 @@ function Re({ items: e = [], "data-testid": t }) {
|
|
|
935
931
|
let F = x - 16, I = P;
|
|
936
932
|
for (; t.measureText(I).width > F && I.length > 1;) I = I.slice(0, -1);
|
|
937
933
|
I !== P && (I = I.slice(0, -1) + "…"), t.fillText(I, w, a + i * .74);
|
|
938
|
-
let ee = Math.round((r.count ?? 0) / (g || 1) * 100)
|
|
934
|
+
let ee = Math.round((r.count ?? 0) / (g || 1) * 100);
|
|
939
935
|
E(D.current, r.id, m, a, n, i, {
|
|
940
936
|
label: r.name,
|
|
941
|
-
value: `${P}
|
|
942
|
-
sublabel: `Rank #${o + 1}
|
|
937
|
+
value: `${P} · ${ee}% of total`,
|
|
938
|
+
sublabel: `Rank #${o + 1}`,
|
|
943
939
|
color: f
|
|
944
940
|
});
|
|
945
941
|
}), x(t, b, W, e, .015), c = requestAnimationFrame(_);
|
|
@@ -980,7 +976,7 @@ function Re({ items: e = [], "data-testid": t }) {
|
|
|
980
976
|
//#endregion
|
|
981
977
|
//#region src/components/dotMatrixChart/DotMatrixChart.tsx
|
|
982
978
|
var G = 680, K = 260;
|
|
983
|
-
function
|
|
979
|
+
function Re({ items: e = [], "data-testid": t }) {
|
|
984
980
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
985
981
|
width: G,
|
|
986
982
|
height: K
|
|
@@ -1047,7 +1043,7 @@ function ze({ items: e = [], "data-testid": t }) {
|
|
|
1047
1043
|
}
|
|
1048
1044
|
//#endregion
|
|
1049
1045
|
//#region src/components/lineChart/LineChart.tsx
|
|
1050
|
-
function
|
|
1046
|
+
function ze({ rows: e = [], className: t, colors: n }) {
|
|
1051
1047
|
return /* @__PURE__ */ s(I, {
|
|
1052
1048
|
rows: e,
|
|
1053
1049
|
variant: "line",
|
|
@@ -1057,7 +1053,7 @@ function Be({ rows: e = [], className: t, colors: n }) {
|
|
|
1057
1053
|
}
|
|
1058
1054
|
//#endregion
|
|
1059
1055
|
//#region src/components/constants.ts
|
|
1060
|
-
var
|
|
1056
|
+
var Be = [
|
|
1061
1057
|
"#4C93D9",
|
|
1062
1058
|
"#5DA537",
|
|
1063
1059
|
"#F3862C",
|
|
@@ -1065,7 +1061,7 @@ var Ve = [
|
|
|
1065
1061
|
"#A0B724",
|
|
1066
1062
|
"#EEBF3B",
|
|
1067
1063
|
"#3C45D1"
|
|
1068
|
-
],
|
|
1064
|
+
], Ve = {
|
|
1069
1065
|
nodes: [
|
|
1070
1066
|
{
|
|
1071
1067
|
id: "supplier-x",
|
|
@@ -1108,8 +1104,8 @@ var Ve = [
|
|
|
1108
1104
|
};
|
|
1109
1105
|
//#endregion
|
|
1110
1106
|
//#region src/components/miniBars/MiniBars.tsx
|
|
1111
|
-
function
|
|
1112
|
-
let r = n?.slices ??
|
|
1107
|
+
function He({ rows: e = [], className: t, colors: n }) {
|
|
1108
|
+
let r = n?.slices ?? Be;
|
|
1113
1109
|
return /* @__PURE__ */ s("div", {
|
|
1114
1110
|
className: ["d3-mini-bars", t].filter(Boolean).join(" "),
|
|
1115
1111
|
children: e.map(([e, t, n], i) => /* @__PURE__ */ c("div", {
|
|
@@ -1135,7 +1131,7 @@ function Ue({ rows: e = [], className: t, colors: n }) {
|
|
|
1135
1131
|
width: Math.max(0, Math.min(100, t)),
|
|
1136
1132
|
height: "12",
|
|
1137
1133
|
rx: "6",
|
|
1138
|
-
className: `d3-mini-fill tone-${i %
|
|
1134
|
+
className: `d3-mini-fill tone-${i % Be.length}`,
|
|
1139
1135
|
fill: r[i % r.length]
|
|
1140
1136
|
})]
|
|
1141
1137
|
})
|
|
@@ -1147,9 +1143,9 @@ function Ue({ rows: e = [], className: t, colors: n }) {
|
|
|
1147
1143
|
}
|
|
1148
1144
|
//#endregion
|
|
1149
1145
|
//#region src/components/radialFanTreeChart/RadialFanTreeChart.tsx
|
|
1150
|
-
var
|
|
1151
|
-
function
|
|
1152
|
-
let m = a(null), g = a(/* @__PURE__ */ new Map()), _ = a(0), b = i(() => r.filter((e) => typeof e == "object" && !!e), [r]), x = i(() => Math.max(
|
|
1146
|
+
var Ue = 770, We = 320, Ge = 60, Ke = 28;
|
|
1147
|
+
function qe({ total: e = 0, totalLabel: t, items: r = [], width: o = Ue, "data-testid": l }) {
|
|
1148
|
+
let m = a(null), g = a(/* @__PURE__ */ new Map()), _ = a(0), b = i(() => r.filter((e) => typeof e == "object" && !!e), [r]), x = i(() => Math.max(We, Ge + Math.max(0, b.length - 1) * Ke), [b.length]), { hoveredRef: S, tooltip: E, hitZonesRef: O } = w(m, {
|
|
1153
1149
|
width: o,
|
|
1154
1150
|
height: x
|
|
1155
1151
|
});
|
|
@@ -1181,8 +1177,8 @@ function Je({ total: e = 0, totalLabel: t, items: r = [], width: o = We, "data-t
|
|
|
1181
1177
|
let a = U(t.count ?? 0);
|
|
1182
1178
|
T(O.current, t.id, _.x, _.y, i + 8, {
|
|
1183
1179
|
label: t.name,
|
|
1184
|
-
value:
|
|
1185
|
-
sublabel: `${Math.round((t.count ?? 0) / (e || 1) * 100)}% of
|
|
1180
|
+
value: a,
|
|
1181
|
+
sublabel: `${Math.round((t.count ?? 0) / (e || 1) * 100)}% of total`,
|
|
1186
1182
|
color: o
|
|
1187
1183
|
}), r.globalAlpha = n, r.font = f.font, r.textAlign = "left";
|
|
1188
1184
|
let c = t.abbreviation ?? t.name?.slice(0, 6) ?? "", l = ` ${U(t.count ?? 0)}`, d = _.x + i + 6, g = _.y + 4;
|
|
@@ -1199,9 +1195,9 @@ function Je({ total: e = 0, totalLabel: t, items: r = [], width: o = We, "data-t
|
|
|
1199
1195
|
a !== n && (a = a.slice(0, -1) + "…"), r.fillStyle = u.t1, r.textAlign = "center", r.textBaseline = "middle", r.fillText(a, 88, i), r.globalAlpha = 1;
|
|
1200
1196
|
}
|
|
1201
1197
|
T(O.current, "__root__", 88, i, 32, {
|
|
1202
|
-
label: "Total
|
|
1203
|
-
value:
|
|
1204
|
-
sublabel:
|
|
1198
|
+
label: t ?? "Total",
|
|
1199
|
+
value: U(e, 0),
|
|
1200
|
+
sublabel: `${b.length} items`,
|
|
1205
1201
|
color: u.blue
|
|
1206
1202
|
}), C = requestAnimationFrame(w);
|
|
1207
1203
|
};
|
|
@@ -1214,7 +1210,7 @@ function Je({ total: e = 0, totalLabel: t, items: r = [], width: o = We, "data-t
|
|
|
1214
1210
|
o
|
|
1215
1211
|
]), b.length === 0 ? /* @__PURE__ */ s(L, {
|
|
1216
1212
|
width: o,
|
|
1217
|
-
height:
|
|
1213
|
+
height: We,
|
|
1218
1214
|
"data-testid": l
|
|
1219
1215
|
}) : /* @__PURE__ */ c("div", {
|
|
1220
1216
|
"data-testid": l,
|
|
@@ -1241,21 +1237,21 @@ function Je({ total: e = 0, totalLabel: t, items: r = [], width: o = We, "data-t
|
|
|
1241
1237
|
}
|
|
1242
1238
|
//#endregion
|
|
1243
1239
|
//#region src/components/pieChart/PieChart.tsx
|
|
1244
|
-
var
|
|
1245
|
-
function
|
|
1240
|
+
var Je = 192, Ye = Je, Xe = Je + 80;
|
|
1241
|
+
function Ze({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
1246
1242
|
let o = a(null), f = a(/* @__PURE__ */ new Map()), p = a(0), m = i?.slices ?? d, { hoveredRef: g, tooltip: b, hitZonesRef: x } = w(o, {
|
|
1247
|
-
width:
|
|
1248
|
-
height:
|
|
1243
|
+
width: Ye,
|
|
1244
|
+
height: Xe
|
|
1249
1245
|
});
|
|
1250
1246
|
return n(() => {
|
|
1251
1247
|
let n = o.current;
|
|
1252
1248
|
if (!n) return;
|
|
1253
|
-
let r = v(n,
|
|
1249
|
+
let r = v(n, Ye, Xe);
|
|
1254
1250
|
p.current = 0;
|
|
1255
|
-
let i =
|
|
1251
|
+
let i = Ye / 2, a = Je / 2, s = Je * .4, c = t === "donut" ? Je * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, d, b = () => {
|
|
1256
1252
|
p.current++;
|
|
1257
1253
|
let n = p.current;
|
|
1258
|
-
r.clearRect(0, 0,
|
|
1254
|
+
r.clearRect(0, 0, Ye, Xe);
|
|
1259
1255
|
let o = 1 - (1 - Math.min(n / 48, 1)) ** 3;
|
|
1260
1256
|
N(f.current, g.current), x.current = [];
|
|
1261
1257
|
let v = -Math.PI / 2;
|
|
@@ -1269,10 +1265,10 @@ function Qe({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1269
1265
|
let O = j(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? O * 2 : 0);
|
|
1270
1266
|
r.beginPath(), r.moveTo(i + Math.cos(v) * c, a + Math.sin(v) * c), r.arc(i, a, k, v, g), c > 0 ? r.arc(i, a, c, g, v, !0) : r.lineTo(i, a), r.closePath(), r.fillStyle = h(_, .7 + b * .2), r.fill(), r.strokeStyle = h(u.bg, .8), r.lineWidth = 1.5, r.stroke(), v = g;
|
|
1271
1267
|
}), t === "donut" && e.length > 0 && y(r, i, a, c * .8, u.blue, .06);
|
|
1272
|
-
let S =
|
|
1268
|
+
let S = Je + 12;
|
|
1273
1269
|
e.forEach((e, t) => {
|
|
1274
1270
|
let n = m[t % m.length], i = (e.pricing ?? 0) / l, a = f.current.get(e.id ?? `sl-${t}`) ?? 0, o = S + t * 18;
|
|
1275
|
-
r.beginPath(), r.arc(8, o, 4, 0, Math.PI * 2), r.fillStyle = h(n, .8 + a * .2), r.fill(), r.font = "9px 'JetBrains Mono', monospace", r.fillStyle = h(u.t2, .7 + a * .2), r.textAlign = "left", r.fillText(e.vendor, 18, o + 3.5), r.font = "bold 9px 'JetBrains Mono', monospace", r.fillStyle = _(u.t3, n, a), r.textAlign = "right", r.fillText(`${e.pricing ?? 0} (${Math.round(i * 100)}%)`,
|
|
1271
|
+
r.beginPath(), r.arc(8, o, 4, 0, Math.PI * 2), r.fillStyle = h(n, .8 + a * .2), r.fill(), r.font = "9px 'JetBrains Mono', monospace", r.fillStyle = h(u.t2, .7 + a * .2), r.textAlign = "left", r.fillText(e.vendor, 18, o + 3.5), r.font = "bold 9px 'JetBrains Mono', monospace", r.fillStyle = _(u.t3, n, a), r.textAlign = "right", r.fillText(`${e.pricing ?? 0} (${Math.round(i * 100)}%)`, Ye - 4, o + 3.5);
|
|
1276
1272
|
}), d = requestAnimationFrame(b);
|
|
1277
1273
|
};
|
|
1278
1274
|
return b(), () => cancelAnimationFrame(d);
|
|
@@ -1286,30 +1282,30 @@ function Qe({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1286
1282
|
children: /* @__PURE__ */ c("div", {
|
|
1287
1283
|
style: {
|
|
1288
1284
|
position: "relative",
|
|
1289
|
-
width:
|
|
1290
|
-
height:
|
|
1285
|
+
width: Ye,
|
|
1286
|
+
height: Xe
|
|
1291
1287
|
},
|
|
1292
1288
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1293
1289
|
ref: o,
|
|
1294
1290
|
role: "img",
|
|
1295
1291
|
"aria-label": `${t} chart`,
|
|
1296
1292
|
style: {
|
|
1297
|
-
width:
|
|
1298
|
-
height:
|
|
1293
|
+
width: Ye,
|
|
1294
|
+
height: Xe,
|
|
1299
1295
|
display: "block",
|
|
1300
1296
|
borderRadius: 8
|
|
1301
1297
|
}
|
|
1302
1298
|
}), /* @__PURE__ */ s(C, {
|
|
1303
1299
|
...b,
|
|
1304
|
-
parentW:
|
|
1305
|
-
parentH:
|
|
1300
|
+
parentW: Ye,
|
|
1301
|
+
parentH: Xe
|
|
1306
1302
|
})]
|
|
1307
1303
|
})
|
|
1308
1304
|
});
|
|
1309
1305
|
}
|
|
1310
1306
|
//#endregion
|
|
1311
1307
|
//#region src/components/sankey/SankeySvg.tsx
|
|
1312
|
-
function
|
|
1308
|
+
function Qe(e, t, n, r) {
|
|
1313
1309
|
let i = new Set(t.map((e) => e.source)), a = new Set(t.map((e) => e.target)), o = /* @__PURE__ */ new Map(), s = [];
|
|
1314
1310
|
for (e.forEach((e) => {
|
|
1315
1311
|
i.has(e.id) && !a.has(e.id) && s.push({
|
|
@@ -1354,8 +1350,8 @@ function $e(e, t, n, r) {
|
|
|
1354
1350
|
});
|
|
1355
1351
|
}), f;
|
|
1356
1352
|
}
|
|
1357
|
-
function
|
|
1358
|
-
let _ = a(null), b = a(/* @__PURE__ */ new Map()), S = a(0), D = a([]), O = g?.nodes ?? d, k = g?.links ?? u.bd, A = g?.activeLinks ?? u.blue, M = g?.activeNodes ?? u.blue, P = i(() =>
|
|
1353
|
+
function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f, selectedEntity: p, className: m, colors: g }) {
|
|
1354
|
+
let _ = a(null), b = a(/* @__PURE__ */ new Map()), S = a(0), D = a([]), O = g?.nodes ?? d, k = g?.links ?? u.bd, A = g?.activeLinks ?? u.blue, M = g?.activeNodes ?? u.blue, P = i(() => Qe(e, t, r, o), [
|
|
1359
1355
|
e,
|
|
1360
1356
|
t,
|
|
1361
1357
|
r,
|
|
@@ -1455,7 +1451,7 @@ function et({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1455
1451
|
}
|
|
1456
1452
|
//#endregion
|
|
1457
1453
|
//#region src/canvas/CausalFlowCanvas.tsx
|
|
1458
|
-
var
|
|
1454
|
+
var et = [
|
|
1459
1455
|
{
|
|
1460
1456
|
x: .13,
|
|
1461
1457
|
y: .48
|
|
@@ -1488,7 +1484,7 @@ var tt = [
|
|
|
1488
1484
|
x: .92,
|
|
1489
1485
|
y: .22
|
|
1490
1486
|
}
|
|
1491
|
-
],
|
|
1487
|
+
], tt = [
|
|
1492
1488
|
u.blue,
|
|
1493
1489
|
u.orange,
|
|
1494
1490
|
u.red,
|
|
@@ -1496,7 +1492,7 @@ var tt = [
|
|
|
1496
1492
|
u.green,
|
|
1497
1493
|
u.amber,
|
|
1498
1494
|
u.t2
|
|
1499
|
-
],
|
|
1495
|
+
], nt = [
|
|
1500
1496
|
26,
|
|
1501
1497
|
24,
|
|
1502
1498
|
24,
|
|
@@ -1506,21 +1502,21 @@ var tt = [
|
|
|
1506
1502
|
22,
|
|
1507
1503
|
22
|
|
1508
1504
|
];
|
|
1509
|
-
function
|
|
1505
|
+
function rt(e, t) {
|
|
1510
1506
|
let n = 1 - t;
|
|
1511
1507
|
return {
|
|
1512
1508
|
x: n * n * n * e.p0.x + 3 * n * n * t * e.p1.x + 3 * n * t * t * e.p2.x + t * t * t * e.p3.x,
|
|
1513
1509
|
y: n * n * n * e.p0.y + 3 * n * n * t * e.p1.y + 3 * n * t * t * e.p2.y + t * t * t * e.p3.y
|
|
1514
1510
|
};
|
|
1515
1511
|
}
|
|
1516
|
-
function
|
|
1512
|
+
function it(e, t) {
|
|
1517
1513
|
let n = 1 - t, r = 3 * n * n * (e.p1.x - e.p0.x) + 6 * n * t * (e.p2.x - e.p1.x) + 3 * t * t * (e.p3.x - e.p2.x), i = 3 * n * n * (e.p1.y - e.p0.y) + 6 * n * t * (e.p2.y - e.p1.y) + 3 * t * t * (e.p3.y - e.p2.y), a = Math.sqrt(r * r + i * i) || 1;
|
|
1518
1514
|
return {
|
|
1519
1515
|
x: -i / a,
|
|
1520
1516
|
y: r / a
|
|
1521
1517
|
};
|
|
1522
1518
|
}
|
|
1523
|
-
function
|
|
1519
|
+
function at(e, t) {
|
|
1524
1520
|
let n = t.x - e.x, r = t.y - e.y;
|
|
1525
1521
|
return {
|
|
1526
1522
|
p0: {
|
|
@@ -1541,7 +1537,7 @@ function ot(e, t) {
|
|
|
1541
1537
|
}
|
|
1542
1538
|
};
|
|
1543
1539
|
}
|
|
1544
|
-
function
|
|
1540
|
+
function ot({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
|
|
1545
1541
|
let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: g, hitZonesRef: S } = w(d, {
|
|
1546
1542
|
width: r,
|
|
1547
1543
|
height: o
|
|
@@ -1549,15 +1545,15 @@ function st({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1549
1545
|
let t = /* @__PURE__ */ new Map();
|
|
1550
1546
|
return e.forEach((e, n) => t.set(e.id, n)), t;
|
|
1551
1547
|
}, [e]), O = i(() => t.length > 0 ? Math.max(...t.map((e) => e.value)) : 100, [t]), k = (e) => O > 1 ? e / 100 : e, A = i(() => e.map((e, t) => {
|
|
1552
|
-
let n =
|
|
1548
|
+
let n = et[t % et.length];
|
|
1553
1549
|
return {
|
|
1554
1550
|
id: e.id,
|
|
1555
1551
|
label: e.name,
|
|
1556
1552
|
sub: e.valueLabel ?? "",
|
|
1557
1553
|
x: n.x * r,
|
|
1558
1554
|
y: n.y * o,
|
|
1559
|
-
r:
|
|
1560
|
-
color:
|
|
1555
|
+
r: nt[t % nt.length],
|
|
1556
|
+
color: tt[t % tt.length]
|
|
1561
1557
|
};
|
|
1562
1558
|
}), [
|
|
1563
1559
|
e,
|
|
@@ -1579,7 +1575,7 @@ function st({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1579
1575
|
if (t.clearRect(0, 0, r, o), S.current = [], b(t, r, o, e, 50, h(u.blue, .05)), M.forEach((e, n) => {
|
|
1580
1576
|
let r = A[e.fromIdx], i = A[e.toIdx];
|
|
1581
1577
|
if (!r || !i) return;
|
|
1582
|
-
let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d =
|
|
1578
|
+
let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = at(r, i);
|
|
1583
1579
|
t.beginPath(), t.moveTo(d.p0.x, d.p0.y), t.bezierCurveTo(d.p1.x, d.p1.y, d.p2.x, d.p2.y, d.p3.x, d.p3.y), t.strokeStyle = h(o, s), t.lineWidth = 16, t.lineCap = "round", t.stroke(), t.strokeStyle = h(o, c), t.lineWidth = 1.5, t.stroke();
|
|
1584
1580
|
for (let t = 0; t < e.conf * 2.5; t++) Math.random() < .45 && p.current.push({
|
|
1585
1581
|
edgeIdx: n,
|
|
@@ -1588,7 +1584,7 @@ function st({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1588
1584
|
off: (Math.random() - .5) * 13,
|
|
1589
1585
|
sz: .7 + Math.random() * 2
|
|
1590
1586
|
});
|
|
1591
|
-
let f =
|
|
1587
|
+
let f = rt(d, .5), m = `${Math.round(e.conf * 100)}%`;
|
|
1592
1588
|
t.font = "bold 12px 'JetBrains Mono', monospace", t.textBaseline = "middle";
|
|
1593
1589
|
let g = t.measureText(m).width + 14;
|
|
1594
1590
|
t.fillStyle = "rgba(10,16,24,0.88)", t.beginPath(), t.roundRect(f.x - g / 2, f.y - 11, g, 22, 6), t.fill(), t.strokeStyle = h(u.blue, .25), t.lineWidth = 1, t.stroke(), t.fillStyle = h(u.blue, .9), t.textAlign = "center", t.fillText(m, f.x, f.y);
|
|
@@ -1598,7 +1594,7 @@ function st({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1598
1594
|
if (!n) return !1;
|
|
1599
1595
|
let r = A[n.fromIdx], i = A[n.toIdx];
|
|
1600
1596
|
if (!r || !i) return !1;
|
|
1601
|
-
let a =
|
|
1597
|
+
let a = at(r, i), o = rt(a, e.t), s = it(a, e.t), c = o.x + s.x * e.off, l = o.y + s.y * e.off, u = Math.sin(e.t * Math.PI) * .7, d = _(r.color, i.color, e.t);
|
|
1602
1598
|
return y(t, c, l, e.sz * 3, d, u * .1), t.beginPath(), t.arc(c, l, e.sz, 0, Math.PI * 2), t.fillStyle = h(d, u), t.fill(), !0;
|
|
1603
1599
|
}), p.current.length > 350 && (p.current = p.current.slice(-350)), A.forEach((n, r) => {
|
|
1604
1600
|
let i = l === n.id, a = m.current === `node-${r}`, o = j(e, .03, 3e-4) * .1 + 1, s = n.r * o * (i ? 1.15 : 1);
|
|
@@ -1655,10 +1651,10 @@ function st({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1655
1651
|
}
|
|
1656
1652
|
//#endregion
|
|
1657
1653
|
//#region src/components/sankey/ProcessSankey.tsx
|
|
1658
|
-
function
|
|
1659
|
-
return /* @__PURE__ */ s(
|
|
1660
|
-
nodes:
|
|
1661
|
-
links:
|
|
1654
|
+
function st({ selectedEntity: e, colors: t }) {
|
|
1655
|
+
return /* @__PURE__ */ s(ot, {
|
|
1656
|
+
nodes: Ve.nodes,
|
|
1657
|
+
links: Ve.links,
|
|
1662
1658
|
width: 960,
|
|
1663
1659
|
height: 280,
|
|
1664
1660
|
selectedEntity: e
|
|
@@ -1666,7 +1662,7 @@ function ct({ selectedEntity: e, colors: t }) {
|
|
|
1666
1662
|
}
|
|
1667
1663
|
//#endregion
|
|
1668
1664
|
//#region src/components/sankey/RankingSankey.tsx
|
|
1669
|
-
function
|
|
1665
|
+
function ct({ rows: e = [], className: t, colors: n }) {
|
|
1670
1666
|
let { nodes: r, links: a } = i(() => {
|
|
1671
1667
|
let t = e.slice(0, 5);
|
|
1672
1668
|
return {
|
|
@@ -1684,7 +1680,7 @@ function lt({ rows: e = [], className: t, colors: n }) {
|
|
|
1684
1680
|
}))
|
|
1685
1681
|
};
|
|
1686
1682
|
}, [e]);
|
|
1687
|
-
return /* @__PURE__ */ s(
|
|
1683
|
+
return /* @__PURE__ */ s($e, {
|
|
1688
1684
|
nodes: r,
|
|
1689
1685
|
links: a,
|
|
1690
1686
|
width: 760,
|
|
@@ -1696,18 +1692,18 @@ function lt({ rows: e = [], className: t, colors: n }) {
|
|
|
1696
1692
|
}
|
|
1697
1693
|
//#endregion
|
|
1698
1694
|
//#region src/components/balanceScaleChart/BalanceScaleChart.tsx
|
|
1699
|
-
var
|
|
1700
|
-
function
|
|
1695
|
+
var lt = 500, ut = 210;
|
|
1696
|
+
function dt({ left: e, right: t, "data-testid": r }) {
|
|
1701
1697
|
let i = a(null), o = a(0);
|
|
1702
1698
|
return n(() => {
|
|
1703
1699
|
let n = i.current;
|
|
1704
1700
|
if (!n) return;
|
|
1705
|
-
let r = v(n,
|
|
1701
|
+
let r = v(n, lt, ut);
|
|
1706
1702
|
o.current = 0;
|
|
1707
|
-
let a =
|
|
1703
|
+
let a = lt / 2, s = Math.max(e.value ?? 0, t.value ?? 0, 1), c = (e.value - t.value) / s * 14, l, d = () => {
|
|
1708
1704
|
o.current++;
|
|
1709
1705
|
let n = o.current;
|
|
1710
|
-
r.clearRect(0, 0,
|
|
1706
|
+
r.clearRect(0, 0, lt, ut), r.letterSpacing = f.letterSpacing;
|
|
1711
1707
|
let i = D(Math.min(n / 80, 1)), m = c * A(Math.min(n / 80, 1)) * Math.PI / 180;
|
|
1712
1708
|
r.strokeStyle = h(u.bd, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(a, 20), r.lineTo(a, 150), r.stroke(), r.beginPath(), r.arc(a, 20, 5 * i, 0, Math.PI * 2), r.fillStyle = u.t2, r.fill();
|
|
1713
1709
|
let g = {
|
|
@@ -1742,16 +1738,16 @@ function ft({ left: e, right: t, "data-testid": r }) {
|
|
|
1742
1738
|
"data-testid": r,
|
|
1743
1739
|
style: {
|
|
1744
1740
|
position: "relative",
|
|
1745
|
-
width:
|
|
1746
|
-
height:
|
|
1741
|
+
width: lt,
|
|
1742
|
+
height: ut
|
|
1747
1743
|
},
|
|
1748
1744
|
children: /* @__PURE__ */ s("canvas", {
|
|
1749
1745
|
ref: i,
|
|
1750
1746
|
role: "img",
|
|
1751
1747
|
"aria-label": "Quotation balance — accepted vs submitted quotation value",
|
|
1752
1748
|
style: {
|
|
1753
|
-
width:
|
|
1754
|
-
height:
|
|
1749
|
+
width: lt,
|
|
1750
|
+
height: ut,
|
|
1755
1751
|
display: "block"
|
|
1756
1752
|
}
|
|
1757
1753
|
})
|
|
@@ -1759,25 +1755,25 @@ function ft({ left: e, right: t, "data-testid": r }) {
|
|
|
1759
1755
|
}
|
|
1760
1756
|
//#endregion
|
|
1761
1757
|
//#region src/components/areaLineChart/AreaLineChart.tsx
|
|
1762
|
-
var
|
|
1763
|
-
function
|
|
1758
|
+
var ft = 680, q = 280;
|
|
1759
|
+
function pt({ points: e = [], "data-testid": t }) {
|
|
1764
1760
|
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
1765
|
-
width:
|
|
1761
|
+
width: ft,
|
|
1766
1762
|
height: q
|
|
1767
1763
|
}), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
1768
1764
|
return n(() => {
|
|
1769
1765
|
let e = r.current;
|
|
1770
1766
|
if (!e) return;
|
|
1771
|
-
let t = v(e,
|
|
1767
|
+
let t = v(e, ft, q);
|
|
1772
1768
|
l.current = 0;
|
|
1773
|
-
let n =
|
|
1769
|
+
let n = ft - 54 - 28, i = q - 30 - 54, a = Math.max(...g.map((e) => e.count), 1), s = g.length, c = s > 1 ? n / (s - 1) : n, p = g.map((e, t) => ({
|
|
1774
1770
|
x: 54 + t * c,
|
|
1775
1771
|
y: 30 + i - e.count / a * i,
|
|
1776
1772
|
point: e
|
|
1777
1773
|
})), _, b = () => {
|
|
1778
1774
|
l.current++;
|
|
1779
1775
|
let e = l.current;
|
|
1780
|
-
t.clearRect(0, 0,
|
|
1776
|
+
t.clearRect(0, 0, ft, q), t.letterSpacing = f.letterSpacing;
|
|
1781
1777
|
let r = D(Math.min(e / 72, 1));
|
|
1782
1778
|
N(o.current, d.current), m.current = [], [
|
|
1783
1779
|
.25,
|
|
@@ -1810,8 +1806,8 @@ function mt({ points: e = [], "data-testid": t }) {
|
|
|
1810
1806
|
let r = `pt-${n}`, s = o.current.get(r) ?? 0;
|
|
1811
1807
|
T(m.current, r, e.x, e.y, 10, {
|
|
1812
1808
|
label: e.point.week,
|
|
1813
|
-
value:
|
|
1814
|
-
sublabel:
|
|
1809
|
+
value: String(e.point.count),
|
|
1810
|
+
sublabel: String(e.point.value),
|
|
1815
1811
|
color: u.blue
|
|
1816
1812
|
}), s > 0 && S(t, e.x, 30, 30 + i, h(u.blue, .15 * s));
|
|
1817
1813
|
let c = e.point.count === a;
|
|
@@ -1820,7 +1816,7 @@ function mt({ points: e = [], "data-testid": t }) {
|
|
|
1820
1816
|
};
|
|
1821
1817
|
return b(), () => cancelAnimationFrame(_);
|
|
1822
1818
|
}, [g]), g.length < 2 ? /* @__PURE__ */ s(L, {
|
|
1823
|
-
width:
|
|
1819
|
+
width: ft,
|
|
1824
1820
|
height: q,
|
|
1825
1821
|
"data-testid": t
|
|
1826
1822
|
}) : /* @__PURE__ */ s("div", {
|
|
@@ -1833,7 +1829,7 @@ function mt({ points: e = [], "data-testid": t }) {
|
|
|
1833
1829
|
children: /* @__PURE__ */ c("div", {
|
|
1834
1830
|
style: {
|
|
1835
1831
|
position: "relative",
|
|
1836
|
-
width:
|
|
1832
|
+
width: ft,
|
|
1837
1833
|
height: q
|
|
1838
1834
|
},
|
|
1839
1835
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -1841,13 +1837,13 @@ function mt({ points: e = [], "data-testid": t }) {
|
|
|
1841
1837
|
role: "img",
|
|
1842
1838
|
"aria-label": "Trend chart — count over time",
|
|
1843
1839
|
style: {
|
|
1844
|
-
width:
|
|
1840
|
+
width: ft,
|
|
1845
1841
|
height: q,
|
|
1846
1842
|
display: "block"
|
|
1847
1843
|
}
|
|
1848
1844
|
}), /* @__PURE__ */ s(C, {
|
|
1849
1845
|
...p,
|
|
1850
|
-
parentW:
|
|
1846
|
+
parentW: ft,
|
|
1851
1847
|
parentH: q
|
|
1852
1848
|
})]
|
|
1853
1849
|
})
|
|
@@ -1855,31 +1851,31 @@ function mt({ points: e = [], "data-testid": t }) {
|
|
|
1855
1851
|
}
|
|
1856
1852
|
//#endregion
|
|
1857
1853
|
//#region src/components/trend/Trend.tsx
|
|
1858
|
-
var
|
|
1859
|
-
function
|
|
1854
|
+
var mt = 680, J = 280, ht = 54, gt = 48, _t = 64, vt = f.font, yt = 12, bt = Math.PI * 2, xt = 72, St = 20, Ct = 5e3;
|
|
1855
|
+
function wt({ points: e = [], "data-testid": t }) {
|
|
1860
1856
|
let r = a(null), o = a(null), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), p = i(() => {
|
|
1861
|
-
if (d.length <= 1) return
|
|
1857
|
+
if (d.length <= 1) return _t;
|
|
1862
1858
|
let e = document.createElement("canvas").getContext("2d");
|
|
1863
|
-
if (!e) return
|
|
1864
|
-
e.font =
|
|
1865
|
-
let t = Math.max(1, Math.ceil(d.length /
|
|
1866
|
-
return Math.max(
|
|
1867
|
-
}, [d]), m = Math.round(p / 2), g =
|
|
1859
|
+
if (!e) return _t;
|
|
1860
|
+
e.font = vt;
|
|
1861
|
+
let t = Math.max(1, Math.ceil(d.length / St)), n = Math.max(...d.filter((e, n) => n % t === 0).map((t) => e.measureText(t.week).width));
|
|
1862
|
+
return Math.max(_t, n + yt);
|
|
1863
|
+
}, [d]), m = Math.round(p / 2), g = gt + m + Math.max(0, d.length - 1) * p, _ = Math.max(mt - ht, Math.min(g, Ct)), { tooltip: y, hitZonesRef: b } = w(r, {
|
|
1868
1864
|
width: _,
|
|
1869
1865
|
height: J
|
|
1870
1866
|
});
|
|
1871
1867
|
return n(() => {
|
|
1872
1868
|
let e = r.current;
|
|
1873
1869
|
if (!e) return;
|
|
1874
|
-
let t = v(e, _, J), n = o.current ? v(o.current,
|
|
1870
|
+
let t = v(e, _, J), n = o.current ? v(o.current, ht, J) : null;
|
|
1875
1871
|
l.current = 0;
|
|
1876
|
-
let i = d.length <=
|
|
1872
|
+
let i = d.length <= xt ? xt : Math.max(24, Math.round(xt * (xt / d.length))), a = _ - gt, s = J - 42 - 54, c = d.length > 0 ? d.map((e) => e.count) : [0], g = Math.min(...c), y = Math.max(...c), x = y - g || 1, S = d.length, C = S > 1 ? (a - m) / (S - 1) : a - m, w = Math.max(1, Math.ceil(p / C)), E = g < 0, O = E ? 42 + s - -g / x * s : 42 + s, k = d.map((e, t) => ({
|
|
1877
1873
|
x: m + t * C,
|
|
1878
1874
|
y: 42 + s - (e.count - g) / x * s,
|
|
1879
1875
|
point: e
|
|
1880
1876
|
}));
|
|
1881
1877
|
if (n) {
|
|
1882
|
-
n.clearRect(0, 0,
|
|
1878
|
+
n.clearRect(0, 0, ht, J), n.letterSpacing = f.letterSpacing;
|
|
1883
1879
|
let e = E ? [
|
|
1884
1880
|
g,
|
|
1885
1881
|
g + x * .25,
|
|
@@ -1895,13 +1891,13 @@ function Tt({ points: e = [], "data-testid": t }) {
|
|
|
1895
1891
|
];
|
|
1896
1892
|
e.forEach((t, r) => {
|
|
1897
1893
|
let i = r / (e.length - 1), a = 42 + s - i * s;
|
|
1898
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(U(t),
|
|
1894
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(U(t), ht - 6, a + 3);
|
|
1899
1895
|
}), n.save(), n.translate(12, 42 + s / 2), n.rotate(-Math.PI / 2), n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText("Count", 0, 0), n.restore();
|
|
1900
1896
|
}
|
|
1901
1897
|
let A = t.createLinearGradient(0, 42, 0, 42 + s);
|
|
1902
1898
|
A.addColorStop(0, h(u.blue, .22)), A.addColorStop(1, h(u.blue, .02));
|
|
1903
1899
|
let j = 0, M, N = (e) => {
|
|
1904
|
-
t.font =
|
|
1900
|
+
t.font = vt, t.fillStyle = f.color, t.textAlign = "center";
|
|
1905
1901
|
for (let n = 0; n < e; n++) n % w === 0 && t.fillText(k[n].point.week, k[n].x, J - 54 + 14);
|
|
1906
1902
|
}, P = () => {
|
|
1907
1903
|
l.current++;
|
|
@@ -1937,13 +1933,13 @@ function Tt({ points: e = [], "data-testid": t }) {
|
|
|
1937
1933
|
e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
|
|
1938
1934
|
}
|
|
1939
1935
|
t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(), t.fillStyle = h(u.blue, .8), t.beginPath();
|
|
1940
|
-
for (let e = 0; e < c; e++) t.moveTo(k[e].x + 3.5, k[e].y), t.arc(k[e].x, k[e].y, 3.5, 0,
|
|
1936
|
+
for (let e = 0; e < c; e++) t.moveTo(k[e].x + 3.5, k[e].y), t.arc(k[e].x, k[e].y, 3.5, 0, bt);
|
|
1941
1937
|
if (t.fill(), c > j) {
|
|
1942
1938
|
b.current = [];
|
|
1943
1939
|
for (let e = 0; e < c; e++) T(b.current, `pt-${e}`, k[e].x, k[e].y, 10, {
|
|
1944
1940
|
label: k[e].point.week,
|
|
1945
|
-
value:
|
|
1946
|
-
sublabel:
|
|
1941
|
+
value: String(k[e].point.count),
|
|
1942
|
+
sublabel: String(k[e].point.value),
|
|
1947
1943
|
color: u.blue
|
|
1948
1944
|
});
|
|
1949
1945
|
j = c;
|
|
@@ -1957,7 +1953,7 @@ function Tt({ points: e = [], "data-testid": t }) {
|
|
|
1957
1953
|
p,
|
|
1958
1954
|
b
|
|
1959
1955
|
]), d.length < 2 ? /* @__PURE__ */ s(L, {
|
|
1960
|
-
width:
|
|
1956
|
+
width: mt,
|
|
1961
1957
|
height: J,
|
|
1962
1958
|
"data-testid": t
|
|
1963
1959
|
}) : /* @__PURE__ */ c("div", {
|
|
@@ -1971,7 +1967,7 @@ function Tt({ points: e = [], "data-testid": t }) {
|
|
|
1971
1967
|
ref: o,
|
|
1972
1968
|
"aria-hidden": "true",
|
|
1973
1969
|
style: {
|
|
1974
|
-
width:
|
|
1970
|
+
width: ht,
|
|
1975
1971
|
height: J,
|
|
1976
1972
|
display: "block",
|
|
1977
1973
|
flexShrink: 0
|
|
@@ -2009,46 +2005,46 @@ function Tt({ points: e = [], "data-testid": t }) {
|
|
|
2009
2005
|
}
|
|
2010
2006
|
//#endregion
|
|
2011
2007
|
//#region src/components/proportionalBandChart/ProportionalBandChart.tsx
|
|
2012
|
-
var
|
|
2013
|
-
function
|
|
2008
|
+
var Tt = 680, Et = 240, Dt = 28, Ot = 156;
|
|
2009
|
+
function kt(e, t, n) {
|
|
2014
2010
|
if (e.measureText(t).width <= n) return t;
|
|
2015
2011
|
let r = t;
|
|
2016
2012
|
for (; r.length > 0 && e.measureText(`${r}…`).width > n;) r = r.slice(0, -1);
|
|
2017
2013
|
return `${r}…`;
|
|
2018
2014
|
}
|
|
2019
|
-
var
|
|
2015
|
+
var At = {
|
|
2020
2016
|
Critical: u.red,
|
|
2021
2017
|
High: u.orange,
|
|
2022
2018
|
Medium: u.amber,
|
|
2023
2019
|
Low: u.green
|
|
2024
2020
|
};
|
|
2025
|
-
function
|
|
2026
|
-
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), m = d.length > 0 ? Math.min(
|
|
2021
|
+
function jt({ severities: e = [], "data-testid": t }) {
|
|
2022
|
+
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), m = d.length > 0 ? Math.min(Tt, 2 * Dt + d.length * Ot) : Tt, { hoveredRef: g, tooltip: _, hitZonesRef: b } = w(r, {
|
|
2027
2023
|
width: m,
|
|
2028
|
-
height:
|
|
2024
|
+
height: Et
|
|
2029
2025
|
});
|
|
2030
2026
|
return n(() => {
|
|
2031
2027
|
let e = r.current;
|
|
2032
2028
|
if (!e) return;
|
|
2033
|
-
let t = v(e, m,
|
|
2029
|
+
let t = v(e, m, Et);
|
|
2034
2030
|
l.current = 0;
|
|
2035
|
-
let n = d.reduce((e, t) => e + (t.count ?? 0), 0), i =
|
|
2031
|
+
let n = d.reduce((e, t) => e + (t.count ?? 0), 0), i = Dt, a = Dt, s = m - i - a, c = Et - 50 - 52, _ = d.map((e) => (e.count ?? 0) / (n || 1) * s), x, S = () => {
|
|
2036
2032
|
l.current++;
|
|
2037
2033
|
let e = l.current;
|
|
2038
|
-
t.clearRect(0, 0, m,
|
|
2034
|
+
t.clearRect(0, 0, m, Et), t.letterSpacing = f.letterSpacing;
|
|
2039
2035
|
let r = O(Math.min(e / 60, 1));
|
|
2040
2036
|
N(o.current, g.current), b.current = [], t.strokeStyle = h(u.bd, .2), t.lineWidth = 1, t.beginPath(), t.rect(i, 50, s, c), t.stroke(), t.strokeStyle = h(u.t2, .15), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(m / 2, 50), t.lineTo(m / 2, 50 + c), t.stroke(), t.setLineDash([]);
|
|
2041
2037
|
let a = i;
|
|
2042
2038
|
d.forEach((e, i) => {
|
|
2043
|
-
let s =
|
|
2039
|
+
let s = At[e.severity] ?? u.blue, l = _[i], d = o.current.get(e.severity) ?? 0, m = a + l / 2, g = l * .85, v = l * r, x = g * r, S = m - x / 2;
|
|
2044
2040
|
if (v > 0 && (d > 0 && y(t, a + v / 2, 50 + c / 2, v * .4, s, .15 * d), t.beginPath(), t.moveTo(S, 50), t.lineTo(S + x, 50), t.lineTo(a + v, 50 + c), t.lineTo(a, 50 + c), t.closePath(), t.fillStyle = h(s, .45 + d * .25), t.fill(), t.strokeStyle = h(s, (.5 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(S, 50), t.lineTo(S + x, 50), t.stroke(), t.strokeStyle = h(s, (.3 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(a, 50 + c), t.lineTo(a + v, 50 + c), t.stroke()), E(b.current, e.severity, a, 50, l, c, {
|
|
2045
2041
|
label: e.severity,
|
|
2046
|
-
value:
|
|
2047
|
-
sublabel: `${Math.round((e.count ?? 0) / (n || 1) * 100)}
|
|
2042
|
+
value: U(e.count ?? 0),
|
|
2043
|
+
sublabel: `${Math.round((e.count ?? 0) / (n || 1) * 100)}%`,
|
|
2048
2044
|
color: s
|
|
2049
2045
|
}), r > .5) {
|
|
2050
2046
|
let i = Math.min(1, (r - .5) / .5), o = a + l / 2;
|
|
2051
|
-
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? s : h(s, .9), t.textAlign = "center", t.fillText(
|
|
2047
|
+
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? s : h(s, .9), t.textAlign = "center", t.fillText(kt(t, e.severity, l - 12), o, 38), t.font = p.font, t.fillStyle = d > 0 ? u.t1 : h(u.t1, .85), t.fillText(U(e.count ?? 0), o, 50 + c / 2 + 6), t.font = f.font, t.fillStyle = d > 0 ? s : f.color, t.fillText(`${Math.round((e.count ?? 0) / (n || 1) * 100)}%`, o, 50 + c + 18), t.globalAlpha = 1;
|
|
2052
2048
|
}
|
|
2053
2049
|
a += l;
|
|
2054
2050
|
});
|
|
@@ -2058,14 +2054,14 @@ function Mt({ severities: e = [], "data-testid": t }) {
|
|
|
2058
2054
|
return S(), () => cancelAnimationFrame(x);
|
|
2059
2055
|
}, [d, m]), d.length === 0 ? /* @__PURE__ */ s(L, {
|
|
2060
2056
|
width: m,
|
|
2061
|
-
height:
|
|
2057
|
+
height: Et,
|
|
2062
2058
|
"data-testid": t
|
|
2063
2059
|
}) : /* @__PURE__ */ c("div", {
|
|
2064
2060
|
"data-testid": t,
|
|
2065
2061
|
style: {
|
|
2066
2062
|
position: "relative",
|
|
2067
2063
|
width: m,
|
|
2068
|
-
height:
|
|
2064
|
+
height: Et
|
|
2069
2065
|
},
|
|
2070
2066
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2071
2067
|
ref: r,
|
|
@@ -2073,24 +2069,24 @@ function Mt({ severities: e = [], "data-testid": t }) {
|
|
|
2073
2069
|
"aria-label": "Early Warning severity distribution — prism spectrum bands",
|
|
2074
2070
|
style: {
|
|
2075
2071
|
width: m,
|
|
2076
|
-
height:
|
|
2072
|
+
height: Et,
|
|
2077
2073
|
display: "block"
|
|
2078
2074
|
}
|
|
2079
2075
|
}), /* @__PURE__ */ s(C, {
|
|
2080
2076
|
..._,
|
|
2081
2077
|
parentW: m,
|
|
2082
|
-
parentH:
|
|
2078
|
+
parentH: Et
|
|
2083
2079
|
})]
|
|
2084
2080
|
});
|
|
2085
2081
|
}
|
|
2086
2082
|
//#endregion
|
|
2087
2083
|
//#region src/components/hubAndSpokeRadialChart/HubAndSpokeRadialChart.tsx
|
|
2088
|
-
var Y = 300, X = 280,
|
|
2084
|
+
var Y = 300, X = 280, Mt = 100, Nt = {
|
|
2089
2085
|
Open: u.red,
|
|
2090
2086
|
Submitted: u.amber,
|
|
2091
2087
|
Closed: u.green
|
|
2092
2088
|
};
|
|
2093
|
-
function
|
|
2089
|
+
function Pt({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o }) {
|
|
2094
2090
|
let l = a(null), d = a(0), m = a(/* @__PURE__ */ new Map()), { hoveredRef: g, tooltip: _, hitZonesRef: S } = w(l, {
|
|
2095
2091
|
width: Y,
|
|
2096
2092
|
height: X
|
|
@@ -2100,21 +2096,21 @@ function Ft({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o })
|
|
|
2100
2096
|
if (!e) return;
|
|
2101
2097
|
let n = v(e, Y, X);
|
|
2102
2098
|
d.current = 0;
|
|
2103
|
-
let i = Y * .5, a = X * .56, o =
|
|
2099
|
+
let i = Y * .5, a = X * .56, o = Mt, s = E.reduce((e, t) => e + (t.count ?? 0), 0), c = Math.max(...E.map((e) => e.count ?? 0), 1), _, C = () => {
|
|
2104
2100
|
d.current++;
|
|
2105
2101
|
let e = d.current;
|
|
2106
2102
|
n.clearRect(0, 0, Y, X), n.letterSpacing = f.letterSpacing, S.current = [], m.current.forEach((e, t) => {
|
|
2107
2103
|
let n = t === g.current ? 1 : 0, r = e + (n - e) * .12;
|
|
2108
2104
|
Math.abs(r - n) < .005 ? n === 0 ? m.current.delete(t) : m.current.set(t, 1) : m.current.set(t, r);
|
|
2109
2105
|
}), g.current && !m.current.has(g.current) && m.current.set(g.current, 0), b(n, Y, X, e, 40, h(u.blue, .04)), E.forEach((t, r) => {
|
|
2110
|
-
let s = r / 3 * Math.PI * 2 - Math.PI / 2, l = i + Math.cos(s) * o, d = a + Math.sin(s) * o, f =
|
|
2106
|
+
let s = r / 3 * Math.PI * 2 - Math.PI / 2, l = i + Math.cos(s) * o, d = a + Math.sin(s) * o, f = Nt[t.status] ?? u.blue, m = 2 + t.count / c * 8;
|
|
2111
2107
|
n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = h(f, .08), n.lineWidth = m * 2, n.stroke(), n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = h(f, .25), n.lineWidth = 1, n.stroke();
|
|
2112
2108
|
let g = (e * .005 + r * .33) % 1, _ = i + (l - i) * g, v = a + (d - a) * g;
|
|
2113
2109
|
y(n, _, v, 6, f, .4), n.beginPath(), n.arc(_, v, 2, 0, Math.PI * 2), n.fillStyle = h(f, .8), n.fill();
|
|
2114
2110
|
let b = (i + l) / 2, x = (a + d) / 2;
|
|
2115
2111
|
n.font = p.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = h(f, .85), n.fillText(String(t.count), b, x);
|
|
2116
2112
|
}), E.forEach((e, t) => {
|
|
2117
|
-
let l = t / 3 * Math.PI * 2 - Math.PI / 2, d = i + Math.cos(l) * o, p = a + Math.sin(l) * o, g =
|
|
2113
|
+
let l = t / 3 * Math.PI * 2 - Math.PI / 2, d = i + Math.cos(l) * o, p = a + Math.sin(l) * o, g = Nt[e.status] ?? u.blue, _ = 10 + e.count / c * 18, v = m.current.get(e.status) ?? 0;
|
|
2118
2114
|
y(n, d, p, _ * 2.5, g, .2 + v * .15);
|
|
2119
2115
|
let b = n.createRadialGradient(d, p - _ * .2, 0, d, p, _);
|
|
2120
2116
|
b.addColorStop(0, h(g, .8 + v * .2)), b.addColorStop(1, h(g, .4 + v * .1)), n.beginPath(), n.arc(d, p, _, 0, Math.PI * 2), n.fillStyle = b, n.fill(), n.font = "bold " + f.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = h(u.t1, .9), n.fillText(e.status, d, p), T(S.current, e.status, d, p, _ + 6, {
|
|
@@ -2168,8 +2164,8 @@ function Ft({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o })
|
|
|
2168
2164
|
}
|
|
2169
2165
|
//#endregion
|
|
2170
2166
|
//#region src/components/trendChart/TrendChart.tsx
|
|
2171
|
-
var
|
|
2172
|
-
function
|
|
2167
|
+
var Ft = 280, Z = 96;
|
|
2168
|
+
function It({ points: e = [], className: t, colors: r }) {
|
|
2173
2169
|
let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), p = i(() => e.filter(Array.isArray).map(([e, t]) => {
|
|
2174
2170
|
let n = String(t).match(/-?\d+(\.\d+)?/);
|
|
2175
2171
|
return {
|
|
@@ -2177,18 +2173,18 @@ function Lt({ points: e = [], className: t, colors: r }) {
|
|
|
2177
2173
|
value: n ? Number(n[0]) : 0
|
|
2178
2174
|
};
|
|
2179
2175
|
}), [e]), { mouseRef: m, hoveredRef: g, tooltip: _, hitZonesRef: b } = w(o, {
|
|
2180
|
-
width:
|
|
2176
|
+
width: Ft,
|
|
2181
2177
|
height: Z
|
|
2182
2178
|
});
|
|
2183
2179
|
return n(() => {
|
|
2184
2180
|
let e = o.current;
|
|
2185
2181
|
if (!e) return;
|
|
2186
|
-
let t = v(e,
|
|
2182
|
+
let t = v(e, Ft, Z);
|
|
2187
2183
|
f.current = 0;
|
|
2188
2184
|
let n = r?.line ?? u.blue, i = r?.point ?? u.blue, a = r?.axisLine ?? u.bd, s, c = () => {
|
|
2189
2185
|
f.current++;
|
|
2190
2186
|
let e = f.current;
|
|
2191
|
-
if (t.clearRect(0, 0,
|
|
2187
|
+
if (t.clearRect(0, 0, Ft, Z), p.length < 2) {
|
|
2192
2188
|
s = requestAnimationFrame(c);
|
|
2193
2189
|
return;
|
|
2194
2190
|
}
|
|
@@ -2197,8 +2193,8 @@ function Lt({ points: e = [], className: t, colors: r }) {
|
|
|
2197
2193
|
right: 12,
|
|
2198
2194
|
top: 16,
|
|
2199
2195
|
bottom: 20
|
|
2200
|
-
}, o =
|
|
2201
|
-
if (N(d.current, g.current), b.current = [], t.strokeStyle = h(a, .3), t.lineWidth = .5, t.setLineDash([]), t.beginPath(), t.moveTo(r.left, Z - r.bottom), t.lineTo(
|
|
2196
|
+
}, o = Ft - r.left - r.right, l = Z - r.top - r.bottom, _ = p.map((e) => e.value), v = Math.min(..._), x = Math.max(..._) - v || 1, C = (e) => r.left + e / (p.length - 1) * o, w = (e) => r.top + (1 - (e - v) / x) * l, E = 1 - (1 - Math.min(e / 48, 1)) ** 3, D = Math.max(2, Math.floor(E * p.length));
|
|
2197
|
+
if (N(d.current, g.current), b.current = [], t.strokeStyle = h(a, .3), t.lineWidth = .5, t.setLineDash([]), t.beginPath(), t.moveTo(r.left, Z - r.bottom), t.lineTo(Ft - r.right, Z - r.bottom), t.stroke(), t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = h(u.t4, .9), t.textAlign = "center", p.forEach((e, n) => {
|
|
2202
2198
|
t.fillText(e.label.replace("Day ", "D"), C(n), Z - 4);
|
|
2203
2199
|
}), m.current.over && g.current) {
|
|
2204
2200
|
let e = parseInt(g.current.split("-")[1]);
|
|
@@ -2235,7 +2231,7 @@ function Lt({ points: e = [], className: t, colors: r }) {
|
|
|
2235
2231
|
children: /* @__PURE__ */ c("div", {
|
|
2236
2232
|
style: {
|
|
2237
2233
|
position: "relative",
|
|
2238
|
-
width:
|
|
2234
|
+
width: Ft,
|
|
2239
2235
|
height: Z
|
|
2240
2236
|
},
|
|
2241
2237
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -2243,14 +2239,14 @@ function Lt({ points: e = [], className: t, colors: r }) {
|
|
|
2243
2239
|
role: "img",
|
|
2244
2240
|
"aria-label": "trend chart",
|
|
2245
2241
|
style: {
|
|
2246
|
-
width:
|
|
2242
|
+
width: Ft,
|
|
2247
2243
|
height: Z,
|
|
2248
2244
|
display: "block",
|
|
2249
2245
|
borderRadius: 8
|
|
2250
2246
|
}
|
|
2251
2247
|
}), /* @__PURE__ */ s(C, {
|
|
2252
2248
|
..._,
|
|
2253
|
-
parentW:
|
|
2249
|
+
parentW: Ft,
|
|
2254
2250
|
parentH: Z
|
|
2255
2251
|
})]
|
|
2256
2252
|
})
|
|
@@ -2258,67 +2254,72 @@ function Lt({ points: e = [], className: t, colors: r }) {
|
|
|
2258
2254
|
}
|
|
2259
2255
|
//#endregion
|
|
2260
2256
|
//#region src/components/segmentedSplitBarChart/SegmentedSplitBarChart.tsx
|
|
2261
|
-
function
|
|
2257
|
+
function Lt(e, t, n) {
|
|
2262
2258
|
if (e.measureText(t).width <= n) return t;
|
|
2263
2259
|
let r = t;
|
|
2264
2260
|
for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
|
|
2265
2261
|
return r + "…";
|
|
2266
2262
|
}
|
|
2267
|
-
var
|
|
2268
|
-
function
|
|
2269
|
-
let r = a(null), l = a(/* @__PURE__ */ new Map()), d = a(0), [g, _] = o(!1), b = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), x = i(() => g ? b : b.slice(0,
|
|
2270
|
-
width:
|
|
2263
|
+
var Rt = 680, zt = 8, Bt = 26, Vt = 14, Ht = 16, Ut = 32;
|
|
2264
|
+
function Wt({ items: e = [], "data-testid": t }) {
|
|
2265
|
+
let r = a(null), l = a(/* @__PURE__ */ new Map()), d = a(0), [g, _] = o(!1), b = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), x = i(() => g ? b : b.slice(0, zt), [b, g]), S = Ht + Ut + x.length * (Bt + Vt) - Vt, { hoveredRef: T, tooltip: D, hitZonesRef: k } = w(r, {
|
|
2266
|
+
width: Rt,
|
|
2271
2267
|
height: S
|
|
2272
2268
|
});
|
|
2273
2269
|
return n(() => {
|
|
2274
2270
|
let e = r.current;
|
|
2275
2271
|
if (!e) return;
|
|
2276
|
-
let t = v(e,
|
|
2272
|
+
let t = v(e, Rt, S);
|
|
2277
2273
|
d.current = 0;
|
|
2278
|
-
let n =
|
|
2274
|
+
let n = Ht, i = Ut, a = Bt, o = Vt, s = Rt - 150 - 28, c = Math.max(...x.map((e) => (e.implemented ?? 0) + (e.unimplemented ?? 0)), 1), g = x.length * (a + o) - o, _ = n + (S - n - i - g) / 2, b, C = () => {
|
|
2279
2275
|
d.current++;
|
|
2280
2276
|
let e = d.current;
|
|
2281
|
-
t.clearRect(0, 0,
|
|
2277
|
+
t.clearRect(0, 0, Rt, S);
|
|
2282
2278
|
let n = O(Math.min(e / 60, 1));
|
|
2283
2279
|
N(l.current, T.current), k.current = [], x.forEach((e, r) => {
|
|
2284
2280
|
let i = M(n, r, x.length, O), d = _ + r * (a + o), m = (e.implemented ?? 0) + (e.unimplemented ?? 0), g = (e.implemented ?? 0) / c * s * i, v = (e.unimplemented ?? 0) / c * s * i, b = `${e.id}-impl`, S = `${e.id}-un`, C = l.current.get(b) ?? 0, w = l.current.get(S) ?? 0;
|
|
2285
|
-
E(k.current, b,
|
|
2286
|
-
label:
|
|
2287
|
-
value:
|
|
2288
|
-
sublabel: `${Math.round((e.implemented ?? 0) / (m || 1) * 100)}
|
|
2281
|
+
E(k.current, b, 150, d, g || 1, a, {
|
|
2282
|
+
label: e.name,
|
|
2283
|
+
value: U(e.implemented ?? 0),
|
|
2284
|
+
sublabel: `${Math.round((e.implemented ?? 0) / (m || 1) * 100)}%`,
|
|
2289
2285
|
color: u.green
|
|
2290
|
-
}), E(k.current, S,
|
|
2291
|
-
label:
|
|
2292
|
-
value:
|
|
2293
|
-
sublabel: `${Math.round((e.unimplemented ?? 0) / (m || 1) * 100)}
|
|
2286
|
+
}), E(k.current, S, 150 + g, d, v || 1, a, {
|
|
2287
|
+
label: e.name,
|
|
2288
|
+
value: U(e.unimplemented ?? 0),
|
|
2289
|
+
sublabel: `${Math.round((e.unimplemented ?? 0) / (m || 1) * 100)}%`,
|
|
2294
2290
|
color: u.amber
|
|
2295
|
-
}), t.font = f.font, t.fillStyle = u.t2, t.textAlign = "right", t.fillText(
|
|
2291
|
+
}), t.font = f.font, t.fillStyle = u.t2, t.textAlign = "right", t.fillText(Lt(t, e.abbreviation ?? e.name ?? "", 134), 142, d + a / 2 + 4), E(k.current, b, 0, d, 150, a, {
|
|
2292
|
+
label: e.name ?? e.abbreviation ?? "",
|
|
2293
|
+
value: `${U((e.implemented ?? 0) + (e.unimplemented ?? 0))} total variations`,
|
|
2294
|
+
sublabel: `Implemented: ${U(e.implemented ?? 0)} · Pending: ${U(e.unimplemented ?? 0)}`,
|
|
2295
|
+
color: u.green
|
|
2296
|
+
}), t.fillStyle = h(u.bd, .15), t.beginPath(), t.roundRect(150, d, m / c * s, a, 4), t.fill(), g > 0 && (C > 0 && y(t, 150 + g / 2, d + a / 2, g * .3, u.green, .12 * C), t.fillStyle = h(u.green, .6 + C * .2), t.beginPath(), t.roundRect(150, d, g, a, [
|
|
2296
2297
|
4,
|
|
2297
2298
|
0,
|
|
2298
2299
|
0,
|
|
2299
2300
|
4
|
|
2300
|
-
]), t.fill(), g > 28 && i > .5 && (t.font = p.font, t.fillStyle = C > 0 ? u.green : u.t2, t.textAlign = "center", t.fillText(U(e.implemented ?? 0),
|
|
2301
|
+
]), t.fill(), g > 28 && i > .5 && (t.font = p.font, t.fillStyle = C > 0 ? u.green : u.t2, t.textAlign = "center", t.fillText(U(e.implemented ?? 0), 150 + g / 2, d + a / 2 + 4))), v > 0 && (w > 0 && y(t, 150 + g + v / 2, d + a / 2, v * .3, u.amber, .12 * w), t.fillStyle = h(u.amber, .18 + w * .18), t.strokeStyle = h(u.amber, .3 + w * .3), t.lineWidth = 1, t.beginPath(), t.roundRect(150 + g, d, v, a, [
|
|
2301
2302
|
0,
|
|
2302
2303
|
4,
|
|
2303
2304
|
4,
|
|
2304
2305
|
0
|
|
2305
|
-
]), t.fill(), t.stroke(), v > 28 && i > .5 && (t.font = p.font, t.fillStyle = w > 0 ? u.amber : u.t2, t.textAlign = "center", t.fillText(U(e.unimplemented ?? 0),
|
|
2306
|
+
]), t.fill(), t.stroke(), v > 28 && i > .5 && (t.font = p.font, t.fillStyle = w > 0 ? u.amber : u.t2, t.textAlign = "center", t.fillText(U(e.unimplemented ?? 0), 150 + g + v / 2, d + a / 2 + 4))), g > 0 && v > 0 && (t.strokeStyle = h(u.bg, .7), t.lineWidth = 2, t.beginPath(), t.moveTo(150 + g, d), t.lineTo(150 + g, d + a), t.stroke());
|
|
2306
2307
|
});
|
|
2307
|
-
let r = _ + g + 24, i =
|
|
2308
|
+
let r = _ + g + 24, i = 150 + s / 2;
|
|
2308
2309
|
t.font = m.font, t.textAlign = "right", t.fillStyle = u.green, t.fillText("■ Implemented", i - 10, r), t.textAlign = "left", t.fillStyle = m.color, t.fillText("■ Unimplemented", i + 10, r), b = requestAnimationFrame(C);
|
|
2309
2310
|
};
|
|
2310
2311
|
return C(), () => cancelAnimationFrame(b);
|
|
2311
2312
|
}, [x, S]), b.length === 0 ? /* @__PURE__ */ s(L, {
|
|
2312
|
-
width:
|
|
2313
|
+
width: Rt,
|
|
2313
2314
|
height: 160,
|
|
2314
2315
|
"data-testid": t
|
|
2315
2316
|
}) : /* @__PURE__ */ c("div", {
|
|
2316
2317
|
"data-testid": t,
|
|
2317
|
-
style: { width:
|
|
2318
|
+
style: { width: Rt },
|
|
2318
2319
|
children: [/* @__PURE__ */ c("div", {
|
|
2319
2320
|
style: {
|
|
2320
2321
|
position: "relative",
|
|
2321
|
-
width:
|
|
2322
|
+
width: Rt,
|
|
2322
2323
|
height: S
|
|
2323
2324
|
},
|
|
2324
2325
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -2326,16 +2327,16 @@ function Gt({ items: e = [], "data-testid": t }) {
|
|
|
2326
2327
|
role: "img",
|
|
2327
2328
|
"aria-label": "Implemented vs unimplemented variations per contractor — split bar",
|
|
2328
2329
|
style: {
|
|
2329
|
-
width:
|
|
2330
|
+
width: Rt,
|
|
2330
2331
|
height: S,
|
|
2331
2332
|
display: "block"
|
|
2332
2333
|
}
|
|
2333
2334
|
}), /* @__PURE__ */ s(C, {
|
|
2334
2335
|
...D,
|
|
2335
|
-
parentW:
|
|
2336
|
+
parentW: Rt,
|
|
2336
2337
|
parentH: S
|
|
2337
2338
|
})]
|
|
2338
|
-
}), b.length >
|
|
2339
|
+
}), b.length > zt && /* @__PURE__ */ s("div", {
|
|
2339
2340
|
style: { marginTop: 8 },
|
|
2340
2341
|
children: /* @__PURE__ */ s(ie, {
|
|
2341
2342
|
expanded: g,
|
|
@@ -2346,18 +2347,18 @@ function Gt({ items: e = [], "data-testid": t }) {
|
|
|
2346
2347
|
}
|
|
2347
2348
|
//#endregion
|
|
2348
2349
|
//#region src/components/weeklyFlow/WeeklyFlow.tsx
|
|
2349
|
-
var
|
|
2350
|
-
function
|
|
2350
|
+
var Gt = 800, Kt = 360;
|
|
2351
|
+
function qt({ items: e = [], "data-testid": t }) {
|
|
2351
2352
|
let r = a(null), i = a(/* @__PURE__ */ new Map()), o = a(0), { hoveredRef: l, tooltip: m, hitZonesRef: g } = w(r, {
|
|
2352
|
-
width:
|
|
2353
|
-
height:
|
|
2353
|
+
width: Gt,
|
|
2354
|
+
height: Kt
|
|
2354
2355
|
});
|
|
2355
2356
|
return n(() => {
|
|
2356
2357
|
let t = r.current;
|
|
2357
2358
|
if (!t) return;
|
|
2358
|
-
let n = v(t,
|
|
2359
|
+
let n = v(t, Gt, Kt);
|
|
2359
2360
|
o.current = 0;
|
|
2360
|
-
let a = e.reduce((e, t) => e + (t.base ?? 0), 0), s = e.reduce((e, t) => e + (t.variation ?? 0), 0), c = e.reduce((e, t) => e + (t.total ?? 0), 0), m =
|
|
2361
|
+
let a = e.reduce((e, t) => e + (t.base ?? 0), 0), s = e.reduce((e, t) => e + (t.variation ?? 0), 0), c = e.reduce((e, t) => e + (t.total ?? 0), 0), m = Kt - 20 - 26, _ = m - 6 * (e.length - 1), b = 20, x = e.map((e, t) => {
|
|
2361
2362
|
let n = Math.max(24, (e.total ?? 0) / (c || 1) * _), r = {
|
|
2362
2363
|
x: 100 - 110 / 2,
|
|
2363
2364
|
y: b,
|
|
@@ -2385,16 +2386,16 @@ function Jt({ items: e = [], "data-testid": t }) {
|
|
|
2385
2386
|
}, j, P = () => {
|
|
2386
2387
|
o.current++;
|
|
2387
2388
|
let t = o.current;
|
|
2388
|
-
n.clearRect(0, 0,
|
|
2389
|
+
n.clearRect(0, 0, Gt, Kt), n.letterSpacing = f.letterSpacing;
|
|
2389
2390
|
let r = D(Math.min(t / 80, 1));
|
|
2390
2391
|
if (N(i.current, l.current), g.current = [], e.forEach((t, o) => {
|
|
2391
2392
|
let c = x[o], l = M(r, o, e.length, D), u = i.current.get(t.id) ?? 0;
|
|
2392
2393
|
if (l < .01) return;
|
|
2393
2394
|
let d = (t.base ?? 0) / (t.total || 1), f = (t.variation ?? 0) / (t.total || 1), p = c.h * d, m = c.h * f, h = c.y + p / 2, g = c.y + p + m / 2, _ = Math.max(2, (t.base ?? 0) / a * C), v = Math.max(2, (t.variation ?? 0) / s * w), y = O.y + e.slice(0, o).reduce((e, t) => e + (t.base ?? 0) / a * C, 0) + _ / 2, b = k.y + e.slice(0, o).reduce((e, t) => e + (t.variation ?? 0) / s * w, 0) + v / 2, S = u * .2 + .18;
|
|
2394
|
-
|
|
2395
|
+
Jt(n, c.x + 110, h, 420 - 110 / 2, y, _ * l, c.color, S), Jt(n, c.x + 110, g, 420 - 110 / 2, b, v * l, c.color, S * .75);
|
|
2395
2396
|
}), r > .3) {
|
|
2396
2397
|
let e = Math.min(1, (r - .3) / .7), t = A.y + a / c * m / 2, i = A.y + m - s / c * m / 2;
|
|
2397
|
-
|
|
2398
|
+
Jt(n, 475, O.cy, 720 - 110 / 2, t, C * e, u.blue, .25 * e), Jt(n, 475, k.cy, 720 - 110 / 2, i, w * e, u.amber, .22 * e);
|
|
2398
2399
|
}
|
|
2399
2400
|
if ([
|
|
2400
2401
|
"Contractors",
|
|
@@ -2406,22 +2407,22 @@ function Jt({ items: e = [], "data-testid": t }) {
|
|
|
2406
2407
|
420,
|
|
2407
2408
|
720
|
|
2408
2409
|
][t];
|
|
2409
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText(e, r,
|
|
2410
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText(e, r, Kt - 8);
|
|
2410
2411
|
}), e.forEach((t, a) => {
|
|
2411
2412
|
let o = x[a], s = M(r, a, e.length, D), c = i.current.get(t.id) ?? 0;
|
|
2412
2413
|
E(g.current, t.id, o.x, o.y, 110, o.h, {
|
|
2413
2414
|
label: t.name,
|
|
2414
|
-
value:
|
|
2415
|
-
sublabel:
|
|
2415
|
+
value: t.totalLabel ?? String(t.total ?? 0),
|
|
2416
|
+
sublabel: `${t.baseLabel ?? String(t.base ?? 0)} + ${t.variationLabel ?? String(t.variation ?? 0)}`,
|
|
2416
2417
|
color: o.color
|
|
2417
2418
|
}), c > 0 && y(n, o.x + 110 / 2, o.cy, 110 * .6, o.color, .12 * c), n.fillStyle = h(o.color, (.3 + c * .15) * s), n.strokeStyle = h(o.color, (.55 + c * .25) * s), n.lineWidth = 1, n.beginPath(), n.roundRect(o.x, o.y, 110 * s, o.h, 4), n.fill(), n.stroke(), s > .6 && o.h >= 24 && (n.globalAlpha = Math.min(1, (s - .6) / .4), n.font = f.font, n.fillStyle = c > 0 ? o.color : h(u.t2, .9), n.textAlign = "center", n.textBaseline = "middle", n.fillText(t.abbreviation ?? t.name?.slice(0, 6) ?? "", o.x + 110 / 2, o.h >= 36 ? o.cy - 5 : o.cy), o.h >= 36 && (n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = h(u.t3, .8), n.fillText(t.totalLabel ?? String(t.total ?? 0), o.x + 110 / 2, o.cy + 7)), n.globalAlpha = 1, n.textBaseline = "alphabetic");
|
|
2418
2419
|
}), r > .2) {
|
|
2419
2420
|
let e = Math.min(1, (r - .2) / .4);
|
|
2420
|
-
y(n, 420, O.cy, 30, u.blue, .1 * e), n.fillStyle = h(u.blue, .3 * e), n.strokeStyle = h(u.blue, .5 * e), n.lineWidth = 1, n.beginPath(), n.roundRect(O.x, O.y, 110, O.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.blue, n.textAlign = "center", n.fillText("Base Value", 420, O.cy - 6), n.font = p.font, n.fillStyle = p.color, n.fillText(
|
|
2421
|
+
y(n, 420, O.cy, 30, u.blue, .1 * e), n.fillStyle = h(u.blue, .3 * e), n.strokeStyle = h(u.blue, .5 * e), n.lineWidth = 1, n.beginPath(), n.roundRect(O.x, O.y, 110, O.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.blue, n.textAlign = "center", n.fillText("Base Value", 420, O.cy - 6), n.font = p.font, n.fillStyle = p.color, n.fillText(U(a), 420, O.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic", y(n, 420, k.cy, 24, u.amber, .1 * e), n.fillStyle = h(u.amber, .22 * e), n.strokeStyle = h(u.amber, .4 * e), n.beginPath(), n.roundRect(k.x, k.y, 110, k.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.amber, n.textAlign = "center", n.fillText("Variations", 420, k.cy - 4), n.font = p.font, n.fillStyle = p.color, n.fillText(U(s), 420, k.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic";
|
|
2421
2422
|
}
|
|
2422
2423
|
if (r > .5) {
|
|
2423
2424
|
let e = Math.min(1, (r - .5) / .5);
|
|
2424
|
-
y(n, 720, A.cy, 44, u.blue, .2 * e), n.fillStyle = h(u.blue, .25 * e), n.strokeStyle = h(u.blue, .6 * e), n.lineWidth = 1.5, n.beginPath(), n.roundRect(A.x, A.y, 110, A.h * e, 6), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.t2, n.textAlign = "center", n.fillText("Total Commitment", 720, A.cy - 12), n.font = p.font, n.fillStyle = u.blue, n.fillText(
|
|
2425
|
+
y(n, 720, A.cy, 44, u.blue, .2 * e), n.fillStyle = h(u.blue, .25 * e), n.strokeStyle = h(u.blue, .6 * e), n.lineWidth = 1.5, n.beginPath(), n.roundRect(A.x, A.y, 110, A.h * e, 6), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.t2, n.textAlign = "center", n.fillText("Total Commitment", 720, A.cy - 12), n.font = p.font, n.fillStyle = u.blue, n.fillText(U(c), 720, A.cy + 6), n.globalAlpha = 1, n.textBaseline = "alphabetic";
|
|
2425
2426
|
}
|
|
2426
2427
|
j = requestAnimationFrame(P);
|
|
2427
2428
|
};
|
|
@@ -2430,33 +2431,33 @@ function Jt({ items: e = [], "data-testid": t }) {
|
|
|
2430
2431
|
"data-testid": t,
|
|
2431
2432
|
style: {
|
|
2432
2433
|
position: "relative",
|
|
2433
|
-
width:
|
|
2434
|
-
height:
|
|
2434
|
+
width: Gt,
|
|
2435
|
+
height: Kt
|
|
2435
2436
|
},
|
|
2436
2437
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2437
2438
|
ref: r,
|
|
2438
2439
|
role: "img",
|
|
2439
2440
|
"aria-label": "Weekly report flow — base value and variations per contractor flowing to total commitment",
|
|
2440
2441
|
style: {
|
|
2441
|
-
width:
|
|
2442
|
-
height:
|
|
2442
|
+
width: Gt,
|
|
2443
|
+
height: Kt,
|
|
2443
2444
|
display: "block"
|
|
2444
2445
|
}
|
|
2445
2446
|
}), /* @__PURE__ */ s(C, {
|
|
2446
2447
|
...m,
|
|
2447
|
-
parentW:
|
|
2448
|
-
parentH:
|
|
2448
|
+
parentW: Gt,
|
|
2449
|
+
parentH: Kt
|
|
2449
2450
|
})]
|
|
2450
2451
|
});
|
|
2451
2452
|
}
|
|
2452
|
-
function
|
|
2453
|
+
function Jt(e, t, n, r, i, a, o, s) {
|
|
2453
2454
|
let c = (t + r) / 2;
|
|
2454
2455
|
e.beginPath(), e.moveTo(t, n - a / 2), e.bezierCurveTo(c, n - a / 2, c, i - a / 2, r, i - a / 2), e.lineTo(r, i + a / 2), e.bezierCurveTo(c, i + a / 2, c, n + a / 2, t, n + a / 2), e.closePath(), e.fillStyle = h(o, s), e.fill();
|
|
2455
2456
|
}
|
|
2456
2457
|
//#endregion
|
|
2457
2458
|
//#region src/components/visualizationRenderer/VisualizationRenderer.tsx
|
|
2458
|
-
function
|
|
2459
|
-
return e.type === "line" ? /* @__PURE__ */ s(
|
|
2459
|
+
function Yt({ config: e, className: t }) {
|
|
2460
|
+
return e.type === "line" ? /* @__PURE__ */ s(ze, {
|
|
2460
2461
|
rows: e.rows,
|
|
2461
2462
|
className: t
|
|
2462
2463
|
}) : e.type === "area" ? /* @__PURE__ */ s(ee, {
|
|
@@ -2465,31 +2466,31 @@ function Xt({ config: e, className: t }) {
|
|
|
2465
2466
|
}) : e.type === "bar" ? /* @__PURE__ */ s(re, {
|
|
2466
2467
|
rows: e.rows,
|
|
2467
2468
|
className: t
|
|
2468
|
-
}) : e.type === "pie" ? /* @__PURE__ */ s(
|
|
2469
|
+
}) : e.type === "pie" ? /* @__PURE__ */ s(Ze, {
|
|
2469
2470
|
rows: e.rows,
|
|
2470
2471
|
variant: "pie",
|
|
2471
2472
|
className: t
|
|
2472
|
-
}) : e.type === "donut" ? /* @__PURE__ */ s(
|
|
2473
|
+
}) : e.type === "donut" ? /* @__PURE__ */ s(Ze, {
|
|
2473
2474
|
rows: e.rows,
|
|
2474
2475
|
variant: "donut",
|
|
2475
2476
|
className: t
|
|
2476
|
-
}) : e.type === "sankey" ? /* @__PURE__ */ s(
|
|
2477
|
+
}) : e.type === "sankey" ? /* @__PURE__ */ s(ct, {
|
|
2477
2478
|
rows: e.rows,
|
|
2478
2479
|
className: t
|
|
2479
|
-
}) : e.type === "flow" ? /* @__PURE__ */ s(
|
|
2480
|
+
}) : e.type === "flow" ? /* @__PURE__ */ s(st, {
|
|
2480
2481
|
selectedEntity: e.selectedEntity,
|
|
2481
2482
|
className: t
|
|
2482
|
-
}) : e.type === "trend" ? /* @__PURE__ */ s(
|
|
2483
|
+
}) : e.type === "trend" ? /* @__PURE__ */ s(It, {
|
|
2483
2484
|
points: e.points,
|
|
2484
2485
|
className: t
|
|
2485
|
-
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(
|
|
2486
|
+
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(He, {
|
|
2486
2487
|
rows: e.rows,
|
|
2487
2488
|
className: t
|
|
2488
|
-
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Ae, { data: e.data }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Se, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(de, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(
|
|
2489
|
+
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Ae, { data: e.data }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Se, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(de, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(Pt, {
|
|
2489
2490
|
segments: e.segments,
|
|
2490
2491
|
title: e.title,
|
|
2491
2492
|
unitLabel: e.unitLabel
|
|
2492
|
-
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(
|
|
2493
|
+
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(Re, { items: e.items }) : e.type === "ranked-card-leaderboard" ? /* @__PURE__ */ s(Le, { items: e.items }) : e.type === "proportional-band-chart" ? /* @__PURE__ */ s(jt, { severities: e.severities }) : e.type === "radial-fan-tree-chart" ? /* @__PURE__ */ s(qe, {
|
|
2493
2494
|
total: e.total,
|
|
2494
2495
|
totalLabel: e.totalLabel,
|
|
2495
2496
|
items: e.items
|
|
@@ -2497,47 +2498,47 @@ function Xt({ config: e, className: t }) {
|
|
|
2497
2498
|
confirmed: e.confirmed,
|
|
2498
2499
|
total: e.total,
|
|
2499
2500
|
label: e.label
|
|
2500
|
-
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(
|
|
2501
|
+
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(Wt, { items: e.items }) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(dt, {
|
|
2501
2502
|
left: e.left,
|
|
2502
2503
|
right: e.right
|
|
2503
|
-
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(
|
|
2504
|
+
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(pt, { points: e.points }) : e.type === "trend-view" ? /* @__PURE__ */ s(wt, { points: e.points }) : e.type === "weekly-flow" ? /* @__PURE__ */ s(qt, { items: e.items }) : /* @__PURE__ */ s("div", {
|
|
2504
2505
|
className: "viz-empty",
|
|
2505
2506
|
children: "Visualization unavailable"
|
|
2506
2507
|
});
|
|
2507
2508
|
}
|
|
2508
2509
|
//#endregion
|
|
2509
2510
|
//#region src/utils/mounts.tsx
|
|
2510
|
-
var
|
|
2511
|
-
function
|
|
2511
|
+
var Xt = [];
|
|
2512
|
+
function Zt(e) {
|
|
2512
2513
|
try {
|
|
2513
2514
|
return JSON.parse(decodeURIComponent(e));
|
|
2514
2515
|
} catch {
|
|
2515
2516
|
return null;
|
|
2516
2517
|
}
|
|
2517
2518
|
}
|
|
2518
|
-
function
|
|
2519
|
-
for (;
|
|
2520
|
-
let e =
|
|
2519
|
+
function Qt() {
|
|
2520
|
+
for (; Xt.length;) {
|
|
2521
|
+
let e = Xt.pop();
|
|
2521
2522
|
e && e.unmount();
|
|
2522
2523
|
}
|
|
2523
2524
|
}
|
|
2524
|
-
function
|
|
2525
|
-
|
|
2525
|
+
function $t() {
|
|
2526
|
+
Qt(), document.querySelectorAll("[data-d3-viz]").forEach((t) => {
|
|
2526
2527
|
let n = t.dataset.d3Viz;
|
|
2527
2528
|
if (!n) return;
|
|
2528
|
-
let r =
|
|
2529
|
+
let r = Zt(n);
|
|
2529
2530
|
if (!r) return;
|
|
2530
2531
|
let i = e(t);
|
|
2531
|
-
|
|
2532
|
+
Xt.push(i), i.render(/* @__PURE__ */ s(Yt, { config: r }));
|
|
2532
2533
|
});
|
|
2533
2534
|
}
|
|
2534
|
-
function
|
|
2535
|
+
function en(e) {
|
|
2535
2536
|
return encodeURIComponent(JSON.stringify(e));
|
|
2536
2537
|
}
|
|
2537
2538
|
//#endregion
|
|
2538
2539
|
//#region src/components/donutChart/DonutChart.tsx
|
|
2539
|
-
function
|
|
2540
|
-
return /* @__PURE__ */ s(
|
|
2540
|
+
function tn({ rows: e = [], className: t, colors: n }) {
|
|
2541
|
+
return /* @__PURE__ */ s(Ze, {
|
|
2541
2542
|
rows: e,
|
|
2542
2543
|
variant: "donut",
|
|
2543
2544
|
className: t,
|
|
@@ -2556,26 +2557,27 @@ var Q = {
|
|
|
2556
2557
|
red: u.red,
|
|
2557
2558
|
amber: u.amber,
|
|
2558
2559
|
green: u.green
|
|
2559
|
-
}, $ = "'Satoshi Variable', 'DM Sans', sans-serif",
|
|
2560
|
+
}, $ = "'Satoshi Variable', 'DM Sans', sans-serif", nn = {
|
|
2560
2561
|
color: "#F7F7F7",
|
|
2561
2562
|
fontFamily: $,
|
|
2562
2563
|
fontSize: 24,
|
|
2563
2564
|
fontWeight: 500,
|
|
2564
2565
|
lineHeight: "32px"
|
|
2565
|
-
},
|
|
2566
|
+
}, rn = {
|
|
2566
2567
|
color: "#C2C2C2",
|
|
2567
2568
|
fontFamily: $,
|
|
2568
2569
|
fontSize: 18,
|
|
2569
2570
|
fontWeight: 400,
|
|
2570
2571
|
lineHeight: "20px"
|
|
2571
2572
|
};
|
|
2572
|
-
function
|
|
2573
|
-
|
|
2573
|
+
function an({ items: e = [] }) {
|
|
2574
|
+
let t = e.filter((e) => e.value);
|
|
2575
|
+
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2574
2576
|
style: {
|
|
2575
2577
|
display: "flex",
|
|
2576
2578
|
gap: 8
|
|
2577
2579
|
},
|
|
2578
|
-
children:
|
|
2580
|
+
children: t.map((e, t) => /* @__PURE__ */ c("div", {
|
|
2579
2581
|
style: {
|
|
2580
2582
|
display: "flex",
|
|
2581
2583
|
flexDirection: "column",
|
|
@@ -2592,25 +2594,26 @@ function on({ items: e = [] }) {
|
|
|
2592
2594
|
},
|
|
2593
2595
|
children: [/* @__PURE__ */ s("div", {
|
|
2594
2596
|
style: {
|
|
2595
|
-
...
|
|
2597
|
+
...nn,
|
|
2596
2598
|
color: Q.t1
|
|
2597
2599
|
},
|
|
2598
2600
|
children: e.value
|
|
2599
2601
|
}), /* @__PURE__ */ s("div", {
|
|
2600
|
-
style: { ...
|
|
2602
|
+
style: { ...rn },
|
|
2601
2603
|
children: e.label
|
|
2602
2604
|
})]
|
|
2603
2605
|
}, t))
|
|
2604
2606
|
});
|
|
2605
2607
|
}
|
|
2606
|
-
function
|
|
2607
|
-
|
|
2608
|
+
function on({ items: e = [] }) {
|
|
2609
|
+
let t = e.filter((e) => e.name ?? e.value);
|
|
2610
|
+
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2608
2611
|
style: {
|
|
2609
2612
|
display: "flex",
|
|
2610
2613
|
flexDirection: "column",
|
|
2611
2614
|
gap: 5
|
|
2612
2615
|
},
|
|
2613
|
-
children:
|
|
2616
|
+
children: t.map((e, t) => /* @__PURE__ */ c("div", {
|
|
2614
2617
|
style: {
|
|
2615
2618
|
display: "flex",
|
|
2616
2619
|
alignItems: "center",
|
|
@@ -2635,7 +2638,7 @@ function sn({ items: e = [] }) {
|
|
|
2635
2638
|
}),
|
|
2636
2639
|
/* @__PURE__ */ s("span", {
|
|
2637
2640
|
style: {
|
|
2638
|
-
...
|
|
2641
|
+
...nn,
|
|
2639
2642
|
fontSize: 18,
|
|
2640
2643
|
color: Q.t1,
|
|
2641
2644
|
minWidth: 70,
|
|
@@ -2645,7 +2648,7 @@ function sn({ items: e = [] }) {
|
|
|
2645
2648
|
}),
|
|
2646
2649
|
/* @__PURE__ */ s("span", {
|
|
2647
2650
|
style: {
|
|
2648
|
-
...
|
|
2651
|
+
...rn,
|
|
2649
2652
|
flex: 1
|
|
2650
2653
|
},
|
|
2651
2654
|
children: e.kpiLabel
|
|
@@ -2654,13 +2657,14 @@ function sn({ items: e = [] }) {
|
|
|
2654
2657
|
}, t))
|
|
2655
2658
|
});
|
|
2656
2659
|
}
|
|
2657
|
-
function
|
|
2658
|
-
|
|
2660
|
+
function sn({ items: e = [] }) {
|
|
2661
|
+
let t = e.filter((e) => e.value);
|
|
2662
|
+
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2659
2663
|
style: {
|
|
2660
2664
|
display: "flex",
|
|
2661
2665
|
gap: 8
|
|
2662
2666
|
},
|
|
2663
|
-
children:
|
|
2667
|
+
children: t.map((e, t) => /* @__PURE__ */ c("div", {
|
|
2664
2668
|
style: {
|
|
2665
2669
|
display: "flex",
|
|
2666
2670
|
flexDirection: "column",
|
|
@@ -2676,30 +2680,31 @@ function cn({ items: e = [] }) {
|
|
|
2676
2680
|
},
|
|
2677
2681
|
children: [/* @__PURE__ */ s("div", {
|
|
2678
2682
|
style: {
|
|
2679
|
-
...
|
|
2683
|
+
...nn,
|
|
2680
2684
|
color: Q.t1
|
|
2681
2685
|
},
|
|
2682
2686
|
children: e.value
|
|
2683
2687
|
}), /* @__PURE__ */ s("div", {
|
|
2684
|
-
style: { ...
|
|
2688
|
+
style: { ...rn },
|
|
2685
2689
|
children: e.label
|
|
2686
2690
|
})]
|
|
2687
2691
|
}, t))
|
|
2688
2692
|
});
|
|
2689
2693
|
}
|
|
2690
|
-
var
|
|
2694
|
+
var cn = {
|
|
2691
2695
|
red: Q.red,
|
|
2692
2696
|
amber: Q.amber,
|
|
2693
2697
|
green: Q.green
|
|
2694
2698
|
};
|
|
2695
|
-
function
|
|
2696
|
-
|
|
2699
|
+
function ln({ items: e = [] }) {
|
|
2700
|
+
let t = e.filter((e) => e.text);
|
|
2701
|
+
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2697
2702
|
style: {
|
|
2698
2703
|
display: "flex",
|
|
2699
2704
|
flexDirection: "column",
|
|
2700
2705
|
gap: 5
|
|
2701
2706
|
},
|
|
2702
|
-
children:
|
|
2707
|
+
children: t.map((e, t) => (cn[e.severity], /* @__PURE__ */ c("div", {
|
|
2703
2708
|
style: {
|
|
2704
2709
|
display: "flex",
|
|
2705
2710
|
alignItems: "flex-start",
|
|
@@ -2716,14 +2721,16 @@ function un({ items: e = [] }) {
|
|
|
2716
2721
|
flexShrink: 0,
|
|
2717
2722
|
marginTop: 5
|
|
2718
2723
|
} }), /* @__PURE__ */ s("span", {
|
|
2719
|
-
style: { ...
|
|
2724
|
+
style: { ...rn },
|
|
2720
2725
|
children: e.text
|
|
2721
2726
|
})]
|
|
2722
2727
|
}, t)))
|
|
2723
2728
|
});
|
|
2724
2729
|
}
|
|
2725
|
-
function
|
|
2726
|
-
let a =
|
|
2730
|
+
function un({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
2731
|
+
let a = r.filter((e) => e.name);
|
|
2732
|
+
if (a.length === 0) return null;
|
|
2733
|
+
let o = t - e;
|
|
2727
2734
|
return /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("div", {
|
|
2728
2735
|
style: {
|
|
2729
2736
|
position: "relative",
|
|
@@ -2762,8 +2769,8 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2762
2769
|
},
|
|
2763
2770
|
children: [t, n]
|
|
2764
2771
|
}),
|
|
2765
|
-
|
|
2766
|
-
let i = (t.val - e) /
|
|
2772
|
+
a.map((t, r) => {
|
|
2773
|
+
let i = (t.val - e) / o * 100, a = t.color ?? u.blue, l = r % 2 == 0;
|
|
2767
2774
|
return /* @__PURE__ */ c("div", {
|
|
2768
2775
|
style: {
|
|
2769
2776
|
position: "absolute",
|
|
@@ -2780,7 +2787,7 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2780
2787
|
children: [/* @__PURE__ */ s("div", {
|
|
2781
2788
|
style: {
|
|
2782
2789
|
fontSize: 18,
|
|
2783
|
-
color:
|
|
2790
|
+
color: a,
|
|
2784
2791
|
fontFamily: $,
|
|
2785
2792
|
whiteSpace: "nowrap"
|
|
2786
2793
|
},
|
|
@@ -2789,7 +2796,7 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2789
2796
|
style: {
|
|
2790
2797
|
fontSize: 18,
|
|
2791
2798
|
fontWeight: 500,
|
|
2792
|
-
color:
|
|
2799
|
+
color: a,
|
|
2793
2800
|
fontFamily: $,
|
|
2794
2801
|
whiteSpace: "nowrap"
|
|
2795
2802
|
},
|
|
@@ -2800,8 +2807,8 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2800
2807
|
width: 10,
|
|
2801
2808
|
height: 10,
|
|
2802
2809
|
borderRadius: "50%",
|
|
2803
|
-
background:
|
|
2804
|
-
boxShadow: `0 0 8px ${
|
|
2810
|
+
background: a,
|
|
2811
|
+
boxShadow: `0 0 8px ${a}70`,
|
|
2805
2812
|
margin: l ? "0 auto" : "26px auto 0"
|
|
2806
2813
|
} }),
|
|
2807
2814
|
!l && /* @__PURE__ */ c("div", {
|
|
@@ -2812,7 +2819,7 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2812
2819
|
children: [/* @__PURE__ */ s("div", {
|
|
2813
2820
|
style: {
|
|
2814
2821
|
fontSize: 18,
|
|
2815
|
-
color:
|
|
2822
|
+
color: a,
|
|
2816
2823
|
fontFamily: $,
|
|
2817
2824
|
whiteSpace: "nowrap"
|
|
2818
2825
|
},
|
|
@@ -2821,7 +2828,7 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2821
2828
|
style: {
|
|
2822
2829
|
fontSize: 18,
|
|
2823
2830
|
fontWeight: 500,
|
|
2824
|
-
color:
|
|
2831
|
+
color: a,
|
|
2825
2832
|
fontFamily: $,
|
|
2826
2833
|
whiteSpace: "nowrap"
|
|
2827
2834
|
},
|
|
@@ -2832,9 +2839,10 @@ function dn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2832
2839
|
}, r);
|
|
2833
2840
|
})
|
|
2834
2841
|
]
|
|
2835
|
-
}), i && i.length > 0 && /* @__PURE__ */ s(
|
|
2842
|
+
}), i && i.length > 0 && /* @__PURE__ */ s(sn, { items: i })] });
|
|
2836
2843
|
}
|
|
2837
|
-
function
|
|
2844
|
+
function dn({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i, rightLabel: a, rightValue: o, rightColor: l, chips: d }) {
|
|
2845
|
+
if (!t && !a) return null;
|
|
2838
2846
|
let f = r ?? u.blue, p = l ?? u.blue;
|
|
2839
2847
|
return /* @__PURE__ */ c("div", { children: [
|
|
2840
2848
|
/* @__PURE__ */ c("div", {
|
|
@@ -2928,10 +2936,11 @@ function fn({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i,
|
|
|
2928
2936
|
})
|
|
2929
2937
|
})]
|
|
2930
2938
|
}),
|
|
2931
|
-
d && d.length > 0 && /* @__PURE__ */ s(
|
|
2939
|
+
d && d.length > 0 && /* @__PURE__ */ s(sn, { items: d })
|
|
2932
2940
|
] });
|
|
2933
2941
|
}
|
|
2934
|
-
function
|
|
2942
|
+
function fn({ pct: e, label: t, color: n, chips: r }) {
|
|
2943
|
+
if (e == null && !t) return null;
|
|
2935
2944
|
let i = n ?? u.blue, a = 2 * Math.PI * 30, o = a * (1 - e / 100);
|
|
2936
2945
|
return /* @__PURE__ */ c("div", {
|
|
2937
2946
|
style: {
|
|
@@ -2990,7 +2999,7 @@ function pn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
2990
2999
|
style: { flex: 1 },
|
|
2991
3000
|
children: [/* @__PURE__ */ s("div", {
|
|
2992
3001
|
style: {
|
|
2993
|
-
...
|
|
3002
|
+
...rn,
|
|
2994
3003
|
padding: "10px 0px"
|
|
2995
3004
|
},
|
|
2996
3005
|
children: t
|
|
@@ -3013,14 +3022,14 @@ function pn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3013
3022
|
children: [
|
|
3014
3023
|
/* @__PURE__ */ s("span", {
|
|
3015
3024
|
style: {
|
|
3016
|
-
...
|
|
3025
|
+
...nn,
|
|
3017
3026
|
color: Q.t2
|
|
3018
3027
|
},
|
|
3019
3028
|
children: e.value
|
|
3020
3029
|
}),
|
|
3021
3030
|
/* @__PURE__ */ s("span", {
|
|
3022
3031
|
style: {
|
|
3023
|
-
...
|
|
3032
|
+
...nn,
|
|
3024
3033
|
color: Q.t2,
|
|
3025
3034
|
fontWeight: 400,
|
|
3026
3035
|
userSelect: "none"
|
|
@@ -3028,7 +3037,7 @@ function pn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3028
3037
|
children: "|"
|
|
3029
3038
|
}),
|
|
3030
3039
|
/* @__PURE__ */ s("span", {
|
|
3031
|
-
style: { ...
|
|
3040
|
+
style: { ...rn },
|
|
3032
3041
|
children: e.label
|
|
3033
3042
|
})
|
|
3034
3043
|
]
|
|
@@ -3037,23 +3046,24 @@ function pn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3037
3046
|
})]
|
|
3038
3047
|
});
|
|
3039
3048
|
}
|
|
3040
|
-
var
|
|
3049
|
+
var pn = {
|
|
3041
3050
|
green: "#34D39918",
|
|
3042
3051
|
amber: "#FBBF2418",
|
|
3043
3052
|
red: "#F0606018"
|
|
3044
|
-
},
|
|
3053
|
+
}, mn = {
|
|
3045
3054
|
green: "#34D399",
|
|
3046
3055
|
amber: "#FBBF24",
|
|
3047
3056
|
red: "#F06060"
|
|
3048
3057
|
};
|
|
3049
|
-
function
|
|
3050
|
-
|
|
3058
|
+
function hn({ items: e = [] }) {
|
|
3059
|
+
let t = e.filter((e) => e.name ?? e.value);
|
|
3060
|
+
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
3051
3061
|
style: {
|
|
3052
3062
|
display: "flex",
|
|
3053
3063
|
flexDirection: "column",
|
|
3054
3064
|
gap: 5
|
|
3055
3065
|
},
|
|
3056
|
-
children:
|
|
3066
|
+
children: t.map((e, t) => /* @__PURE__ */ c("div", {
|
|
3057
3067
|
style: {
|
|
3058
3068
|
display: "flex",
|
|
3059
3069
|
alignItems: "center",
|
|
@@ -3110,8 +3120,8 @@ function gn({ items: e = [] }) {
|
|
|
3110
3120
|
style: {
|
|
3111
3121
|
fontSize: 18,
|
|
3112
3122
|
fontWeight: 500,
|
|
3113
|
-
color:
|
|
3114
|
-
background:
|
|
3123
|
+
color: mn[e.badgeSeverity],
|
|
3124
|
+
background: pn[e.badgeSeverity],
|
|
3115
3125
|
padding: "2px 7px",
|
|
3116
3126
|
borderRadius: 4,
|
|
3117
3127
|
fontFamily: $,
|
|
@@ -3123,7 +3133,7 @@ function gn({ items: e = [] }) {
|
|
|
3123
3133
|
}),
|
|
3124
3134
|
e.sublabel && /* @__PURE__ */ s("span", {
|
|
3125
3135
|
style: {
|
|
3126
|
-
...
|
|
3136
|
+
...rn,
|
|
3127
3137
|
flexShrink: 0,
|
|
3128
3138
|
minWidth: 80,
|
|
3129
3139
|
textAlign: "right"
|
|
@@ -3134,20 +3144,21 @@ function gn({ items: e = [] }) {
|
|
|
3134
3144
|
}, t))
|
|
3135
3145
|
});
|
|
3136
3146
|
}
|
|
3137
|
-
var
|
|
3147
|
+
var gn = {
|
|
3138
3148
|
red: Q.red,
|
|
3139
3149
|
amber: Q.amber,
|
|
3140
3150
|
green: Q.green
|
|
3141
3151
|
};
|
|
3142
|
-
function
|
|
3143
|
-
|
|
3152
|
+
function _n({ items: e = [] }) {
|
|
3153
|
+
let t = e.filter((e) => e.text);
|
|
3154
|
+
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
3144
3155
|
style: {
|
|
3145
3156
|
display: "flex",
|
|
3146
3157
|
flexDirection: "column",
|
|
3147
3158
|
gap: 5
|
|
3148
3159
|
},
|
|
3149
|
-
children:
|
|
3150
|
-
let n =
|
|
3160
|
+
children: t.map((e, t) => {
|
|
3161
|
+
let n = gn[e.severity];
|
|
3151
3162
|
return /* @__PURE__ */ c("div", {
|
|
3152
3163
|
style: {
|
|
3153
3164
|
display: "flex",
|
|
@@ -3173,13 +3184,13 @@ function vn({ items: e = [] }) {
|
|
|
3173
3184
|
/* @__PURE__ */ s("span", {
|
|
3174
3185
|
style: {
|
|
3175
3186
|
flex: 1,
|
|
3176
|
-
...
|
|
3187
|
+
...rn
|
|
3177
3188
|
},
|
|
3178
3189
|
children: e.text
|
|
3179
3190
|
}),
|
|
3180
3191
|
/* @__PURE__ */ s("span", {
|
|
3181
3192
|
style: {
|
|
3182
|
-
...
|
|
3193
|
+
...rn,
|
|
3183
3194
|
flexShrink: 0,
|
|
3184
3195
|
marginTop: 1
|
|
3185
3196
|
},
|
|
@@ -3190,8 +3201,8 @@ function vn({ items: e = [] }) {
|
|
|
3190
3201
|
})
|
|
3191
3202
|
});
|
|
3192
3203
|
}
|
|
3193
|
-
function
|
|
3194
|
-
return /* @__PURE__ */ c("div", {
|
|
3204
|
+
function vn({ columns: e = [], rows: t = [] }) {
|
|
3205
|
+
return t.length === 0 ? null : /* @__PURE__ */ c("div", {
|
|
3195
3206
|
style: {
|
|
3196
3207
|
display: "flex",
|
|
3197
3208
|
flexDirection: "column",
|
|
@@ -3253,21 +3264,21 @@ function yn({ columns: e = [], rows: t = [] }) {
|
|
|
3253
3264
|
}, t))]
|
|
3254
3265
|
});
|
|
3255
3266
|
}
|
|
3256
|
-
function
|
|
3267
|
+
function yn({ block: e }) {
|
|
3257
3268
|
if (!e) return null;
|
|
3258
3269
|
switch (e.type) {
|
|
3259
|
-
case "stats": return /* @__PURE__ */ s(
|
|
3260
|
-
case "ranked": return /* @__PURE__ */ s(
|
|
3261
|
-
case "chips": return /* @__PURE__ */ s(
|
|
3262
|
-
case "badges": return /* @__PURE__ */ s(
|
|
3263
|
-
case "dot-strip": return /* @__PURE__ */ s(
|
|
3270
|
+
case "stats": return /* @__PURE__ */ s(an, { items: e.items });
|
|
3271
|
+
case "ranked": return /* @__PURE__ */ s(on, { items: e.items });
|
|
3272
|
+
case "chips": return /* @__PURE__ */ s(sn, { items: e.items });
|
|
3273
|
+
case "badges": return /* @__PURE__ */ s(ln, { items: e.items });
|
|
3274
|
+
case "dot-strip": return /* @__PURE__ */ s(un, {
|
|
3264
3275
|
min: e.min,
|
|
3265
3276
|
max: e.max,
|
|
3266
3277
|
unit: e.unit,
|
|
3267
3278
|
dots: e.dots,
|
|
3268
3279
|
chips: e.chips
|
|
3269
3280
|
});
|
|
3270
|
-
case "proportion": return /* @__PURE__ */ s(
|
|
3281
|
+
case "proportion": return /* @__PURE__ */ s(dn, {
|
|
3271
3282
|
leftPct: e.leftPct,
|
|
3272
3283
|
leftLabel: e.leftLabel,
|
|
3273
3284
|
leftValue: e.leftValue,
|
|
@@ -3278,15 +3289,15 @@ function bn({ block: e }) {
|
|
|
3278
3289
|
rightColor: e.rightColor,
|
|
3279
3290
|
chips: e.chips
|
|
3280
3291
|
});
|
|
3281
|
-
case "ring": return /* @__PURE__ */ s(
|
|
3292
|
+
case "ring": return /* @__PURE__ */ s(fn, {
|
|
3282
3293
|
pct: e.pct,
|
|
3283
3294
|
label: e.label,
|
|
3284
3295
|
color: e.color,
|
|
3285
3296
|
chips: e.chips
|
|
3286
3297
|
});
|
|
3287
|
-
case "scorecard-rows": return /* @__PURE__ */ s(
|
|
3288
|
-
case "flags-list": return /* @__PURE__ */ s(
|
|
3289
|
-
case "comparison-rows": return /* @__PURE__ */ s(
|
|
3298
|
+
case "scorecard-rows": return /* @__PURE__ */ s(hn, { items: e.items });
|
|
3299
|
+
case "flags-list": return /* @__PURE__ */ s(_n, { items: e.items });
|
|
3300
|
+
case "comparison-rows": return /* @__PURE__ */ s(vn, {
|
|
3290
3301
|
columns: e.columns,
|
|
3291
3302
|
rows: e.rows
|
|
3292
3303
|
});
|
|
@@ -3295,14 +3306,14 @@ function bn({ block: e }) {
|
|
|
3295
3306
|
}
|
|
3296
3307
|
//#endregion
|
|
3297
3308
|
//#region src/components/keyHighlights/Takeaway.tsx
|
|
3298
|
-
var
|
|
3309
|
+
var bn = "'Satoshi Variable', 'DM Sans', sans-serif", xn = {
|
|
3299
3310
|
color: "#C2C2C2",
|
|
3300
|
-
fontFamily:
|
|
3311
|
+
fontFamily: bn,
|
|
3301
3312
|
fontSize: 18,
|
|
3302
3313
|
fontWeight: 400,
|
|
3303
3314
|
lineHeight: 1.65
|
|
3304
3315
|
};
|
|
3305
|
-
function
|
|
3316
|
+
function Sn({ text: e }) {
|
|
3306
3317
|
return /* @__PURE__ */ c("div", {
|
|
3307
3318
|
style: {
|
|
3308
3319
|
padding: "8px 0px",
|
|
@@ -3315,16 +3326,16 @@ function Cn({ text: e }) {
|
|
|
3315
3326
|
fontSize: 18,
|
|
3316
3327
|
fontWeight: 500,
|
|
3317
3328
|
color: u.t1,
|
|
3318
|
-
fontFamily:
|
|
3329
|
+
fontFamily: bn,
|
|
3319
3330
|
lineHeight: 1.65,
|
|
3320
3331
|
marginRight: 8
|
|
3321
3332
|
},
|
|
3322
3333
|
children: "Takeaway"
|
|
3323
3334
|
}), /* @__PURE__ */ s("span", {
|
|
3324
|
-
style: { ...
|
|
3335
|
+
style: { ...xn },
|
|
3325
3336
|
children: e
|
|
3326
3337
|
})]
|
|
3327
3338
|
});
|
|
3328
3339
|
}
|
|
3329
3340
|
//#endregion
|
|
3330
|
-
export { ee as AreaChart, re as BarChart, l as ChartFrame,
|
|
3341
|
+
export { ee as AreaChart, re as BarChart, l as ChartFrame, tn as DonutChart, yn as KeyHighlights, ze as LineChart, He as MiniBars, Ze as PieChart, st as ProcessSankey, ct as RankingSankey, $e as SankeySvg, I as SeriesChart, Sn as Takeaway, wt as Trend, It as TrendChart, Yt as VisualizationRenderer, Qt as cleanupVisualizationMounts, $t as hydrateVisualizationMounts, en as serializeVisualizationConfig };
|