@divami-artefacts/ai-design-system 1.0.45 → 1.0.47
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/components/balanceScaleChart/BalanceScaleChart.d.ts +1 -1
- package/dist/components/balanceScaleChart/types.d.ts +3 -0
- package/dist/components/segmentedSplitBarChart/SegmentedSplitBarChart.d.ts +1 -1
- package/dist/components/segmentedSplitBarChart/types.d.ts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +341 -320
- package/dist/types/index.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -578,8 +578,16 @@ function fe({ items: e = [], "data-testid": t }) {
|
|
|
578
578
|
}
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/components/semiCircularGaugeChart/SemiCircularGaugeChart.tsx
|
|
581
|
-
var pe = 480, me =
|
|
582
|
-
function
|
|
581
|
+
var pe = 480, me = 270, he = 18;
|
|
582
|
+
function ge(e, t, n) {
|
|
583
|
+
let r = t.split(" "), i = [], a = "";
|
|
584
|
+
for (let t of r) {
|
|
585
|
+
let r = a ? `${a} ${t}` : t;
|
|
586
|
+
e.measureText(r).width > n && a ? (i.push(a), a = t) : a = r;
|
|
587
|
+
}
|
|
588
|
+
return a && i.push(a), i;
|
|
589
|
+
}
|
|
590
|
+
function _e({ confirmed: e, total: t, label: r, "data-testid": i }) {
|
|
583
591
|
let o = a(null), c = a(0);
|
|
584
592
|
return n(() => {
|
|
585
593
|
let n = o.current;
|
|
@@ -614,7 +622,9 @@ function he({ confirmed: e, total: t, label: r, "data-testid": i }) {
|
|
|
614
622
|
let v = Math.round((e ?? 0) / (t || 1) * 100), b = s + v / 100 * d * o, x = v >= 66 ? u.green : v >= 33 ? u.amber : u.red;
|
|
615
623
|
y(i, a + Math.cos(b) * 194 / 2, 155 + Math.sin(b) * 194 / 2, 18, x, .35 * o), i.beginPath(), i.arc(a, 155, 194 / 2, s, b), i.strokeStyle = h(x, .7 * o), i.lineWidth = 38, i.lineCap = "round", i.stroke(), i.lineCap = "butt";
|
|
616
624
|
let S = s + v / 100 * d * _, C = a + Math.cos(S) * 82, w = 155 + Math.sin(S) * 82, T = a - Math.cos(S) * 14, E = 155 - Math.sin(S) * 14;
|
|
617
|
-
i.strokeStyle = h(x, .18 * _), i.lineWidth = 6, i.lineCap = "round", i.beginPath(), i.moveTo(T, E), i.lineTo(C, w), i.stroke(), i.strokeStyle = h(u.t1, .92 * _), i.lineWidth = 2, i.lineCap = "round", i.beginPath(), i.moveTo(T, E), i.lineTo(C, w), i.stroke(), i.beginPath(), i.arc(C, w, 3, 0, Math.PI * 2), i.fillStyle = h(x, .9 * _), i.fill(), y(i, a, 155, 20, x, .25 * _), i.beginPath(), i.arc(a, 155, 9, 0, Math.PI * 2), i.strokeStyle = h(x, .5 * _), i.lineWidth = 1.5, i.stroke(), i.beginPath(), i.arc(a, 155, 5, 0, Math.PI * 2), i.fillStyle = u.t1, i.fill(), o > .5 && (i.globalAlpha = Math.min(1, (o - .5) / .5), i.font = "500 24px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = x, i.textAlign = "center", i.fillText(`${Math.round(v * _)}%`, a, 117), i.globalAlpha = 1), o > .7 && r && (i.globalAlpha = Math.min(1, (o - .7) / .3), i.font = m.font, i.fillStyle = m.color, i.textAlign = "center", i
|
|
625
|
+
i.strokeStyle = h(x, .18 * _), i.lineWidth = 6, i.lineCap = "round", i.beginPath(), i.moveTo(T, E), i.lineTo(C, w), i.stroke(), i.strokeStyle = h(u.t1, .92 * _), i.lineWidth = 2, i.lineCap = "round", i.beginPath(), i.moveTo(T, E), i.lineTo(C, w), i.stroke(), i.beginPath(), i.arc(C, w, 3, 0, Math.PI * 2), i.fillStyle = h(x, .9 * _), i.fill(), y(i, a, 155, 20, x, .25 * _), i.beginPath(), i.arc(a, 155, 9, 0, Math.PI * 2), i.strokeStyle = h(x, .5 * _), i.lineWidth = 1.5, i.stroke(), i.beginPath(), i.arc(a, 155, 5, 0, Math.PI * 2), i.fillStyle = u.t1, i.fill(), o > .5 && (i.globalAlpha = Math.min(1, (o - .5) / .5), i.font = "500 24px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = x, i.textAlign = "center", i.fillText(`${Math.round(v * _)}%`, a, 117), i.globalAlpha = 1), o > .7 && r && (i.globalAlpha = Math.min(1, (o - .7) / .3), i.font = m.font, i.fillStyle = m.color, i.textAlign = "center", ge(i, `${e ?? 0} of ${t ?? 0} ${r}`, pe - 40).forEach((e, t) => {
|
|
626
|
+
i.fillText(e, a, 213 + t * he);
|
|
627
|
+
}), i.globalAlpha = 1);
|
|
618
628
|
for (let e = 0; e <= 10; e++) {
|
|
619
629
|
let t = s + e / 10 * d;
|
|
620
630
|
if (i.strokeStyle = h(u.bd, .5), i.lineWidth = e % 5 == 0 ? 1.5 : .8, i.beginPath(), i.moveTo(a + Math.cos(t) * 122, 155 + Math.sin(t) * 122), i.lineTo(a + Math.cos(t) * 128, 155 + Math.sin(t) * 128), i.stroke(), e % 5 == 0) {
|
|
@@ -650,7 +660,7 @@ function he({ confirmed: e, total: t, label: r, "data-testid": i }) {
|
|
|
650
660
|
}
|
|
651
661
|
//#endregion
|
|
652
662
|
//#region src/canvas/useCanvasLoop.ts
|
|
653
|
-
function
|
|
663
|
+
function ve(e, t, r, i, o = !0, s = {}) {
|
|
654
664
|
let c = a(0), { easing: l = D, durationFrames: u = 48 } = s;
|
|
655
665
|
n(() => {
|
|
656
666
|
let n = e.current;
|
|
@@ -682,28 +692,28 @@ function ge(e, t, r, i, o = !0, s = {}) {
|
|
|
682
692
|
}
|
|
683
693
|
//#endregion
|
|
684
694
|
//#region src/components/multiMetricConstellationChart/MultiMetricConstellationChart.tsx
|
|
685
|
-
var z = 780, B = 234,
|
|
695
|
+
var z = 780, B = 234, ye = 130, be = 52, xe = [
|
|
686
696
|
u.blue,
|
|
687
697
|
u.amber,
|
|
688
698
|
u.purple,
|
|
689
699
|
u.green
|
|
690
|
-
],
|
|
700
|
+
], Se = [
|
|
691
701
|
"Base Value",
|
|
692
702
|
"Variations",
|
|
693
703
|
"Commitment"
|
|
694
|
-
],
|
|
704
|
+
], Ce = [
|
|
695
705
|
"Base",
|
|
696
706
|
"Var",
|
|
697
707
|
"Commit"
|
|
698
708
|
];
|
|
699
|
-
function
|
|
709
|
+
function we({ items: e = [], "data-testid": t }) {
|
|
700
710
|
let n = a(null), r = a(/* @__PURE__ */ new Map()), { hoveredRef: o, tooltip: l, hitZonesRef: d } = w(n, {
|
|
701
711
|
width: z,
|
|
702
712
|
height: B
|
|
703
713
|
}), p = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), g = i(() => {
|
|
704
714
|
let e = Math.max(...p.map((e) => e.base ?? 0)), t = Math.max(...p.map((e) => e.variation ?? 0));
|
|
705
715
|
return p.map((n, r) => {
|
|
706
|
-
let i = z * (.12 + r * .19), a =
|
|
716
|
+
let i = z * (.12 + r * .19), a = ye, o = Math.min(z * .075, be), s = xe[r % xe.length], c = [
|
|
707
717
|
(n.base ?? 0) / (e || 1) * 100,
|
|
708
718
|
(n.variation ?? 0) / (t || 1) * 100,
|
|
709
719
|
n.percentage ?? 0
|
|
@@ -712,10 +722,10 @@ function Se({ items: e = [], "data-testid": t }) {
|
|
|
712
722
|
n.variationLabel ?? String(n.variation ?? 0),
|
|
713
723
|
`${n.percentage ?? 0}%`
|
|
714
724
|
], u = c.map((e, t) => {
|
|
715
|
-
let n = -Math.PI / 2 + t /
|
|
725
|
+
let n = -Math.PI / 2 + t / Se.length * Math.PI * 2, r = e / 100, s = o * Math.max(.08, r);
|
|
716
726
|
return {
|
|
717
|
-
name:
|
|
718
|
-
short:
|
|
727
|
+
name: Se[t],
|
|
728
|
+
short: Ce[t],
|
|
719
729
|
label: l[t],
|
|
720
730
|
val: Math.round(e),
|
|
721
731
|
x: i + Math.cos(n) * s,
|
|
@@ -735,7 +745,7 @@ function Se({ items: e = [], "data-testid": t }) {
|
|
|
735
745
|
};
|
|
736
746
|
});
|
|
737
747
|
}, [p]);
|
|
738
|
-
return
|
|
748
|
+
return ve(n, z, B, (e, t, n) => {
|
|
739
749
|
N(r.current, o.current), d.current = [], b(e, z, B, n, 30), g.forEach((t, i) => {
|
|
740
750
|
let a = t.color, o = `constellation-${i}`, s = r.current.get(o) ?? 0;
|
|
741
751
|
e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 5, 0, Math.PI * 2), e.strokeStyle = h(u.bd, .08 + .08 * s), e.lineWidth = .5, e.stroke(), e.beginPath(), t.stars.forEach((t, n) => {
|
|
@@ -786,7 +796,7 @@ function Se({ items: e = [], "data-testid": t }) {
|
|
|
786
796
|
}
|
|
787
797
|
//#endregion
|
|
788
798
|
//#region src/components/stackedHorizontalBarChart/StackedHorizontalBarChart.tsx
|
|
789
|
-
var
|
|
799
|
+
var Te = 680, Ee = 220, De = 8, Oe = [
|
|
790
800
|
u.blue,
|
|
791
801
|
u.amber,
|
|
792
802
|
u.purple,
|
|
@@ -796,53 +806,53 @@ var Ce = 680, we = 220, Te = 8, Ee = [
|
|
|
796
806
|
right: 80,
|
|
797
807
|
top: 16,
|
|
798
808
|
bottom: 38
|
|
799
|
-
},
|
|
800
|
-
function
|
|
809
|
+
}, ke = 150, H = 18;
|
|
810
|
+
function Ae(e, t, n) {
|
|
801
811
|
if (e.measureText(t).width <= n) return t;
|
|
802
812
|
let r = t;
|
|
803
813
|
for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
|
|
804
814
|
return r + "…";
|
|
805
815
|
}
|
|
806
|
-
function
|
|
816
|
+
function je(e) {
|
|
807
817
|
let t = Math.abs(e), n = e < 0 ? "-" : "";
|
|
808
818
|
return t >= 1e6 ? `${n}£${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${n}£${(t / 1e3).toFixed(1)}K` : `${n}£${t.toFixed(0)}`;
|
|
809
819
|
}
|
|
810
|
-
function
|
|
811
|
-
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,
|
|
812
|
-
width:
|
|
820
|
+
function Me({ data: e, "data-testid": t }) {
|
|
821
|
+
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, De), x = b.length, S = Math.max(...v.map((e) => Math.abs(e.total ?? 0)), 1), T = x * H + Math.max(0, x - 1) * 8, D = V.top + V.bottom + T, k = Te - V.left - ke - V.right, A = _.length === 0, { hoveredRef: j, tooltip: P, hitZonesRef: F } = w(n, {
|
|
822
|
+
width: Te,
|
|
813
823
|
height: D
|
|
814
824
|
});
|
|
815
|
-
return
|
|
825
|
+
return ve(n, Te, D, (e, t) => {
|
|
816
826
|
N(r.current, j.current), F.current = [], b.forEach((n, i) => {
|
|
817
|
-
let a =
|
|
818
|
-
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(
|
|
827
|
+
let a = Oe[i % Oe.length], o = M(t, i, x, O), s = V.top + i * (H + 8), c = V.left + ke, l = r.current.get(n.id) ?? 0, d = Math.max(n.base ?? 0, 0), m = Math.max(n.total ?? 0, 0), g = d / S * k * o, _ = m / S * k * o, v = _ - g;
|
|
828
|
+
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(Ae(e, n.name ?? "", ke - 16), c - 8, s + H / 2), E(F.current, n.id, 0, s, c, H, {
|
|
819
829
|
label: n.name,
|
|
820
|
-
value: `${n.totalLabel ??
|
|
821
|
-
sublabel: `Base ${n.baseLabel ??
|
|
830
|
+
value: `${n.totalLabel ?? je(n.total ?? 0)} total`,
|
|
831
|
+
sublabel: `Base ${n.baseLabel ?? je(n.base ?? 0)} + Var ${n.variationLabel ?? je(n.variation ?? 0)}`,
|
|
822
832
|
color: a
|
|
823
833
|
}), e.fillStyle = h(u.bd, .25), e.beginPath(), e.roundRect(c, s, k, H, 4), e.fill(), g > 0 && (l > 0 && y(e, c + g / 2, s + H / 2, g * .3, a, .1 * l), e.fillStyle = h(a, .5 + l * .15), e.beginPath(), e.roundRect(c, s, g, H, 4), e.fill()), v > 2 && (e.fillStyle = h(a, .22 + l * .08), e.beginPath(), e.roundRect(c + g, s, v, H, [
|
|
824
834
|
0,
|
|
825
835
|
4,
|
|
826
836
|
4,
|
|
827
837
|
0
|
|
828
|
-
]), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(a, .55), e.lineWidth = 1, e.beginPath(), e.moveTo(c + g, s + 3), e.lineTo(c + g, s + H - 3), e.stroke(), e.setLineDash([])), l > 0 && _ > 0 && (e.strokeStyle = h(a, .5 * l), e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.roundRect(c, s, _, H, 4), e.stroke()), o > .35 && (e.globalAlpha = Math.min(1, (o - .35) / .4), e.font = p.font, e.fillStyle = l > 0 ? a : p.color, e.textAlign = "left", e.textBaseline = "middle", e.fillText(n.totalLabel ??
|
|
838
|
+
]), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(a, .55), e.lineWidth = 1, e.beginPath(), e.moveTo(c + g, s + 3), e.lineTo(c + g, s + H - 3), e.stroke(), e.setLineDash([])), l > 0 && _ > 0 && (e.strokeStyle = h(a, .5 * l), e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.roundRect(c, s, _, H, 4), e.stroke()), o > .35 && (e.globalAlpha = Math.min(1, (o - .35) / .4), e.font = p.font, e.fillStyle = l > 0 ? a : p.color, e.textAlign = "left", e.textBaseline = "middle", e.fillText(n.totalLabel ?? je(n.total ?? 0), c + _ + 6, s + H / 2), e.globalAlpha = 1), E(F.current, n.id, c, s, Math.max(_, 1), H, {
|
|
829
839
|
label: n.name,
|
|
830
|
-
value: n.totalLabel ??
|
|
831
|
-
sublabel: `${n.baseLabel ??
|
|
840
|
+
value: n.totalLabel ?? je(n.total ?? 0),
|
|
841
|
+
sublabel: `${n.baseLabel ?? je(n.base ?? 0)} + ${n.variationLabel ?? je(n.variation ?? 0)}`,
|
|
832
842
|
color: a
|
|
833
843
|
});
|
|
834
844
|
});
|
|
835
845
|
let n = D - 14;
|
|
836
|
-
e.textBaseline = "middle", e.font = m.font, e.textAlign = "left", e.fillStyle = h(u.blue, .5), e.beginPath(), e.roundRect(V.left +
|
|
846
|
+
e.textBaseline = "middle", e.font = m.font, e.textAlign = "left", e.fillStyle = h(u.blue, .5), e.beginPath(), e.roundRect(V.left + ke, n - 3, 14, 6, 2), e.fill(), e.fillStyle = m.color, e.fillText("base value", V.left + ke + 18, n), e.fillStyle = h(u.blue, .22), e.beginPath(), e.roundRect(V.left + ke + 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(V.left + ke + 101, n - 3), e.lineTo(V.left + ke + 101, n + 3), e.stroke(), e.setLineDash([]), e.fillStyle = m.color, e.fillText("approved variations", V.left + ke + 112, n), e.font = m.font, e.textAlign = "right", e.fillStyle = m.color, e.fillText(`Portfolio: ${je(g?.total ?? 0)}`, Te - 8, n);
|
|
837
847
|
}, !0, { easing: O }), A ? /* @__PURE__ */ s(I, {
|
|
838
|
-
width:
|
|
839
|
-
height:
|
|
848
|
+
width: Te,
|
|
849
|
+
height: Ee,
|
|
840
850
|
message: "No contract data available",
|
|
841
851
|
"data-testid": t
|
|
842
852
|
}) : /* @__PURE__ */ c("div", {
|
|
843
853
|
"data-testid": t,
|
|
844
854
|
style: {
|
|
845
|
-
width:
|
|
855
|
+
width: Te,
|
|
846
856
|
transition: "all 0.25s ease"
|
|
847
857
|
},
|
|
848
858
|
children: [/* @__PURE__ */ c("div", {
|
|
@@ -852,17 +862,17 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
852
862
|
role: "img",
|
|
853
863
|
"aria-label": "Total contract value per contractor — horizontal bar chart",
|
|
854
864
|
style: {
|
|
855
|
-
width:
|
|
865
|
+
width: Te,
|
|
856
866
|
height: D,
|
|
857
867
|
display: "block",
|
|
858
868
|
borderRadius: 8
|
|
859
869
|
}
|
|
860
870
|
}), /* @__PURE__ */ s(C, {
|
|
861
871
|
...P,
|
|
862
|
-
parentW:
|
|
872
|
+
parentW: Te,
|
|
863
873
|
parentH: D
|
|
864
874
|
})]
|
|
865
|
-
}), _.length >
|
|
875
|
+
}), _.length > De && /* @__PURE__ */ s("div", {
|
|
866
876
|
style: { marginTop: 8 },
|
|
867
877
|
children: /* @__PURE__ */ s(ae, {
|
|
868
878
|
expanded: i,
|
|
@@ -873,7 +883,7 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
873
883
|
}
|
|
874
884
|
//#endregion
|
|
875
885
|
//#region src/utils/numberFormat.ts
|
|
876
|
-
var
|
|
886
|
+
var Ne = [
|
|
877
887
|
{
|
|
878
888
|
value: 0xe8d4a51000,
|
|
879
889
|
suffix: "T",
|
|
@@ -897,14 +907,14 @@ var je = [
|
|
|
897
907
|
];
|
|
898
908
|
function U(e, t = 1) {
|
|
899
909
|
let n = Math.abs(e), r = e < 0 ? "-" : "";
|
|
900
|
-
for (let e of
|
|
910
|
+
for (let e of Ne) if (n >= e.value) return `${r}${(n / e.divisor).toFixed(t)}${e.suffix}`;
|
|
901
911
|
return `${r}${n.toFixed(0)}`;
|
|
902
912
|
}
|
|
903
913
|
//#endregion
|
|
904
914
|
//#region src/components/rankedCardLeaderboard/RankedCardLeaderboard.tsx
|
|
905
|
-
var
|
|
906
|
-
function
|
|
907
|
-
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), m = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), g = m.reduce((e, t) => e + (t.count ?? 0), 0), _ = Math.min(
|
|
915
|
+
var Pe = 780, W = 240, Fe = 12, Ie = 10, Le = 5, Re = (Pe - 2 * Fe - (Le - 1) * Ie) / Le;
|
|
916
|
+
function ze({ items: e = [], "data-testid": t }) {
|
|
917
|
+
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), m = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), g = m.reduce((e, t) => e + (t.count ?? 0), 0), _ = Math.min(Le, m.length), b = _ > 0 ? 2 * Fe + _ * Re + (_ - 1) * Ie : Pe, { hoveredRef: S, tooltip: T, hitZonesRef: D } = w(r, {
|
|
908
918
|
width: b,
|
|
909
919
|
height: W
|
|
910
920
|
});
|
|
@@ -913,14 +923,14 @@ function Le({ items: e = [], "data-testid": t }) {
|
|
|
913
923
|
if (!e) return;
|
|
914
924
|
let t = v(e, b, W);
|
|
915
925
|
o.current = 0;
|
|
916
|
-
let n =
|
|
926
|
+
let n = Re, i = W * .84, a = W * .08, s = Fe, c, _ = () => {
|
|
917
927
|
o.current++;
|
|
918
928
|
let e = o.current;
|
|
919
929
|
t.clearRect(0, 0, b, W), t.letterSpacing = f.letterSpacing, D.current = [], l.current.forEach((e, t) => {
|
|
920
930
|
let n = t === S.current ? 1 : 0, r = e + (n - e) * .12;
|
|
921
931
|
Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
|
|
922
932
|
}), S.current && !l.current.has(S.current) && l.current.set(S.current, 0), m.forEach((r, o) => {
|
|
923
|
-
let c = o === 0, f = o === 0 ? u.red : o === 1 ? u.amber : d[o % d.length], m = s + o * (n +
|
|
933
|
+
let c = o === 0, f = o === 0 ? u.red : o === 1 ? u.amber : d[o % d.length], m = s + o * (n + Ie), _ = l.current.get(r.id) ?? 0, v = _ * 8, b = m - v / 2, x = n + v, S = c ? j(e, .04, 3e-4) * .06 + .06 : 0;
|
|
924
934
|
t.fillStyle = h(f, .08 + _ * .07), t.beginPath(), t.roundRect(b, a, x, i, 6), t.fill(), t.strokeStyle = h(f, .2 + _ * .4 + S), t.lineWidth = c ? 1.5 : 1, t.stroke(), (_ > .01 || c) && y(t, b + x / 2, a + i / 2, x * .55, f, S + _ * .14), t.font = p.font, t.textAlign = "left", t.textBaseline = "top", t.fillStyle = h(f, .5 + _ * .35), t.fillText(`#${o + 1}`, b + 7, a + 6);
|
|
925
935
|
let C = Math.min(n * .28, i * .32, 72), w = b + x / 2, T = a + i * .38, O = t.createRadialGradient(w, T - C * .2, 0, w, T, C);
|
|
926
936
|
O.addColorStop(0, h(f, .5 + _ * .2)), O.addColorStop(1, h(f, .2 + _ * .1)), t.beginPath(), t.arc(w, T, C, 0, Math.PI * 2), t.fillStyle = O, t.fill(), t.strokeStyle = h(f, .4 + _ * .3), t.lineWidth = 1, t.stroke(), t.font = p.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(u.t1, .9);
|
|
@@ -979,7 +989,7 @@ function Le({ items: e = [], "data-testid": t }) {
|
|
|
979
989
|
//#endregion
|
|
980
990
|
//#region src/components/dotMatrixChart/DotMatrixChart.tsx
|
|
981
991
|
var G = 680, K = 260;
|
|
982
|
-
function
|
|
992
|
+
function Be({ items: e = [], "data-testid": t }) {
|
|
983
993
|
let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
984
994
|
width: G,
|
|
985
995
|
height: K
|
|
@@ -1046,7 +1056,7 @@ function Re({ items: e = [], "data-testid": t }) {
|
|
|
1046
1056
|
}
|
|
1047
1057
|
//#endregion
|
|
1048
1058
|
//#region src/components/lineChart/LineChart.tsx
|
|
1049
|
-
function
|
|
1059
|
+
function Ve({ rows: e = [], className: t, colors: n }) {
|
|
1050
1060
|
return /* @__PURE__ */ s(ee, {
|
|
1051
1061
|
rows: e,
|
|
1052
1062
|
variant: "line",
|
|
@@ -1056,7 +1066,7 @@ function ze({ rows: e = [], className: t, colors: n }) {
|
|
|
1056
1066
|
}
|
|
1057
1067
|
//#endregion
|
|
1058
1068
|
//#region src/components/constants.ts
|
|
1059
|
-
var
|
|
1069
|
+
var He = [
|
|
1060
1070
|
"#4C93D9",
|
|
1061
1071
|
"#5DA537",
|
|
1062
1072
|
"#F3862C",
|
|
@@ -1064,7 +1074,7 @@ var Be = [
|
|
|
1064
1074
|
"#A0B724",
|
|
1065
1075
|
"#EEBF3B",
|
|
1066
1076
|
"#3C45D1"
|
|
1067
|
-
],
|
|
1077
|
+
], Ue = {
|
|
1068
1078
|
nodes: [
|
|
1069
1079
|
{
|
|
1070
1080
|
id: "supplier-x",
|
|
@@ -1107,8 +1117,8 @@ var Be = [
|
|
|
1107
1117
|
};
|
|
1108
1118
|
//#endregion
|
|
1109
1119
|
//#region src/components/miniBars/MiniBars.tsx
|
|
1110
|
-
function
|
|
1111
|
-
let r = n?.slices ??
|
|
1120
|
+
function We({ rows: e = [], className: t, colors: n }) {
|
|
1121
|
+
let r = n?.slices ?? He;
|
|
1112
1122
|
return /* @__PURE__ */ s("div", {
|
|
1113
1123
|
className: ["d3-mini-bars", t].filter(Boolean).join(" "),
|
|
1114
1124
|
children: e.map(([e, t, n], i) => /* @__PURE__ */ c("div", {
|
|
@@ -1134,7 +1144,7 @@ function He({ rows: e = [], className: t, colors: n }) {
|
|
|
1134
1144
|
width: Math.max(0, Math.min(100, t)),
|
|
1135
1145
|
height: "12",
|
|
1136
1146
|
rx: "6",
|
|
1137
|
-
className: `d3-mini-fill tone-${i %
|
|
1147
|
+
className: `d3-mini-fill tone-${i % He.length}`,
|
|
1138
1148
|
fill: r[i % r.length]
|
|
1139
1149
|
})]
|
|
1140
1150
|
})
|
|
@@ -1146,9 +1156,9 @@ function He({ rows: e = [], className: t, colors: n }) {
|
|
|
1146
1156
|
}
|
|
1147
1157
|
//#endregion
|
|
1148
1158
|
//#region src/components/radialFanTreeChart/RadialFanTreeChart.tsx
|
|
1149
|
-
var
|
|
1150
|
-
function
|
|
1151
|
-
let m = a(null), g = a(/* @__PURE__ */ new Map()), _ = a(0), b = i(() => r.filter((e) => typeof e == "object" && !!e), [r]), x = i(() => Math.max(
|
|
1159
|
+
var Ge = 770, Ke = 320, qe = 60, Je = 28;
|
|
1160
|
+
function Ye({ total: e = 0, totalLabel: t, items: r = [], width: o = Ge, "data-testid": l }) {
|
|
1161
|
+
let m = a(null), g = a(/* @__PURE__ */ new Map()), _ = a(0), b = i(() => r.filter((e) => typeof e == "object" && !!e), [r]), x = i(() => Math.max(Ke, qe + Math.max(0, b.length - 1) * Je), [b.length]), { hoveredRef: S, tooltip: E, hitZonesRef: O } = w(m, {
|
|
1152
1162
|
width: o,
|
|
1153
1163
|
height: x
|
|
1154
1164
|
});
|
|
@@ -1213,7 +1223,7 @@ function qe({ total: e = 0, totalLabel: t, items: r = [], width: o = Ue, "data-t
|
|
|
1213
1223
|
o
|
|
1214
1224
|
]), b.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1215
1225
|
width: o,
|
|
1216
|
-
height:
|
|
1226
|
+
height: Ke,
|
|
1217
1227
|
"data-testid": l
|
|
1218
1228
|
}) : /* @__PURE__ */ c("div", {
|
|
1219
1229
|
"data-testid": l,
|
|
@@ -1240,21 +1250,21 @@ function qe({ total: e = 0, totalLabel: t, items: r = [], width: o = Ue, "data-t
|
|
|
1240
1250
|
}
|
|
1241
1251
|
//#endregion
|
|
1242
1252
|
//#region src/components/pieChart/PieChart.tsx
|
|
1243
|
-
var
|
|
1244
|
-
function
|
|
1253
|
+
var Xe = 192, Ze = Xe, Qe = Xe + 80;
|
|
1254
|
+
function $e({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
1245
1255
|
let o = a(null), f = a(/* @__PURE__ */ new Map()), p = a(0), m = i?.slices ?? d, { hoveredRef: g, tooltip: b, hitZonesRef: x } = w(o, {
|
|
1246
|
-
width:
|
|
1247
|
-
height:
|
|
1256
|
+
width: Ze,
|
|
1257
|
+
height: Qe
|
|
1248
1258
|
});
|
|
1249
1259
|
return n(() => {
|
|
1250
1260
|
let n = o.current;
|
|
1251
1261
|
if (!n) return;
|
|
1252
|
-
let r = v(n,
|
|
1262
|
+
let r = v(n, Ze, Qe);
|
|
1253
1263
|
p.current = 0;
|
|
1254
|
-
let i =
|
|
1264
|
+
let i = Ze / 2, a = Xe / 2, s = Xe * .4, c = t === "donut" ? Xe * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, d, b = () => {
|
|
1255
1265
|
p.current++;
|
|
1256
1266
|
let n = p.current;
|
|
1257
|
-
r.clearRect(0, 0,
|
|
1267
|
+
r.clearRect(0, 0, Ze, Qe);
|
|
1258
1268
|
let o = 1 - (1 - Math.min(n / 48, 1)) ** 3;
|
|
1259
1269
|
N(f.current, g.current), x.current = [];
|
|
1260
1270
|
let v = -Math.PI / 2;
|
|
@@ -1268,10 +1278,10 @@ function Ze({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1268
1278
|
let O = j(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? O * 2 : 0);
|
|
1269
1279
|
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;
|
|
1270
1280
|
}), t === "donut" && e.length > 0 && y(r, i, a, c * .8, u.blue, .06);
|
|
1271
|
-
let S =
|
|
1281
|
+
let S = Xe + 12;
|
|
1272
1282
|
e.forEach((e, t) => {
|
|
1273
1283
|
let n = m[t % m.length], i = (e.pricing ?? 0) / l, a = f.current.get(e.id ?? `sl-${t}`) ?? 0, o = S + t * 18;
|
|
1274
|
-
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)}%)`,
|
|
1284
|
+
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)}%)`, Ze - 4, o + 3.5);
|
|
1275
1285
|
}), d = requestAnimationFrame(b);
|
|
1276
1286
|
};
|
|
1277
1287
|
return b(), () => cancelAnimationFrame(d);
|
|
@@ -1285,30 +1295,30 @@ function Ze({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
1285
1295
|
children: /* @__PURE__ */ c("div", {
|
|
1286
1296
|
style: {
|
|
1287
1297
|
position: "relative",
|
|
1288
|
-
width:
|
|
1289
|
-
height:
|
|
1298
|
+
width: Ze,
|
|
1299
|
+
height: Qe
|
|
1290
1300
|
},
|
|
1291
1301
|
children: [/* @__PURE__ */ s("canvas", {
|
|
1292
1302
|
ref: o,
|
|
1293
1303
|
role: "img",
|
|
1294
1304
|
"aria-label": `${t} chart`,
|
|
1295
1305
|
style: {
|
|
1296
|
-
width:
|
|
1297
|
-
height:
|
|
1306
|
+
width: Ze,
|
|
1307
|
+
height: Qe,
|
|
1298
1308
|
display: "block",
|
|
1299
1309
|
borderRadius: 8
|
|
1300
1310
|
}
|
|
1301
1311
|
}), /* @__PURE__ */ s(C, {
|
|
1302
1312
|
...b,
|
|
1303
|
-
parentW:
|
|
1304
|
-
parentH:
|
|
1313
|
+
parentW: Ze,
|
|
1314
|
+
parentH: Qe
|
|
1305
1315
|
})]
|
|
1306
1316
|
})
|
|
1307
1317
|
});
|
|
1308
1318
|
}
|
|
1309
1319
|
//#endregion
|
|
1310
1320
|
//#region src/components/sankey/SankeySvg.tsx
|
|
1311
|
-
function
|
|
1321
|
+
function et(e, t, n, r) {
|
|
1312
1322
|
let i = new Set(t.map((e) => e.source)), a = new Set(t.map((e) => e.target)), o = /* @__PURE__ */ new Map(), s = [];
|
|
1313
1323
|
for (e.forEach((e) => {
|
|
1314
1324
|
i.has(e.id) && !a.has(e.id) && s.push({
|
|
@@ -1353,8 +1363,8 @@ function Qe(e, t, n, r) {
|
|
|
1353
1363
|
});
|
|
1354
1364
|
}), f;
|
|
1355
1365
|
}
|
|
1356
|
-
function
|
|
1357
|
-
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(() =>
|
|
1366
|
+
function tt({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f, selectedEntity: p, className: m, colors: g }) {
|
|
1367
|
+
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(() => et(e, t, r, o), [
|
|
1358
1368
|
e,
|
|
1359
1369
|
t,
|
|
1360
1370
|
r,
|
|
@@ -1454,7 +1464,7 @@ function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1454
1464
|
}
|
|
1455
1465
|
//#endregion
|
|
1456
1466
|
//#region src/canvas/CausalFlowCanvas.tsx
|
|
1457
|
-
var
|
|
1467
|
+
var nt = [
|
|
1458
1468
|
{
|
|
1459
1469
|
x: .13,
|
|
1460
1470
|
y: .48
|
|
@@ -1487,7 +1497,7 @@ var et = [
|
|
|
1487
1497
|
x: .92,
|
|
1488
1498
|
y: .22
|
|
1489
1499
|
}
|
|
1490
|
-
],
|
|
1500
|
+
], rt = [
|
|
1491
1501
|
u.blue,
|
|
1492
1502
|
u.orange,
|
|
1493
1503
|
u.red,
|
|
@@ -1495,7 +1505,7 @@ var et = [
|
|
|
1495
1505
|
u.green,
|
|
1496
1506
|
u.amber,
|
|
1497
1507
|
u.t2
|
|
1498
|
-
],
|
|
1508
|
+
], it = [
|
|
1499
1509
|
26,
|
|
1500
1510
|
24,
|
|
1501
1511
|
24,
|
|
@@ -1505,21 +1515,21 @@ var et = [
|
|
|
1505
1515
|
22,
|
|
1506
1516
|
22
|
|
1507
1517
|
];
|
|
1508
|
-
function
|
|
1518
|
+
function at(e, t) {
|
|
1509
1519
|
let n = 1 - t;
|
|
1510
1520
|
return {
|
|
1511
1521
|
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,
|
|
1512
1522
|
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
|
|
1513
1523
|
};
|
|
1514
1524
|
}
|
|
1515
|
-
function
|
|
1525
|
+
function ot(e, t) {
|
|
1516
1526
|
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;
|
|
1517
1527
|
return {
|
|
1518
1528
|
x: -i / a,
|
|
1519
1529
|
y: r / a
|
|
1520
1530
|
};
|
|
1521
1531
|
}
|
|
1522
|
-
function
|
|
1532
|
+
function st(e, t) {
|
|
1523
1533
|
let n = t.x - e.x, r = t.y - e.y;
|
|
1524
1534
|
return {
|
|
1525
1535
|
p0: {
|
|
@@ -1540,7 +1550,7 @@ function at(e, t) {
|
|
|
1540
1550
|
}
|
|
1541
1551
|
};
|
|
1542
1552
|
}
|
|
1543
|
-
function
|
|
1553
|
+
function ct({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
|
|
1544
1554
|
let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: g, hitZonesRef: S } = w(d, {
|
|
1545
1555
|
width: r,
|
|
1546
1556
|
height: o
|
|
@@ -1548,15 +1558,15 @@ function ot({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1548
1558
|
let t = /* @__PURE__ */ new Map();
|
|
1549
1559
|
return e.forEach((e, n) => t.set(e.id, n)), t;
|
|
1550
1560
|
}, [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) => {
|
|
1551
|
-
let n =
|
|
1561
|
+
let n = nt[t % nt.length];
|
|
1552
1562
|
return {
|
|
1553
1563
|
id: e.id,
|
|
1554
1564
|
label: e.name,
|
|
1555
1565
|
sub: e.valueLabel ?? "",
|
|
1556
1566
|
x: n.x * r,
|
|
1557
1567
|
y: n.y * o,
|
|
1558
|
-
r:
|
|
1559
|
-
color:
|
|
1568
|
+
r: it[t % it.length],
|
|
1569
|
+
color: rt[t % rt.length]
|
|
1560
1570
|
};
|
|
1561
1571
|
}), [
|
|
1562
1572
|
e,
|
|
@@ -1578,7 +1588,7 @@ function ot({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1578
1588
|
if (t.clearRect(0, 0, r, o), S.current = [], b(t, r, o, e, 50, h(u.blue, .05)), M.forEach((e, n) => {
|
|
1579
1589
|
let r = A[e.fromIdx], i = A[e.toIdx];
|
|
1580
1590
|
if (!r || !i) return;
|
|
1581
|
-
let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d =
|
|
1591
|
+
let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = st(r, i);
|
|
1582
1592
|
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();
|
|
1583
1593
|
for (let t = 0; t < e.conf * 2.5; t++) Math.random() < .45 && p.current.push({
|
|
1584
1594
|
edgeIdx: n,
|
|
@@ -1587,7 +1597,7 @@ function ot({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1587
1597
|
off: (Math.random() - .5) * 13,
|
|
1588
1598
|
sz: .7 + Math.random() * 2
|
|
1589
1599
|
});
|
|
1590
|
-
let f =
|
|
1600
|
+
let f = at(d, .5), m = `${Math.round(e.conf * 100)}%`;
|
|
1591
1601
|
t.font = "bold 12px 'JetBrains Mono', monospace", t.textBaseline = "middle";
|
|
1592
1602
|
let g = t.measureText(m).width + 14;
|
|
1593
1603
|
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);
|
|
@@ -1597,7 +1607,7 @@ function ot({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1597
1607
|
if (!n) return !1;
|
|
1598
1608
|
let r = A[n.fromIdx], i = A[n.toIdx];
|
|
1599
1609
|
if (!r || !i) return !1;
|
|
1600
|
-
let a =
|
|
1610
|
+
let a = st(r, i), o = at(a, e.t), s = ot(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);
|
|
1601
1611
|
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;
|
|
1602
1612
|
}), p.current.length > 350 && (p.current = p.current.slice(-350)), A.forEach((n, r) => {
|
|
1603
1613
|
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);
|
|
@@ -1654,10 +1664,10 @@ function ot({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
|
|
|
1654
1664
|
}
|
|
1655
1665
|
//#endregion
|
|
1656
1666
|
//#region src/components/sankey/ProcessSankey.tsx
|
|
1657
|
-
function
|
|
1658
|
-
return /* @__PURE__ */ s(
|
|
1659
|
-
nodes:
|
|
1660
|
-
links:
|
|
1667
|
+
function lt({ selectedEntity: e, colors: t }) {
|
|
1668
|
+
return /* @__PURE__ */ s(ct, {
|
|
1669
|
+
nodes: Ue.nodes,
|
|
1670
|
+
links: Ue.links,
|
|
1661
1671
|
width: 960,
|
|
1662
1672
|
height: 280,
|
|
1663
1673
|
selectedEntity: e
|
|
@@ -1665,7 +1675,7 @@ function st({ selectedEntity: e, colors: t }) {
|
|
|
1665
1675
|
}
|
|
1666
1676
|
//#endregion
|
|
1667
1677
|
//#region src/components/sankey/RankingSankey.tsx
|
|
1668
|
-
function
|
|
1678
|
+
function ut({ rows: e = [], className: t, colors: n }) {
|
|
1669
1679
|
let { nodes: r, links: a } = i(() => {
|
|
1670
1680
|
let t = e.slice(0, 5);
|
|
1671
1681
|
return {
|
|
@@ -1683,7 +1693,7 @@ function ct({ rows: e = [], className: t, colors: n }) {
|
|
|
1683
1693
|
}))
|
|
1684
1694
|
};
|
|
1685
1695
|
}, [e]);
|
|
1686
|
-
return /* @__PURE__ */ s(
|
|
1696
|
+
return /* @__PURE__ */ s(tt, {
|
|
1687
1697
|
nodes: r,
|
|
1688
1698
|
links: a,
|
|
1689
1699
|
width: 760,
|
|
@@ -1695,62 +1705,62 @@ function ct({ rows: e = [], className: t, colors: n }) {
|
|
|
1695
1705
|
}
|
|
1696
1706
|
//#endregion
|
|
1697
1707
|
//#region src/components/balanceScaleChart/BalanceScaleChart.tsx
|
|
1698
|
-
var
|
|
1699
|
-
function
|
|
1700
|
-
let
|
|
1708
|
+
var dt = 500, ft = 280;
|
|
1709
|
+
function pt({ left: e, right: t, leftTitle: r = "Accepted", rightTitle: i = "Submitted", unit: o = "quotations", "data-testid": c }) {
|
|
1710
|
+
let l = a(null), d = a(0);
|
|
1701
1711
|
return n(() => {
|
|
1702
|
-
let n =
|
|
1712
|
+
let n = l.current;
|
|
1703
1713
|
if (!n) return;
|
|
1704
|
-
let
|
|
1705
|
-
|
|
1706
|
-
let
|
|
1707
|
-
|
|
1708
|
-
let n =
|
|
1709
|
-
|
|
1710
|
-
let
|
|
1711
|
-
|
|
1712
|
-
let
|
|
1713
|
-
x:
|
|
1714
|
-
y:
|
|
1715
|
-
},
|
|
1716
|
-
x:
|
|
1717
|
-
y:
|
|
1714
|
+
let a = v(n, dt, ft);
|
|
1715
|
+
d.current = 0;
|
|
1716
|
+
let s = dt / 2, c = Math.abs(e.value ?? 0), m = Math.abs(t.value ?? 0), g = Math.max(c, m, 1), _ = (e.value - t.value) / (2 * g) * 14, b = Math.max(-14, Math.min(14, _)), x, S = () => {
|
|
1717
|
+
d.current++;
|
|
1718
|
+
let n = d.current;
|
|
1719
|
+
a.clearRect(0, 0, dt, ft), a.letterSpacing = f.letterSpacing;
|
|
1720
|
+
let l = D(Math.min(n / 80, 1)), _ = b * A(Math.min(n / 80, 1)) * Math.PI / 180;
|
|
1721
|
+
a.strokeStyle = h(u.bd, .5 * l), a.lineWidth = 2, a.beginPath(), a.moveTo(s, 50), a.lineTo(s, 180), a.stroke(), a.beginPath(), a.arc(s, 50, 5 * l, 0, Math.PI * 2), a.fillStyle = u.t2, a.fill();
|
|
1722
|
+
let v = {
|
|
1723
|
+
x: s - Math.cos(_) * 160,
|
|
1724
|
+
y: 50 + Math.sin(-_) * 160
|
|
1725
|
+
}, C = {
|
|
1726
|
+
x: s + Math.cos(_) * 160,
|
|
1727
|
+
y: 50 + Math.sin(_) * 160
|
|
1718
1728
|
};
|
|
1719
|
-
|
|
1720
|
-
let
|
|
1721
|
-
y(
|
|
1729
|
+
a.strokeStyle = h(u.t2, .5 * l), a.lineWidth = 2, a.beginPath(), a.moveTo(v.x, v.y), a.lineTo(C.x, C.y), a.stroke();
|
|
1730
|
+
let w = Math.max(20, c / g * 100 * l), T = v.y + 18;
|
|
1731
|
+
y(a, v.x, T + w / 2, 90 * .5, u.green, .18 * l), a.fillStyle = h(u.green, .5 * l), a.beginPath(), a.roundRect(v.x - 90 / 2, T, 90, w, [
|
|
1722
1732
|
0,
|
|
1723
1733
|
0,
|
|
1724
1734
|
6,
|
|
1725
1735
|
6
|
|
1726
|
-
]),
|
|
1727
|
-
|
|
1728
|
-
}),
|
|
1729
|
-
let
|
|
1730
|
-
|
|
1736
|
+
]), a.fill(), a.strokeStyle = h(u.green, .7 * l), a.lineWidth = 1.5, a.stroke(), a.strokeStyle = h(u.t2, .35 * l), a.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
|
|
1737
|
+
a.beginPath(), a.moveTo(v.x + e, v.y + 4), a.lineTo(v.x + e, T), a.stroke();
|
|
1738
|
+
}), l > .5 && (a.globalAlpha = Math.min(1, (l - .5) / .5), a.font = p.font, a.fillStyle = u.green, a.textAlign = "center", a.fillText(e.label, v.x, T + w + 18), a.font = f.font, a.fillStyle = f.color, a.fillText(r, v.x, T + w + 38), a.fillText(`${e.count} ${o}`, v.x, T + w + 58), a.globalAlpha = 1);
|
|
1739
|
+
let E = Math.max(20, m / g * 100 * l), O = C.y + 18;
|
|
1740
|
+
a.fillStyle = h(u.amber, .3 * l), a.strokeStyle = h(u.amber, .5 * l), a.lineWidth = 1.5, a.beginPath(), a.roundRect(C.x - 90 / 2, O, 90, E, [
|
|
1731
1741
|
0,
|
|
1732
1742
|
0,
|
|
1733
1743
|
6,
|
|
1734
1744
|
6
|
|
1735
|
-
]),
|
|
1736
|
-
|
|
1737
|
-
}),
|
|
1745
|
+
]), a.fill(), a.stroke(), a.strokeStyle = h(u.t2, .35 * l), a.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
|
|
1746
|
+
a.beginPath(), a.moveTo(C.x + e, C.y + 4), a.lineTo(C.x + e, O), a.stroke();
|
|
1747
|
+
}), l > .5 && (a.globalAlpha = Math.min(1, (l - .5) / .5), a.font = p.font, a.fillStyle = u.amber, a.textAlign = "center", a.fillText(t.label, C.x, O + E + 18), a.font = f.font, a.fillStyle = f.color, a.fillText(i, C.x, O + E + 38), a.fillText(`${t.count} ${o}`, C.x, O + E + 58), a.globalAlpha = 1), x = requestAnimationFrame(S);
|
|
1738
1748
|
};
|
|
1739
|
-
return
|
|
1749
|
+
return S(), () => cancelAnimationFrame(x);
|
|
1740
1750
|
}, [e, t]), /* @__PURE__ */ s("div", {
|
|
1741
|
-
"data-testid":
|
|
1751
|
+
"data-testid": c,
|
|
1742
1752
|
style: {
|
|
1743
1753
|
position: "relative",
|
|
1744
|
-
width:
|
|
1745
|
-
height:
|
|
1754
|
+
width: dt,
|
|
1755
|
+
height: ft
|
|
1746
1756
|
},
|
|
1747
1757
|
children: /* @__PURE__ */ s("canvas", {
|
|
1748
|
-
ref:
|
|
1758
|
+
ref: l,
|
|
1749
1759
|
role: "img",
|
|
1750
1760
|
"aria-label": "Quotation balance — accepted vs submitted quotation value",
|
|
1751
1761
|
style: {
|
|
1752
|
-
width:
|
|
1753
|
-
height:
|
|
1762
|
+
width: dt,
|
|
1763
|
+
height: ft,
|
|
1754
1764
|
display: "block"
|
|
1755
1765
|
}
|
|
1756
1766
|
})
|
|
@@ -1758,25 +1768,25 @@ function dt({ left: e, right: t, "data-testid": r }) {
|
|
|
1758
1768
|
}
|
|
1759
1769
|
//#endregion
|
|
1760
1770
|
//#region src/components/areaLineChart/AreaLineChart.tsx
|
|
1761
|
-
var
|
|
1762
|
-
function
|
|
1771
|
+
var mt = 680, q = 280;
|
|
1772
|
+
function ht({ points: e = [], "data-testid": t }) {
|
|
1763
1773
|
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
|
|
1764
|
-
width:
|
|
1774
|
+
width: mt,
|
|
1765
1775
|
height: q
|
|
1766
1776
|
}), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
|
|
1767
1777
|
return n(() => {
|
|
1768
1778
|
let e = r.current;
|
|
1769
1779
|
if (!e) return;
|
|
1770
|
-
let t = v(e,
|
|
1780
|
+
let t = v(e, mt, q);
|
|
1771
1781
|
l.current = 0;
|
|
1772
|
-
let n =
|
|
1782
|
+
let n = mt - 54 - 28, i = q - 30 - 54, a = Math.max(...g.map((e) => e.count), 1), s = g.length, c = s > 1 ? n / (s - 1) : n, p = g.map((e, t) => ({
|
|
1773
1783
|
x: 54 + t * c,
|
|
1774
1784
|
y: 30 + i - e.count / a * i,
|
|
1775
1785
|
point: e
|
|
1776
1786
|
})), _, b = () => {
|
|
1777
1787
|
l.current++;
|
|
1778
1788
|
let e = l.current;
|
|
1779
|
-
t.clearRect(0, 0,
|
|
1789
|
+
t.clearRect(0, 0, mt, q), t.letterSpacing = f.letterSpacing;
|
|
1780
1790
|
let r = D(Math.min(e / 72, 1));
|
|
1781
1791
|
N(o.current, d.current), m.current = [], [
|
|
1782
1792
|
.25,
|
|
@@ -1818,7 +1828,7 @@ function pt({ points: e = [], "data-testid": t }) {
|
|
|
1818
1828
|
};
|
|
1819
1829
|
return b(), () => cancelAnimationFrame(_);
|
|
1820
1830
|
}, [g]), g.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1821
|
-
width:
|
|
1831
|
+
width: mt,
|
|
1822
1832
|
height: q,
|
|
1823
1833
|
"data-testid": t
|
|
1824
1834
|
}) : /* @__PURE__ */ s("div", {
|
|
@@ -1831,7 +1841,7 @@ function pt({ points: e = [], "data-testid": t }) {
|
|
|
1831
1841
|
children: /* @__PURE__ */ c("div", {
|
|
1832
1842
|
style: {
|
|
1833
1843
|
position: "relative",
|
|
1834
|
-
width:
|
|
1844
|
+
width: mt,
|
|
1835
1845
|
height: q
|
|
1836
1846
|
},
|
|
1837
1847
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -1839,13 +1849,13 @@ function pt({ points: e = [], "data-testid": t }) {
|
|
|
1839
1849
|
role: "img",
|
|
1840
1850
|
"aria-label": "Trend chart — count over time",
|
|
1841
1851
|
style: {
|
|
1842
|
-
width:
|
|
1852
|
+
width: mt,
|
|
1843
1853
|
height: q,
|
|
1844
1854
|
display: "block"
|
|
1845
1855
|
}
|
|
1846
1856
|
}), /* @__PURE__ */ s(C, {
|
|
1847
1857
|
...p,
|
|
1848
|
-
parentW:
|
|
1858
|
+
parentW: mt,
|
|
1849
1859
|
parentH: q
|
|
1850
1860
|
})]
|
|
1851
1861
|
})
|
|
@@ -1853,31 +1863,31 @@ function pt({ points: e = [], "data-testid": t }) {
|
|
|
1853
1863
|
}
|
|
1854
1864
|
//#endregion
|
|
1855
1865
|
//#region src/components/trend/Trend.tsx
|
|
1856
|
-
var
|
|
1857
|
-
function
|
|
1866
|
+
var gt = 680, J = 280, _t = 80, vt = 48, yt = 64, bt = f.font, xt = 12, St = Math.PI * 2, Ct = 72, wt = 20, Tt = 5e3;
|
|
1867
|
+
function Et({ points: e = [], "data-testid": t }) {
|
|
1858
1868
|
let r = a(null), o = a(null), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), p = i(() => {
|
|
1859
|
-
if (d.length <= 1) return
|
|
1869
|
+
if (d.length <= 1) return yt;
|
|
1860
1870
|
let e = document.createElement("canvas").getContext("2d");
|
|
1861
|
-
if (!e) return
|
|
1862
|
-
e.font =
|
|
1863
|
-
let t = Math.max(1, Math.ceil(d.length /
|
|
1864
|
-
return Math.max(
|
|
1865
|
-
}, [d]), m = Math.round(p / 2), g =
|
|
1871
|
+
if (!e) return yt;
|
|
1872
|
+
e.font = bt;
|
|
1873
|
+
let t = Math.max(1, Math.ceil(d.length / wt)), n = Math.max(...d.filter((e, n) => n % t === 0).map((t) => e.measureText(t.week).width));
|
|
1874
|
+
return Math.max(yt, n + xt);
|
|
1875
|
+
}, [d]), m = Math.round(p / 2), g = vt + m + Math.max(0, d.length - 1) * p, _ = Math.max(gt - _t, Math.min(g, Tt)), { tooltip: y, hitZonesRef: b } = w(r, {
|
|
1866
1876
|
width: _,
|
|
1867
1877
|
height: J
|
|
1868
1878
|
});
|
|
1869
1879
|
return n(() => {
|
|
1870
1880
|
let e = r.current;
|
|
1871
1881
|
if (!e) return;
|
|
1872
|
-
let t = v(e, _, J), n = o.current ? v(o.current,
|
|
1882
|
+
let t = v(e, _, J), n = o.current ? v(o.current, _t, J) : null;
|
|
1873
1883
|
l.current = 0;
|
|
1874
|
-
let i = d.length <=
|
|
1884
|
+
let i = d.length <= Ct ? Ct : Math.max(24, Math.round(Ct * (Ct / d.length))), a = _ - vt, s = J - 42 - 54, c = d.length > 0 ? d.map((e) => e.count) : [0], g = Math.min(...c), y = Math.max(...c), x = y - g || 1, S = d.length, C = S > 1 ? (a - m) / (S - 1) : a - m, w = Math.max(1, Math.ceil(p / C)), E = g < 0, O = E ? 42 + s - -g / x * s : 42 + s, k = d.map((e, t) => ({
|
|
1875
1885
|
x: m + t * C,
|
|
1876
1886
|
y: 42 + s - (E ? (e.count - g) / x : e.count / (y || 1)) * s,
|
|
1877
1887
|
point: e
|
|
1878
1888
|
}));
|
|
1879
1889
|
if (n) {
|
|
1880
|
-
n.clearRect(0, 0,
|
|
1890
|
+
n.clearRect(0, 0, _t, J), n.letterSpacing = f.letterSpacing;
|
|
1881
1891
|
let e = E ? [
|
|
1882
1892
|
g,
|
|
1883
1893
|
g + x * .25,
|
|
@@ -1893,13 +1903,13 @@ function wt({ points: e = [], "data-testid": t }) {
|
|
|
1893
1903
|
];
|
|
1894
1904
|
e.forEach((t, r) => {
|
|
1895
1905
|
let i = r / (e.length - 1), a = 42 + s - i * s;
|
|
1896
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(U(t),
|
|
1906
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(U(t), _t - 6, a + 3);
|
|
1897
1907
|
}), n.save(), n.translate(12, 42 + s / 2), n.rotate(-Math.PI / 2), n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText("Count", 0, 0), n.restore();
|
|
1898
1908
|
}
|
|
1899
1909
|
let A = t.createLinearGradient(0, 42, 0, 42 + s);
|
|
1900
1910
|
A.addColorStop(0, h(u.blue, .22)), A.addColorStop(1, h(u.blue, .02));
|
|
1901
1911
|
let j = 0, M, N = (e) => {
|
|
1902
|
-
t.font =
|
|
1912
|
+
t.font = bt, t.fillStyle = f.color, t.textAlign = "center";
|
|
1903
1913
|
for (let n = 0; n < e; n++) n % w === 0 && t.fillText(k[n].point.week, k[n].x, J - 54 + 14);
|
|
1904
1914
|
}, P = () => {
|
|
1905
1915
|
l.current++;
|
|
@@ -1935,7 +1945,7 @@ function wt({ points: e = [], "data-testid": t }) {
|
|
|
1935
1945
|
e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
|
|
1936
1946
|
}
|
|
1937
1947
|
t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(), t.fillStyle = h(u.blue, .8), t.beginPath();
|
|
1938
|
-
for (let e = 0; e < c; e++) t.moveTo(k[e].x + 3.5, k[e].y), t.arc(k[e].x, k[e].y, 3.5, 0,
|
|
1948
|
+
for (let e = 0; e < c; e++) t.moveTo(k[e].x + 3.5, k[e].y), t.arc(k[e].x, k[e].y, 3.5, 0, St);
|
|
1939
1949
|
if (t.fill(), c > j) {
|
|
1940
1950
|
b.current = [];
|
|
1941
1951
|
for (let e = 0; e < c; e++) T(b.current, `pt-${e}`, k[e].x, k[e].y, 10, {
|
|
@@ -1954,7 +1964,7 @@ function wt({ points: e = [], "data-testid": t }) {
|
|
|
1954
1964
|
p,
|
|
1955
1965
|
b
|
|
1956
1966
|
]), d.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1957
|
-
width:
|
|
1967
|
+
width: gt,
|
|
1958
1968
|
height: J,
|
|
1959
1969
|
"data-testid": t
|
|
1960
1970
|
}) : /* @__PURE__ */ c("div", {
|
|
@@ -1968,7 +1978,7 @@ function wt({ points: e = [], "data-testid": t }) {
|
|
|
1968
1978
|
ref: o,
|
|
1969
1979
|
"aria-hidden": "true",
|
|
1970
1980
|
style: {
|
|
1971
|
-
width:
|
|
1981
|
+
width: _t,
|
|
1972
1982
|
height: J,
|
|
1973
1983
|
display: "block",
|
|
1974
1984
|
flexShrink: 0
|
|
@@ -2006,38 +2016,38 @@ function wt({ points: e = [], "data-testid": t }) {
|
|
|
2006
2016
|
}
|
|
2007
2017
|
//#endregion
|
|
2008
2018
|
//#region src/components/proportionalBandChart/ProportionalBandChart.tsx
|
|
2009
|
-
var
|
|
2010
|
-
function
|
|
2019
|
+
var Dt = 680, Ot = 240, kt = 28, At = 156;
|
|
2020
|
+
function jt(e, t, n) {
|
|
2011
2021
|
if (e.measureText(t).width <= n) return t;
|
|
2012
2022
|
let r = t;
|
|
2013
2023
|
for (; r.length > 0 && e.measureText(`${r}…`).width > n;) r = r.slice(0, -1);
|
|
2014
2024
|
return `${r}…`;
|
|
2015
2025
|
}
|
|
2016
|
-
var
|
|
2026
|
+
var Mt = {
|
|
2017
2027
|
Critical: u.red,
|
|
2018
2028
|
High: u.orange,
|
|
2019
2029
|
Medium: u.amber,
|
|
2020
2030
|
Low: u.green
|
|
2021
2031
|
};
|
|
2022
|
-
function
|
|
2023
|
-
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), m = d.length > 0 ? Math.min(
|
|
2032
|
+
function Nt({ severities: e = [], "data-testid": t }) {
|
|
2033
|
+
let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), m = d.length > 0 ? Math.min(Dt, 2 * kt + d.length * At) : Dt, { hoveredRef: g, tooltip: _, hitZonesRef: b } = w(r, {
|
|
2024
2034
|
width: m,
|
|
2025
|
-
height:
|
|
2035
|
+
height: Ot
|
|
2026
2036
|
});
|
|
2027
2037
|
return n(() => {
|
|
2028
2038
|
let e = r.current;
|
|
2029
2039
|
if (!e) return;
|
|
2030
|
-
let t = v(e, m,
|
|
2040
|
+
let t = v(e, m, Ot);
|
|
2031
2041
|
l.current = 0;
|
|
2032
|
-
let n = d.reduce((e, t) => e + (t.count ?? 0), 0), i =
|
|
2042
|
+
let n = d.reduce((e, t) => e + (t.count ?? 0), 0), i = kt, a = kt, s = m - i - a, c = Ot - 50 - 52, _ = d.map((e) => (e.count ?? 0) / (n || 1) * s), x, S = () => {
|
|
2033
2043
|
l.current++;
|
|
2034
2044
|
let e = l.current;
|
|
2035
|
-
t.clearRect(0, 0, m,
|
|
2045
|
+
t.clearRect(0, 0, m, Ot), t.letterSpacing = f.letterSpacing;
|
|
2036
2046
|
let r = O(Math.min(e / 60, 1));
|
|
2037
2047
|
N(o.current, g.current), b.current = [], t.strokeStyle = h(u.bd, .2), t.lineWidth = 1, t.beginPath(), t.rect(i, 50, s, c), t.stroke(), t.strokeStyle = h(u.t2, .15), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(m / 2, 50), t.lineTo(m / 2, 50 + c), t.stroke(), t.setLineDash([]);
|
|
2038
2048
|
let a = i;
|
|
2039
2049
|
d.forEach((e, i) => {
|
|
2040
|
-
let s =
|
|
2050
|
+
let s = Mt[e.severity] ?? u.blue, l = _[i], d = o.current.get(e.severity) ?? 0, m = a + l / 2, g = l * .85, v = l * r, x = g * r, S = m - x / 2;
|
|
2041
2051
|
if (v > 0 && (d > 0 && y(t, a + v / 2, 50 + c / 2, v * .4, s, .15 * d), t.beginPath(), t.moveTo(S, 50), t.lineTo(S + x, 50), t.lineTo(a + v, 50 + c), t.lineTo(a, 50 + c), t.closePath(), t.fillStyle = h(s, .45 + d * .25), t.fill(), t.strokeStyle = h(s, (.5 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(S, 50), t.lineTo(S + x, 50), t.stroke(), t.strokeStyle = h(s, (.3 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(a, 50 + c), t.lineTo(a + v, 50 + c), t.stroke()), E(b.current, e.severity, a, 50, l, c, {
|
|
2042
2052
|
label: e.severity,
|
|
2043
2053
|
value: U(e.count ?? 0),
|
|
@@ -2045,7 +2055,7 @@ function jt({ severities: e = [], "data-testid": t }) {
|
|
|
2045
2055
|
color: s
|
|
2046
2056
|
}), r > .5) {
|
|
2047
2057
|
let i = Math.min(1, (r - .5) / .5), o = a + l / 2;
|
|
2048
|
-
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? s : h(s, .9), t.textAlign = "center", t.fillText(
|
|
2058
|
+
t.globalAlpha = i, t.font = f.font, t.fillStyle = d > 0 ? s : h(s, .9), t.textAlign = "center", t.fillText(jt(t, e.severity, l - 12), o, 38), t.font = p.font, t.fillStyle = d > 0 ? u.t1 : h(u.t1, .85), t.fillText(U(e.count ?? 0), o, 50 + c / 2 + 6), t.font = f.font, t.fillStyle = d > 0 ? s : f.color, t.fillText(`${Math.round((e.count ?? 0) / (n || 1) * 100)}%`, o, 50 + c + 18), t.globalAlpha = 1;
|
|
2049
2059
|
}
|
|
2050
2060
|
a += l;
|
|
2051
2061
|
});
|
|
@@ -2055,14 +2065,14 @@ function jt({ severities: e = [], "data-testid": t }) {
|
|
|
2055
2065
|
return S(), () => cancelAnimationFrame(x);
|
|
2056
2066
|
}, [d, m]), d.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2057
2067
|
width: m,
|
|
2058
|
-
height:
|
|
2068
|
+
height: Ot,
|
|
2059
2069
|
"data-testid": t
|
|
2060
2070
|
}) : /* @__PURE__ */ c("div", {
|
|
2061
2071
|
"data-testid": t,
|
|
2062
2072
|
style: {
|
|
2063
2073
|
position: "relative",
|
|
2064
2074
|
width: m,
|
|
2065
|
-
height:
|
|
2075
|
+
height: Ot
|
|
2066
2076
|
},
|
|
2067
2077
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2068
2078
|
ref: r,
|
|
@@ -2070,24 +2080,24 @@ function jt({ severities: e = [], "data-testid": t }) {
|
|
|
2070
2080
|
"aria-label": "Early Warning severity distribution — prism spectrum bands",
|
|
2071
2081
|
style: {
|
|
2072
2082
|
width: m,
|
|
2073
|
-
height:
|
|
2083
|
+
height: Ot,
|
|
2074
2084
|
display: "block"
|
|
2075
2085
|
}
|
|
2076
2086
|
}), /* @__PURE__ */ s(C, {
|
|
2077
2087
|
..._,
|
|
2078
2088
|
parentW: m,
|
|
2079
|
-
parentH:
|
|
2089
|
+
parentH: Ot
|
|
2080
2090
|
})]
|
|
2081
2091
|
});
|
|
2082
2092
|
}
|
|
2083
2093
|
//#endregion
|
|
2084
2094
|
//#region src/components/hubAndSpokeRadialChart/HubAndSpokeRadialChart.tsx
|
|
2085
|
-
var Y = 300, X = 280,
|
|
2095
|
+
var Y = 300, X = 280, Pt = 100, Ft = {
|
|
2086
2096
|
Open: u.red,
|
|
2087
2097
|
Submitted: u.amber,
|
|
2088
2098
|
Closed: u.green
|
|
2089
2099
|
};
|
|
2090
|
-
function
|
|
2100
|
+
function It({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o }) {
|
|
2091
2101
|
let l = a(null), d = a(0), m = a(/* @__PURE__ */ new Map()), { hoveredRef: g, tooltip: _, hitZonesRef: S } = w(l, {
|
|
2092
2102
|
width: Y,
|
|
2093
2103
|
height: X
|
|
@@ -2097,21 +2107,21 @@ function Pt({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o })
|
|
|
2097
2107
|
if (!e) return;
|
|
2098
2108
|
let n = v(e, Y, X);
|
|
2099
2109
|
d.current = 0;
|
|
2100
|
-
let i = Y * .5, a = X * .56, o =
|
|
2110
|
+
let i = Y * .5, a = X * .56, o = Pt, s = E.reduce((e, t) => e + (t.count ?? 0), 0), c = Math.max(...E.map((e) => e.count ?? 0), 1), _, C = () => {
|
|
2101
2111
|
d.current++;
|
|
2102
2112
|
let e = d.current;
|
|
2103
2113
|
n.clearRect(0, 0, Y, X), n.letterSpacing = f.letterSpacing, S.current = [], m.current.forEach((e, t) => {
|
|
2104
2114
|
let n = t === g.current ? 1 : 0, r = e + (n - e) * .12;
|
|
2105
2115
|
Math.abs(r - n) < .005 ? n === 0 ? m.current.delete(t) : m.current.set(t, 1) : m.current.set(t, r);
|
|
2106
2116
|
}), g.current && !m.current.has(g.current) && m.current.set(g.current, 0), b(n, Y, X, e, 40, h(u.blue, .04)), E.forEach((t, r) => {
|
|
2107
|
-
let s = r / 3 * Math.PI * 2 - Math.PI / 2, l = i + Math.cos(s) * o, d = a + Math.sin(s) * o, f =
|
|
2117
|
+
let s = r / 3 * Math.PI * 2 - Math.PI / 2, l = i + Math.cos(s) * o, d = a + Math.sin(s) * o, f = Ft[t.status] ?? u.blue, m = 2 + t.count / c * 8;
|
|
2108
2118
|
n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = h(f, .08), n.lineWidth = m * 2, n.stroke(), n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = h(f, .25), n.lineWidth = 1, n.stroke();
|
|
2109
2119
|
let g = (e * .005 + r * .33) % 1, _ = i + (l - i) * g, v = a + (d - a) * g;
|
|
2110
2120
|
y(n, _, v, 6, f, .4), n.beginPath(), n.arc(_, v, 2, 0, Math.PI * 2), n.fillStyle = h(f, .8), n.fill();
|
|
2111
2121
|
let b = (i + l) / 2, x = (a + d) / 2;
|
|
2112
2122
|
n.font = p.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = h(f, .85), n.fillText(String(t.count), b, x);
|
|
2113
2123
|
}), E.forEach((e, t) => {
|
|
2114
|
-
let l = t / 3 * Math.PI * 2 - Math.PI / 2, d = i + Math.cos(l) * o, p = a + Math.sin(l) * o, g =
|
|
2124
|
+
let l = t / 3 * Math.PI * 2 - Math.PI / 2, d = i + Math.cos(l) * o, p = a + Math.sin(l) * o, g = Ft[e.status] ?? u.blue, _ = 10 + e.count / c * 18, v = m.current.get(e.status) ?? 0;
|
|
2115
2125
|
y(n, d, p, _ * 2.5, g, .2 + v * .15);
|
|
2116
2126
|
let b = n.createRadialGradient(d, p - _ * .2, 0, d, p, _);
|
|
2117
2127
|
b.addColorStop(0, h(g, .8 + v * .2)), b.addColorStop(1, h(g, .4 + v * .1)), n.beginPath(), n.arc(d, p, _, 0, Math.PI * 2), n.fillStyle = b, n.fill(), n.font = "bold " + f.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = h(u.t1, .9), n.fillText(e.status, d, p), T(S.current, e.status, d, p, _ + 6, {
|
|
@@ -2165,8 +2175,8 @@ function Pt({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o })
|
|
|
2165
2175
|
}
|
|
2166
2176
|
//#endregion
|
|
2167
2177
|
//#region src/components/trendChart/TrendChart.tsx
|
|
2168
|
-
var
|
|
2169
|
-
function
|
|
2178
|
+
var Lt = 280, Z = 96;
|
|
2179
|
+
function Rt({ points: e = [], className: t, colors: r }) {
|
|
2170
2180
|
let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), p = i(() => e.filter(Array.isArray).map(([e, t]) => {
|
|
2171
2181
|
let n = String(t).match(/-?\d+(\.\d+)?/);
|
|
2172
2182
|
return {
|
|
@@ -2174,18 +2184,18 @@ function It({ points: e = [], className: t, colors: r }) {
|
|
|
2174
2184
|
value: n ? Number(n[0]) : 0
|
|
2175
2185
|
};
|
|
2176
2186
|
}), [e]), { mouseRef: m, hoveredRef: g, tooltip: _, hitZonesRef: b } = w(o, {
|
|
2177
|
-
width:
|
|
2187
|
+
width: Lt,
|
|
2178
2188
|
height: Z
|
|
2179
2189
|
});
|
|
2180
2190
|
return n(() => {
|
|
2181
2191
|
let e = o.current;
|
|
2182
2192
|
if (!e) return;
|
|
2183
|
-
let t = v(e,
|
|
2193
|
+
let t = v(e, Lt, Z);
|
|
2184
2194
|
f.current = 0;
|
|
2185
2195
|
let n = r?.line ?? u.blue, i = r?.point ?? u.blue, a = r?.axisLine ?? u.bd, s, c = () => {
|
|
2186
2196
|
f.current++;
|
|
2187
2197
|
let e = f.current;
|
|
2188
|
-
if (t.clearRect(0, 0,
|
|
2198
|
+
if (t.clearRect(0, 0, Lt, Z), p.length < 2) {
|
|
2189
2199
|
s = requestAnimationFrame(c);
|
|
2190
2200
|
return;
|
|
2191
2201
|
}
|
|
@@ -2194,8 +2204,8 @@ function It({ points: e = [], className: t, colors: r }) {
|
|
|
2194
2204
|
right: 12,
|
|
2195
2205
|
top: 16,
|
|
2196
2206
|
bottom: 20
|
|
2197
|
-
}, o =
|
|
2198
|
-
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(
|
|
2207
|
+
}, o = Lt - 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));
|
|
2208
|
+
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(Lt - 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) => {
|
|
2199
2209
|
t.fillText(e.label.replace("Day ", "D"), C(n), Z - 4);
|
|
2200
2210
|
}), m.current.over && g.current) {
|
|
2201
2211
|
let e = parseInt(g.current.split("-")[1]);
|
|
@@ -2232,7 +2242,7 @@ function It({ points: e = [], className: t, colors: r }) {
|
|
|
2232
2242
|
children: /* @__PURE__ */ c("div", {
|
|
2233
2243
|
style: {
|
|
2234
2244
|
position: "relative",
|
|
2235
|
-
width:
|
|
2245
|
+
width: Lt,
|
|
2236
2246
|
height: Z
|
|
2237
2247
|
},
|
|
2238
2248
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -2240,14 +2250,14 @@ function It({ points: e = [], className: t, colors: r }) {
|
|
|
2240
2250
|
role: "img",
|
|
2241
2251
|
"aria-label": "trend chart",
|
|
2242
2252
|
style: {
|
|
2243
|
-
width:
|
|
2253
|
+
width: Lt,
|
|
2244
2254
|
height: Z,
|
|
2245
2255
|
display: "block",
|
|
2246
2256
|
borderRadius: 8
|
|
2247
2257
|
}
|
|
2248
2258
|
}), /* @__PURE__ */ s(C, {
|
|
2249
2259
|
..._,
|
|
2250
|
-
parentW:
|
|
2260
|
+
parentW: Lt,
|
|
2251
2261
|
parentH: Z
|
|
2252
2262
|
})]
|
|
2253
2263
|
})
|
|
@@ -2255,111 +2265,111 @@ function It({ points: e = [], className: t, colors: r }) {
|
|
|
2255
2265
|
}
|
|
2256
2266
|
//#endregion
|
|
2257
2267
|
//#region src/components/segmentedSplitBarChart/SegmentedSplitBarChart.tsx
|
|
2258
|
-
function
|
|
2268
|
+
function zt(e, t, n) {
|
|
2259
2269
|
if (e.measureText(t).width <= n) return t;
|
|
2260
2270
|
let r = t;
|
|
2261
2271
|
for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
|
|
2262
2272
|
return r + "…";
|
|
2263
2273
|
}
|
|
2264
|
-
var
|
|
2265
|
-
function
|
|
2266
|
-
let
|
|
2267
|
-
width:
|
|
2268
|
-
height:
|
|
2274
|
+
var Bt = 680, Vt = 8, Ht = 26, Ut = 14, Wt = 16, Gt = 32;
|
|
2275
|
+
function Kt({ items: e = [], labelA: t = "Implemented", labelB: r = "Unimplemented", unit: l = "variations", "data-testid": d }) {
|
|
2276
|
+
let g = a(null), _ = a(/* @__PURE__ */ new Map()), b = a(0), [x, S] = o(!1), T = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), D = i(() => x ? T : T.slice(0, Vt), [T, x]), k = Wt + Gt + D.length * (Ht + Ut) - Ut, { hoveredRef: A, tooltip: j, hitZonesRef: P } = w(g, {
|
|
2277
|
+
width: Bt,
|
|
2278
|
+
height: k
|
|
2269
2279
|
});
|
|
2270
2280
|
return n(() => {
|
|
2271
|
-
let e =
|
|
2281
|
+
let e = g.current;
|
|
2272
2282
|
if (!e) return;
|
|
2273
|
-
let
|
|
2274
|
-
|
|
2275
|
-
let
|
|
2276
|
-
|
|
2277
|
-
let e =
|
|
2278
|
-
|
|
2279
|
-
let
|
|
2280
|
-
N(
|
|
2281
|
-
let
|
|
2282
|
-
E(
|
|
2283
|
+
let n = v(e, Bt, k);
|
|
2284
|
+
b.current = 0;
|
|
2285
|
+
let i = Wt, a = Gt, o = Ht, s = Ut, c = Bt - 150 - 28, d = Math.max(...D.map((e) => (e.implemented ?? 0) + (e.unimplemented ?? 0)), 1), x = D.length * (o + s) - s, S = i + (k - i - a - x) / 2, C, w = () => {
|
|
2286
|
+
b.current++;
|
|
2287
|
+
let e = b.current;
|
|
2288
|
+
n.clearRect(0, 0, Bt, k);
|
|
2289
|
+
let i = O(Math.min(e / 60, 1));
|
|
2290
|
+
N(_.current, A.current), P.current = [], D.forEach((e, a) => {
|
|
2291
|
+
let m = M(i, a, D.length, O), g = S + a * (o + s), v = (e.implemented ?? 0) + (e.unimplemented ?? 0), b = (e.implemented ?? 0) / d * c * m, x = (e.unimplemented ?? 0) / d * c * m, C = `${e.id}-impl`, w = `${e.id}-un`, T = _.current.get(C) ?? 0, k = _.current.get(w) ?? 0;
|
|
2292
|
+
E(P.current, C, 150, g, b || 1, o, {
|
|
2283
2293
|
label: e.name,
|
|
2284
2294
|
value: U(e.implemented ?? 0),
|
|
2285
|
-
sublabel: `${Math.round((e.implemented ?? 0) / (
|
|
2295
|
+
sublabel: `${Math.round((e.implemented ?? 0) / (v || 1) * 100)}%`,
|
|
2286
2296
|
color: u.green
|
|
2287
|
-
}), E(
|
|
2297
|
+
}), E(P.current, w, 150 + b, g, x || 1, o, {
|
|
2288
2298
|
label: e.name,
|
|
2289
2299
|
value: U(e.unimplemented ?? 0),
|
|
2290
|
-
sublabel: `${Math.round((e.unimplemented ?? 0) / (
|
|
2300
|
+
sublabel: `${Math.round((e.unimplemented ?? 0) / (v || 1) * 100)}%`,
|
|
2291
2301
|
color: u.amber
|
|
2292
|
-
}),
|
|
2302
|
+
}), n.font = f.font, n.fillStyle = u.t2, n.textAlign = "right", n.fillText(zt(n, e.abbreviation ?? e.name ?? "", 134), 142, g + o / 2 + 4), E(P.current, C, 0, g, 150, o, {
|
|
2293
2303
|
label: e.name ?? e.abbreviation ?? "",
|
|
2294
|
-
value: `${U((e.implemented ?? 0) + (e.unimplemented ?? 0))} total
|
|
2295
|
-
sublabel:
|
|
2304
|
+
value: `${U((e.implemented ?? 0) + (e.unimplemented ?? 0))} total ${l}`,
|
|
2305
|
+
sublabel: `${t}: ${U(e.implemented ?? 0)} · ${r}: ${U(e.unimplemented ?? 0)}`,
|
|
2296
2306
|
color: u.green
|
|
2297
|
-
}),
|
|
2307
|
+
}), n.fillStyle = h(u.bd, .15), n.beginPath(), n.roundRect(150, g, v / d * c, o, 4), n.fill(), b > 0 && (T > 0 && y(n, 150 + b / 2, g + o / 2, b * .3, u.green, .12 * T), n.fillStyle = h(u.green, .6 + T * .2), n.beginPath(), n.roundRect(150, g, b, o, [
|
|
2298
2308
|
4,
|
|
2299
2309
|
0,
|
|
2300
2310
|
0,
|
|
2301
2311
|
4
|
|
2302
|
-
]),
|
|
2312
|
+
]), n.fill(), b > 28 && m > .5 && (n.font = p.font, n.fillStyle = T > 0 ? u.green : u.t2, n.textAlign = "center", n.fillText(U(e.implemented ?? 0), 150 + b / 2, g + o / 2 + 4))), x > 0 && (k > 0 && y(n, 150 + b + x / 2, g + o / 2, x * .3, u.amber, .12 * k), n.fillStyle = h(u.amber, .18 + k * .18), n.strokeStyle = h(u.amber, .3 + k * .3), n.lineWidth = 1, n.beginPath(), n.roundRect(150 + b, g, x, o, [
|
|
2303
2313
|
0,
|
|
2304
2314
|
4,
|
|
2305
2315
|
4,
|
|
2306
2316
|
0
|
|
2307
|
-
]),
|
|
2317
|
+
]), n.fill(), n.stroke(), x > 28 && m > .5 && (n.font = p.font, n.fillStyle = k > 0 ? u.amber : u.t2, n.textAlign = "center", n.fillText(U(e.unimplemented ?? 0), 150 + b + x / 2, g + o / 2 + 4))), b > 0 && x > 0 && (n.strokeStyle = h(u.bg, .7), n.lineWidth = 2, n.beginPath(), n.moveTo(150 + b, g), n.lineTo(150 + b, g + o), n.stroke());
|
|
2308
2318
|
});
|
|
2309
|
-
let
|
|
2310
|
-
|
|
2319
|
+
let a = S + x + 24, g = 150 + c / 2;
|
|
2320
|
+
n.font = m.font, n.textAlign = "right", n.fillStyle = u.green, n.fillText(`■ ${t}`, g - 10, a), n.textAlign = "left", n.fillStyle = m.color, n.fillText(`■ ${r}`, g + 10, a), C = requestAnimationFrame(w);
|
|
2311
2321
|
};
|
|
2312
|
-
return
|
|
2313
|
-
}, [
|
|
2314
|
-
width:
|
|
2322
|
+
return w(), () => cancelAnimationFrame(C);
|
|
2323
|
+
}, [D, k]), T.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2324
|
+
width: Bt,
|
|
2315
2325
|
height: 160,
|
|
2316
|
-
"data-testid":
|
|
2326
|
+
"data-testid": d
|
|
2317
2327
|
}) : /* @__PURE__ */ c("div", {
|
|
2318
|
-
"data-testid":
|
|
2319
|
-
style: { width:
|
|
2328
|
+
"data-testid": d,
|
|
2329
|
+
style: { width: Bt },
|
|
2320
2330
|
children: [/* @__PURE__ */ c("div", {
|
|
2321
2331
|
style: {
|
|
2322
2332
|
position: "relative",
|
|
2323
|
-
width:
|
|
2324
|
-
height:
|
|
2333
|
+
width: Bt,
|
|
2334
|
+
height: k
|
|
2325
2335
|
},
|
|
2326
2336
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2327
|
-
ref:
|
|
2337
|
+
ref: g,
|
|
2328
2338
|
role: "img",
|
|
2329
2339
|
"aria-label": "Implemented vs unimplemented variations per contractor — split bar",
|
|
2330
2340
|
style: {
|
|
2331
|
-
width:
|
|
2332
|
-
height:
|
|
2341
|
+
width: Bt,
|
|
2342
|
+
height: k,
|
|
2333
2343
|
display: "block"
|
|
2334
2344
|
}
|
|
2335
2345
|
}), /* @__PURE__ */ s(C, {
|
|
2336
|
-
...
|
|
2337
|
-
parentW:
|
|
2338
|
-
parentH:
|
|
2346
|
+
...j,
|
|
2347
|
+
parentW: Bt,
|
|
2348
|
+
parentH: k
|
|
2339
2349
|
})]
|
|
2340
|
-
}),
|
|
2350
|
+
}), T.length > Vt && /* @__PURE__ */ s("div", {
|
|
2341
2351
|
style: { marginTop: 8 },
|
|
2342
2352
|
children: /* @__PURE__ */ s(ae, {
|
|
2343
|
-
expanded:
|
|
2344
|
-
onToggle: () =>
|
|
2353
|
+
expanded: x,
|
|
2354
|
+
onToggle: () => S((e) => !e)
|
|
2345
2355
|
})
|
|
2346
2356
|
})]
|
|
2347
2357
|
});
|
|
2348
2358
|
}
|
|
2349
2359
|
//#endregion
|
|
2350
2360
|
//#region src/components/weeklyFlow/WeeklyFlow.tsx
|
|
2351
|
-
var
|
|
2352
|
-
function
|
|
2361
|
+
var qt = 800, Jt = 360;
|
|
2362
|
+
function Yt({ items: e = [], "data-testid": t }) {
|
|
2353
2363
|
let r = a(null), i = a(/* @__PURE__ */ new Map()), o = a(0), { hoveredRef: l, tooltip: m, hitZonesRef: g } = w(r, {
|
|
2354
|
-
width:
|
|
2355
|
-
height:
|
|
2364
|
+
width: qt,
|
|
2365
|
+
height: Jt
|
|
2356
2366
|
});
|
|
2357
2367
|
return n(() => {
|
|
2358
2368
|
let t = r.current;
|
|
2359
2369
|
if (!t) return;
|
|
2360
|
-
let n = v(t,
|
|
2370
|
+
let n = v(t, qt, Jt);
|
|
2361
2371
|
o.current = 0;
|
|
2362
|
-
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 =
|
|
2372
|
+
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 = Jt - 20 - 26, _ = m - 6 * (e.length - 1), b = 20, x = e.map((e, t) => {
|
|
2363
2373
|
let n = Math.max(24, (e.total ?? 0) / (c || 1) * _), r = {
|
|
2364
2374
|
x: 100 - 110 / 2,
|
|
2365
2375
|
y: b,
|
|
@@ -2387,16 +2397,16 @@ function qt({ items: e = [], "data-testid": t }) {
|
|
|
2387
2397
|
}, j, P = () => {
|
|
2388
2398
|
o.current++;
|
|
2389
2399
|
let t = o.current;
|
|
2390
|
-
n.clearRect(0, 0,
|
|
2400
|
+
n.clearRect(0, 0, qt, Jt), n.letterSpacing = f.letterSpacing;
|
|
2391
2401
|
let r = D(Math.min(t / 80, 1));
|
|
2392
2402
|
if (N(i.current, l.current), g.current = [], e.forEach((t, o) => {
|
|
2393
2403
|
let c = x[o], l = M(r, o, e.length, D), u = i.current.get(t.id) ?? 0;
|
|
2394
2404
|
if (l < .01) return;
|
|
2395
2405
|
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;
|
|
2396
|
-
|
|
2406
|
+
Xt(n, c.x + 110, h, 420 - 110 / 2, y, _ * l, c.color, S), Xt(n, c.x + 110, g, 420 - 110 / 2, b, v * l, c.color, S * .75);
|
|
2397
2407
|
}), r > .3) {
|
|
2398
2408
|
let e = Math.min(1, (r - .3) / .7), t = A.y + a / c * m / 2, i = A.y + m - s / c * m / 2;
|
|
2399
|
-
|
|
2409
|
+
Xt(n, 475, O.cy, 720 - 110 / 2, t, C * e, u.blue, .25 * e), Xt(n, 475, k.cy, 720 - 110 / 2, i, w * e, u.amber, .22 * e);
|
|
2400
2410
|
}
|
|
2401
2411
|
if ([
|
|
2402
2412
|
"Contractors",
|
|
@@ -2408,7 +2418,7 @@ function qt({ items: e = [], "data-testid": t }) {
|
|
|
2408
2418
|
420,
|
|
2409
2419
|
720
|
|
2410
2420
|
][t];
|
|
2411
|
-
n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText(e, r,
|
|
2421
|
+
n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText(e, r, Jt - 8);
|
|
2412
2422
|
}), e.forEach((t, a) => {
|
|
2413
2423
|
let o = x[a], s = M(r, a, e.length, D), c = i.current.get(t.id) ?? 0;
|
|
2414
2424
|
E(g.current, t.id, o.x, o.y, 110, o.h, {
|
|
@@ -2432,33 +2442,33 @@ function qt({ items: e = [], "data-testid": t }) {
|
|
|
2432
2442
|
"data-testid": t,
|
|
2433
2443
|
style: {
|
|
2434
2444
|
position: "relative",
|
|
2435
|
-
width:
|
|
2436
|
-
height:
|
|
2445
|
+
width: qt,
|
|
2446
|
+
height: Jt
|
|
2437
2447
|
},
|
|
2438
2448
|
children: [/* @__PURE__ */ s("canvas", {
|
|
2439
2449
|
ref: r,
|
|
2440
2450
|
role: "img",
|
|
2441
2451
|
"aria-label": "Weekly report flow — base value and variations per contractor flowing to total commitment",
|
|
2442
2452
|
style: {
|
|
2443
|
-
width:
|
|
2444
|
-
height:
|
|
2453
|
+
width: qt,
|
|
2454
|
+
height: Jt,
|
|
2445
2455
|
display: "block"
|
|
2446
2456
|
}
|
|
2447
2457
|
}), /* @__PURE__ */ s(C, {
|
|
2448
2458
|
...m,
|
|
2449
|
-
parentW:
|
|
2450
|
-
parentH:
|
|
2459
|
+
parentW: qt,
|
|
2460
|
+
parentH: Jt
|
|
2451
2461
|
})]
|
|
2452
2462
|
});
|
|
2453
2463
|
}
|
|
2454
|
-
function
|
|
2464
|
+
function Xt(e, t, n, r, i, a, o, s) {
|
|
2455
2465
|
let c = (t + r) / 2;
|
|
2456
2466
|
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();
|
|
2457
2467
|
}
|
|
2458
2468
|
//#endregion
|
|
2459
2469
|
//#region src/components/visualizationRenderer/VisualizationRenderer.tsx
|
|
2460
|
-
function
|
|
2461
|
-
return e.type === "line" ? /* @__PURE__ */ s(
|
|
2470
|
+
function Zt({ config: e, className: t }) {
|
|
2471
|
+
return e.type === "line" ? /* @__PURE__ */ s(Ve, {
|
|
2462
2472
|
rows: e.rows,
|
|
2463
2473
|
className: t
|
|
2464
2474
|
}) : e.type === "area" ? /* @__PURE__ */ s(te, {
|
|
@@ -2467,79 +2477,87 @@ function Yt({ config: e, className: t }) {
|
|
|
2467
2477
|
}) : e.type === "bar" ? /* @__PURE__ */ s(ie, {
|
|
2468
2478
|
rows: e.rows,
|
|
2469
2479
|
className: t
|
|
2470
|
-
}) : e.type === "pie" ? /* @__PURE__ */ s(
|
|
2480
|
+
}) : e.type === "pie" ? /* @__PURE__ */ s($e, {
|
|
2471
2481
|
rows: e.rows,
|
|
2472
2482
|
variant: "pie",
|
|
2473
2483
|
className: t
|
|
2474
|
-
}) : e.type === "donut" ? /* @__PURE__ */ s(
|
|
2484
|
+
}) : e.type === "donut" ? /* @__PURE__ */ s($e, {
|
|
2475
2485
|
rows: e.rows,
|
|
2476
2486
|
variant: "donut",
|
|
2477
2487
|
className: t
|
|
2478
|
-
}) : e.type === "sankey" ? /* @__PURE__ */ s(
|
|
2488
|
+
}) : e.type === "sankey" ? /* @__PURE__ */ s(ut, {
|
|
2479
2489
|
rows: e.rows,
|
|
2480
2490
|
className: t
|
|
2481
|
-
}) : e.type === "flow" ? /* @__PURE__ */ s(
|
|
2491
|
+
}) : e.type === "flow" ? /* @__PURE__ */ s(lt, {
|
|
2482
2492
|
selectedEntity: e.selectedEntity,
|
|
2483
2493
|
className: t
|
|
2484
|
-
}) : e.type === "trend" ? /* @__PURE__ */ s(
|
|
2494
|
+
}) : e.type === "trend" ? /* @__PURE__ */ s(Rt, {
|
|
2485
2495
|
points: e.points,
|
|
2486
2496
|
className: t
|
|
2487
|
-
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(
|
|
2497
|
+
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(We, {
|
|
2488
2498
|
rows: e.rows,
|
|
2489
2499
|
className: t
|
|
2490
|
-
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(
|
|
2500
|
+
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Me, { data: e.data ?? { items: e.items ?? [] } }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(we, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(fe, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(It, {
|
|
2491
2501
|
segments: e.segments,
|
|
2492
2502
|
title: e.title,
|
|
2493
2503
|
unitLabel: e.unitLabel
|
|
2494
|
-
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(
|
|
2504
|
+
}) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(Be, { items: e.items }) : e.type === "ranked-card-leaderboard" ? /* @__PURE__ */ s(ze, { items: e.items }) : e.type === "proportional-band-chart" ? /* @__PURE__ */ s(Nt, { severities: e.severities }) : e.type === "radial-fan-tree-chart" ? /* @__PURE__ */ s(Ye, {
|
|
2495
2505
|
total: e.total,
|
|
2496
2506
|
totalLabel: e.totalLabel,
|
|
2497
2507
|
items: e.items
|
|
2498
|
-
}) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(
|
|
2508
|
+
}) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(_e, {
|
|
2499
2509
|
confirmed: e.confirmed,
|
|
2500
2510
|
total: e.total,
|
|
2501
2511
|
label: e.label
|
|
2502
|
-
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(
|
|
2512
|
+
}) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(Kt, {
|
|
2513
|
+
items: e.items,
|
|
2514
|
+
labelA: e.labelA,
|
|
2515
|
+
labelB: e.labelB,
|
|
2516
|
+
unit: e.unit
|
|
2517
|
+
}) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(pt, {
|
|
2503
2518
|
left: e.left,
|
|
2504
|
-
right: e.right
|
|
2505
|
-
|
|
2519
|
+
right: e.right,
|
|
2520
|
+
leftTitle: e.leftTitle,
|
|
2521
|
+
rightTitle: e.rightTitle,
|
|
2522
|
+
unit: e.unit
|
|
2523
|
+
}) : e.type === "area-line-chart" ? /* @__PURE__ */ s(ht, { points: e.points }) : e.type === "trend-view" ? /* @__PURE__ */ s(Et, { points: e.points }) : e.type === "weekly-flow" ? /* @__PURE__ */ s(Yt, { items: e.items }) : /* @__PURE__ */ s("div", {
|
|
2506
2524
|
className: "viz-empty",
|
|
2507
2525
|
children: "Visualization unavailable"
|
|
2508
2526
|
});
|
|
2509
2527
|
}
|
|
2510
2528
|
//#endregion
|
|
2511
2529
|
//#region src/utils/mounts.tsx
|
|
2512
|
-
var
|
|
2513
|
-
function
|
|
2530
|
+
var Qt = [];
|
|
2531
|
+
function $t(e) {
|
|
2514
2532
|
try {
|
|
2515
2533
|
return JSON.parse(decodeURIComponent(e));
|
|
2516
2534
|
} catch {
|
|
2517
2535
|
return null;
|
|
2518
2536
|
}
|
|
2519
2537
|
}
|
|
2520
|
-
function
|
|
2521
|
-
for (;
|
|
2522
|
-
let e =
|
|
2538
|
+
function en() {
|
|
2539
|
+
for (; Qt.length;) {
|
|
2540
|
+
let e = Qt.pop();
|
|
2523
2541
|
e && e.unmount();
|
|
2524
2542
|
}
|
|
2525
2543
|
}
|
|
2526
|
-
function
|
|
2527
|
-
|
|
2544
|
+
function tn() {
|
|
2545
|
+
en(), document.querySelectorAll("[data-d3-viz]").forEach((t) => {
|
|
2528
2546
|
let n = t.dataset.d3Viz;
|
|
2529
2547
|
if (!n) return;
|
|
2530
|
-
let r =
|
|
2548
|
+
let r = $t(n);
|
|
2531
2549
|
if (!r) return;
|
|
2532
2550
|
let i = e(t);
|
|
2533
|
-
|
|
2551
|
+
Qt.push(i), i.render(/* @__PURE__ */ s(Zt, { config: r }));
|
|
2534
2552
|
});
|
|
2535
2553
|
}
|
|
2536
|
-
function
|
|
2554
|
+
function nn(e) {
|
|
2537
2555
|
return encodeURIComponent(JSON.stringify(e));
|
|
2538
2556
|
}
|
|
2539
2557
|
//#endregion
|
|
2540
2558
|
//#region src/components/donutChart/DonutChart.tsx
|
|
2541
|
-
function
|
|
2542
|
-
return /* @__PURE__ */ s(
|
|
2559
|
+
function rn({ rows: e = [], className: t, colors: n }) {
|
|
2560
|
+
return /* @__PURE__ */ s($e, {
|
|
2543
2561
|
rows: e,
|
|
2544
2562
|
variant: "donut",
|
|
2545
2563
|
className: t,
|
|
@@ -2558,20 +2576,20 @@ var Q = {
|
|
|
2558
2576
|
red: u.red,
|
|
2559
2577
|
amber: u.amber,
|
|
2560
2578
|
green: u.green
|
|
2561
|
-
}, $ = "'Satoshi Variable', 'DM Sans', sans-serif",
|
|
2579
|
+
}, $ = "'Satoshi Variable', 'DM Sans', sans-serif", an = {
|
|
2562
2580
|
color: "#F7F7F7",
|
|
2563
2581
|
fontFamily: $,
|
|
2564
2582
|
fontSize: 24,
|
|
2565
2583
|
fontWeight: 500,
|
|
2566
2584
|
lineHeight: "32px"
|
|
2567
|
-
},
|
|
2568
|
-
color: "#
|
|
2585
|
+
}, on = {
|
|
2586
|
+
color: "#B3B5B6",
|
|
2569
2587
|
fontFamily: $,
|
|
2570
2588
|
fontSize: 18,
|
|
2571
2589
|
fontWeight: 400,
|
|
2572
2590
|
lineHeight: "20px"
|
|
2573
2591
|
};
|
|
2574
|
-
function
|
|
2592
|
+
function sn({ items: e = [] }) {
|
|
2575
2593
|
let t = e.filter((e) => e.value);
|
|
2576
2594
|
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2577
2595
|
style: {
|
|
@@ -2596,18 +2614,18 @@ function an({ items: e = [] }) {
|
|
|
2596
2614
|
},
|
|
2597
2615
|
children: [/* @__PURE__ */ s("div", {
|
|
2598
2616
|
style: {
|
|
2599
|
-
...
|
|
2617
|
+
...an,
|
|
2600
2618
|
color: Q.t1
|
|
2601
2619
|
},
|
|
2602
2620
|
children: e.value
|
|
2603
2621
|
}), /* @__PURE__ */ s("div", {
|
|
2604
|
-
style: { ...
|
|
2622
|
+
style: { ...on },
|
|
2605
2623
|
children: e.label
|
|
2606
2624
|
})]
|
|
2607
2625
|
}, t))
|
|
2608
2626
|
});
|
|
2609
2627
|
}
|
|
2610
|
-
function
|
|
2628
|
+
function cn({ items: e = [] }) {
|
|
2611
2629
|
let t = e.filter((e) => e.name ?? e.value);
|
|
2612
2630
|
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2613
2631
|
style: {
|
|
@@ -2640,7 +2658,7 @@ function on({ items: e = [] }) {
|
|
|
2640
2658
|
}),
|
|
2641
2659
|
/* @__PURE__ */ s("span", {
|
|
2642
2660
|
style: {
|
|
2643
|
-
...
|
|
2661
|
+
...an,
|
|
2644
2662
|
fontSize: 18,
|
|
2645
2663
|
color: Q.t1,
|
|
2646
2664
|
minWidth: 70,
|
|
@@ -2650,7 +2668,7 @@ function on({ items: e = [] }) {
|
|
|
2650
2668
|
}),
|
|
2651
2669
|
/* @__PURE__ */ s("span", {
|
|
2652
2670
|
style: {
|
|
2653
|
-
...
|
|
2671
|
+
...on,
|
|
2654
2672
|
flex: 1
|
|
2655
2673
|
},
|
|
2656
2674
|
children: e.kpiLabel
|
|
@@ -2659,7 +2677,7 @@ function on({ items: e = [] }) {
|
|
|
2659
2677
|
}, t))
|
|
2660
2678
|
});
|
|
2661
2679
|
}
|
|
2662
|
-
function
|
|
2680
|
+
function ln({ items: e = [] }) {
|
|
2663
2681
|
let t = e.filter((e) => e.value);
|
|
2664
2682
|
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2665
2683
|
style: {
|
|
@@ -2682,23 +2700,23 @@ function sn({ items: e = [] }) {
|
|
|
2682
2700
|
},
|
|
2683
2701
|
children: [/* @__PURE__ */ s("div", {
|
|
2684
2702
|
style: {
|
|
2685
|
-
...
|
|
2703
|
+
...an,
|
|
2686
2704
|
color: Q.t1
|
|
2687
2705
|
},
|
|
2688
2706
|
children: e.value
|
|
2689
2707
|
}), /* @__PURE__ */ s("div", {
|
|
2690
|
-
style: { ...
|
|
2708
|
+
style: { ...on },
|
|
2691
2709
|
children: e.label
|
|
2692
2710
|
})]
|
|
2693
2711
|
}, t))
|
|
2694
2712
|
});
|
|
2695
2713
|
}
|
|
2696
|
-
var
|
|
2714
|
+
var un = {
|
|
2697
2715
|
red: Q.red,
|
|
2698
2716
|
amber: Q.amber,
|
|
2699
2717
|
green: Q.green
|
|
2700
2718
|
};
|
|
2701
|
-
function
|
|
2719
|
+
function dn({ items: e = [] }) {
|
|
2702
2720
|
let t = e.filter((e) => e.text);
|
|
2703
2721
|
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
2704
2722
|
style: {
|
|
@@ -2706,7 +2724,7 @@ function ln({ items: e = [] }) {
|
|
|
2706
2724
|
flexDirection: "column",
|
|
2707
2725
|
gap: 5
|
|
2708
2726
|
},
|
|
2709
|
-
children: t.map((e, t) => (
|
|
2727
|
+
children: t.map((e, t) => (un[e.severity], /* @__PURE__ */ c("div", {
|
|
2710
2728
|
style: {
|
|
2711
2729
|
display: "flex",
|
|
2712
2730
|
alignItems: "flex-start",
|
|
@@ -2723,13 +2741,16 @@ function ln({ items: e = [] }) {
|
|
|
2723
2741
|
flexShrink: 0,
|
|
2724
2742
|
marginTop: 5
|
|
2725
2743
|
} }), /* @__PURE__ */ s("span", {
|
|
2726
|
-
style: {
|
|
2744
|
+
style: {
|
|
2745
|
+
...on,
|
|
2746
|
+
color: "#B3B5B6"
|
|
2747
|
+
},
|
|
2727
2748
|
children: e.text
|
|
2728
2749
|
})]
|
|
2729
2750
|
}, t)))
|
|
2730
2751
|
});
|
|
2731
2752
|
}
|
|
2732
|
-
function
|
|
2753
|
+
function fn({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
2733
2754
|
let a = r.filter((e) => e.name);
|
|
2734
2755
|
if (a.length === 0) return null;
|
|
2735
2756
|
let o = t - e;
|
|
@@ -2841,9 +2862,9 @@ function un({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
|
|
|
2841
2862
|
}, r);
|
|
2842
2863
|
})
|
|
2843
2864
|
]
|
|
2844
|
-
}), i && i.length > 0 && /* @__PURE__ */ s(
|
|
2865
|
+
}), i && i.length > 0 && /* @__PURE__ */ s(ln, { items: i })] });
|
|
2845
2866
|
}
|
|
2846
|
-
function
|
|
2867
|
+
function pn({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i, rightLabel: a, rightValue: o, rightColor: l, chips: d }) {
|
|
2847
2868
|
if (!t && !a) return null;
|
|
2848
2869
|
let f = r ?? u.blue, p = l ?? u.blue;
|
|
2849
2870
|
return /* @__PURE__ */ c("div", { children: [
|
|
@@ -2938,10 +2959,10 @@ function dn({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i,
|
|
|
2938
2959
|
})
|
|
2939
2960
|
})]
|
|
2940
2961
|
}),
|
|
2941
|
-
d && d.length > 0 && /* @__PURE__ */ s(
|
|
2962
|
+
d && d.length > 0 && /* @__PURE__ */ s(ln, { items: d })
|
|
2942
2963
|
] });
|
|
2943
2964
|
}
|
|
2944
|
-
function
|
|
2965
|
+
function mn({ pct: e, label: t, color: n, chips: r }) {
|
|
2945
2966
|
if (e == null && !t) return null;
|
|
2946
2967
|
let i = n ?? u.blue, a = 2 * Math.PI * 30, o = a * (1 - e / 100);
|
|
2947
2968
|
return /* @__PURE__ */ c("div", {
|
|
@@ -3001,7 +3022,7 @@ function fn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3001
3022
|
style: { flex: 1 },
|
|
3002
3023
|
children: [/* @__PURE__ */ s("div", {
|
|
3003
3024
|
style: {
|
|
3004
|
-
...
|
|
3025
|
+
...on,
|
|
3005
3026
|
padding: "10px 0px"
|
|
3006
3027
|
},
|
|
3007
3028
|
children: t
|
|
@@ -3024,14 +3045,14 @@ function fn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3024
3045
|
children: [
|
|
3025
3046
|
/* @__PURE__ */ s("span", {
|
|
3026
3047
|
style: {
|
|
3027
|
-
...
|
|
3048
|
+
...an,
|
|
3028
3049
|
color: Q.t2
|
|
3029
3050
|
},
|
|
3030
3051
|
children: e.value
|
|
3031
3052
|
}),
|
|
3032
3053
|
/* @__PURE__ */ s("span", {
|
|
3033
3054
|
style: {
|
|
3034
|
-
...
|
|
3055
|
+
...an,
|
|
3035
3056
|
color: Q.t2,
|
|
3036
3057
|
fontWeight: 400,
|
|
3037
3058
|
userSelect: "none"
|
|
@@ -3039,7 +3060,7 @@ function fn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3039
3060
|
children: "|"
|
|
3040
3061
|
}),
|
|
3041
3062
|
/* @__PURE__ */ s("span", {
|
|
3042
|
-
style: { ...
|
|
3063
|
+
style: { ...on },
|
|
3043
3064
|
children: e.label
|
|
3044
3065
|
})
|
|
3045
3066
|
]
|
|
@@ -3048,7 +3069,7 @@ function fn({ pct: e, label: t, color: n, chips: r }) {
|
|
|
3048
3069
|
})]
|
|
3049
3070
|
});
|
|
3050
3071
|
}
|
|
3051
|
-
function
|
|
3072
|
+
function hn({ items: e = [] }) {
|
|
3052
3073
|
let t = e.filter((e) => e.name ?? e.value);
|
|
3053
3074
|
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
3054
3075
|
style: {
|
|
@@ -3126,7 +3147,7 @@ function pn({ items: e = [] }) {
|
|
|
3126
3147
|
}),
|
|
3127
3148
|
e.sublabel && /* @__PURE__ */ s("span", {
|
|
3128
3149
|
style: {
|
|
3129
|
-
...
|
|
3150
|
+
...on,
|
|
3130
3151
|
flexShrink: 0,
|
|
3131
3152
|
minWidth: 80,
|
|
3132
3153
|
textAlign: "right"
|
|
@@ -3137,12 +3158,12 @@ function pn({ items: e = [] }) {
|
|
|
3137
3158
|
}, t))
|
|
3138
3159
|
});
|
|
3139
3160
|
}
|
|
3140
|
-
var
|
|
3161
|
+
var gn = {
|
|
3141
3162
|
red: Q.red,
|
|
3142
3163
|
amber: Q.amber,
|
|
3143
3164
|
green: Q.green
|
|
3144
3165
|
};
|
|
3145
|
-
function
|
|
3166
|
+
function _n({ items: e = [] }) {
|
|
3146
3167
|
let t = e.filter((e) => e.text);
|
|
3147
3168
|
return t.length === 0 ? null : /* @__PURE__ */ s("div", {
|
|
3148
3169
|
style: {
|
|
@@ -3151,7 +3172,7 @@ function hn({ items: e = [] }) {
|
|
|
3151
3172
|
gap: 5
|
|
3152
3173
|
},
|
|
3153
3174
|
children: t.map((e, t) => {
|
|
3154
|
-
let n =
|
|
3175
|
+
let n = gn[e.severity];
|
|
3155
3176
|
return /* @__PURE__ */ c("div", {
|
|
3156
3177
|
style: {
|
|
3157
3178
|
display: "flex",
|
|
@@ -3177,13 +3198,13 @@ function hn({ items: e = [] }) {
|
|
|
3177
3198
|
/* @__PURE__ */ s("span", {
|
|
3178
3199
|
style: {
|
|
3179
3200
|
flex: 1,
|
|
3180
|
-
...
|
|
3201
|
+
...on
|
|
3181
3202
|
},
|
|
3182
3203
|
children: e.text
|
|
3183
3204
|
}),
|
|
3184
3205
|
/* @__PURE__ */ s("span", {
|
|
3185
3206
|
style: {
|
|
3186
|
-
...
|
|
3207
|
+
...on,
|
|
3187
3208
|
flexShrink: 0,
|
|
3188
3209
|
marginTop: 1
|
|
3189
3210
|
},
|
|
@@ -3194,7 +3215,7 @@ function hn({ items: e = [] }) {
|
|
|
3194
3215
|
})
|
|
3195
3216
|
});
|
|
3196
3217
|
}
|
|
3197
|
-
function
|
|
3218
|
+
function vn({ columns: e = [], rows: t = [] }) {
|
|
3198
3219
|
return t.length === 0 ? null : /* @__PURE__ */ c("div", {
|
|
3199
3220
|
style: {
|
|
3200
3221
|
display: "flex",
|
|
@@ -3257,21 +3278,21 @@ function gn({ columns: e = [], rows: t = [] }) {
|
|
|
3257
3278
|
}, t))]
|
|
3258
3279
|
});
|
|
3259
3280
|
}
|
|
3260
|
-
function
|
|
3281
|
+
function yn({ block: e }) {
|
|
3261
3282
|
if (!e) return null;
|
|
3262
3283
|
switch (e.type) {
|
|
3263
|
-
case "stats": return /* @__PURE__ */ s(
|
|
3264
|
-
case "ranked": return /* @__PURE__ */ s(
|
|
3265
|
-
case "chips": return /* @__PURE__ */ s(
|
|
3266
|
-
case "badges": return /* @__PURE__ */ s(
|
|
3267
|
-
case "dot-strip": return /* @__PURE__ */ s(
|
|
3284
|
+
case "stats": return /* @__PURE__ */ s(sn, { items: e.items });
|
|
3285
|
+
case "ranked": return /* @__PURE__ */ s(cn, { items: e.items });
|
|
3286
|
+
case "chips": return /* @__PURE__ */ s(ln, { items: e.items });
|
|
3287
|
+
case "badges": return /* @__PURE__ */ s(dn, { items: e.items });
|
|
3288
|
+
case "dot-strip": return /* @__PURE__ */ s(fn, {
|
|
3268
3289
|
min: e.min,
|
|
3269
3290
|
max: e.max,
|
|
3270
3291
|
unit: e.unit,
|
|
3271
3292
|
dots: e.dots,
|
|
3272
3293
|
chips: e.chips
|
|
3273
3294
|
});
|
|
3274
|
-
case "proportion": return /* @__PURE__ */ s(
|
|
3295
|
+
case "proportion": return /* @__PURE__ */ s(pn, {
|
|
3275
3296
|
leftPct: e.leftPct,
|
|
3276
3297
|
leftLabel: e.leftLabel,
|
|
3277
3298
|
leftValue: e.leftValue,
|
|
@@ -3282,15 +3303,15 @@ function _n({ block: e }) {
|
|
|
3282
3303
|
rightColor: e.rightColor,
|
|
3283
3304
|
chips: e.chips
|
|
3284
3305
|
});
|
|
3285
|
-
case "ring": return /* @__PURE__ */ s(
|
|
3306
|
+
case "ring": return /* @__PURE__ */ s(mn, {
|
|
3286
3307
|
pct: e.pct,
|
|
3287
3308
|
label: e.label,
|
|
3288
3309
|
color: e.color,
|
|
3289
3310
|
chips: e.chips
|
|
3290
3311
|
});
|
|
3291
|
-
case "scorecard-rows": return /* @__PURE__ */ s(
|
|
3292
|
-
case "flags-list": return /* @__PURE__ */ s(
|
|
3293
|
-
case "comparison-rows": return /* @__PURE__ */ s(
|
|
3312
|
+
case "scorecard-rows": return /* @__PURE__ */ s(hn, { items: e.items });
|
|
3313
|
+
case "flags-list": return /* @__PURE__ */ s(_n, { items: e.items });
|
|
3314
|
+
case "comparison-rows": return /* @__PURE__ */ s(vn, {
|
|
3294
3315
|
columns: e.columns,
|
|
3295
3316
|
rows: e.rows
|
|
3296
3317
|
});
|
|
@@ -3299,14 +3320,14 @@ function _n({ block: e }) {
|
|
|
3299
3320
|
}
|
|
3300
3321
|
//#endregion
|
|
3301
3322
|
//#region src/components/keyHighlights/Takeaway.tsx
|
|
3302
|
-
var
|
|
3323
|
+
var bn = "'Satoshi Variable', 'DM Sans', sans-serif", xn = {
|
|
3303
3324
|
color: "#C2C2C2",
|
|
3304
|
-
fontFamily:
|
|
3325
|
+
fontFamily: bn,
|
|
3305
3326
|
fontSize: 18,
|
|
3306
3327
|
fontWeight: 400,
|
|
3307
3328
|
lineHeight: 1.65
|
|
3308
3329
|
};
|
|
3309
|
-
function
|
|
3330
|
+
function Sn({ text: e }) {
|
|
3310
3331
|
return /* @__PURE__ */ c("div", {
|
|
3311
3332
|
style: {
|
|
3312
3333
|
padding: "8px 0px",
|
|
@@ -3319,16 +3340,16 @@ function bn({ text: e }) {
|
|
|
3319
3340
|
fontSize: 18,
|
|
3320
3341
|
fontWeight: 500,
|
|
3321
3342
|
color: u.t1,
|
|
3322
|
-
fontFamily:
|
|
3343
|
+
fontFamily: bn,
|
|
3323
3344
|
lineHeight: 1.65,
|
|
3324
3345
|
marginRight: 8
|
|
3325
3346
|
},
|
|
3326
3347
|
children: "Takeaway"
|
|
3327
3348
|
}), /* @__PURE__ */ s("span", {
|
|
3328
|
-
style: { ...
|
|
3349
|
+
style: { ...xn },
|
|
3329
3350
|
children: e
|
|
3330
3351
|
})]
|
|
3331
3352
|
});
|
|
3332
3353
|
}
|
|
3333
3354
|
//#endregion
|
|
3334
|
-
export { te as AreaChart, ie as BarChart, l as ChartFrame,
|
|
3355
|
+
export { te as AreaChart, ie as BarChart, l as ChartFrame, rn as DonutChart, yn as KeyHighlights, Ve as LineChart, We as MiniBars, $e as PieChart, lt as ProcessSankey, ut as RankingSankey, tt as SankeySvg, ee as SeriesChart, Sn as Takeaway, Et as Trend, Rt as TrendChart, Zt as VisualizationRenderer, en as cleanupVisualizationMounts, tn as hydrateVisualizationMounts, nn as serializeVisualizationConfig };
|