@divami-artefacts/ai-design-system 1.0.23 → 1.0.24
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/index.cjs +1 -1
- package/dist/index.js +249 -243
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -812,12 +812,18 @@ var we = 680, Te = 220, Ee = 8, De = [
|
|
|
812
812
|
right: 80,
|
|
813
813
|
top: 16,
|
|
814
814
|
bottom: 38
|
|
815
|
-
}, Oe =
|
|
816
|
-
function ke(e) {
|
|
815
|
+
}, Oe = 150, V = 18;
|
|
816
|
+
function ke(e, t, n) {
|
|
817
|
+
if (e.measureText(t).width <= n) return t;
|
|
818
|
+
let r = t;
|
|
819
|
+
for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
|
|
820
|
+
return r + "…";
|
|
821
|
+
}
|
|
822
|
+
function Ae(e) {
|
|
817
823
|
let t = Math.abs(e), n = e < 0 ? "-" : "";
|
|
818
824
|
return t >= 1e6 ? `${n}£${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${n}£${(t / 1e3).toFixed(1)}K` : `${n}£${t.toFixed(0)}`;
|
|
819
825
|
}
|
|
820
|
-
function
|
|
826
|
+
function je({ data: e, "data-testid": t }) {
|
|
821
827
|
let n = a(null), r = a(/* @__PURE__ */ new Map()), [i, l] = o(!1), { items: d = [], totals: g } = e, _ = d.filter((e) => typeof e == "object" && !!e), v = [..._].sort((e, t) => (t.total ?? 0) - (e.total ?? 0)), b = i ? v : v.slice(0, Ee), x = b.length, S = Math.max(...v.map((e) => Math.abs(e.total ?? 0)), 1), T = Math.max(Te, B.top + B.bottom + x * V + Math.max(0, x - 1) * 8), D = we - B.left - Oe - B.right, k = x > 1 ? (T - B.top - B.bottom - x * V) / (x - 1) : 0, A = _.length === 0, { hoveredRef: j, tooltip: P, hitZonesRef: F } = w(n, {
|
|
822
828
|
width: we,
|
|
823
829
|
height: T
|
|
@@ -825,20 +831,20 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
825
831
|
return ge(n, we, T, (e, t) => {
|
|
826
832
|
N(r.current, j.current), F.current = [], b.forEach((n, i) => {
|
|
827
833
|
let a = De[i % De.length], o = M(t, i, x, O), s = B.top + i * (V + k), c = B.left + Oe, l = r.current.get(n.id) ?? 0, d = Math.max(n.base ?? 0, 0), m = Math.max(n.total ?? 0, 0), g = d / S * D * o, _ = m / S * D * o, v = _ - g;
|
|
828
|
-
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(
|
|
834
|
+
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(ke(e, n.name, Oe - 16), c - 8, s + V / 2), e.fillStyle = h(u.bd, .25), e.beginPath(), e.roundRect(c, s, D, V, 4), e.fill(), g > 0 && (l > 0 && y(e, c + g / 2, s + V / 2, g * .3, a, .1 * l), e.fillStyle = h(a, .5 + l * .15), e.beginPath(), e.roundRect(c, s, g, V, 4), e.fill()), v > 2 && (e.fillStyle = h(a, .22 + l * .08), e.beginPath(), e.roundRect(c + g, s, v, V, [
|
|
829
835
|
0,
|
|
830
836
|
4,
|
|
831
837
|
4,
|
|
832
838
|
0
|
|
833
|
-
]), 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 + V - 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, _, V, 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(
|
|
839
|
+
]), 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 + V - 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, _, V, 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(Ae(n.total ?? 0), c + _ + 6, s + V / 2), e.globalAlpha = 1), E(F.current, n.id, c, s, Math.max(_, 1), V, {
|
|
834
840
|
label: n.name,
|
|
835
|
-
value: `${
|
|
836
|
-
sublabel: `Base ${
|
|
841
|
+
value: `${Ae(n.total ?? 0)} total`,
|
|
842
|
+
sublabel: `Base ${Ae(n.base ?? 0)} + Var ${Ae(n.variation ?? 0)} · ${n.percentage ?? 0}% committed`,
|
|
837
843
|
color: a
|
|
838
844
|
});
|
|
839
845
|
});
|
|
840
846
|
let n = T - 14;
|
|
841
|
-
e.textBaseline = "middle", e.font = m.font, e.textAlign = "left", e.fillStyle = h(u.blue, .5), e.beginPath(), e.roundRect(B.left + Oe, n - 3, 14, 6, 2), e.fill(), e.fillStyle = m.color, e.fillText("base value", B.left + Oe + 18, n), e.fillStyle = h(u.blue, .22), e.beginPath(), e.roundRect(B.left + Oe + 94, n - 3, 14, 6, 2), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(u.blue, .5), e.lineWidth = .5, e.beginPath(), e.moveTo(B.left + Oe + 101, n - 3), e.lineTo(B.left + Oe + 101, n + 3), e.stroke(), e.setLineDash([]), e.fillStyle = m.color, e.fillText("approved variations", B.left + Oe + 112, n), e.font = m.font, e.textAlign = "right", e.fillStyle = m.color, e.fillText(`Portfolio: ${
|
|
847
|
+
e.textBaseline = "middle", e.font = m.font, e.textAlign = "left", e.fillStyle = h(u.blue, .5), e.beginPath(), e.roundRect(B.left + Oe, n - 3, 14, 6, 2), e.fill(), e.fillStyle = m.color, e.fillText("base value", B.left + Oe + 18, n), e.fillStyle = h(u.blue, .22), e.beginPath(), e.roundRect(B.left + Oe + 94, n - 3, 14, 6, 2), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(u.blue, .5), e.lineWidth = .5, e.beginPath(), e.moveTo(B.left + Oe + 101, n - 3), e.lineTo(B.left + Oe + 101, n + 3), e.stroke(), e.setLineDash([]), e.fillStyle = m.color, e.fillText("approved variations", B.left + Oe + 112, n), e.font = m.font, e.textAlign = "right", e.fillStyle = m.color, e.fillText(`Portfolio: ${Ae(g?.total ?? 0)}`, we - 8, n);
|
|
842
848
|
}, !0, { easing: O }), A ? /* @__PURE__ */ s(I, {
|
|
843
849
|
width: we,
|
|
844
850
|
height: Te,
|
|
@@ -878,14 +884,14 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
878
884
|
}
|
|
879
885
|
//#endregion
|
|
880
886
|
//#region src/components/rankedCardLeaderboard/RankedCardLeaderboard.tsx
|
|
881
|
-
var H = 780, U = 240,
|
|
887
|
+
var H = 780, U = 240, Me = 12, Ne = 10, Pe = [
|
|
882
888
|
"Highest exposure",
|
|
883
889
|
"Elevated risk",
|
|
884
890
|
"Moderate exposure",
|
|
885
891
|
"Moderate exposure",
|
|
886
892
|
"Low exposure"
|
|
887
893
|
];
|
|
888
|
-
function
|
|
894
|
+
function Fe({ items: e = [], "data-testid": t }) {
|
|
889
895
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(r, {
|
|
890
896
|
width: H,
|
|
891
897
|
height: U
|
|
@@ -895,18 +901,18 @@ function Pe({ items: e = [], "data-testid": t }) {
|
|
|
895
901
|
if (!e) return;
|
|
896
902
|
let t = v(e, H, U);
|
|
897
903
|
o.current = 0;
|
|
898
|
-
let n = Math.min(5, b.length), i = (H - 2 *
|
|
904
|
+
let n = Math.min(5, b.length), i = (H - 2 * Me - 4 * Ne) / 5, a = U * .84, s = U * .08, c = n * i + (n - 1) * Ne, g = Math.round((H - c) / 2), C, w = () => {
|
|
899
905
|
o.current++;
|
|
900
906
|
let e = o.current;
|
|
901
907
|
t.clearRect(0, 0, H, U), t.letterSpacing = f.letterSpacing, _.current = [], l.current.forEach((e, t) => {
|
|
902
908
|
let n = t === m.current ? 1 : 0, r = e + (n - e) * .12;
|
|
903
909
|
Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
|
|
904
910
|
}), m.current && !l.current.has(m.current) && l.current.set(m.current, 0), b.forEach((n, r) => {
|
|
905
|
-
let o = r === 0, c = r === 0 ? u.red : r === 1 ? u.amber : d[r % d.length], f = g + r * (i +
|
|
911
|
+
let o = r === 0, c = r === 0 ? u.red : r === 1 ? u.amber : d[r % d.length], f = g + r * (i + Ne), m = l.current.get(n.id) ?? 0, v = m * 8, b = f - v / 2, x = i + v, C = o ? j(e, .04, 3e-4) * .06 + .06 : 0;
|
|
906
912
|
t.fillStyle = h(c, .08 + m * .07), t.beginPath(), t.roundRect(b, s, x, a, 6), t.fill(), t.strokeStyle = h(c, .2 + m * .4 + C), t.lineWidth = o ? 1.5 : 1, t.stroke(), (m > .01 || o) && y(t, b + x / 2, s + a / 2, x * .55, c, C + m * .14), t.font = p.font, t.textAlign = "left", t.textBaseline = "top", t.fillStyle = h(c, .5 + m * .35), t.fillText(`#${r + 1}`, b + 7, s + 6);
|
|
907
913
|
let w = Math.min(i * .28, a * .32, 72), T = b + x / 2, D = s + a * .38, O = t.createRadialGradient(T, D - w * .2, 0, T, D, w);
|
|
908
914
|
O.addColorStop(0, h(c, .5 + m * .2)), O.addColorStop(1, h(c, .2 + m * .1)), t.beginPath(), t.arc(T, D, w, 0, Math.PI * 2), t.fillStyle = O, t.fill(), t.strokeStyle = h(c, .4 + m * .3), t.lineWidth = 1, t.stroke(), t.font = p.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(u.t1, .9), t.fillText(n.abbreviation ?? n.name.slice(0, 6), T, D), t.font = p.font, t.textBaseline = "alphabetic", t.fillStyle = h(c, .9 + m * .1), t.fillText(String(n.count ?? 0), T, s + a * .76);
|
|
909
|
-
let k = Math.round((n.count ?? 0) / (S || 1) * 100), A =
|
|
915
|
+
let k = Math.round((n.count ?? 0) / (S || 1) * 100), A = Pe[r] ?? "Low exposure";
|
|
910
916
|
E(_.current, n.id, f, s, i, a, {
|
|
911
917
|
label: n.name,
|
|
912
918
|
value: `${n.count ?? 0} · ${k}% of total`,
|
|
@@ -947,7 +953,7 @@ function Pe({ items: e = [], "data-testid": t }) {
|
|
|
947
953
|
//#endregion
|
|
948
954
|
//#region src/components/dotMatrixChart/DotMatrixChart.tsx
|
|
949
955
|
var W = 680, G = 260;
|
|
950
|
-
function
|
|
956
|
+
function Ie({ items: e = [], "data-testid": t }) {
|
|
951
957
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
952
958
|
width: W,
|
|
953
959
|
height: G
|
|
@@ -1014,7 +1020,7 @@ function Fe({ items: e = [], "data-testid": t }) {
|
|
|
1014
1020
|
}
|
|
1015
1021
|
//#endregion
|
|
1016
1022
|
//#region src/components/lineChart/LineChart.tsx
|
|
1017
|
-
function
|
|
1023
|
+
function Le({ rows: e = [], className: t, colors: n }) {
|
|
1018
1024
|
return /* @__PURE__ */ s(ee, {
|
|
1019
1025
|
rows: e,
|
|
1020
1026
|
variant: "line",
|
|
@@ -1024,7 +1030,7 @@ function Ie({ rows: e = [], className: t, colors: n }) {
|
|
|
1024
1030
|
}
|
|
1025
1031
|
//#endregion
|
|
1026
1032
|
//#region src/components/constants.ts
|
|
1027
|
-
var
|
|
1033
|
+
var Re = [
|
|
1028
1034
|
"#4C93D9",
|
|
1029
1035
|
"#5DA537",
|
|
1030
1036
|
"#F3862C",
|
|
@@ -1032,7 +1038,7 @@ var Le = [
|
|
|
1032
1038
|
"#A0B724",
|
|
1033
1039
|
"#EEBF3B",
|
|
1034
1040
|
"#3C45D1"
|
|
1035
|
-
],
|
|
1041
|
+
], ze = {
|
|
1036
1042
|
nodes: [
|
|
1037
1043
|
{
|
|
1038
1044
|
id: "supplier-x",
|
|
@@ -1075,8 +1081,8 @@ var Le = [
|
|
|
1075
1081
|
};
|
|
1076
1082
|
//#endregion
|
|
1077
1083
|
//#region src/components/miniBars/MiniBars.tsx
|
|
1078
|
-
function
|
|
1079
|
-
let r = n?.slices ??
|
|
1084
|
+
function Be({ rows: e = [], className: t, colors: n }) {
|
|
1085
|
+
let r = n?.slices ?? Re;
|
|
1080
1086
|
return /* @__PURE__ */ s("div", {
|
|
1081
1087
|
className: ["d3-mini-bars", t].filter(Boolean).join(" "),
|
|
1082
1088
|
children: e.map(([e, t, n], i) => /* @__PURE__ */ c("div", {
|
|
@@ -1102,7 +1108,7 @@ function ze({ rows: e = [], className: t, colors: n }) {
|
|
|
1102
1108
|
width: Math.max(0, Math.min(100, t)),
|
|
1103
1109
|
height: "12",
|
|
1104
1110
|
rx: "6",
|
|
1105
|
-
className: `d3-mini-fill tone-${i %
|
|
1111
|
+
className: `d3-mini-fill tone-${i % Re.length}`,
|
|
1106
1112
|
fill: r[i % r.length]
|
|
1107
1113
|
})]
|
|
1108
1114
|
})
|
|
@@ -1114,24 +1120,24 @@ function ze({ rows: e = [], className: t, colors: n }) {
|
|
|
1114
1120
|
}
|
|
1115
1121
|
//#endregion
|
|
1116
1122
|
//#region src/components/radialFanTreeChart/RadialFanTreeChart.tsx
|
|
1117
|
-
var
|
|
1118
|
-
function
|
|
1119
|
-
let o = a(null), l = a(/* @__PURE__ */ new Map()), m = a(0), g = i(() => t.filter((e) => typeof e == "object" && !!e), [t]), _ = i(() => Math.max(
|
|
1120
|
-
width:
|
|
1123
|
+
var Ve = 680, He = 320, Ue = 60, We = 28;
|
|
1124
|
+
function Ge({ total: e = 0, items: t = [], "data-testid": r }) {
|
|
1125
|
+
let o = a(null), l = a(/* @__PURE__ */ new Map()), m = a(0), g = i(() => t.filter((e) => typeof e == "object" && !!e), [t]), _ = i(() => Math.max(He, Ue + Math.max(0, g.length - 1) * We), [g.length]), { hoveredRef: b, tooltip: x, hitZonesRef: S } = w(o, {
|
|
1126
|
+
width: Ve,
|
|
1121
1127
|
height: _
|
|
1122
1128
|
});
|
|
1123
1129
|
return n(() => {
|
|
1124
1130
|
let t = o.current;
|
|
1125
1131
|
if (!t) return;
|
|
1126
|
-
let n = v(t,
|
|
1132
|
+
let n = v(t, Ve, _);
|
|
1127
1133
|
m.current = 0;
|
|
1128
|
-
let r = _ / 2, i =
|
|
1134
|
+
let r = _ / 2, i = Ve - 80, a = Math.max(...g.map((e) => e.count ?? 0)), s = (_ - 60) / (g.length - 1), c = g.map((e, t) => ({
|
|
1129
1135
|
x: i,
|
|
1130
1136
|
y: 30 + t * s
|
|
1131
1137
|
})), x, C = () => {
|
|
1132
1138
|
m.current++;
|
|
1133
1139
|
let t = m.current;
|
|
1134
|
-
n.clearRect(0, 0,
|
|
1140
|
+
n.clearRect(0, 0, Ve, _), n.letterSpacing = f.letterSpacing;
|
|
1135
1141
|
let o = D(Math.min(t / 72, 1));
|
|
1136
1142
|
N(l.current, b.current), S.current = [], y(n, 88, r, 48 * o, u.blue, .15 * o), g.forEach((t, s) => {
|
|
1137
1143
|
let m = d[s % d.length], _ = M(o, s, g.length, D), v = c[s], b = l.current.get(t.id) ?? 0, x = Math.max(1.5, (t.count ?? 0) / a * 6);
|
|
@@ -1163,14 +1169,14 @@ function We({ total: e = 0, items: t = [], "data-testid": r }) {
|
|
|
1163
1169
|
g,
|
|
1164
1170
|
_
|
|
1165
1171
|
]), g.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1166
|
-
width:
|
|
1167
|
-
height:
|
|
1172
|
+
width: Ve,
|
|
1173
|
+
height: He,
|
|
1168
1174
|
"data-testid": r
|
|
1169
1175
|
}) : /* @__PURE__ */ c("div", {
|
|
1170
1176
|
"data-testid": r,
|
|
1171
1177
|
style: {
|
|
1172
1178
|
position: "relative",
|
|
1173
|
-
width:
|
|
1179
|
+
width: Ve,
|
|
1174
1180
|
height: _
|
|
1175
1181
|
},
|
|
1176
1182
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -1178,34 +1184,34 @@ function We({ total: e = 0, items: t = [], "data-testid": r }) {
|
|
|
1178
1184
|
role: "img",
|
|
1179
1185
|
"aria-label": "NCE fault tree — NCEs per contractor as branching tree",
|
|
1180
1186
|
style: {
|
|
1181
|
-
width:
|
|
1187
|
+
width: Ve,
|
|
1182
1188
|
height: _,
|
|
1183
1189
|
display: "block"
|
|
1184
1190
|
}
|
|
1185
1191
|
}), /* @__PURE__ */ s(C, {
|
|
1186
1192
|
...x,
|
|
1187
|
-
parentW:
|
|
1193
|
+
parentW: Ve,
|
|
1188
1194
|
parentH: _
|
|
1189
1195
|
})]
|
|
1190
1196
|
});
|
|
1191
1197
|
}
|
|
1192
1198
|
//#endregion
|
|
1193
1199
|
//#region src/components/pieChart/PieChart.tsx
|
|
1194
|
-
var
|
|
1195
|
-
function
|
|
1200
|
+
var Ke = 192, qe = Ke, Je = Ke + 80;
|
|
1201
|
+
function Ye({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
1196
1202
|
let o = a(null), f = a(/* @__PURE__ */ new Map()), p = a(0), m = i?.slices ?? d, { hoveredRef: g, tooltip: b, hitZonesRef: x } = w(o, {
|
|
1197
|
-
width:
|
|
1198
|
-
height:
|
|
1203
|
+
width: qe,
|
|
1204
|
+
height: Je
|
|
1199
1205
|
});
|
|
1200
1206
|
return n(() => {
|
|
1201
1207
|
let n = o.current;
|
|
1202
1208
|
if (!n) return;
|
|
1203
|
-
let r = v(n,
|
|
1209
|
+
let r = v(n, qe, Je);
|
|
1204
1210
|
p.current = 0;
|
|
1205
|
-
let i =
|
|
1211
|
+
let i = qe / 2, a = Ke / 2, s = Ke * .4, c = t === "donut" ? Ke * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, d, b = () => {
|
|
1206
1212
|
p.current++;
|
|
1207
1213
|
let n = p.current;
|
|
1208
|
-
r.clearRect(0, 0,
|
|
1214
|
+
r.clearRect(0, 0, qe, Je);
|
|
1209
1215
|
let o = 1 - (1 - Math.min(n / 48, 1)) ** 3;
|
|
1210
1216
|
N(f.current, g.current), x.current = [];
|
|
1211
1217
|
let v = -Math.PI / 2;
|
|
@@ -1219,10 +1225,10 @@ function Je({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1219
1225
|
let O = j(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? O * 2 : 0);
|
|
1220
1226
|
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;
|
|
1221
1227
|
}), t === "donut" && e.length > 0 && y(r, i, a, c * .8, u.blue, .06);
|
|
1222
|
-
let S =
|
|
1228
|
+
let S = Ke + 12;
|
|
1223
1229
|
e.forEach((e, t) => {
|
|
1224
1230
|
let n = m[t % m.length], i = (e.pricing ?? 0) / l, a = f.current.get(e.id ?? `sl-${t}`) ?? 0, o = S + t * 18;
|
|
1225
|
-
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)}%)`,
|
|
1231
|
+
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)}%)`, qe - 4, o + 3.5);
|
|
1226
1232
|
}), d = requestAnimationFrame(b);
|
|
1227
1233
|
};
|
|
1228
1234
|
return b(), () => cancelAnimationFrame(d);
|
|
@@ -1236,30 +1242,30 @@ function Je({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1236
1242
|
children: /* @__PURE__ */ c("div", {
|
|
1237
1243
|
style: {
|
|
1238
1244
|
position: "relative",
|
|
1239
|
-
width:
|
|
1240
|
-
height:
|
|
1245
|
+
width: qe,
|
|
1246
|
+
height: Je
|
|
1241
1247
|
},
|
|
1242
1248
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1243
1249
|
ref: o,
|
|
1244
1250
|
role: "img",
|
|
1245
1251
|
"aria-label": `${t} chart`,
|
|
1246
1252
|
style: {
|
|
1247
|
-
width:
|
|
1248
|
-
height:
|
|
1253
|
+
width: qe,
|
|
1254
|
+
height: Je,
|
|
1249
1255
|
display: "block",
|
|
1250
1256
|
borderRadius: 8
|
|
1251
1257
|
}
|
|
1252
1258
|
}), /* @__PURE__ */ s(C, {
|
|
1253
1259
|
...b,
|
|
1254
|
-
parentW:
|
|
1255
|
-
parentH:
|
|
1260
|
+
parentW: qe,
|
|
1261
|
+
parentH: Je
|
|
1256
1262
|
})]
|
|
1257
1263
|
})
|
|
1258
1264
|
});
|
|
1259
1265
|
}
|
|
1260
1266
|
//#endregion
|
|
1261
1267
|
//#region src/components/sankey/SankeySvg.tsx
|
|
1262
|
-
function
|
|
1268
|
+
function Xe(e, t, n, r) {
|
|
1263
1269
|
let i = new Set(t.map((e) => e.source)), a = new Set(t.map((e) => e.target)), o = /* @__PURE__ */ new Map(), s = [];
|
|
1264
1270
|
for (e.forEach((e) => {
|
|
1265
1271
|
i.has(e.id) && !a.has(e.id) && s.push({
|
|
@@ -1304,8 +1310,8 @@ function Ye(e, t, n, r) {
|
|
|
1304
1310
|
});
|
|
1305
1311
|
}), f;
|
|
1306
1312
|
}
|
|
1307
|
-
function
|
|
1308
|
-
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(() =>
|
|
1313
|
+
function Ze({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f, selectedEntity: p, className: m, colors: g }) {
|
|
1314
|
+
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(() => Xe(e, t, r, o), [
|
|
1309
1315
|
e,
|
|
1310
1316
|
t,
|
|
1311
1317
|
r,
|
|
@@ -1405,7 +1411,7 @@ function Xe({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1405
1411
|
}
|
|
1406
1412
|
//#endregion
|
|
1407
1413
|
//#region src/canvas/CausalFlowCanvas.tsx
|
|
1408
|
-
var
|
|
1414
|
+
var Qe = [
|
|
1409
1415
|
{
|
|
1410
1416
|
x: .13,
|
|
1411
1417
|
y: .48
|
|
@@ -1438,7 +1444,7 @@ var Ze = [
|
|
|
1438
1444
|
x: .92,
|
|
1439
1445
|
y: .22
|
|
1440
1446
|
}
|
|
1441
|
-
],
|
|
1447
|
+
], $e = [
|
|
1442
1448
|
u.blue,
|
|
1443
1449
|
u.orange,
|
|
1444
1450
|
u.red,
|
|
@@ -1446,7 +1452,7 @@ var Ze = [
|
|
|
1446
1452
|
u.green,
|
|
1447
1453
|
u.amber,
|
|
1448
1454
|
u.t2
|
|
1449
|
-
],
|
|
1455
|
+
], et = [
|
|
1450
1456
|
26,
|
|
1451
1457
|
24,
|
|
1452
1458
|
24,
|
|
@@ -1456,21 +1462,21 @@ var Ze = [
|
|
|
1456
1462
|
22,
|
|
1457
1463
|
22
|
|
1458
1464
|
];
|
|
1459
|
-
function
|
|
1465
|
+
function tt(e, t) {
|
|
1460
1466
|
let n = 1 - t;
|
|
1461
1467
|
return {
|
|
1462
1468
|
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,
|
|
1463
1469
|
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
|
|
1464
1470
|
};
|
|
1465
1471
|
}
|
|
1466
|
-
function
|
|
1472
|
+
function nt(e, t) {
|
|
1467
1473
|
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;
|
|
1468
1474
|
return {
|
|
1469
1475
|
x: -i / a,
|
|
1470
1476
|
y: r / a
|
|
1471
1477
|
};
|
|
1472
1478
|
}
|
|
1473
|
-
function
|
|
1479
|
+
function rt(e, t) {
|
|
1474
1480
|
let n = t.x - e.x, r = t.y - e.y;
|
|
1475
1481
|
return {
|
|
1476
1482
|
p0: {
|
|
@@ -1491,7 +1497,7 @@ function nt(e, t) {
|
|
|
1491
1497
|
}
|
|
1492
1498
|
};
|
|
1493
1499
|
}
|
|
1494
|
-
function
|
|
1500
|
+
function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
|
|
1495
1501
|
let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: g, hitZonesRef: S } = w(d, {
|
|
1496
1502
|
width: r,
|
|
1497
1503
|
height: o
|
|
@@ -1499,15 +1505,15 @@ function rt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1499
1505
|
let t = /* @__PURE__ */ new Map();
|
|
1500
1506
|
return e.forEach((e, n) => t.set(e.id, n)), t;
|
|
1501
1507
|
}, [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) => {
|
|
1502
|
-
let n =
|
|
1508
|
+
let n = Qe[t % Qe.length];
|
|
1503
1509
|
return {
|
|
1504
1510
|
id: e.id,
|
|
1505
1511
|
label: e.name,
|
|
1506
1512
|
sub: e.valueLabel ?? "",
|
|
1507
1513
|
x: n.x * r,
|
|
1508
1514
|
y: n.y * o,
|
|
1509
|
-
r:
|
|
1510
|
-
color:
|
|
1515
|
+
r: et[t % et.length],
|
|
1516
|
+
color: $e[t % $e.length]
|
|
1511
1517
|
};
|
|
1512
1518
|
}), [
|
|
1513
1519
|
e,
|
|
@@ -1529,7 +1535,7 @@ function rt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1529
1535
|
if (t.clearRect(0, 0, r, o), S.current = [], b(t, r, o, e, 50, h(u.blue, .05)), M.forEach((e, n) => {
|
|
1530
1536
|
let r = A[e.fromIdx], i = A[e.toIdx];
|
|
1531
1537
|
if (!r || !i) return;
|
|
1532
|
-
let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d =
|
|
1538
|
+
let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = rt(r, i);
|
|
1533
1539
|
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();
|
|
1534
1540
|
for (let t = 0; t < e.conf * 2.5; t++) Math.random() < .45 && p.current.push({
|
|
1535
1541
|
edgeIdx: n,
|
|
@@ -1538,7 +1544,7 @@ function rt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1538
1544
|
off: (Math.random() - .5) * 13,
|
|
1539
1545
|
sz: .7 + Math.random() * 2
|
|
1540
1546
|
});
|
|
1541
|
-
let f =
|
|
1547
|
+
let f = tt(d, .5), m = `${Math.round(e.conf * 100)}%`;
|
|
1542
1548
|
t.font = "bold 12px 'JetBrains Mono', monospace", t.textBaseline = "middle";
|
|
1543
1549
|
let g = t.measureText(m).width + 14;
|
|
1544
1550
|
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);
|
|
@@ -1548,7 +1554,7 @@ function rt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1548
1554
|
if (!n) return !1;
|
|
1549
1555
|
let r = A[n.fromIdx], i = A[n.toIdx];
|
|
1550
1556
|
if (!r || !i) return !1;
|
|
1551
|
-
let a =
|
|
1557
|
+
let a = rt(r, i), o = tt(a, e.t), s = nt(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);
|
|
1552
1558
|
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;
|
|
1553
1559
|
}), p.current.length > 350 && (p.current = p.current.slice(-350)), A.forEach((n, r) => {
|
|
1554
1560
|
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);
|
|
@@ -1605,10 +1611,10 @@ function rt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1605
1611
|
}
|
|
1606
1612
|
//#endregion
|
|
1607
1613
|
//#region src/components/sankey/ProcessSankey.tsx
|
|
1608
|
-
function
|
|
1609
|
-
return /* @__PURE__ */ s(
|
|
1610
|
-
nodes:
|
|
1611
|
-
links:
|
|
1614
|
+
function at({ selectedEntity: e, colors: t }) {
|
|
1615
|
+
return /* @__PURE__ */ s(it, {
|
|
1616
|
+
nodes: ze.nodes,
|
|
1617
|
+
links: ze.links,
|
|
1612
1618
|
width: 960,
|
|
1613
1619
|
height: 280,
|
|
1614
1620
|
selectedEntity: e
|
|
@@ -1616,7 +1622,7 @@ function it({ selectedEntity: e, colors: t }) {
|
|
|
1616
1622
|
}
|
|
1617
1623
|
//#endregion
|
|
1618
1624
|
//#region src/components/sankey/RankingSankey.tsx
|
|
1619
|
-
function
|
|
1625
|
+
function ot({ rows: e = [], className: t, colors: n }) {
|
|
1620
1626
|
let { nodes: r, links: a } = i(() => {
|
|
1621
1627
|
let t = e.slice(0, 5);
|
|
1622
1628
|
return {
|
|
@@ -1634,7 +1640,7 @@ function at({ rows: e = [], className: t, colors: n }) {
|
|
|
1634
1640
|
}))
|
|
1635
1641
|
};
|
|
1636
1642
|
}, [e]);
|
|
1637
|
-
return /* @__PURE__ */ s(
|
|
1643
|
+
return /* @__PURE__ */ s(Ze, {
|
|
1638
1644
|
nodes: r,
|
|
1639
1645
|
links: a,
|
|
1640
1646
|
width: 760,
|
|
@@ -1646,20 +1652,20 @@ function at({ rows: e = [], className: t, colors: n }) {
|
|
|
1646
1652
|
}
|
|
1647
1653
|
//#endregion
|
|
1648
1654
|
//#region src/components/balanceScaleChart/BalanceScaleChart.tsx
|
|
1649
|
-
var
|
|
1650
|
-
function
|
|
1655
|
+
var st = 500, ct = 320;
|
|
1656
|
+
function lt({ left: e, right: t, "data-testid": r }) {
|
|
1651
1657
|
let i = a(null), o = a(0);
|
|
1652
1658
|
return n(() => {
|
|
1653
1659
|
let n = i.current;
|
|
1654
1660
|
if (!n) return;
|
|
1655
|
-
let r = v(n,
|
|
1661
|
+
let r = v(n, st, ct);
|
|
1656
1662
|
o.current = 0;
|
|
1657
|
-
let a =
|
|
1663
|
+
let a = st / 2, s = Math.max(e.value, t.value), c = (e.value - t.value) / s * 14, l, d = () => {
|
|
1658
1664
|
o.current++;
|
|
1659
1665
|
let n = o.current;
|
|
1660
|
-
r.clearRect(0, 0,
|
|
1666
|
+
r.clearRect(0, 0, st, ct), r.letterSpacing = f.letterSpacing;
|
|
1661
1667
|
let i = D(Math.min(n / 80, 1)), g = c * A(Math.min(n / 80, 1)) * Math.PI / 180;
|
|
1662
|
-
r.strokeStyle = h(u.bd, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(a, 100), r.lineTo(a,
|
|
1668
|
+
r.strokeStyle = h(u.bd, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(a, 100), r.lineTo(a, ct - 80), r.stroke(), r.beginPath(), r.arc(a, 100, 5 * i, 0, Math.PI * 2), r.fillStyle = u.t2, r.fill();
|
|
1663
1669
|
let _ = {
|
|
1664
1670
|
x: a - Math.cos(g) * 160,
|
|
1665
1671
|
y: 100 + Math.sin(-g) * 160
|
|
@@ -1685,23 +1691,23 @@ function ct({ left: e, right: t, "data-testid": r }) {
|
|
|
1685
1691
|
6
|
|
1686
1692
|
]), r.fill(), r.stroke(), r.strokeStyle = h(u.t2, .35 * i), r.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
|
|
1687
1693
|
r.beginPath(), r.moveTo(v.x + e, v.y + 4), r.lineTo(v.x + e, C), r.stroke();
|
|
1688
|
-
}), i > .5 && (r.globalAlpha = Math.min(1, (i - .5) / .5), r.font = p.font, r.fillStyle = u.amber, r.textAlign = "center", r.fillText(t.label, v.x, C + S + 18), r.font = f.font, r.fillStyle = f.color, r.fillText("Submitted", v.x, C + S + 32), r.fillText(`${t.count} quotations`, v.x, C + S + 44), r.globalAlpha = 1), i > .85 && Math.abs(c) > 1 && (r.globalAlpha = Math.min(1, (i - .85) / .15) * .6, r.font = m.font, r.fillStyle = m.color, r.textAlign = "center", r.fillText(`${Math.abs(c).toFixed(1)}° tilt toward accepted`, a,
|
|
1694
|
+
}), i > .5 && (r.globalAlpha = Math.min(1, (i - .5) / .5), r.font = p.font, r.fillStyle = u.amber, r.textAlign = "center", r.fillText(t.label, v.x, C + S + 18), r.font = f.font, r.fillStyle = f.color, r.fillText("Submitted", v.x, C + S + 32), r.fillText(`${t.count} quotations`, v.x, C + S + 44), r.globalAlpha = 1), i > .85 && Math.abs(c) > 1 && (r.globalAlpha = Math.min(1, (i - .85) / .15) * .6, r.font = m.font, r.fillStyle = m.color, r.textAlign = "center", r.fillText(`${Math.abs(c).toFixed(1)}° tilt toward accepted`, a, ct - 12), r.globalAlpha = 1), l = requestAnimationFrame(d);
|
|
1689
1695
|
};
|
|
1690
1696
|
return d(), () => cancelAnimationFrame(l);
|
|
1691
1697
|
}, [e, t]), /* @__PURE__ */ s("div", {
|
|
1692
1698
|
"data-testid": r,
|
|
1693
1699
|
style: {
|
|
1694
1700
|
position: "relative",
|
|
1695
|
-
width:
|
|
1696
|
-
height:
|
|
1701
|
+
width: st,
|
|
1702
|
+
height: ct
|
|
1697
1703
|
},
|
|
1698
1704
|
children: /* @__PURE__ */ s("canvas", {
|
|
1699
1705
|
ref: i,
|
|
1700
1706
|
role: "img",
|
|
1701
1707
|
"aria-label": "Quotation balance — accepted vs submitted quotation value",
|
|
1702
1708
|
style: {
|
|
1703
|
-
width:
|
|
1704
|
-
height:
|
|
1709
|
+
width: st,
|
|
1710
|
+
height: ct,
|
|
1705
1711
|
display: "block"
|
|
1706
1712
|
}
|
|
1707
1713
|
})
|
|
@@ -1709,25 +1715,25 @@ function ct({ left: e, right: t, "data-testid": r }) {
|
|
|
1709
1715
|
}
|
|
1710
1716
|
//#endregion
|
|
1711
1717
|
//#region src/components/areaLineChart/AreaLineChart.tsx
|
|
1712
|
-
var
|
|
1713
|
-
function
|
|
1718
|
+
var ut = 680, K = 280;
|
|
1719
|
+
function dt({ points: e = [], "data-testid": t }) {
|
|
1714
1720
|
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
1715
|
-
width:
|
|
1721
|
+
width: ut,
|
|
1716
1722
|
height: K
|
|
1717
1723
|
}), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
1718
1724
|
return n(() => {
|
|
1719
1725
|
let e = r.current;
|
|
1720
1726
|
if (!e) return;
|
|
1721
|
-
let t = v(e,
|
|
1727
|
+
let t = v(e, ut, K);
|
|
1722
1728
|
l.current = 0;
|
|
1723
|
-
let n =
|
|
1729
|
+
let n = ut - 54 - 28, i = K - 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) => ({
|
|
1724
1730
|
x: 54 + t * c,
|
|
1725
1731
|
y: 30 + i - e.count / a * i,
|
|
1726
1732
|
point: e
|
|
1727
1733
|
})), _, b = () => {
|
|
1728
1734
|
l.current++;
|
|
1729
1735
|
let e = l.current;
|
|
1730
|
-
t.clearRect(0, 0,
|
|
1736
|
+
t.clearRect(0, 0, ut, K), t.letterSpacing = f.letterSpacing;
|
|
1731
1737
|
let r = D(Math.min(e / 72, 1));
|
|
1732
1738
|
N(o.current, d.current), m.current = [], [
|
|
1733
1739
|
.25,
|
|
@@ -1770,7 +1776,7 @@ function ut({ points: e = [], "data-testid": t }) {
|
|
|
1770
1776
|
};
|
|
1771
1777
|
return b(), () => cancelAnimationFrame(_);
|
|
1772
1778
|
}, [g]), g.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1773
|
-
width:
|
|
1779
|
+
width: ut,
|
|
1774
1780
|
height: K,
|
|
1775
1781
|
"data-testid": t
|
|
1776
1782
|
}) : /* @__PURE__ */ s("div", {
|
|
@@ -1783,7 +1789,7 @@ function ut({ points: e = [], "data-testid": t }) {
|
|
|
1783
1789
|
children: /* @__PURE__ */ c("div", {
|
|
1784
1790
|
style: {
|
|
1785
1791
|
position: "relative",
|
|
1786
|
-
width:
|
|
1792
|
+
width: ut,
|
|
1787
1793
|
height: K
|
|
1788
1794
|
},
|
|
1789
1795
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -1791,13 +1797,13 @@ function ut({ points: e = [], "data-testid": t }) {
|
|
|
1791
1797
|
role: "img",
|
|
1792
1798
|
"aria-label": "Trend chart — count over time",
|
|
1793
1799
|
style: {
|
|
1794
|
-
width:
|
|
1800
|
+
width: ut,
|
|
1795
1801
|
height: K,
|
|
1796
1802
|
display: "block"
|
|
1797
1803
|
}
|
|
1798
1804
|
}), /* @__PURE__ */ s(C, {
|
|
1799
1805
|
...p,
|
|
1800
|
-
parentW:
|
|
1806
|
+
parentW: ut,
|
|
1801
1807
|
parentH: K
|
|
1802
1808
|
})]
|
|
1803
1809
|
})
|
|
@@ -1805,42 +1811,42 @@ function ut({ points: e = [], "data-testid": t }) {
|
|
|
1805
1811
|
}
|
|
1806
1812
|
//#endregion
|
|
1807
1813
|
//#region src/components/trend/Trend.tsx
|
|
1808
|
-
var
|
|
1809
|
-
function
|
|
1814
|
+
var ft = 680, q = 280, pt = 54, mt = 28, ht = 64, gt = f.font, _t = 12, vt = Math.PI * 2, yt = 72, bt = 20, xt = 5e3;
|
|
1815
|
+
function St({ points: e = [], "data-testid": t }) {
|
|
1810
1816
|
let r = a(null), o = a(null), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), p = i(() => {
|
|
1811
|
-
if (d.length <= 1) return
|
|
1817
|
+
if (d.length <= 1) return ht;
|
|
1812
1818
|
let e = document.createElement("canvas").getContext("2d");
|
|
1813
|
-
if (!e) return
|
|
1814
|
-
e.font =
|
|
1815
|
-
let t = Math.max(1, Math.ceil(d.length /
|
|
1816
|
-
return Math.max(
|
|
1817
|
-
}, [d]), m = Math.round(p / 2), g =
|
|
1819
|
+
if (!e) return ht;
|
|
1820
|
+
e.font = gt;
|
|
1821
|
+
let t = Math.max(1, Math.ceil(d.length / bt)), n = Math.max(...d.filter((e, n) => n % t === 0).map((t) => e.measureText(t.week).width));
|
|
1822
|
+
return Math.max(ht, n + _t);
|
|
1823
|
+
}, [d]), m = Math.round(p / 2), g = mt + m + Math.max(0, d.length - 1) * p, _ = Math.max(ft - pt, Math.min(g, xt)), { tooltip: y, hitZonesRef: b } = w(r, {
|
|
1818
1824
|
width: _,
|
|
1819
1825
|
height: q
|
|
1820
1826
|
});
|
|
1821
1827
|
return n(() => {
|
|
1822
1828
|
let e = r.current;
|
|
1823
1829
|
if (!e) return;
|
|
1824
|
-
let t = v(e, _, q), n = o.current ? v(o.current,
|
|
1830
|
+
let t = v(e, _, q), n = o.current ? v(o.current, pt, q) : null;
|
|
1825
1831
|
l.current = 0;
|
|
1826
|
-
let i = d.length <=
|
|
1832
|
+
let i = d.length <= yt ? yt : Math.max(24, Math.round(yt * (yt / d.length))), a = _ - mt, s = q - 30 - 54, c = Math.max(...d.map((e) => e.count), 1), g = d.length, y = g > 1 ? (a - m) / (g - 1) : a - m, x = Math.max(1, Math.ceil(p / y)), S = d.map((e, t) => ({
|
|
1827
1833
|
x: m + t * y,
|
|
1828
1834
|
y: 30 + s - e.count / c * s,
|
|
1829
1835
|
point: e
|
|
1830
1836
|
}));
|
|
1831
|
-
n && (n.clearRect(0, 0,
|
|
1837
|
+
n && (n.clearRect(0, 0, pt, q), n.letterSpacing = f.letterSpacing, [
|
|
1832
1838
|
.25,
|
|
1833
1839
|
.5,
|
|
1834
1840
|
.75,
|
|
1835
1841
|
1
|
|
1836
1842
|
].forEach((e) => {
|
|
1837
1843
|
let t = 30 + s - e * s;
|
|
1838
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(String(Math.round(c * e)),
|
|
1844
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(String(Math.round(c * e)), pt - 6, t + 3);
|
|
1839
1845
|
}), n.save(), n.translate(12, 30 + 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());
|
|
1840
1846
|
let C = t.createLinearGradient(0, 30, 0, 30 + s);
|
|
1841
1847
|
C.addColorStop(0, h(u.blue, .22)), C.addColorStop(1, h(u.blue, .02));
|
|
1842
1848
|
let w = 0, E, O = (e) => {
|
|
1843
|
-
t.font =
|
|
1849
|
+
t.font = gt, t.fillStyle = f.color, t.textAlign = "center";
|
|
1844
1850
|
for (let n = 0; n < e; n++) n % x === 0 && t.fillText(S[n].point.week, S[n].x, q - 54 + 14);
|
|
1845
1851
|
}, k = () => {
|
|
1846
1852
|
l.current++;
|
|
@@ -1869,7 +1875,7 @@ function xt({ points: e = [], "data-testid": t }) {
|
|
|
1869
1875
|
e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
|
|
1870
1876
|
}
|
|
1871
1877
|
t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(), t.fillStyle = h(u.blue, .8), t.beginPath();
|
|
1872
|
-
for (let e = 0; e < c; e++) t.moveTo(S[e].x + 3.5, S[e].y), t.arc(S[e].x, S[e].y, 3.5, 0,
|
|
1878
|
+
for (let e = 0; e < c; e++) t.moveTo(S[e].x + 3.5, S[e].y), t.arc(S[e].x, S[e].y, 3.5, 0, vt);
|
|
1873
1879
|
if (t.fill(), c > w) {
|
|
1874
1880
|
b.current = [];
|
|
1875
1881
|
for (let e = 0; e < c; e++) T(b.current, `pt-${e}`, S[e].x, S[e].y, 10, {
|
|
@@ -1889,7 +1895,7 @@ function xt({ points: e = [], "data-testid": t }) {
|
|
|
1889
1895
|
p,
|
|
1890
1896
|
b
|
|
1891
1897
|
]), d.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1892
|
-
width:
|
|
1898
|
+
width: ft,
|
|
1893
1899
|
height: q,
|
|
1894
1900
|
"data-testid": t
|
|
1895
1901
|
}) : /* @__PURE__ */ c("div", {
|
|
@@ -1903,7 +1909,7 @@ function xt({ points: e = [], "data-testid": t }) {
|
|
|
1903
1909
|
ref: o,
|
|
1904
1910
|
"aria-hidden": "true",
|
|
1905
1911
|
style: {
|
|
1906
|
-
width:
|
|
1912
|
+
width: pt,
|
|
1907
1913
|
height: q,
|
|
1908
1914
|
display: "block",
|
|
1909
1915
|
flexShrink: 0
|
|
@@ -1940,38 +1946,38 @@ function xt({ points: e = [], "data-testid": t }) {
|
|
|
1940
1946
|
}
|
|
1941
1947
|
//#endregion
|
|
1942
1948
|
//#region src/components/proportionalBandChart/ProportionalBandChart.tsx
|
|
1943
|
-
var J = 680,
|
|
1944
|
-
function
|
|
1949
|
+
var J = 680, Ct = 240;
|
|
1950
|
+
function wt(e, t, n) {
|
|
1945
1951
|
if (e.measureText(t).width <= n) return t;
|
|
1946
1952
|
let r = t;
|
|
1947
1953
|
for (; r.length > 0 && e.measureText(`${r}…`).width > n;) r = r.slice(0, -1);
|
|
1948
1954
|
return `${r}…`;
|
|
1949
1955
|
}
|
|
1950
|
-
var
|
|
1956
|
+
var Tt = {
|
|
1951
1957
|
Critical: u.red,
|
|
1952
1958
|
High: u.orange,
|
|
1953
1959
|
Medium: u.amber,
|
|
1954
1960
|
Low: u.green
|
|
1955
1961
|
};
|
|
1956
|
-
function
|
|
1962
|
+
function Et({ severities: e = [], "data-testid": t }) {
|
|
1957
1963
|
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: m, hitZonesRef: g } = w(r, {
|
|
1958
1964
|
width: J,
|
|
1959
|
-
height:
|
|
1965
|
+
height: Ct
|
|
1960
1966
|
}), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
1961
1967
|
return n(() => {
|
|
1962
1968
|
let e = r.current;
|
|
1963
1969
|
if (!e) return;
|
|
1964
|
-
let t = v(e, J,
|
|
1970
|
+
let t = v(e, J, Ct);
|
|
1965
1971
|
l.current = 0;
|
|
1966
|
-
let n = _.reduce((e, t) => e + t.count, 0), i = J - 28 - 28, a =
|
|
1972
|
+
let n = _.reduce((e, t) => e + t.count, 0), i = J - 28 - 28, a = Ct - 50 - 52, s = _.map((e) => e.count / n * i), c, m = () => {
|
|
1967
1973
|
l.current++;
|
|
1968
1974
|
let e = l.current;
|
|
1969
|
-
t.clearRect(0, 0, J,
|
|
1975
|
+
t.clearRect(0, 0, J, Ct), t.letterSpacing = f.letterSpacing;
|
|
1970
1976
|
let r = O(Math.min(e / 60, 1));
|
|
1971
1977
|
N(o.current, d.current), g.current = [], t.strokeStyle = h(u.bd, .2), t.lineWidth = 1, t.beginPath(), t.rect(28, 50, i, a), t.stroke(), t.strokeStyle = h(u.t2, .15), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(J / 2, 50), t.lineTo(J / 2, 50 + a), t.stroke(), t.setLineDash([]);
|
|
1972
1978
|
let v = 28;
|
|
1973
1979
|
_.forEach((e, i) => {
|
|
1974
|
-
let c =
|
|
1980
|
+
let c = Tt[e.severity] ?? u.blue, l = s[i];
|
|
1975
1981
|
l * r;
|
|
1976
1982
|
let d = o.current.get(e.severity) ?? 0, m = v + l / 2, _ = l * .85;
|
|
1977
1983
|
m - _ / 2;
|
|
@@ -1983,7 +1989,7 @@ function Tt({ severities: e = [], "data-testid": t }) {
|
|
|
1983
1989
|
color: c
|
|
1984
1990
|
}), r > .5) {
|
|
1985
1991
|
let i = Math.min(1, (r - .5) / .5), o = v + l / 2;
|
|
1986
|
-
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? c : h(c, .9), t.textAlign = "center", t.fillText(
|
|
1992
|
+
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? c : h(c, .9), t.textAlign = "center", t.fillText(wt(t, e.severity, l - 12), o, 38), t.font = p.font, t.fillStyle = d > 0 ? u.t1 : h(u.t1, .85), t.fillText(String(e.count), o, 50 + a / 2 + 6), t.font = f.font, t.fillStyle = d > 0 ? c : f.color, t.fillText(`${Math.round(e.count / n * 100)}%`, o, 50 + a + 18), t.globalAlpha = 1;
|
|
1987
1993
|
}
|
|
1988
1994
|
v += l;
|
|
1989
1995
|
});
|
|
@@ -1993,14 +1999,14 @@ function Tt({ severities: e = [], "data-testid": t }) {
|
|
|
1993
1999
|
return m(), () => cancelAnimationFrame(c);
|
|
1994
2000
|
}, [_]), _.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1995
2001
|
width: J,
|
|
1996
|
-
height:
|
|
2002
|
+
height: Ct,
|
|
1997
2003
|
"data-testid": t
|
|
1998
2004
|
}) : /* @__PURE__ */ c("div", {
|
|
1999
2005
|
"data-testid": t,
|
|
2000
2006
|
style: {
|
|
2001
2007
|
position: "relative",
|
|
2002
2008
|
width: J,
|
|
2003
|
-
height:
|
|
2009
|
+
height: Ct
|
|
2004
2010
|
},
|
|
2005
2011
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2006
2012
|
ref: r,
|
|
@@ -2008,24 +2014,24 @@ function Tt({ severities: e = [], "data-testid": t }) {
|
|
|
2008
2014
|
"aria-label": "Early Warning severity distribution — prism spectrum bands",
|
|
2009
2015
|
style: {
|
|
2010
2016
|
width: J,
|
|
2011
|
-
height:
|
|
2017
|
+
height: Ct,
|
|
2012
2018
|
display: "block"
|
|
2013
2019
|
}
|
|
2014
2020
|
}), /* @__PURE__ */ s(C, {
|
|
2015
2021
|
...m,
|
|
2016
2022
|
parentW: J,
|
|
2017
|
-
parentH:
|
|
2023
|
+
parentH: Ct
|
|
2018
2024
|
})]
|
|
2019
2025
|
});
|
|
2020
2026
|
}
|
|
2021
2027
|
//#endregion
|
|
2022
2028
|
//#region src/components/hubAndSpokeRadialChart/HubAndSpokeRadialChart.tsx
|
|
2023
|
-
var Y = 460, X = 300,
|
|
2029
|
+
var Y = 460, X = 300, Dt = {
|
|
2024
2030
|
Open: u.red,
|
|
2025
2031
|
Submitted: u.amber,
|
|
2026
2032
|
Closed: u.green
|
|
2027
2033
|
};
|
|
2028
|
-
function
|
|
2034
|
+
function Ot({ segments: e = [], title: t, "data-testid": r }) {
|
|
2029
2035
|
let o = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), { hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(o, {
|
|
2030
2036
|
width: Y,
|
|
2031
2037
|
height: X
|
|
@@ -2042,14 +2048,14 @@ function Dt({ segments: e = [], title: t, "data-testid": r }) {
|
|
|
2042
2048
|
let n = t === m.current ? 1 : 0, r = e + (n - e) * .12;
|
|
2043
2049
|
Math.abs(r - n) < .005 ? n === 0 ? d.current.delete(t) : d.current.set(t, 1) : d.current.set(t, r);
|
|
2044
2050
|
}), m.current && !d.current.has(m.current) && d.current.set(m.current, 0), b(t, Y, X, e, 40, h(u.blue, .04)), S.forEach((a, o) => {
|
|
2045
|
-
let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, d = r + Math.sin(c) * i, f =
|
|
2051
|
+
let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, d = r + Math.sin(c) * i, f = Dt[a.status] ?? u.blue, m = 2 + a.count / s * 8;
|
|
2046
2052
|
t.beginPath(), t.moveTo(n, r), t.lineTo(l, d), t.strokeStyle = h(f, .08), t.lineWidth = m * 2, t.stroke(), t.beginPath(), t.moveTo(n, r), t.lineTo(l, d), t.strokeStyle = h(f, .25), t.lineWidth = 1, t.stroke();
|
|
2047
2053
|
let g = (e * .005 + o * .33) % 1, _ = n + (l - n) * g, v = r + (d - r) * g;
|
|
2048
2054
|
y(t, _, v, 6, f, .4), t.beginPath(), t.arc(_, v, 2, 0, Math.PI * 2), t.fillStyle = h(f, .8), t.fill();
|
|
2049
2055
|
let b = (n + l) / 2, x = (r + d) / 2;
|
|
2050
2056
|
t.font = p.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(f, .85), t.fillText(String(a.count), b, x);
|
|
2051
2057
|
}), S.forEach((e, o) => {
|
|
2052
|
-
let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, p = r + Math.sin(c) * i, m =
|
|
2058
|
+
let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, p = r + Math.sin(c) * i, m = Dt[e.status] ?? u.blue, g = 10 + e.count / s * 18, v = d.current.get(e.status) ?? 0;
|
|
2053
2059
|
y(t, l, p, g * 2.5, m, .2 + v * .15);
|
|
2054
2060
|
let b = t.createRadialGradient(l, p - g * .2, 0, l, p, g);
|
|
2055
2061
|
b.addColorStop(0, h(m, .8 + v * .2)), b.addColorStop(1, h(m, .4 + v * .1)), t.beginPath(), t.arc(l, p, g, 0, Math.PI * 2), t.fillStyle = b, t.fill(), t.font = "bold " + f.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(u.t1, .9), t.fillText(e.status, l, p), T(_.current, e.status, l, p, g + 6, {
|
|
@@ -2099,8 +2105,8 @@ function Dt({ segments: e = [], title: t, "data-testid": r }) {
|
|
|
2099
2105
|
}
|
|
2100
2106
|
//#endregion
|
|
2101
2107
|
//#region src/components/trendChart/TrendChart.tsx
|
|
2102
|
-
var
|
|
2103
|
-
function
|
|
2108
|
+
var kt = 280, Z = 96;
|
|
2109
|
+
function At({ points: e = [], className: t, colors: r }) {
|
|
2104
2110
|
let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), p = i(() => e.map(([e, t]) => {
|
|
2105
2111
|
let n = String(t).match(/-?\d+(\.\d+)?/);
|
|
2106
2112
|
return {
|
|
@@ -2108,18 +2114,18 @@ function kt({ points: e = [], className: t, colors: r }) {
|
|
|
2108
2114
|
value: n ? Number(n[0]) : 0
|
|
2109
2115
|
};
|
|
2110
2116
|
}), [e]), { mouseRef: m, hoveredRef: g, tooltip: _, hitZonesRef: b } = w(o, {
|
|
2111
|
-
width:
|
|
2117
|
+
width: kt,
|
|
2112
2118
|
height: Z
|
|
2113
2119
|
});
|
|
2114
2120
|
return n(() => {
|
|
2115
2121
|
let e = o.current;
|
|
2116
2122
|
if (!e) return;
|
|
2117
|
-
let t = v(e,
|
|
2123
|
+
let t = v(e, kt, Z);
|
|
2118
2124
|
f.current = 0;
|
|
2119
2125
|
let n = r?.line ?? u.blue, i = r?.point ?? u.blue, a = r?.axisLine ?? u.bd, s, c = () => {
|
|
2120
2126
|
f.current++;
|
|
2121
2127
|
let e = f.current;
|
|
2122
|
-
if (t.clearRect(0, 0,
|
|
2128
|
+
if (t.clearRect(0, 0, kt, Z), p.length < 2) {
|
|
2123
2129
|
s = requestAnimationFrame(c);
|
|
2124
2130
|
return;
|
|
2125
2131
|
}
|
|
@@ -2128,8 +2134,8 @@ function kt({ points: e = [], className: t, colors: r }) {
|
|
|
2128
2134
|
right: 12,
|
|
2129
2135
|
top: 16,
|
|
2130
2136
|
bottom: 20
|
|
2131
|
-
}, o =
|
|
2132
|
-
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(
|
|
2137
|
+
}, o = kt - 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));
|
|
2138
|
+
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(kt - 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) => {
|
|
2133
2139
|
t.fillText(e.label.replace("Day ", "D"), C(n), Z - 4);
|
|
2134
2140
|
}), m.current.over && g.current) {
|
|
2135
2141
|
let e = parseInt(g.current.split("-")[1]);
|
|
@@ -2166,7 +2172,7 @@ function kt({ points: e = [], className: t, colors: r }) {
|
|
|
2166
2172
|
children: /* @__PURE__ */ c("div", {
|
|
2167
2173
|
style: {
|
|
2168
2174
|
position: "relative",
|
|
2169
|
-
width:
|
|
2175
|
+
width: kt,
|
|
2170
2176
|
height: Z
|
|
2171
2177
|
},
|
|
2172
2178
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -2174,14 +2180,14 @@ function kt({ points: e = [], className: t, colors: r }) {
|
|
|
2174
2180
|
role: "img",
|
|
2175
2181
|
"aria-label": "trend chart",
|
|
2176
2182
|
style: {
|
|
2177
|
-
width:
|
|
2183
|
+
width: kt,
|
|
2178
2184
|
height: Z,
|
|
2179
2185
|
display: "block",
|
|
2180
2186
|
borderRadius: 8
|
|
2181
2187
|
}
|
|
2182
2188
|
}), /* @__PURE__ */ s(C, {
|
|
2183
2189
|
..._,
|
|
2184
|
-
parentW:
|
|
2190
|
+
parentW: kt,
|
|
2185
2191
|
parentH: Z
|
|
2186
2192
|
})]
|
|
2187
2193
|
})
|
|
@@ -2189,21 +2195,21 @@ function kt({ points: e = [], className: t, colors: r }) {
|
|
|
2189
2195
|
}
|
|
2190
2196
|
//#endregion
|
|
2191
2197
|
//#region src/components/segmentedSplitBarChart/SegmentedSplitBarChart.tsx
|
|
2192
|
-
var
|
|
2193
|
-
function
|
|
2194
|
-
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,
|
|
2195
|
-
width:
|
|
2198
|
+
var jt = 680, Mt = 8, Nt = 26, Pt = 14, Ft = 16, It = 32;
|
|
2199
|
+
function Lt({ items: e = [], "data-testid": t }) {
|
|
2200
|
+
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, Mt), [b, g]), S = Ft + It + x.length * (Nt + Pt) - Pt, { hoveredRef: T, tooltip: D, hitZonesRef: k } = w(r, {
|
|
2201
|
+
width: jt,
|
|
2196
2202
|
height: S
|
|
2197
2203
|
});
|
|
2198
2204
|
return n(() => {
|
|
2199
2205
|
let e = r.current;
|
|
2200
2206
|
if (!e) return;
|
|
2201
|
-
let t = v(e,
|
|
2207
|
+
let t = v(e, jt, S);
|
|
2202
2208
|
d.current = 0;
|
|
2203
|
-
let n =
|
|
2209
|
+
let n = Ft, i = It, a = Nt, o = Pt, s = jt - 60 - 28, c = Math.max(...x.map((e) => (e.implemented ?? 0) + (e.unimplemented ?? 0))), g = x.length * (a + o) - o, _ = n + (S - n - i - g) / 2, b, C = () => {
|
|
2204
2210
|
d.current++;
|
|
2205
2211
|
let e = d.current;
|
|
2206
|
-
t.clearRect(0, 0,
|
|
2212
|
+
t.clearRect(0, 0, jt, S);
|
|
2207
2213
|
let n = O(Math.min(e / 60, 1));
|
|
2208
2214
|
N(l.current, T.current), k.current = [], x.forEach((e, r) => {
|
|
2209
2215
|
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;
|
|
@@ -2234,16 +2240,16 @@ function It({ items: e = [], "data-testid": t }) {
|
|
|
2234
2240
|
};
|
|
2235
2241
|
return C(), () => cancelAnimationFrame(b);
|
|
2236
2242
|
}, [x, S]), b.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2237
|
-
width:
|
|
2243
|
+
width: jt,
|
|
2238
2244
|
height: 160,
|
|
2239
2245
|
"data-testid": t
|
|
2240
2246
|
}) : /* @__PURE__ */ c("div", {
|
|
2241
2247
|
"data-testid": t,
|
|
2242
|
-
style: { width:
|
|
2248
|
+
style: { width: jt },
|
|
2243
2249
|
children: [/* @__PURE__ */ c("div", {
|
|
2244
2250
|
style: {
|
|
2245
2251
|
position: "relative",
|
|
2246
|
-
width:
|
|
2252
|
+
width: jt,
|
|
2247
2253
|
height: S
|
|
2248
2254
|
},
|
|
2249
2255
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -2251,16 +2257,16 @@ function It({ items: e = [], "data-testid": t }) {
|
|
|
2251
2257
|
role: "img",
|
|
2252
2258
|
"aria-label": "Implemented vs unimplemented variations per contractor — split bar",
|
|
2253
2259
|
style: {
|
|
2254
|
-
width:
|
|
2260
|
+
width: jt,
|
|
2255
2261
|
height: S,
|
|
2256
2262
|
display: "block"
|
|
2257
2263
|
}
|
|
2258
2264
|
}), /* @__PURE__ */ s(C, {
|
|
2259
2265
|
...D,
|
|
2260
|
-
parentW:
|
|
2266
|
+
parentW: jt,
|
|
2261
2267
|
parentH: S
|
|
2262
2268
|
})]
|
|
2263
|
-
}), b.length >
|
|
2269
|
+
}), b.length > Mt && /* @__PURE__ */ s("div", {
|
|
2264
2270
|
style: { marginTop: 8 },
|
|
2265
2271
|
children: /* @__PURE__ */ s(ae, {
|
|
2266
2272
|
expanded: g,
|
|
@@ -2271,18 +2277,18 @@ function It({ items: e = [], "data-testid": t }) {
|
|
|
2271
2277
|
}
|
|
2272
2278
|
//#endregion
|
|
2273
2279
|
//#region src/components/weeklyFlow/WeeklyFlow.tsx
|
|
2274
|
-
var
|
|
2275
|
-
function
|
|
2280
|
+
var Rt = 800, zt = 360;
|
|
2281
|
+
function Bt({ items: e = [], "data-testid": t }) {
|
|
2276
2282
|
let r = a(null), i = a(/* @__PURE__ */ new Map()), o = a(0), { hoveredRef: l, tooltip: m, hitZonesRef: g } = w(r, {
|
|
2277
|
-
width:
|
|
2278
|
-
height:
|
|
2283
|
+
width: Rt,
|
|
2284
|
+
height: zt
|
|
2279
2285
|
});
|
|
2280
2286
|
return n(() => {
|
|
2281
2287
|
let t = r.current;
|
|
2282
2288
|
if (!t) return;
|
|
2283
|
-
let n = v(t,
|
|
2289
|
+
let n = v(t, Rt, zt);
|
|
2284
2290
|
o.current = 0;
|
|
2285
|
-
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 =
|
|
2291
|
+
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 = zt - 20 - 26, _ = m - 6 * (e.length - 1), b = 20, x = e.map((e, t) => {
|
|
2286
2292
|
let n = Math.max(24, (e.total ?? 0) / (c || 1) * _), r = {
|
|
2287
2293
|
x: 100 - 110 / 2,
|
|
2288
2294
|
y: b,
|
|
@@ -2310,16 +2316,16 @@ function zt({ items: e = [], "data-testid": t }) {
|
|
|
2310
2316
|
}, j, P = () => {
|
|
2311
2317
|
o.current++;
|
|
2312
2318
|
let t = o.current;
|
|
2313
|
-
n.clearRect(0, 0,
|
|
2319
|
+
n.clearRect(0, 0, Rt, zt), n.letterSpacing = f.letterSpacing;
|
|
2314
2320
|
let r = D(Math.min(t / 80, 1));
|
|
2315
2321
|
if (N(i.current, l.current), g.current = [], e.forEach((t, o) => {
|
|
2316
2322
|
let c = x[o], l = M(r, o, e.length, D), u = i.current.get(t.id) ?? 0;
|
|
2317
2323
|
if (l < .01) return;
|
|
2318
2324
|
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;
|
|
2319
|
-
|
|
2325
|
+
Vt(n, c.x + 110, h, 420 - 110 / 2, y, _ * l, c.color, S), Vt(n, c.x + 110, g, 420 - 110 / 2, b, v * l, c.color, S * .75);
|
|
2320
2326
|
}), r > .3) {
|
|
2321
2327
|
let e = Math.min(1, (r - .3) / .7), t = A.y + a / c * m / 2, i = A.y + m - s / c * m / 2;
|
|
2322
|
-
|
|
2328
|
+
Vt(n, 475, O.cy, 720 - 110 / 2, t, C * e, u.blue, .25 * e), Vt(n, 475, k.cy, 720 - 110 / 2, i, w * e, u.amber, .22 * e);
|
|
2323
2329
|
}
|
|
2324
2330
|
if ([
|
|
2325
2331
|
"Contractors",
|
|
@@ -2331,7 +2337,7 @@ function zt({ items: e = [], "data-testid": t }) {
|
|
|
2331
2337
|
420,
|
|
2332
2338
|
720
|
|
2333
2339
|
][t];
|
|
2334
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText(e, r,
|
|
2340
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText(e, r, zt - 8);
|
|
2335
2341
|
}), e.forEach((t, a) => {
|
|
2336
2342
|
let o = x[a], s = M(r, a, e.length, D), c = i.current.get(t.id) ?? 0;
|
|
2337
2343
|
E(g.current, t.id, o.x, o.y, 110, o.h, {
|
|
@@ -2355,33 +2361,33 @@ function zt({ items: e = [], "data-testid": t }) {
|
|
|
2355
2361
|
"data-testid": t,
|
|
2356
2362
|
style: {
|
|
2357
2363
|
position: "relative",
|
|
2358
|
-
width:
|
|
2359
|
-
height:
|
|
2364
|
+
width: Rt,
|
|
2365
|
+
height: zt
|
|
2360
2366
|
},
|
|
2361
2367
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2362
2368
|
ref: r,
|
|
2363
2369
|
role: "img",
|
|
2364
2370
|
"aria-label": "Weekly report flow — base value and variations per contractor flowing to total commitment",
|
|
2365
2371
|
style: {
|
|
2366
|
-
width:
|
|
2367
|
-
height:
|
|
2372
|
+
width: Rt,
|
|
2373
|
+
height: zt,
|
|
2368
2374
|
display: "block"
|
|
2369
2375
|
}
|
|
2370
2376
|
}), /* @__PURE__ */ s(C, {
|
|
2371
2377
|
...m,
|
|
2372
|
-
parentW:
|
|
2373
|
-
parentH:
|
|
2378
|
+
parentW: Rt,
|
|
2379
|
+
parentH: zt
|
|
2374
2380
|
})]
|
|
2375
2381
|
});
|
|
2376
2382
|
}
|
|
2377
|
-
function
|
|
2383
|
+
function Vt(e, t, n, r, i, a, o, s) {
|
|
2378
2384
|
let c = (t + r) / 2;
|
|
2379
2385
|
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();
|
|
2380
2386
|
}
|
|
2381
2387
|
//#endregion
|
|
2382
2388
|
//#region src/components/visualizationRenderer/VisualizationRenderer.tsx
|
|
2383
|
-
function
|
|
2384
|
-
return e.type === "line" ? /* @__PURE__ */ s(
|
|
2389
|
+
function Ht({ config: e, className: t }) {
|
|
2390
|
+
return e.type === "line" ? /* @__PURE__ */ s(Le, {
|
|
2385
2391
|
rows: e.rows,
|
|
2386
2392
|
className: t
|
|
2387
2393
|
}) : e.type === "area" ? /* @__PURE__ */ s(te, {
|
|
@@ -2390,77 +2396,77 @@ function Vt({ config: e, className: t }) {
|
|
|
2390
2396
|
}) : e.type === "bar" ? /* @__PURE__ */ s(ie, {
|
|
2391
2397
|
rows: e.rows,
|
|
2392
2398
|
className: t
|
|
2393
|
-
}) : e.type === "pie" ? /* @__PURE__ */ s(
|
|
2399
|
+
}) : e.type === "pie" ? /* @__PURE__ */ s(Ye, {
|
|
2394
2400
|
rows: e.rows,
|
|
2395
2401
|
variant: "pie",
|
|
2396
2402
|
className: t
|
|
2397
|
-
}) : e.type === "donut" ? /* @__PURE__ */ s(
|
|
2403
|
+
}) : e.type === "donut" ? /* @__PURE__ */ s(Ye, {
|
|
2398
2404
|
rows: e.rows,
|
|
2399
2405
|
variant: "donut",
|
|
2400
2406
|
className: t
|
|
2401
|
-
}) : e.type === "sankey" ? /* @__PURE__ */ s(
|
|
2407
|
+
}) : e.type === "sankey" ? /* @__PURE__ */ s(ot, {
|
|
2402
2408
|
rows: e.rows,
|
|
2403
2409
|
className: t
|
|
2404
|
-
}) : e.type === "flow" ? /* @__PURE__ */ s(
|
|
2410
|
+
}) : e.type === "flow" ? /* @__PURE__ */ s(at, {
|
|
2405
2411
|
selectedEntity: e.selectedEntity,
|
|
2406
2412
|
className: t
|
|
2407
|
-
}) : e.type === "trend" ? /* @__PURE__ */ s(
|
|
2413
|
+
}) : e.type === "trend" ? /* @__PURE__ */ s(At, {
|
|
2408
2414
|
points: e.points,
|
|
2409
2415
|
className: t
|
|
2410
|
-
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(
|
|
2416
|
+
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(Be, {
|
|
2411
2417
|
rows: e.rows,
|
|
2412
2418
|
className: t
|
|
2413
|
-
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(
|
|
2419
|
+
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(je, { data: e.data }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Ce, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(fe, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(Ot, {
|
|
2414
2420
|
segments: e.segments,
|
|
2415
2421
|
title: e.title
|
|
2416
|
-
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(
|
|
2422
|
+
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(Ie, { items: e.items }) : e.type === "ranked-card-leaderboard" ? /* @__PURE__ */ s(Fe, { items: e.items }) : e.type === "proportional-band-chart" ? /* @__PURE__ */ s(Et, { severities: e.severities }) : e.type === "radial-fan-tree-chart" ? /* @__PURE__ */ s(Ge, {
|
|
2417
2423
|
total: e.total,
|
|
2418
2424
|
items: e.items
|
|
2419
2425
|
}) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(he, {
|
|
2420
2426
|
value: e.value,
|
|
2421
2427
|
confirmed: e.confirmed,
|
|
2422
2428
|
total: e.total
|
|
2423
|
-
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(
|
|
2429
|
+
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(Lt, { items: e.items }) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(lt, {
|
|
2424
2430
|
left: e.left,
|
|
2425
2431
|
right: e.right
|
|
2426
|
-
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(
|
|
2432
|
+
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(dt, { points: e.points }) : e.type === "trend-view" ? /* @__PURE__ */ s(St, { points: e.points }) : e.type === "weekly-flow" ? /* @__PURE__ */ s(Bt, { items: e.items }) : /* @__PURE__ */ s("div", {
|
|
2427
2433
|
className: "viz-empty",
|
|
2428
2434
|
children: "Visualization unavailable"
|
|
2429
2435
|
});
|
|
2430
2436
|
}
|
|
2431
2437
|
//#endregion
|
|
2432
2438
|
//#region src/utils/mounts.tsx
|
|
2433
|
-
var
|
|
2434
|
-
function
|
|
2439
|
+
var Ut = [];
|
|
2440
|
+
function Wt(e) {
|
|
2435
2441
|
try {
|
|
2436
2442
|
return JSON.parse(decodeURIComponent(e));
|
|
2437
2443
|
} catch {
|
|
2438
2444
|
return null;
|
|
2439
2445
|
}
|
|
2440
2446
|
}
|
|
2441
|
-
function
|
|
2442
|
-
for (;
|
|
2443
|
-
let e =
|
|
2447
|
+
function Gt() {
|
|
2448
|
+
for (; Ut.length;) {
|
|
2449
|
+
let e = Ut.pop();
|
|
2444
2450
|
e && e.unmount();
|
|
2445
2451
|
}
|
|
2446
2452
|
}
|
|
2447
|
-
function
|
|
2448
|
-
|
|
2453
|
+
function Kt() {
|
|
2454
|
+
Gt(), document.querySelectorAll("[data-d3-viz]").forEach((t) => {
|
|
2449
2455
|
let n = t.dataset.d3Viz;
|
|
2450
2456
|
if (!n) return;
|
|
2451
|
-
let r =
|
|
2457
|
+
let r = Wt(n);
|
|
2452
2458
|
if (!r) return;
|
|
2453
2459
|
let i = e(t);
|
|
2454
|
-
|
|
2460
|
+
Ut.push(i), i.render(/* @__PURE__ */ s(Ht, { config: r }));
|
|
2455
2461
|
});
|
|
2456
2462
|
}
|
|
2457
|
-
function
|
|
2463
|
+
function qt(e) {
|
|
2458
2464
|
return encodeURIComponent(JSON.stringify(e));
|
|
2459
2465
|
}
|
|
2460
2466
|
//#endregion
|
|
2461
2467
|
//#region src/components/donutChart/DonutChart.tsx
|
|
2462
|
-
function
|
|
2463
|
-
return /* @__PURE__ */ s(
|
|
2468
|
+
function Jt({ rows: e = [], className: t, colors: n }) {
|
|
2469
|
+
return /* @__PURE__ */ s(Ye, {
|
|
2464
2470
|
rows: e,
|
|
2465
2471
|
variant: "donut",
|
|
2466
2472
|
className: t,
|
|
@@ -2479,20 +2485,20 @@ var Q = {
|
|
|
2479
2485
|
red: u.red,
|
|
2480
2486
|
amber: u.amber,
|
|
2481
2487
|
green: u.green
|
|
2482
|
-
}, $ = "'Satoshi Variable', 'DM Sans', sans-serif",
|
|
2488
|
+
}, $ = "'Satoshi Variable', 'DM Sans', sans-serif", Yt = {
|
|
2483
2489
|
color: "#F7F7F7",
|
|
2484
2490
|
fontFamily: $,
|
|
2485
2491
|
fontSize: 24,
|
|
2486
2492
|
fontWeight: 500,
|
|
2487
2493
|
lineHeight: "32px"
|
|
2488
|
-
},
|
|
2494
|
+
}, Xt = {
|
|
2489
2495
|
color: "#C2C2C2",
|
|
2490
2496
|
fontFamily: $,
|
|
2491
2497
|
fontSize: 18,
|
|
2492
2498
|
fontWeight: 400,
|
|
2493
2499
|
lineHeight: "20px"
|
|
2494
2500
|
};
|
|
2495
|
-
function
|
|
2501
|
+
function Zt({ chips: e = [] }) {
|
|
2496
2502
|
return /* @__PURE__ */ s("div", {
|
|
2497
2503
|
style: {
|
|
2498
2504
|
display: "flex",
|
|
@@ -2514,13 +2520,13 @@ function Xt({ chips: e = [] }) {
|
|
|
2514
2520
|
},
|
|
2515
2521
|
children: [/* @__PURE__ */ s("span", {
|
|
2516
2522
|
style: {
|
|
2517
|
-
...
|
|
2523
|
+
...Yt,
|
|
2518
2524
|
color: e.color ?? Q.t1
|
|
2519
2525
|
},
|
|
2520
2526
|
children: e.value
|
|
2521
2527
|
}), /* @__PURE__ */ s("span", {
|
|
2522
2528
|
style: {
|
|
2523
|
-
...
|
|
2529
|
+
...Xt,
|
|
2524
2530
|
flex: 1
|
|
2525
2531
|
},
|
|
2526
2532
|
children: e.label
|
|
@@ -2528,7 +2534,7 @@ function Xt({ chips: e = [] }) {
|
|
|
2528
2534
|
}, t))
|
|
2529
2535
|
});
|
|
2530
2536
|
}
|
|
2531
|
-
function
|
|
2537
|
+
function Qt({ items: e = [] }) {
|
|
2532
2538
|
return /* @__PURE__ */ s("div", {
|
|
2533
2539
|
style: {
|
|
2534
2540
|
display: "flex",
|
|
@@ -2551,18 +2557,18 @@ function Zt({ items: e = [] }) {
|
|
|
2551
2557
|
},
|
|
2552
2558
|
children: [/* @__PURE__ */ s("div", {
|
|
2553
2559
|
style: {
|
|
2554
|
-
...
|
|
2560
|
+
...Yt,
|
|
2555
2561
|
color: e.color ?? Q.t1
|
|
2556
2562
|
},
|
|
2557
2563
|
children: e.value
|
|
2558
2564
|
}), /* @__PURE__ */ s("div", {
|
|
2559
|
-
style: { ...
|
|
2565
|
+
style: { ...Xt },
|
|
2560
2566
|
children: e.label
|
|
2561
2567
|
})]
|
|
2562
2568
|
}, t))
|
|
2563
2569
|
});
|
|
2564
2570
|
}
|
|
2565
|
-
function
|
|
2571
|
+
function $t({ items: e = [] }) {
|
|
2566
2572
|
return /* @__PURE__ */ s("div", {
|
|
2567
2573
|
style: {
|
|
2568
2574
|
display: "flex",
|
|
@@ -2594,7 +2600,7 @@ function Qt({ items: e = [] }) {
|
|
|
2594
2600
|
}),
|
|
2595
2601
|
/* @__PURE__ */ s("span", {
|
|
2596
2602
|
style: {
|
|
2597
|
-
...
|
|
2603
|
+
...Yt,
|
|
2598
2604
|
fontSize: 18,
|
|
2599
2605
|
color: e.color ?? Q.t1,
|
|
2600
2606
|
minWidth: 70,
|
|
@@ -2604,7 +2610,7 @@ function Qt({ items: e = [] }) {
|
|
|
2604
2610
|
}),
|
|
2605
2611
|
/* @__PURE__ */ s("span", {
|
|
2606
2612
|
style: {
|
|
2607
|
-
...
|
|
2613
|
+
...Xt,
|
|
2608
2614
|
flex: 1
|
|
2609
2615
|
},
|
|
2610
2616
|
children: e.kpiLabel
|
|
@@ -2613,7 +2619,7 @@ function Qt({ items: e = [] }) {
|
|
|
2613
2619
|
}, t))
|
|
2614
2620
|
});
|
|
2615
2621
|
}
|
|
2616
|
-
function
|
|
2622
|
+
function en({ items: e = [] }) {
|
|
2617
2623
|
return /* @__PURE__ */ s("div", {
|
|
2618
2624
|
style: {
|
|
2619
2625
|
display: "flex",
|
|
@@ -2635,23 +2641,23 @@ function $t({ items: e = [] }) {
|
|
|
2635
2641
|
},
|
|
2636
2642
|
children: [/* @__PURE__ */ s("div", {
|
|
2637
2643
|
style: {
|
|
2638
|
-
...
|
|
2644
|
+
...Yt,
|
|
2639
2645
|
color: e.color ?? Q.t1
|
|
2640
2646
|
},
|
|
2641
2647
|
children: e.value
|
|
2642
2648
|
}), /* @__PURE__ */ s("div", {
|
|
2643
|
-
style: { ...
|
|
2649
|
+
style: { ...Xt },
|
|
2644
2650
|
children: e.label
|
|
2645
2651
|
})]
|
|
2646
2652
|
}, t))
|
|
2647
2653
|
});
|
|
2648
2654
|
}
|
|
2649
|
-
var
|
|
2655
|
+
var tn = {
|
|
2650
2656
|
red: Q.red,
|
|
2651
2657
|
amber: Q.amber,
|
|
2652
2658
|
green: Q.green
|
|
2653
2659
|
};
|
|
2654
|
-
function
|
|
2660
|
+
function nn({ items: e = [] }) {
|
|
2655
2661
|
return /* @__PURE__ */ s("div", {
|
|
2656
2662
|
style: {
|
|
2657
2663
|
display: "flex",
|
|
@@ -2659,7 +2665,7 @@ function tn({ items: e = [] }) {
|
|
|
2659
2665
|
gap: 5
|
|
2660
2666
|
},
|
|
2661
2667
|
children: e.map((e, t) => {
|
|
2662
|
-
let n =
|
|
2668
|
+
let n = tn[e.severity];
|
|
2663
2669
|
return /* @__PURE__ */ c("div", {
|
|
2664
2670
|
style: {
|
|
2665
2671
|
display: "flex",
|
|
@@ -2677,14 +2683,14 @@ function tn({ items: e = [] }) {
|
|
|
2677
2683
|
flexShrink: 0,
|
|
2678
2684
|
marginTop: 5
|
|
2679
2685
|
} }), /* @__PURE__ */ s("span", {
|
|
2680
|
-
style: { ...
|
|
2686
|
+
style: { ...Xt },
|
|
2681
2687
|
children: e.text
|
|
2682
2688
|
})]
|
|
2683
2689
|
}, t);
|
|
2684
2690
|
})
|
|
2685
2691
|
});
|
|
2686
2692
|
}
|
|
2687
|
-
function
|
|
2693
|
+
function rn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
2688
2694
|
let a = t - e;
|
|
2689
2695
|
return /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("div", {
|
|
2690
2696
|
style: {
|
|
@@ -2794,9 +2800,9 @@ function nn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2794
2800
|
}, r);
|
|
2795
2801
|
})
|
|
2796
2802
|
]
|
|
2797
|
-
}), i && i.length > 0 && /* @__PURE__ */ s(
|
|
2803
|
+
}), i && i.length > 0 && /* @__PURE__ */ s(Zt, { chips: i })] });
|
|
2798
2804
|
}
|
|
2799
|
-
function
|
|
2805
|
+
function an({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i, rightLabel: a, rightValue: o, rightColor: l, chips: d }) {
|
|
2800
2806
|
let f = r ?? u.blue, p = l ?? u.blue;
|
|
2801
2807
|
return /* @__PURE__ */ c("div", { children: [
|
|
2802
2808
|
/* @__PURE__ */ c("div", {
|
|
@@ -2890,10 +2896,10 @@ function rn({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i,
|
|
|
2890
2896
|
})
|
|
2891
2897
|
})]
|
|
2892
2898
|
}),
|
|
2893
|
-
d && d.length > 0 && /* @__PURE__ */ s(
|
|
2899
|
+
d && d.length > 0 && /* @__PURE__ */ s(Zt, { chips: d })
|
|
2894
2900
|
] });
|
|
2895
2901
|
}
|
|
2896
|
-
function
|
|
2902
|
+
function on({ pct: e, label: t, color: n, chips: r }) {
|
|
2897
2903
|
let i = n ?? u.blue, a = 2 * Math.PI * 30, o = a * (1 - e / 100);
|
|
2898
2904
|
return /* @__PURE__ */ c("div", {
|
|
2899
2905
|
style: {
|
|
@@ -2952,7 +2958,7 @@ function an({ pct: e, label: t, color: n, chips: r }) {
|
|
|
2952
2958
|
style: { flex: 1 },
|
|
2953
2959
|
children: [/* @__PURE__ */ s("div", {
|
|
2954
2960
|
style: {
|
|
2955
|
-
...
|
|
2961
|
+
...Xt,
|
|
2956
2962
|
marginBottom: 10
|
|
2957
2963
|
},
|
|
2958
2964
|
children: t
|
|
@@ -2974,12 +2980,12 @@ function an({ pct: e, label: t, color: n, chips: r }) {
|
|
|
2974
2980
|
},
|
|
2975
2981
|
children: [/* @__PURE__ */ s("span", {
|
|
2976
2982
|
style: {
|
|
2977
|
-
...
|
|
2983
|
+
...Yt,
|
|
2978
2984
|
color: e.color ?? Q.t1
|
|
2979
2985
|
},
|
|
2980
2986
|
children: e.value
|
|
2981
2987
|
}), /* @__PURE__ */ s("span", {
|
|
2982
|
-
style: { ...
|
|
2988
|
+
style: { ...Xt },
|
|
2983
2989
|
children: e.label
|
|
2984
2990
|
})]
|
|
2985
2991
|
}, t))
|
|
@@ -2987,16 +2993,16 @@ function an({ pct: e, label: t, color: n, chips: r }) {
|
|
|
2987
2993
|
})]
|
|
2988
2994
|
});
|
|
2989
2995
|
}
|
|
2990
|
-
var
|
|
2996
|
+
var sn = {
|
|
2991
2997
|
green: "#34D39918",
|
|
2992
2998
|
amber: "#FBBF2418",
|
|
2993
2999
|
red: "#F0606018"
|
|
2994
|
-
},
|
|
3000
|
+
}, cn = {
|
|
2995
3001
|
green: "#34D399",
|
|
2996
3002
|
amber: "#FBBF24",
|
|
2997
3003
|
red: "#F06060"
|
|
2998
3004
|
};
|
|
2999
|
-
function
|
|
3005
|
+
function ln({ items: e = [] }) {
|
|
3000
3006
|
return /* @__PURE__ */ s("div", {
|
|
3001
3007
|
style: {
|
|
3002
3008
|
display: "flex",
|
|
@@ -3060,8 +3066,8 @@ function cn({ items: e = [] }) {
|
|
|
3060
3066
|
style: {
|
|
3061
3067
|
fontSize: 18,
|
|
3062
3068
|
fontWeight: 500,
|
|
3063
|
-
color:
|
|
3064
|
-
background:
|
|
3069
|
+
color: cn[e.badgeSeverity],
|
|
3070
|
+
background: sn[e.badgeSeverity],
|
|
3065
3071
|
padding: "2px 7px",
|
|
3066
3072
|
borderRadius: 4,
|
|
3067
3073
|
fontFamily: $,
|
|
@@ -3073,7 +3079,7 @@ function cn({ items: e = [] }) {
|
|
|
3073
3079
|
}),
|
|
3074
3080
|
e.sublabel && /* @__PURE__ */ s("span", {
|
|
3075
3081
|
style: {
|
|
3076
|
-
...
|
|
3082
|
+
...Xt,
|
|
3077
3083
|
flexShrink: 0,
|
|
3078
3084
|
minWidth: 80,
|
|
3079
3085
|
textAlign: "right"
|
|
@@ -3084,12 +3090,12 @@ function cn({ items: e = [] }) {
|
|
|
3084
3090
|
}, t))
|
|
3085
3091
|
});
|
|
3086
3092
|
}
|
|
3087
|
-
var
|
|
3093
|
+
var un = {
|
|
3088
3094
|
red: Q.red,
|
|
3089
3095
|
amber: Q.amber,
|
|
3090
3096
|
green: Q.green
|
|
3091
3097
|
};
|
|
3092
|
-
function
|
|
3098
|
+
function dn({ items: e = [] }) {
|
|
3093
3099
|
return /* @__PURE__ */ s("div", {
|
|
3094
3100
|
style: {
|
|
3095
3101
|
display: "flex",
|
|
@@ -3097,7 +3103,7 @@ function un({ items: e = [] }) {
|
|
|
3097
3103
|
gap: 5
|
|
3098
3104
|
},
|
|
3099
3105
|
children: e.map((e, t) => {
|
|
3100
|
-
let n =
|
|
3106
|
+
let n = un[e.severity];
|
|
3101
3107
|
return /* @__PURE__ */ c("div", {
|
|
3102
3108
|
style: {
|
|
3103
3109
|
display: "flex",
|
|
@@ -3119,7 +3125,7 @@ function un({ items: e = [] }) {
|
|
|
3119
3125
|
/* @__PURE__ */ s("span", {
|
|
3120
3126
|
style: {
|
|
3121
3127
|
flex: 1,
|
|
3122
|
-
...
|
|
3128
|
+
...Xt
|
|
3123
3129
|
},
|
|
3124
3130
|
children: e.text
|
|
3125
3131
|
}),
|
|
@@ -3138,7 +3144,7 @@ function un({ items: e = [] }) {
|
|
|
3138
3144
|
}),
|
|
3139
3145
|
/* @__PURE__ */ s("span", {
|
|
3140
3146
|
style: {
|
|
3141
|
-
...
|
|
3147
|
+
...Xt,
|
|
3142
3148
|
flexShrink: 0,
|
|
3143
3149
|
marginTop: 1
|
|
3144
3150
|
},
|
|
@@ -3149,7 +3155,7 @@ function un({ items: e = [] }) {
|
|
|
3149
3155
|
})
|
|
3150
3156
|
});
|
|
3151
3157
|
}
|
|
3152
|
-
function
|
|
3158
|
+
function fn({ columns: e = [], rows: t = [] }) {
|
|
3153
3159
|
return /* @__PURE__ */ c("div", {
|
|
3154
3160
|
style: {
|
|
3155
3161
|
display: "flex",
|
|
@@ -3212,21 +3218,21 @@ function dn({ columns: e = [], rows: t = [] }) {
|
|
|
3212
3218
|
}, t))]
|
|
3213
3219
|
});
|
|
3214
3220
|
}
|
|
3215
|
-
function
|
|
3221
|
+
function pn({ block: e }) {
|
|
3216
3222
|
if (!e) return null;
|
|
3217
3223
|
switch (e.type) {
|
|
3218
|
-
case "stats": return /* @__PURE__ */ s(
|
|
3219
|
-
case "ranked": return /* @__PURE__ */ s(
|
|
3220
|
-
case "chips": return /* @__PURE__ */ s(
|
|
3221
|
-
case "badges": return /* @__PURE__ */ s(
|
|
3222
|
-
case "dot-strip": return /* @__PURE__ */ s(
|
|
3224
|
+
case "stats": return /* @__PURE__ */ s(Qt, { items: e.items });
|
|
3225
|
+
case "ranked": return /* @__PURE__ */ s($t, { items: e.items });
|
|
3226
|
+
case "chips": return /* @__PURE__ */ s(en, { items: e.items });
|
|
3227
|
+
case "badges": return /* @__PURE__ */ s(nn, { items: e.items });
|
|
3228
|
+
case "dot-strip": return /* @__PURE__ */ s(rn, {
|
|
3223
3229
|
min: e.min,
|
|
3224
3230
|
max: e.max,
|
|
3225
3231
|
unit: e.unit,
|
|
3226
3232
|
dots: e.dots,
|
|
3227
3233
|
chips: e.chips
|
|
3228
3234
|
});
|
|
3229
|
-
case "proportion": return /* @__PURE__ */ s(
|
|
3235
|
+
case "proportion": return /* @__PURE__ */ s(an, {
|
|
3230
3236
|
leftPct: e.leftPct,
|
|
3231
3237
|
leftLabel: e.leftLabel,
|
|
3232
3238
|
leftValue: e.leftValue,
|
|
@@ -3237,15 +3243,15 @@ function fn({ block: e }) {
|
|
|
3237
3243
|
rightColor: e.rightColor,
|
|
3238
3244
|
chips: e.chips
|
|
3239
3245
|
});
|
|
3240
|
-
case "ring": return /* @__PURE__ */ s(
|
|
3246
|
+
case "ring": return /* @__PURE__ */ s(on, {
|
|
3241
3247
|
pct: e.pct,
|
|
3242
3248
|
label: e.label,
|
|
3243
3249
|
color: e.color,
|
|
3244
3250
|
chips: e.chips
|
|
3245
3251
|
});
|
|
3246
|
-
case "scorecard-rows": return /* @__PURE__ */ s(
|
|
3247
|
-
case "flags-list": return /* @__PURE__ */ s(
|
|
3248
|
-
case "comparison-rows": return /* @__PURE__ */ s(
|
|
3252
|
+
case "scorecard-rows": return /* @__PURE__ */ s(ln, { items: e.items });
|
|
3253
|
+
case "flags-list": return /* @__PURE__ */ s(dn, { items: e.items });
|
|
3254
|
+
case "comparison-rows": return /* @__PURE__ */ s(fn, {
|
|
3249
3255
|
columns: e.columns,
|
|
3250
3256
|
rows: e.rows
|
|
3251
3257
|
});
|
|
@@ -3254,14 +3260,14 @@ function fn({ block: e }) {
|
|
|
3254
3260
|
}
|
|
3255
3261
|
//#endregion
|
|
3256
3262
|
//#region src/components/keyHighlights/Takeaway.tsx
|
|
3257
|
-
var
|
|
3263
|
+
var mn = "'Satoshi Variable', 'DM Sans', sans-serif", hn = {
|
|
3258
3264
|
color: "#C2C2C2",
|
|
3259
|
-
fontFamily:
|
|
3265
|
+
fontFamily: mn,
|
|
3260
3266
|
fontSize: 18,
|
|
3261
3267
|
fontWeight: 400,
|
|
3262
3268
|
lineHeight: "20px"
|
|
3263
3269
|
};
|
|
3264
|
-
function
|
|
3270
|
+
function gn({ text: e }) {
|
|
3265
3271
|
return /* @__PURE__ */ c("div", {
|
|
3266
3272
|
style: {
|
|
3267
3273
|
padding: "8px 0px",
|
|
@@ -3274,16 +3280,16 @@ function hn({ text: e }) {
|
|
|
3274
3280
|
fontSize: 18,
|
|
3275
3281
|
fontWeight: 500,
|
|
3276
3282
|
color: u.t1,
|
|
3277
|
-
fontFamily:
|
|
3283
|
+
fontFamily: mn,
|
|
3278
3284
|
lineHeight: "20px",
|
|
3279
3285
|
marginRight: 8
|
|
3280
3286
|
},
|
|
3281
3287
|
children: "Takeaway"
|
|
3282
3288
|
}), /* @__PURE__ */ s("span", {
|
|
3283
|
-
style: { ...
|
|
3289
|
+
style: { ...hn },
|
|
3284
3290
|
children: e
|
|
3285
3291
|
})]
|
|
3286
3292
|
});
|
|
3287
3293
|
}
|
|
3288
3294
|
//#endregion
|
|
3289
|
-
export { te as AreaChart, ie as BarChart, l as ChartFrame,
|
|
3295
|
+
export { te as AreaChart, ie as BarChart, l as ChartFrame, Jt as DonutChart, pn as KeyHighlights, Le as LineChart, Be as MiniBars, Ye as PieChart, at as ProcessSankey, ot as RankingSankey, Ze as SankeySvg, ee as SeriesChart, gn as Takeaway, St as Trend, At as TrendChart, Ht as VisualizationRenderer, Gt as cleanupVisualizationMounts, Kt as hydrateVisualizationMounts, qt as serializeVisualizationConfig };
|