@divami-artefacts/ai-design-system 1.0.19 → 1.0.21
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 +217 -217
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -126,33 +126,33 @@ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
|
|
|
126
126
|
children: [
|
|
127
127
|
f && /* @__PURE__ */ s("div", {
|
|
128
128
|
style: {
|
|
129
|
-
fontSize:
|
|
129
|
+
fontSize: 14,
|
|
130
130
|
fontWeight: 400,
|
|
131
131
|
color: u.t2,
|
|
132
132
|
marginBottom: 3,
|
|
133
133
|
whiteSpace: "nowrap",
|
|
134
|
-
lineHeight: "
|
|
134
|
+
lineHeight: "20px"
|
|
135
135
|
},
|
|
136
136
|
children: f
|
|
137
137
|
}),
|
|
138
138
|
/* @__PURE__ */ s("div", {
|
|
139
139
|
style: {
|
|
140
|
-
fontSize:
|
|
140
|
+
fontSize: 16,
|
|
141
141
|
fontWeight: 500,
|
|
142
142
|
color: u.t1,
|
|
143
143
|
whiteSpace: "nowrap",
|
|
144
|
-
lineHeight: "
|
|
144
|
+
lineHeight: "22px"
|
|
145
145
|
},
|
|
146
146
|
children: p
|
|
147
147
|
}),
|
|
148
148
|
m && /* @__PURE__ */ s("div", {
|
|
149
149
|
style: {
|
|
150
|
-
fontSize:
|
|
150
|
+
fontSize: 14,
|
|
151
151
|
fontWeight: 400,
|
|
152
152
|
color: "var(--tooltip-accent)",
|
|
153
153
|
marginTop: 3,
|
|
154
154
|
whiteSpace: "nowrap",
|
|
155
|
-
lineHeight: "
|
|
155
|
+
lineHeight: "20px"
|
|
156
156
|
},
|
|
157
157
|
children: m
|
|
158
158
|
})
|
|
@@ -878,92 +878,92 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
878
878
|
}
|
|
879
879
|
//#endregion
|
|
880
880
|
//#region src/components/rankedCardLeaderboard/RankedCardLeaderboard.tsx
|
|
881
|
-
var
|
|
881
|
+
var H = 780, U = 240, je = 12, Me = 10, Ne = [
|
|
882
882
|
"Highest exposure",
|
|
883
883
|
"Elevated risk",
|
|
884
884
|
"Moderate exposure",
|
|
885
885
|
"Moderate exposure",
|
|
886
886
|
"Low exposure"
|
|
887
887
|
];
|
|
888
|
-
function
|
|
888
|
+
function Pe({ items: e = [], "data-testid": t }) {
|
|
889
889
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(r, {
|
|
890
|
-
width:
|
|
891
|
-
height:
|
|
890
|
+
width: H,
|
|
891
|
+
height: U
|
|
892
892
|
}), b = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), S = b.reduce((e, t) => e + (t.count ?? 0), 0);
|
|
893
893
|
return n(() => {
|
|
894
894
|
let e = r.current;
|
|
895
895
|
if (!e) return;
|
|
896
|
-
let t = v(e,
|
|
896
|
+
let t = v(e, H, U);
|
|
897
897
|
o.current = 0;
|
|
898
|
-
let n = Math.min(5, b.length), i = (
|
|
898
|
+
let n = Math.min(5, b.length), i = (H - 2 * je - 4 * Me) / 5, a = U * .84, s = U * .08, c = n * i + (n - 1) * Me, g = Math.round((H - c) / 2), C, w = () => {
|
|
899
899
|
o.current++;
|
|
900
900
|
let e = o.current;
|
|
901
|
-
t.clearRect(0, 0,
|
|
901
|
+
t.clearRect(0, 0, H, U), t.letterSpacing = f.letterSpacing, _.current = [], l.current.forEach((e, t) => {
|
|
902
902
|
let n = t === m.current ? 1 : 0, r = e + (n - e) * .12;
|
|
903
903
|
Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
|
|
904
904
|
}), 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],
|
|
906
|
-
t.fillStyle = h(c, .08 +
|
|
905
|
+
let o = r === 0, c = r === 0 ? u.red : r === 1 ? u.amber : d[r % d.length], f = g + r * (i + Me), 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
|
+
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
907
|
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
|
-
O.addColorStop(0, h(c, .5 +
|
|
909
|
-
let k = Math.round((n.count ?? 0) / (S || 1) * 100), A =
|
|
910
|
-
E(_.current, n.id,
|
|
908
|
+
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 = Ne[r] ?? "Low exposure";
|
|
910
|
+
E(_.current, n.id, f, s, i, a, {
|
|
911
911
|
label: n.name,
|
|
912
|
-
value: `${n.count ?? 0}
|
|
912
|
+
value: `${n.count ?? 0} · ${k}% of total`,
|
|
913
913
|
sublabel: `Rank #${r + 1} · ${A}`,
|
|
914
914
|
color: c
|
|
915
915
|
});
|
|
916
|
-
}), x(t,
|
|
916
|
+
}), x(t, H, U, e, .015), C = requestAnimationFrame(w);
|
|
917
917
|
};
|
|
918
|
-
return
|
|
918
|
+
return w(), () => cancelAnimationFrame(C);
|
|
919
919
|
}, [b, S]), b.length === 0 ? /* @__PURE__ */ s(I, {
|
|
920
|
-
width:
|
|
921
|
-
height:
|
|
920
|
+
width: H,
|
|
921
|
+
height: U,
|
|
922
922
|
"data-testid": t
|
|
923
923
|
}) : /* @__PURE__ */ c("div", {
|
|
924
924
|
"data-testid": t,
|
|
925
925
|
style: {
|
|
926
926
|
position: "relative",
|
|
927
|
-
width:
|
|
928
|
-
height:
|
|
927
|
+
width: H,
|
|
928
|
+
height: U
|
|
929
929
|
},
|
|
930
930
|
children: [/* @__PURE__ */ s("canvas", {
|
|
931
931
|
ref: r,
|
|
932
932
|
role: "img",
|
|
933
|
-
"aria-label": "Contractor rank —
|
|
933
|
+
"aria-label": "Contractor rank — count per contractor",
|
|
934
934
|
style: {
|
|
935
|
-
width:
|
|
936
|
-
height:
|
|
935
|
+
width: H,
|
|
936
|
+
height: U,
|
|
937
937
|
display: "block",
|
|
938
938
|
borderRadius: 8
|
|
939
939
|
}
|
|
940
940
|
}), /* @__PURE__ */ s(C, {
|
|
941
941
|
...g,
|
|
942
|
-
parentW:
|
|
943
|
-
parentH:
|
|
942
|
+
parentW: H,
|
|
943
|
+
parentH: U
|
|
944
944
|
})]
|
|
945
945
|
});
|
|
946
946
|
}
|
|
947
947
|
//#endregion
|
|
948
948
|
//#region src/components/dotMatrixChart/DotMatrixChart.tsx
|
|
949
|
-
var
|
|
950
|
-
function
|
|
949
|
+
var W = 680, G = 260;
|
|
950
|
+
function Fe({ items: e = [], "data-testid": t }) {
|
|
951
951
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
952
|
-
width:
|
|
953
|
-
height:
|
|
952
|
+
width: W,
|
|
953
|
+
height: G
|
|
954
954
|
}), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
955
955
|
return n(() => {
|
|
956
956
|
let e = r.current;
|
|
957
957
|
if (!e) return;
|
|
958
|
-
let t = v(e,
|
|
958
|
+
let t = v(e, W, G);
|
|
959
959
|
o.current = 0;
|
|
960
|
-
let n = g.length, i = Math.max(...g.map((e) => e.count), 1), a = i, s =
|
|
960
|
+
let n = g.length, i = Math.max(...g.map((e) => e.count), 1), a = i, s = W * .05, c = G * .1, p = W * .9 / n, _ = G * .7 / a, S = g.reduce((e, t) => e + t.count, 0), C, w = () => {
|
|
961
961
|
o.current++;
|
|
962
962
|
let e = o.current;
|
|
963
|
-
t.clearRect(0, 0,
|
|
963
|
+
t.clearRect(0, 0, W, G), m.current = [], l.current.forEach((e, t) => {
|
|
964
964
|
let n = t === d.current ? 1 : 0, r = e + (n - e) * .12;
|
|
965
965
|
Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
|
|
966
|
-
}), d.current && !l.current.has(d.current) && l.current.set(d.current, 0), b(t,
|
|
966
|
+
}), d.current && !l.current.has(d.current) && l.current.set(d.current, 0), b(t, W, G, e, 40, h(u.blue, .04)), g.forEach((n, r) => {
|
|
967
967
|
let o = n.count === i, d = u.blue, g = l.current.get(`${n.category}-col`) ?? 0;
|
|
968
968
|
for (let u = 0; u < a; u++) {
|
|
969
969
|
let a = s + r * p + p / 2, f = c + u * _ + _ / 2, v = Math.min(p, _) * .38;
|
|
@@ -981,40 +981,40 @@ function Ie({ items: e = [], "data-testid": t }) {
|
|
|
981
981
|
}
|
|
982
982
|
let v = c + a * _ + 16;
|
|
983
983
|
t.font = f.font, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = o ? u.blue : h(u.t2, .65), t.fillText(n.category, s + r * p + p / 2, v);
|
|
984
|
-
}), x(t,
|
|
984
|
+
}), x(t, W, G, e, .015), C = requestAnimationFrame(w);
|
|
985
985
|
};
|
|
986
986
|
return w(), () => cancelAnimationFrame(C);
|
|
987
987
|
}, [g]), g.length === 0 ? /* @__PURE__ */ s(I, {
|
|
988
|
-
width:
|
|
989
|
-
height:
|
|
988
|
+
width: W,
|
|
989
|
+
height: G,
|
|
990
990
|
"data-testid": t
|
|
991
991
|
}) : /* @__PURE__ */ c("div", {
|
|
992
992
|
"data-testid": t,
|
|
993
993
|
style: {
|
|
994
994
|
position: "relative",
|
|
995
|
-
width:
|
|
996
|
-
height:
|
|
995
|
+
width: W,
|
|
996
|
+
height: G
|
|
997
997
|
},
|
|
998
998
|
children: [/* @__PURE__ */ s("canvas", {
|
|
999
999
|
ref: r,
|
|
1000
1000
|
role: "img",
|
|
1001
1001
|
"aria-label": "Early Warning count by category — breathing dot grid",
|
|
1002
1002
|
style: {
|
|
1003
|
-
width:
|
|
1004
|
-
height:
|
|
1003
|
+
width: W,
|
|
1004
|
+
height: G,
|
|
1005
1005
|
display: "block",
|
|
1006
1006
|
borderRadius: 8
|
|
1007
1007
|
}
|
|
1008
1008
|
}), /* @__PURE__ */ s(C, {
|
|
1009
1009
|
...p,
|
|
1010
|
-
parentW:
|
|
1011
|
-
parentH:
|
|
1010
|
+
parentW: W,
|
|
1011
|
+
parentH: G
|
|
1012
1012
|
})]
|
|
1013
1013
|
});
|
|
1014
1014
|
}
|
|
1015
1015
|
//#endregion
|
|
1016
1016
|
//#region src/components/lineChart/LineChart.tsx
|
|
1017
|
-
function
|
|
1017
|
+
function Ie({ rows: e = [], className: t, colors: n }) {
|
|
1018
1018
|
return /* @__PURE__ */ s(ee, {
|
|
1019
1019
|
rows: e,
|
|
1020
1020
|
variant: "line",
|
|
@@ -1024,7 +1024,7 @@ function Le({ rows: e = [], className: t, colors: n }) {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
//#endregion
|
|
1026
1026
|
//#region src/components/constants.ts
|
|
1027
|
-
var
|
|
1027
|
+
var Le = [
|
|
1028
1028
|
"#4C93D9",
|
|
1029
1029
|
"#5DA537",
|
|
1030
1030
|
"#F3862C",
|
|
@@ -1032,7 +1032,7 @@ var Re = [
|
|
|
1032
1032
|
"#A0B724",
|
|
1033
1033
|
"#EEBF3B",
|
|
1034
1034
|
"#3C45D1"
|
|
1035
|
-
],
|
|
1035
|
+
], Re = {
|
|
1036
1036
|
nodes: [
|
|
1037
1037
|
{
|
|
1038
1038
|
id: "supplier-x",
|
|
@@ -1075,8 +1075,8 @@ var Re = [
|
|
|
1075
1075
|
};
|
|
1076
1076
|
//#endregion
|
|
1077
1077
|
//#region src/components/miniBars/MiniBars.tsx
|
|
1078
|
-
function
|
|
1079
|
-
let r = n?.slices ??
|
|
1078
|
+
function ze({ rows: e = [], className: t, colors: n }) {
|
|
1079
|
+
let r = n?.slices ?? Le;
|
|
1080
1080
|
return /* @__PURE__ */ s("div", {
|
|
1081
1081
|
className: ["d3-mini-bars", t].filter(Boolean).join(" "),
|
|
1082
1082
|
children: e.map(([e, t, n], i) => /* @__PURE__ */ c("div", {
|
|
@@ -1102,7 +1102,7 @@ function Be({ rows: e = [], className: t, colors: n }) {
|
|
|
1102
1102
|
width: Math.max(0, Math.min(100, t)),
|
|
1103
1103
|
height: "12",
|
|
1104
1104
|
rx: "6",
|
|
1105
|
-
className: `d3-mini-fill tone-${i %
|
|
1105
|
+
className: `d3-mini-fill tone-${i % Le.length}`,
|
|
1106
1106
|
fill: r[i % r.length]
|
|
1107
1107
|
})]
|
|
1108
1108
|
})
|
|
@@ -1114,24 +1114,24 @@ function Be({ rows: e = [], className: t, colors: n }) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
//#endregion
|
|
1116
1116
|
//#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:
|
|
1117
|
+
var Be = 680, Ve = 320, He = 60, Ue = 28;
|
|
1118
|
+
function We({ total: e = 0, items: t = [], "data-testid": r }) {
|
|
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(Ve, He + Math.max(0, g.length - 1) * Ue), [g.length]), { hoveredRef: b, tooltip: x, hitZonesRef: S } = w(o, {
|
|
1120
|
+
width: Be,
|
|
1121
1121
|
height: _
|
|
1122
1122
|
});
|
|
1123
1123
|
return n(() => {
|
|
1124
1124
|
let t = o.current;
|
|
1125
1125
|
if (!t) return;
|
|
1126
|
-
let n = v(t,
|
|
1126
|
+
let n = v(t, Be, _);
|
|
1127
1127
|
m.current = 0;
|
|
1128
|
-
let r = _ / 2, i =
|
|
1128
|
+
let r = _ / 2, i = Be - 80, a = Math.max(...g.map((e) => e.count ?? 0)), s = (_ - 60) / (g.length - 1), c = g.map((e, t) => ({
|
|
1129
1129
|
x: i,
|
|
1130
1130
|
y: 30 + t * s
|
|
1131
1131
|
})), x, C = () => {
|
|
1132
1132
|
m.current++;
|
|
1133
1133
|
let t = m.current;
|
|
1134
|
-
n.clearRect(0, 0,
|
|
1134
|
+
n.clearRect(0, 0, Be, _), n.letterSpacing = f.letterSpacing;
|
|
1135
1135
|
let o = D(Math.min(t / 72, 1));
|
|
1136
1136
|
N(l.current, b.current), S.current = [], y(n, 88, r, 48 * o, u.blue, .15 * o), g.forEach((t, s) => {
|
|
1137
1137
|
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 +1163,14 @@ function Ge({ total: e = 0, items: t = [], "data-testid": r }) {
|
|
|
1163
1163
|
g,
|
|
1164
1164
|
_
|
|
1165
1165
|
]), g.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1166
|
-
width:
|
|
1167
|
-
height:
|
|
1166
|
+
width: Be,
|
|
1167
|
+
height: Ve,
|
|
1168
1168
|
"data-testid": r
|
|
1169
1169
|
}) : /* @__PURE__ */ c("div", {
|
|
1170
1170
|
"data-testid": r,
|
|
1171
1171
|
style: {
|
|
1172
1172
|
position: "relative",
|
|
1173
|
-
width:
|
|
1173
|
+
width: Be,
|
|
1174
1174
|
height: _
|
|
1175
1175
|
},
|
|
1176
1176
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -1178,34 +1178,34 @@ function Ge({ total: e = 0, items: t = [], "data-testid": r }) {
|
|
|
1178
1178
|
role: "img",
|
|
1179
1179
|
"aria-label": "NCE fault tree — NCEs per contractor as branching tree",
|
|
1180
1180
|
style: {
|
|
1181
|
-
width:
|
|
1181
|
+
width: Be,
|
|
1182
1182
|
height: _,
|
|
1183
1183
|
display: "block"
|
|
1184
1184
|
}
|
|
1185
1185
|
}), /* @__PURE__ */ s(C, {
|
|
1186
1186
|
...x,
|
|
1187
|
-
parentW:
|
|
1187
|
+
parentW: Be,
|
|
1188
1188
|
parentH: _
|
|
1189
1189
|
})]
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
1192
|
//#endregion
|
|
1193
1193
|
//#region src/components/pieChart/PieChart.tsx
|
|
1194
|
-
var
|
|
1195
|
-
function
|
|
1194
|
+
var Ge = 192, Ke = Ge, qe = Ge + 80;
|
|
1195
|
+
function Je({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
1196
1196
|
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:
|
|
1197
|
+
width: Ke,
|
|
1198
|
+
height: qe
|
|
1199
1199
|
});
|
|
1200
1200
|
return n(() => {
|
|
1201
1201
|
let n = o.current;
|
|
1202
1202
|
if (!n) return;
|
|
1203
|
-
let r = v(n,
|
|
1203
|
+
let r = v(n, Ke, qe);
|
|
1204
1204
|
p.current = 0;
|
|
1205
|
-
let i =
|
|
1205
|
+
let i = Ke / 2, a = Ge / 2, s = Ge * .4, c = t === "donut" ? Ge * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, d, b = () => {
|
|
1206
1206
|
p.current++;
|
|
1207
1207
|
let n = p.current;
|
|
1208
|
-
r.clearRect(0, 0,
|
|
1208
|
+
r.clearRect(0, 0, Ke, qe);
|
|
1209
1209
|
let o = 1 - (1 - Math.min(n / 48, 1)) ** 3;
|
|
1210
1210
|
N(f.current, g.current), x.current = [];
|
|
1211
1211
|
let v = -Math.PI / 2;
|
|
@@ -1219,10 +1219,10 @@ function Ye({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1219
1219
|
let O = j(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? O * 2 : 0);
|
|
1220
1220
|
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
1221
|
}), t === "donut" && e.length > 0 && y(r, i, a, c * .8, u.blue, .06);
|
|
1222
|
-
let S =
|
|
1222
|
+
let S = Ge + 12;
|
|
1223
1223
|
e.forEach((e, t) => {
|
|
1224
1224
|
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)}%)`,
|
|
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)}%)`, Ke - 4, o + 3.5);
|
|
1226
1226
|
}), d = requestAnimationFrame(b);
|
|
1227
1227
|
};
|
|
1228
1228
|
return b(), () => cancelAnimationFrame(d);
|
|
@@ -1236,30 +1236,30 @@ function Ye({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1236
1236
|
children: /* @__PURE__ */ c("div", {
|
|
1237
1237
|
style: {
|
|
1238
1238
|
position: "relative",
|
|
1239
|
-
width:
|
|
1240
|
-
height:
|
|
1239
|
+
width: Ke,
|
|
1240
|
+
height: qe
|
|
1241
1241
|
},
|
|
1242
1242
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1243
1243
|
ref: o,
|
|
1244
1244
|
role: "img",
|
|
1245
1245
|
"aria-label": `${t} chart`,
|
|
1246
1246
|
style: {
|
|
1247
|
-
width:
|
|
1248
|
-
height:
|
|
1247
|
+
width: Ke,
|
|
1248
|
+
height: qe,
|
|
1249
1249
|
display: "block",
|
|
1250
1250
|
borderRadius: 8
|
|
1251
1251
|
}
|
|
1252
1252
|
}), /* @__PURE__ */ s(C, {
|
|
1253
1253
|
...b,
|
|
1254
|
-
parentW:
|
|
1255
|
-
parentH:
|
|
1254
|
+
parentW: Ke,
|
|
1255
|
+
parentH: qe
|
|
1256
1256
|
})]
|
|
1257
1257
|
})
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
1260
|
//#endregion
|
|
1261
1261
|
//#region src/components/sankey/SankeySvg.tsx
|
|
1262
|
-
function
|
|
1262
|
+
function Ye(e, t, n, r) {
|
|
1263
1263
|
let i = new Set(t.map((e) => e.source)), a = new Set(t.map((e) => e.target)), o = /* @__PURE__ */ new Map(), s = [];
|
|
1264
1264
|
for (e.forEach((e) => {
|
|
1265
1265
|
i.has(e.id) && !a.has(e.id) && s.push({
|
|
@@ -1304,8 +1304,8 @@ function Xe(e, t, n, r) {
|
|
|
1304
1304
|
});
|
|
1305
1305
|
}), f;
|
|
1306
1306
|
}
|
|
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(() =>
|
|
1307
|
+
function Xe({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f, selectedEntity: p, className: m, colors: g }) {
|
|
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(() => Ye(e, t, r, o), [
|
|
1309
1309
|
e,
|
|
1310
1310
|
t,
|
|
1311
1311
|
r,
|
|
@@ -1405,7 +1405,7 @@ function Ze({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1405
1405
|
}
|
|
1406
1406
|
//#endregion
|
|
1407
1407
|
//#region src/canvas/CausalFlowCanvas.tsx
|
|
1408
|
-
var
|
|
1408
|
+
var Ze = [
|
|
1409
1409
|
{
|
|
1410
1410
|
x: .13,
|
|
1411
1411
|
y: .48
|
|
@@ -1438,7 +1438,7 @@ var Qe = [
|
|
|
1438
1438
|
x: .92,
|
|
1439
1439
|
y: .22
|
|
1440
1440
|
}
|
|
1441
|
-
],
|
|
1441
|
+
], Qe = [
|
|
1442
1442
|
u.blue,
|
|
1443
1443
|
u.orange,
|
|
1444
1444
|
u.red,
|
|
@@ -1446,7 +1446,7 @@ var Qe = [
|
|
|
1446
1446
|
u.green,
|
|
1447
1447
|
u.amber,
|
|
1448
1448
|
u.t2
|
|
1449
|
-
],
|
|
1449
|
+
], $e = [
|
|
1450
1450
|
26,
|
|
1451
1451
|
24,
|
|
1452
1452
|
24,
|
|
@@ -1456,21 +1456,21 @@ var Qe = [
|
|
|
1456
1456
|
22,
|
|
1457
1457
|
22
|
|
1458
1458
|
];
|
|
1459
|
-
function
|
|
1459
|
+
function et(e, t) {
|
|
1460
1460
|
let n = 1 - t;
|
|
1461
1461
|
return {
|
|
1462
1462
|
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
1463
|
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
1464
|
};
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1466
|
+
function tt(e, t) {
|
|
1467
1467
|
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
1468
|
return {
|
|
1469
1469
|
x: -i / a,
|
|
1470
1470
|
y: r / a
|
|
1471
1471
|
};
|
|
1472
1472
|
}
|
|
1473
|
-
function
|
|
1473
|
+
function nt(e, t) {
|
|
1474
1474
|
let n = t.x - e.x, r = t.y - e.y;
|
|
1475
1475
|
return {
|
|
1476
1476
|
p0: {
|
|
@@ -1491,7 +1491,7 @@ function rt(e, t) {
|
|
|
1491
1491
|
}
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function rt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
|
|
1495
1495
|
let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: g, hitZonesRef: S } = w(d, {
|
|
1496
1496
|
width: r,
|
|
1497
1497
|
height: o
|
|
@@ -1499,15 +1499,15 @@ function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1499
1499
|
let t = /* @__PURE__ */ new Map();
|
|
1500
1500
|
return e.forEach((e, n) => t.set(e.id, n)), t;
|
|
1501
1501
|
}, [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 =
|
|
1502
|
+
let n = Ze[t % Ze.length];
|
|
1503
1503
|
return {
|
|
1504
1504
|
id: e.id,
|
|
1505
1505
|
label: e.name,
|
|
1506
1506
|
sub: e.valueLabel ?? "",
|
|
1507
1507
|
x: n.x * r,
|
|
1508
1508
|
y: n.y * o,
|
|
1509
|
-
r:
|
|
1510
|
-
color:
|
|
1509
|
+
r: $e[t % $e.length],
|
|
1510
|
+
color: Qe[t % Qe.length]
|
|
1511
1511
|
};
|
|
1512
1512
|
}), [
|
|
1513
1513
|
e,
|
|
@@ -1529,7 +1529,7 @@ function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1529
1529
|
if (t.clearRect(0, 0, r, o), S.current = [], b(t, r, o, e, 50, h(u.blue, .05)), M.forEach((e, n) => {
|
|
1530
1530
|
let r = A[e.fromIdx], i = A[e.toIdx];
|
|
1531
1531
|
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 =
|
|
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 = nt(r, i);
|
|
1533
1533
|
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
1534
|
for (let t = 0; t < e.conf * 2.5; t++) Math.random() < .45 && p.current.push({
|
|
1535
1535
|
edgeIdx: n,
|
|
@@ -1538,7 +1538,7 @@ function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1538
1538
|
off: (Math.random() - .5) * 13,
|
|
1539
1539
|
sz: .7 + Math.random() * 2
|
|
1540
1540
|
});
|
|
1541
|
-
let f =
|
|
1541
|
+
let f = et(d, .5), m = `${Math.round(e.conf * 100)}%`;
|
|
1542
1542
|
t.font = "bold 12px 'JetBrains Mono', monospace", t.textBaseline = "middle";
|
|
1543
1543
|
let g = t.measureText(m).width + 14;
|
|
1544
1544
|
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 +1548,7 @@ function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1548
1548
|
if (!n) return !1;
|
|
1549
1549
|
let r = A[n.fromIdx], i = A[n.toIdx];
|
|
1550
1550
|
if (!r || !i) return !1;
|
|
1551
|
-
let a =
|
|
1551
|
+
let a = nt(r, i), o = et(a, e.t), s = tt(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
1552
|
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
1553
|
}), p.current.length > 350 && (p.current = p.current.slice(-350)), A.forEach((n, r) => {
|
|
1554
1554
|
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 +1605,10 @@ function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1605
1605
|
}
|
|
1606
1606
|
//#endregion
|
|
1607
1607
|
//#region src/components/sankey/ProcessSankey.tsx
|
|
1608
|
-
function
|
|
1609
|
-
return /* @__PURE__ */ s(
|
|
1610
|
-
nodes:
|
|
1611
|
-
links:
|
|
1608
|
+
function it({ selectedEntity: e, colors: t }) {
|
|
1609
|
+
return /* @__PURE__ */ s(rt, {
|
|
1610
|
+
nodes: Re.nodes,
|
|
1611
|
+
links: Re.links,
|
|
1612
1612
|
width: 960,
|
|
1613
1613
|
height: 280,
|
|
1614
1614
|
selectedEntity: e
|
|
@@ -1616,7 +1616,7 @@ function at({ selectedEntity: e, colors: t }) {
|
|
|
1616
1616
|
}
|
|
1617
1617
|
//#endregion
|
|
1618
1618
|
//#region src/components/sankey/RankingSankey.tsx
|
|
1619
|
-
function
|
|
1619
|
+
function at({ rows: e = [], className: t, colors: n }) {
|
|
1620
1620
|
let { nodes: r, links: a } = i(() => {
|
|
1621
1621
|
let t = e.slice(0, 5);
|
|
1622
1622
|
return {
|
|
@@ -1634,7 +1634,7 @@ function ot({ rows: e = [], className: t, colors: n }) {
|
|
|
1634
1634
|
}))
|
|
1635
1635
|
};
|
|
1636
1636
|
}, [e]);
|
|
1637
|
-
return /* @__PURE__ */ s(
|
|
1637
|
+
return /* @__PURE__ */ s(Xe, {
|
|
1638
1638
|
nodes: r,
|
|
1639
1639
|
links: a,
|
|
1640
1640
|
width: 760,
|
|
@@ -1646,20 +1646,20 @@ function ot({ rows: e = [], className: t, colors: n }) {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
//#endregion
|
|
1648
1648
|
//#region src/components/balanceScaleChart/BalanceScaleChart.tsx
|
|
1649
|
-
var
|
|
1650
|
-
function
|
|
1649
|
+
var ot = 500, st = 320;
|
|
1650
|
+
function ct({ left: e, right: t, "data-testid": r }) {
|
|
1651
1651
|
let i = a(null), o = a(0);
|
|
1652
1652
|
return n(() => {
|
|
1653
1653
|
let n = i.current;
|
|
1654
1654
|
if (!n) return;
|
|
1655
|
-
let r = v(n,
|
|
1655
|
+
let r = v(n, ot, st);
|
|
1656
1656
|
o.current = 0;
|
|
1657
|
-
let a =
|
|
1657
|
+
let a = ot / 2, s = Math.max(e.value, t.value), c = (e.value - t.value) / s * 14, l, d = () => {
|
|
1658
1658
|
o.current++;
|
|
1659
1659
|
let n = o.current;
|
|
1660
|
-
r.clearRect(0, 0,
|
|
1660
|
+
r.clearRect(0, 0, ot, st), r.letterSpacing = f.letterSpacing;
|
|
1661
1661
|
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,
|
|
1662
|
+
r.strokeStyle = h(u.bd, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(a, 100), r.lineTo(a, st - 80), r.stroke(), r.beginPath(), r.arc(a, 100, 5 * i, 0, Math.PI * 2), r.fillStyle = u.t2, r.fill();
|
|
1663
1663
|
let _ = {
|
|
1664
1664
|
x: a - Math.cos(g) * 160,
|
|
1665
1665
|
y: 100 + Math.sin(-g) * 160
|
|
@@ -1685,23 +1685,23 @@ function lt({ left: e, right: t, "data-testid": r }) {
|
|
|
1685
1685
|
6
|
|
1686
1686
|
]), r.fill(), r.stroke(), r.strokeStyle = h(u.t2, .35 * i), r.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
|
|
1687
1687
|
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,
|
|
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, st - 12), r.globalAlpha = 1), l = requestAnimationFrame(d);
|
|
1689
1689
|
};
|
|
1690
1690
|
return d(), () => cancelAnimationFrame(l);
|
|
1691
1691
|
}, [e, t]), /* @__PURE__ */ s("div", {
|
|
1692
1692
|
"data-testid": r,
|
|
1693
1693
|
style: {
|
|
1694
1694
|
position: "relative",
|
|
1695
|
-
width:
|
|
1696
|
-
height:
|
|
1695
|
+
width: ot,
|
|
1696
|
+
height: st
|
|
1697
1697
|
},
|
|
1698
1698
|
children: /* @__PURE__ */ s("canvas", {
|
|
1699
1699
|
ref: i,
|
|
1700
1700
|
role: "img",
|
|
1701
1701
|
"aria-label": "Quotation balance — accepted vs submitted quotation value",
|
|
1702
1702
|
style: {
|
|
1703
|
-
width:
|
|
1704
|
-
height:
|
|
1703
|
+
width: ot,
|
|
1704
|
+
height: st,
|
|
1705
1705
|
display: "block"
|
|
1706
1706
|
}
|
|
1707
1707
|
})
|
|
@@ -1709,25 +1709,25 @@ function lt({ left: e, right: t, "data-testid": r }) {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
//#endregion
|
|
1711
1711
|
//#region src/components/areaLineChart/AreaLineChart.tsx
|
|
1712
|
-
var
|
|
1713
|
-
function
|
|
1712
|
+
var lt = 680, K = 280;
|
|
1713
|
+
function ut({ points: e = [], "data-testid": t }) {
|
|
1714
1714
|
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
1715
|
-
width:
|
|
1716
|
-
height:
|
|
1715
|
+
width: lt,
|
|
1716
|
+
height: K
|
|
1717
1717
|
}), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
1718
1718
|
return n(() => {
|
|
1719
1719
|
let e = r.current;
|
|
1720
1720
|
if (!e) return;
|
|
1721
|
-
let t = v(e,
|
|
1721
|
+
let t = v(e, lt, K);
|
|
1722
1722
|
l.current = 0;
|
|
1723
|
-
let n =
|
|
1723
|
+
let n = lt - 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
1724
|
x: 54 + t * c,
|
|
1725
1725
|
y: 30 + i - e.count / a * i,
|
|
1726
1726
|
point: e
|
|
1727
1727
|
})), _, b = () => {
|
|
1728
1728
|
l.current++;
|
|
1729
1729
|
let e = l.current;
|
|
1730
|
-
t.clearRect(0, 0,
|
|
1730
|
+
t.clearRect(0, 0, lt, K), t.letterSpacing = f.letterSpacing;
|
|
1731
1731
|
let r = D(Math.min(e / 72, 1));
|
|
1732
1732
|
N(o.current, d.current), m.current = [], [
|
|
1733
1733
|
.25,
|
|
@@ -1737,7 +1737,7 @@ function dt({ points: e = [], "data-testid": t }) {
|
|
|
1737
1737
|
].forEach((e) => {
|
|
1738
1738
|
let r = 30 + i - e * i;
|
|
1739
1739
|
t.strokeStyle = h(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(54, r), t.lineTo(54 + n, r), t.stroke(), t.setLineDash([]), t.font = f.font, t.fillStyle = f.color, t.textAlign = "right", t.fillText(String(Math.round(a * e)), 48, r + 3);
|
|
1740
|
-
}), t.save(), t.translate(12, 30 + i / 2), t.rotate(-Math.PI / 2), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Submissions", 0, 0), t.restore(), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Week", 54 + n / 2,
|
|
1740
|
+
}), t.save(), t.translate(12, 30 + i / 2), t.rotate(-Math.PI / 2), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Submissions", 0, 0), t.restore(), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Week", 54 + n / 2, K - 6), t.strokeStyle = h(u.bd, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(54, 30 + i), t.lineTo(54 + n, 30 + i), t.stroke();
|
|
1741
1741
|
let c = r * (s - 1), g = Math.floor(c) + 1;
|
|
1742
1742
|
if (g >= 2) {
|
|
1743
1743
|
t.beginPath(), t.moveTo(p[0].x, 30 + i), t.lineTo(p[0].x, p[0].y);
|
|
@@ -1765,13 +1765,13 @@ function dt({ points: e = [], "data-testid": t }) {
|
|
|
1765
1765
|
color: u.blue
|
|
1766
1766
|
}), s > 0 && S(t, e.x, 30, 30 + i, h(u.blue, .15 * s));
|
|
1767
1767
|
let c = e.point.count === a;
|
|
1768
|
-
(s > 0 || c) && y(t, e.x, e.y, 14, u.blue, (c ? .3 : 0) + s * .25), t.beginPath(), t.arc(e.x, e.y, s > 0 ? 5 : 3.5, 0, Math.PI * 2), t.fillStyle = h(u.blue, s > 0 ? 1 : .8), t.fill(), (s > 0 || c) && (t.font = f.font, t.fillStyle = u.blue, t.textAlign = "center", t.fillText(String(e.point.count), e.x, e.y - 10)), t.font = f.font, t.fillStyle = s > 0 ? u.blue : f.color, t.textAlign = "center", t.fillText(e.point.week, e.x,
|
|
1768
|
+
(s > 0 || c) && y(t, e.x, e.y, 14, u.blue, (c ? .3 : 0) + s * .25), t.beginPath(), t.arc(e.x, e.y, s > 0 ? 5 : 3.5, 0, Math.PI * 2), t.fillStyle = h(u.blue, s > 0 ? 1 : .8), t.fill(), (s > 0 || c) && (t.font = f.font, t.fillStyle = u.blue, t.textAlign = "center", t.fillText(String(e.point.count), e.x, e.y - 10)), t.font = f.font, t.fillStyle = s > 0 ? u.blue : f.color, t.textAlign = "center", t.fillText(e.point.week, e.x, K - 54 + 14);
|
|
1769
1769
|
}), _ = requestAnimationFrame(b);
|
|
1770
1770
|
};
|
|
1771
1771
|
return b(), () => cancelAnimationFrame(_);
|
|
1772
1772
|
}, [g]), g.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1773
|
-
width:
|
|
1774
|
-
height:
|
|
1773
|
+
width: lt,
|
|
1774
|
+
height: K,
|
|
1775
1775
|
"data-testid": t
|
|
1776
1776
|
}) : /* @__PURE__ */ s("div", {
|
|
1777
1777
|
"data-testid": t,
|
|
@@ -1783,64 +1783,64 @@ function dt({ points: e = [], "data-testid": t }) {
|
|
|
1783
1783
|
children: /* @__PURE__ */ c("div", {
|
|
1784
1784
|
style: {
|
|
1785
1785
|
position: "relative",
|
|
1786
|
-
width:
|
|
1787
|
-
height:
|
|
1786
|
+
width: lt,
|
|
1787
|
+
height: K
|
|
1788
1788
|
},
|
|
1789
1789
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1790
1790
|
ref: r,
|
|
1791
1791
|
role: "img",
|
|
1792
1792
|
"aria-label": "Trend chart — count over time",
|
|
1793
1793
|
style: {
|
|
1794
|
-
width:
|
|
1795
|
-
height:
|
|
1794
|
+
width: lt,
|
|
1795
|
+
height: K,
|
|
1796
1796
|
display: "block"
|
|
1797
1797
|
}
|
|
1798
1798
|
}), /* @__PURE__ */ s(C, {
|
|
1799
1799
|
...p,
|
|
1800
|
-
parentW:
|
|
1801
|
-
parentH:
|
|
1800
|
+
parentW: lt,
|
|
1801
|
+
parentH: K
|
|
1802
1802
|
})]
|
|
1803
1803
|
})
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
1806
|
//#endregion
|
|
1807
1807
|
//#region src/components/trend/Trend.tsx
|
|
1808
|
-
var
|
|
1809
|
-
function
|
|
1808
|
+
var dt = 680, q = 280, ft = 54, pt = 28, mt = 64, ht = f.font, gt = 12;
|
|
1809
|
+
function _t({ points: e = [], "data-testid": t }) {
|
|
1810
1810
|
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
|
|
1811
|
+
if (d.length <= 1) return mt;
|
|
1812
1812
|
let e = document.createElement("canvas").getContext("2d");
|
|
1813
|
-
if (!e) return
|
|
1814
|
-
e.font =
|
|
1813
|
+
if (!e) return mt;
|
|
1814
|
+
e.font = ht;
|
|
1815
1815
|
let t = Math.max(...d.map((t) => e.measureText(t.week).width));
|
|
1816
|
-
return Math.max(
|
|
1817
|
-
}, [d]), m = Math.max(
|
|
1818
|
-
width:
|
|
1819
|
-
height:
|
|
1816
|
+
return Math.max(mt, t + gt);
|
|
1817
|
+
}, [d]), m = Math.round(p / 2), g = Math.max(dt - ft, pt + m + Math.max(0, d.length - 1) * p), { tooltip: _, hitZonesRef: y } = w(r, {
|
|
1818
|
+
width: g,
|
|
1819
|
+
height: q
|
|
1820
1820
|
});
|
|
1821
1821
|
return n(() => {
|
|
1822
1822
|
let e = r.current;
|
|
1823
1823
|
if (!e) return;
|
|
1824
|
-
let t = v(e,
|
|
1824
|
+
let t = v(e, g, q), n = o.current ? v(o.current, ft, q) : null;
|
|
1825
1825
|
l.current = 0;
|
|
1826
|
-
let i =
|
|
1827
|
-
x: t *
|
|
1826
|
+
let i = g - pt, a = q - 30 - 54, s = Math.max(...d.map((e) => e.count), 1), c = d.length, _ = c > 1 ? Math.max((i - m) / (c - 1), p) : i - m, b = d.map((e, t) => ({
|
|
1827
|
+
x: m + t * _,
|
|
1828
1828
|
y: 30 + a - e.count / s * a,
|
|
1829
1829
|
point: e
|
|
1830
1830
|
}));
|
|
1831
|
-
n && (n.clearRect(0, 0,
|
|
1831
|
+
n && (n.clearRect(0, 0, ft, q), n.letterSpacing = f.letterSpacing, [
|
|
1832
1832
|
.25,
|
|
1833
1833
|
.5,
|
|
1834
1834
|
.75,
|
|
1835
1835
|
1
|
|
1836
1836
|
].forEach((e) => {
|
|
1837
1837
|
let t = 30 + a - e * a;
|
|
1838
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(String(Math.round(s * e)),
|
|
1838
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(String(Math.round(s * e)), ft - 6, t + 3);
|
|
1839
1839
|
}), n.save(), n.translate(12, 30 + a / 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
|
-
let
|
|
1840
|
+
let x, S = () => {
|
|
1841
1841
|
l.current++;
|
|
1842
1842
|
let e = Math.min(l.current / 72, 1), n = D(e);
|
|
1843
|
-
t.clearRect(0, 0,
|
|
1843
|
+
t.clearRect(0, 0, g, q), t.letterSpacing = f.letterSpacing, [
|
|
1844
1844
|
.25,
|
|
1845
1845
|
.5,
|
|
1846
1846
|
.75,
|
|
@@ -1848,41 +1848,41 @@ function vt({ points: e = [], "data-testid": t }) {
|
|
|
1848
1848
|
].forEach((e) => {
|
|
1849
1849
|
let n = 30 + a - e * a;
|
|
1850
1850
|
t.strokeStyle = h(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(0, n), t.lineTo(i, n), t.stroke(), t.setLineDash([]);
|
|
1851
|
-
}), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Period", i / 2,
|
|
1851
|
+
}), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Period", m + (i - m) / 2, q - 6), t.strokeStyle = h(u.bd, .3), t.lineWidth = 1, t.beginPath(), t.moveTo(m, 30 + a), t.lineTo(i, 30 + a), t.stroke();
|
|
1852
1852
|
let r = n * (c - 1), o = Math.floor(r) + 1;
|
|
1853
1853
|
if (o >= 2) {
|
|
1854
|
-
t.beginPath(), t.moveTo(
|
|
1854
|
+
t.beginPath(), t.moveTo(b[0].x, 30 + a), t.lineTo(b[0].x, b[0].y);
|
|
1855
1855
|
for (let e = 1; e < o; e++) {
|
|
1856
|
-
let n = r - Math.floor(r), i = e === o - 1 && e === Math.ceil(r) && n > 0, a = i ?
|
|
1856
|
+
let n = r - Math.floor(r), i = e === o - 1 && e === Math.ceil(r) && n > 0, a = i ? b[e - 1].x + (b[e].x - b[e - 1].x) * n : b[e].x, s = i ? b[e - 1].y + (b[e].y - b[e - 1].y) * n : b[e].y;
|
|
1857
1857
|
t.lineTo(a, s);
|
|
1858
1858
|
}
|
|
1859
|
-
t.lineTo(
|
|
1859
|
+
t.lineTo(b[o - 1].x, 30 + a), t.closePath();
|
|
1860
1860
|
let e = t.createLinearGradient(0, 30, 0, 30 + a);
|
|
1861
1861
|
e.addColorStop(0, h(u.blue, .22)), e.addColorStop(1, h(u.blue, .02)), t.fillStyle = e, t.fill();
|
|
1862
1862
|
}
|
|
1863
1863
|
t.beginPath();
|
|
1864
1864
|
for (let e = 0; e < o; e++) {
|
|
1865
|
-
let n = r - Math.floor(r), i = e === o - 1 && e > 0 && e === Math.ceil(r) && n > 0, a = i ?
|
|
1865
|
+
let n = r - Math.floor(r), i = e === o - 1 && e > 0 && e === Math.ceil(r) && n > 0, a = i ? b[e - 1].x + (b[e].x - b[e - 1].x) * n : b[e].x, s = i ? b[e - 1].y + (b[e].y - b[e - 1].y) * n : b[e].y;
|
|
1866
1866
|
e === 0 ? t.moveTo(a, s) : t.lineTo(a, s);
|
|
1867
1867
|
}
|
|
1868
|
-
t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(),
|
|
1869
|
-
n >= o || (T(
|
|
1868
|
+
t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(), y.current = [], b.forEach((e, n) => {
|
|
1869
|
+
n >= o || (T(y.current, `pt-${n}`, e.x, e.y, 10, {
|
|
1870
1870
|
label: e.point.week,
|
|
1871
1871
|
value: `${e.point.count} submissions`,
|
|
1872
1872
|
sublabel: `£${e.point.value}M value`,
|
|
1873
1873
|
color: u.blue
|
|
1874
|
-
}), t.beginPath(), t.arc(e.x, e.y, 3.5, 0, Math.PI * 2), t.fillStyle = h(u.blue, .8), t.fill(), t.font =
|
|
1875
|
-
}), e < 1 && (
|
|
1874
|
+
}), t.beginPath(), t.arc(e.x, e.y, 3.5, 0, Math.PI * 2), t.fillStyle = h(u.blue, .8), t.fill(), t.font = ht, t.fillStyle = f.color, t.textAlign = "center", t.fillText(e.point.week, e.x, q - 54 + 14));
|
|
1875
|
+
}), e < 1 && (x = requestAnimationFrame(S));
|
|
1876
1876
|
};
|
|
1877
|
-
return
|
|
1877
|
+
return S(), () => cancelAnimationFrame(x);
|
|
1878
1878
|
}, [
|
|
1879
1879
|
d,
|
|
1880
|
-
|
|
1880
|
+
g,
|
|
1881
1881
|
p,
|
|
1882
|
-
|
|
1882
|
+
y
|
|
1883
1883
|
]), d.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1884
|
-
width:
|
|
1885
|
-
height:
|
|
1884
|
+
width: dt,
|
|
1885
|
+
height: q,
|
|
1886
1886
|
"data-testid": t
|
|
1887
1887
|
}) : /* @__PURE__ */ c("div", {
|
|
1888
1888
|
"data-testid": t,
|
|
@@ -1895,8 +1895,8 @@ function vt({ points: e = [], "data-testid": t }) {
|
|
|
1895
1895
|
ref: o,
|
|
1896
1896
|
"aria-hidden": "true",
|
|
1897
1897
|
style: {
|
|
1898
|
-
width:
|
|
1899
|
-
height:
|
|
1898
|
+
width: ft,
|
|
1899
|
+
height: q,
|
|
1900
1900
|
display: "block",
|
|
1901
1901
|
flexShrink: 0
|
|
1902
1902
|
}
|
|
@@ -1909,22 +1909,22 @@ function vt({ points: e = [], "data-testid": t }) {
|
|
|
1909
1909
|
children: /* @__PURE__ */ c("div", {
|
|
1910
1910
|
style: {
|
|
1911
1911
|
position: "relative",
|
|
1912
|
-
width:
|
|
1913
|
-
height:
|
|
1912
|
+
width: g,
|
|
1913
|
+
height: q
|
|
1914
1914
|
},
|
|
1915
1915
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1916
1916
|
ref: r,
|
|
1917
1917
|
role: "img",
|
|
1918
1918
|
"aria-label": "Trend chart — count over time",
|
|
1919
1919
|
style: {
|
|
1920
|
-
width:
|
|
1921
|
-
height:
|
|
1920
|
+
width: g,
|
|
1921
|
+
height: q,
|
|
1922
1922
|
display: "block"
|
|
1923
1923
|
}
|
|
1924
1924
|
}), /* @__PURE__ */ s(C, {
|
|
1925
|
-
...
|
|
1926
|
-
parentW:
|
|
1927
|
-
parentH:
|
|
1925
|
+
..._,
|
|
1926
|
+
parentW: g,
|
|
1927
|
+
parentH: q
|
|
1928
1928
|
})]
|
|
1929
1929
|
})
|
|
1930
1930
|
})]
|
|
@@ -1932,38 +1932,38 @@ function vt({ points: e = [], "data-testid": t }) {
|
|
|
1932
1932
|
}
|
|
1933
1933
|
//#endregion
|
|
1934
1934
|
//#region src/components/proportionalBandChart/ProportionalBandChart.tsx
|
|
1935
|
-
var
|
|
1936
|
-
function
|
|
1935
|
+
var J = 680, vt = 240;
|
|
1936
|
+
function yt(e, t, n) {
|
|
1937
1937
|
if (e.measureText(t).width <= n) return t;
|
|
1938
1938
|
let r = t;
|
|
1939
1939
|
for (; r.length > 0 && e.measureText(`${r}…`).width > n;) r = r.slice(0, -1);
|
|
1940
1940
|
return `${r}…`;
|
|
1941
1941
|
}
|
|
1942
|
-
var
|
|
1942
|
+
var bt = {
|
|
1943
1943
|
Critical: u.red,
|
|
1944
1944
|
High: u.orange,
|
|
1945
1945
|
Medium: u.amber,
|
|
1946
1946
|
Low: u.green
|
|
1947
1947
|
};
|
|
1948
|
-
function
|
|
1948
|
+
function xt({ severities: e = [], "data-testid": t }) {
|
|
1949
1949
|
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: m, hitZonesRef: g } = w(r, {
|
|
1950
|
-
width:
|
|
1951
|
-
height:
|
|
1950
|
+
width: J,
|
|
1951
|
+
height: vt
|
|
1952
1952
|
}), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
1953
1953
|
return n(() => {
|
|
1954
1954
|
let e = r.current;
|
|
1955
1955
|
if (!e) return;
|
|
1956
|
-
let t = v(e,
|
|
1956
|
+
let t = v(e, J, vt);
|
|
1957
1957
|
l.current = 0;
|
|
1958
|
-
let n = _.reduce((e, t) => e + t.count, 0), i =
|
|
1958
|
+
let n = _.reduce((e, t) => e + t.count, 0), i = J - 28 - 28, a = vt - 50 - 52, s = _.map((e) => e.count / n * i), c, m = () => {
|
|
1959
1959
|
l.current++;
|
|
1960
1960
|
let e = l.current;
|
|
1961
|
-
t.clearRect(0, 0,
|
|
1961
|
+
t.clearRect(0, 0, J, vt), t.letterSpacing = f.letterSpacing;
|
|
1962
1962
|
let r = O(Math.min(e / 60, 1));
|
|
1963
|
-
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(
|
|
1963
|
+
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([]);
|
|
1964
1964
|
let v = 28;
|
|
1965
1965
|
_.forEach((e, i) => {
|
|
1966
|
-
let c =
|
|
1966
|
+
let c = bt[e.severity] ?? u.blue, l = s[i];
|
|
1967
1967
|
l * r;
|
|
1968
1968
|
let d = o.current.get(e.severity) ?? 0, m = v + l / 2, _ = l * .85;
|
|
1969
1969
|
m - _ / 2;
|
|
@@ -1975,7 +1975,7 @@ function St({ severities: e = [], "data-testid": t }) {
|
|
|
1975
1975
|
color: c
|
|
1976
1976
|
}), r > .5) {
|
|
1977
1977
|
let i = Math.min(1, (r - .5) / .5), o = v + l / 2;
|
|
1978
|
-
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? c : h(c, .9), t.textAlign = "center", t.fillText(
|
|
1978
|
+
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? c : h(c, .9), t.textAlign = "center", t.fillText(yt(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;
|
|
1979
1979
|
}
|
|
1980
1980
|
v += l;
|
|
1981
1981
|
});
|
|
@@ -1984,56 +1984,56 @@ function St({ severities: e = [], "data-testid": t }) {
|
|
|
1984
1984
|
};
|
|
1985
1985
|
return m(), () => cancelAnimationFrame(c);
|
|
1986
1986
|
}, [_]), _.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1987
|
-
width:
|
|
1988
|
-
height:
|
|
1987
|
+
width: J,
|
|
1988
|
+
height: vt,
|
|
1989
1989
|
"data-testid": t
|
|
1990
1990
|
}) : /* @__PURE__ */ c("div", {
|
|
1991
1991
|
"data-testid": t,
|
|
1992
1992
|
style: {
|
|
1993
1993
|
position: "relative",
|
|
1994
|
-
width:
|
|
1995
|
-
height:
|
|
1994
|
+
width: J,
|
|
1995
|
+
height: vt
|
|
1996
1996
|
},
|
|
1997
1997
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1998
1998
|
ref: r,
|
|
1999
1999
|
role: "img",
|
|
2000
2000
|
"aria-label": "Early Warning severity distribution — prism spectrum bands",
|
|
2001
2001
|
style: {
|
|
2002
|
-
width:
|
|
2003
|
-
height:
|
|
2002
|
+
width: J,
|
|
2003
|
+
height: vt,
|
|
2004
2004
|
display: "block"
|
|
2005
2005
|
}
|
|
2006
2006
|
}), /* @__PURE__ */ s(C, {
|
|
2007
2007
|
...m,
|
|
2008
|
-
parentW:
|
|
2009
|
-
parentH:
|
|
2008
|
+
parentW: J,
|
|
2009
|
+
parentH: vt
|
|
2010
2010
|
})]
|
|
2011
2011
|
});
|
|
2012
2012
|
}
|
|
2013
2013
|
//#endregion
|
|
2014
2014
|
//#region src/components/hubAndSpokeRadialChart/HubAndSpokeRadialChart.tsx
|
|
2015
|
-
var
|
|
2015
|
+
var Y = 460, St = 300, Ct = {
|
|
2016
2016
|
Open: u.red,
|
|
2017
2017
|
Submitted: u.amber,
|
|
2018
2018
|
Closed: u.green
|
|
2019
2019
|
};
|
|
2020
2020
|
function wt({ segments: e = [], title: t, "data-testid": r }) {
|
|
2021
2021
|
let o = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), { hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(o, {
|
|
2022
|
-
width:
|
|
2023
|
-
height:
|
|
2022
|
+
width: Y,
|
|
2023
|
+
height: St
|
|
2024
2024
|
}), S = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
2025
2025
|
return n(() => {
|
|
2026
2026
|
let e = o.current;
|
|
2027
2027
|
if (!e) return;
|
|
2028
|
-
let t = v(e,
|
|
2028
|
+
let t = v(e, Y, St);
|
|
2029
2029
|
l.current = 0;
|
|
2030
|
-
let n =
|
|
2030
|
+
let n = Y * .5, r = St * .54, i = Y * .22, a = S.reduce((e, t) => e + t.count, 0), s = Math.max(...S.map((e) => e.count), 1), c, g = () => {
|
|
2031
2031
|
l.current++;
|
|
2032
2032
|
let e = l.current;
|
|
2033
|
-
t.clearRect(0, 0,
|
|
2033
|
+
t.clearRect(0, 0, Y, St), t.letterSpacing = f.letterSpacing, _.current = [], d.current.forEach((e, t) => {
|
|
2034
2034
|
let n = t === m.current ? 1 : 0, r = e + (n - e) * .12;
|
|
2035
2035
|
Math.abs(r - n) < .005 ? n === 0 ? d.current.delete(t) : d.current.set(t, 1) : d.current.set(t, r);
|
|
2036
|
-
}), m.current && !d.current.has(m.current) && d.current.set(m.current, 0), b(t,
|
|
2036
|
+
}), m.current && !d.current.has(m.current) && d.current.set(m.current, 0), b(t, Y, St, e, 40, h(u.blue, .04)), S.forEach((a, o) => {
|
|
2037
2037
|
let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, d = r + Math.sin(c) * i, f = Ct[a.status] ?? u.blue, m = 2 + a.count / s * 8;
|
|
2038
2038
|
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();
|
|
2039
2039
|
let g = (e * .005 + o * .33) % 1, _ = n + (l - n) * g, v = r + (d - r) * g;
|
|
@@ -2058,34 +2058,34 @@ function wt({ segments: e = [], title: t, "data-testid": r }) {
|
|
|
2058
2058
|
label: "Total EW Status",
|
|
2059
2059
|
value: `${a} Early Warnings`,
|
|
2060
2060
|
color: u.t2
|
|
2061
|
-
}), x(t,
|
|
2061
|
+
}), x(t, Y, St, e, .015), c = requestAnimationFrame(g);
|
|
2062
2062
|
};
|
|
2063
2063
|
return g(), () => cancelAnimationFrame(c);
|
|
2064
2064
|
}, [S, t]), S.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2065
|
-
width:
|
|
2066
|
-
height:
|
|
2065
|
+
width: Y,
|
|
2066
|
+
height: St,
|
|
2067
2067
|
"data-testid": r
|
|
2068
2068
|
}) : /* @__PURE__ */ c("div", {
|
|
2069
2069
|
"data-testid": r,
|
|
2070
2070
|
style: {
|
|
2071
2071
|
position: "relative",
|
|
2072
|
-
width:
|
|
2073
|
-
height:
|
|
2072
|
+
width: Y,
|
|
2073
|
+
height: St
|
|
2074
2074
|
},
|
|
2075
2075
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2076
2076
|
ref: o,
|
|
2077
2077
|
role: "img",
|
|
2078
2078
|
"aria-label": t ?? "EW status arc visualization",
|
|
2079
2079
|
style: {
|
|
2080
|
-
width:
|
|
2081
|
-
height:
|
|
2080
|
+
width: Y,
|
|
2081
|
+
height: St,
|
|
2082
2082
|
display: "block",
|
|
2083
2083
|
borderRadius: 8
|
|
2084
2084
|
}
|
|
2085
2085
|
}), /* @__PURE__ */ s(C, {
|
|
2086
2086
|
...g,
|
|
2087
|
-
parentW:
|
|
2088
|
-
parentH:
|
|
2087
|
+
parentW: Y,
|
|
2088
|
+
parentH: St
|
|
2089
2089
|
})]
|
|
2090
2090
|
});
|
|
2091
2091
|
}
|
|
@@ -2373,7 +2373,7 @@ function Lt(e, t, n, r, i, a, o, s) {
|
|
|
2373
2373
|
//#endregion
|
|
2374
2374
|
//#region src/components/visualizationRenderer/VisualizationRenderer.tsx
|
|
2375
2375
|
function Rt({ config: e, className: t }) {
|
|
2376
|
-
return e.type === "line" ? /* @__PURE__ */ s(
|
|
2376
|
+
return e.type === "line" ? /* @__PURE__ */ s(Ie, {
|
|
2377
2377
|
rows: e.rows,
|
|
2378
2378
|
className: t
|
|
2379
2379
|
}) : e.type === "area" ? /* @__PURE__ */ s(te, {
|
|
@@ -2382,40 +2382,40 @@ function Rt({ config: e, className: t }) {
|
|
|
2382
2382
|
}) : e.type === "bar" ? /* @__PURE__ */ s(ie, {
|
|
2383
2383
|
rows: e.rows,
|
|
2384
2384
|
className: t
|
|
2385
|
-
}) : e.type === "pie" ? /* @__PURE__ */ s(
|
|
2385
|
+
}) : e.type === "pie" ? /* @__PURE__ */ s(Je, {
|
|
2386
2386
|
rows: e.rows,
|
|
2387
2387
|
variant: "pie",
|
|
2388
2388
|
className: t
|
|
2389
|
-
}) : e.type === "donut" ? /* @__PURE__ */ s(
|
|
2389
|
+
}) : e.type === "donut" ? /* @__PURE__ */ s(Je, {
|
|
2390
2390
|
rows: e.rows,
|
|
2391
2391
|
variant: "donut",
|
|
2392
2392
|
className: t
|
|
2393
|
-
}) : e.type === "sankey" ? /* @__PURE__ */ s(
|
|
2393
|
+
}) : e.type === "sankey" ? /* @__PURE__ */ s(at, {
|
|
2394
2394
|
rows: e.rows,
|
|
2395
2395
|
className: t
|
|
2396
|
-
}) : e.type === "flow" ? /* @__PURE__ */ s(
|
|
2396
|
+
}) : e.type === "flow" ? /* @__PURE__ */ s(it, {
|
|
2397
2397
|
selectedEntity: e.selectedEntity,
|
|
2398
2398
|
className: t
|
|
2399
2399
|
}) : e.type === "trend" ? /* @__PURE__ */ s(Et, {
|
|
2400
2400
|
points: e.points,
|
|
2401
2401
|
className: t
|
|
2402
|
-
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(
|
|
2402
|
+
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(ze, {
|
|
2403
2403
|
rows: e.rows,
|
|
2404
2404
|
className: t
|
|
2405
2405
|
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Ae, { 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(wt, {
|
|
2406
2406
|
segments: e.segments,
|
|
2407
2407
|
title: e.title
|
|
2408
|
-
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(
|
|
2408
|
+
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(Fe, { items: e.items }) : e.type === "ranked-card-leaderboard" ? /* @__PURE__ */ s(Pe, { items: e.items }) : e.type === "proportional-band-chart" ? /* @__PURE__ */ s(xt, { severities: e.severities }) : e.type === "radial-fan-tree-chart" ? /* @__PURE__ */ s(We, {
|
|
2409
2409
|
total: e.total,
|
|
2410
2410
|
items: e.items
|
|
2411
2411
|
}) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(he, {
|
|
2412
2412
|
value: e.value,
|
|
2413
2413
|
confirmed: e.confirmed,
|
|
2414
2414
|
total: e.total
|
|
2415
|
-
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(Nt, { items: e.items }) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(
|
|
2415
|
+
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(Nt, { items: e.items }) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(ct, {
|
|
2416
2416
|
left: e.left,
|
|
2417
2417
|
right: e.right
|
|
2418
|
-
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(
|
|
2418
|
+
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(ut, { points: e.points }) : e.type === "trend-view" ? /* @__PURE__ */ s(_t, { points: e.points }) : e.type === "weekly-flow" ? /* @__PURE__ */ s(It, { items: e.items }) : /* @__PURE__ */ s("div", {
|
|
2419
2419
|
className: "viz-empty",
|
|
2420
2420
|
children: "Visualization unavailable"
|
|
2421
2421
|
});
|
|
@@ -2452,7 +2452,7 @@ function Ut(e) {
|
|
|
2452
2452
|
//#endregion
|
|
2453
2453
|
//#region src/components/donutChart/DonutChart.tsx
|
|
2454
2454
|
function Wt({ rows: e = [], className: t, colors: n }) {
|
|
2455
|
-
return /* @__PURE__ */ s(
|
|
2455
|
+
return /* @__PURE__ */ s(Je, {
|
|
2456
2456
|
rows: e,
|
|
2457
2457
|
variant: "donut",
|
|
2458
2458
|
className: t,
|
|
@@ -3256,7 +3256,7 @@ var ln = "'Satoshi Variable', 'DM Sans', sans-serif", un = {
|
|
|
3256
3256
|
function dn({ text: e }) {
|
|
3257
3257
|
return /* @__PURE__ */ c("div", {
|
|
3258
3258
|
style: {
|
|
3259
|
-
padding: "8px
|
|
3259
|
+
padding: "8px 0px",
|
|
3260
3260
|
border: "transparent",
|
|
3261
3261
|
borderRadius: 5,
|
|
3262
3262
|
background: "transparent"
|
|
@@ -3278,4 +3278,4 @@ function dn({ text: e }) {
|
|
|
3278
3278
|
});
|
|
3279
3279
|
}
|
|
3280
3280
|
//#endregion
|
|
3281
|
-
export { te as AreaChart, ie as BarChart, l as ChartFrame, Wt as DonutChart, cn as KeyHighlights,
|
|
3281
|
+
export { te as AreaChart, ie as BarChart, l as ChartFrame, Wt as DonutChart, cn as KeyHighlights, Ie as LineChart, ze as MiniBars, Je as PieChart, it as ProcessSankey, at as RankingSankey, Xe as SankeySvg, ee as SeriesChart, dn as Takeaway, _t as Trend, Et as TrendChart, Rt as VisualizationRenderer, Vt as cleanupVisualizationMounts, Ht as hydrateVisualizationMounts, Ut as serializeVisualizationConfig };
|