@validation-os/dashboard 0.15.3 → 0.15.4
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.js +41 -52
- package/dist/index.js.map +1 -1
- package/dist/styles.css +53 -19
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2101,7 +2101,7 @@ function weekOverWeekDelta(assumptions, readings, now) {
|
|
|
2101
2101
|
// src/recommended-experiments.ts
|
|
2102
2102
|
var MAX_RECOMMENDED = 2;
|
|
2103
2103
|
var MAX_CLUSTER_SIZE = 3;
|
|
2104
|
-
var MAX_NEEDS_FRAMING =
|
|
2104
|
+
var MAX_NEEDS_FRAMING = 3;
|
|
2105
2105
|
function buildNeedsFraming(assumptions) {
|
|
2106
2106
|
const live = assumptions.filter((a) => {
|
|
2107
2107
|
const status = str(a.Status);
|
|
@@ -2117,8 +2117,15 @@ function buildNeedsFraming(assumptions) {
|
|
|
2117
2117
|
const title = str(a.Title) ?? id;
|
|
2118
2118
|
const hint = framingHint(a, completeness);
|
|
2119
2119
|
return { id, title, risk, completeness, lens, stage, hint };
|
|
2120
|
-
}).filter((a) => a.completeness < 100)
|
|
2121
|
-
|
|
2120
|
+
}).filter((a) => a.completeness < 100);
|
|
2121
|
+
const byLens = /* @__PURE__ */ new Map();
|
|
2122
|
+
for (const item of items) {
|
|
2123
|
+
const existing = byLens.get(item.lens);
|
|
2124
|
+
if (!existing || item.risk > existing.risk) {
|
|
2125
|
+
byLens.set(item.lens, item);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
return [...byLens.values()].sort((a, b) => b.risk - a.risk).slice(0, MAX_NEEDS_FRAMING);
|
|
2122
2129
|
}
|
|
2123
2130
|
function framingHint(a, completeness) {
|
|
2124
2131
|
const hasScoring = Boolean(str(a["Scoring justification"]));
|
|
@@ -2759,15 +2766,14 @@ function ConfidenceDonut({
|
|
|
2759
2766
|
value,
|
|
2760
2767
|
size = 56
|
|
2761
2768
|
}) {
|
|
2762
|
-
const
|
|
2769
|
+
const stroke = size > 60 ? 6 : 4;
|
|
2770
|
+
const r = (size - stroke) / 2;
|
|
2763
2771
|
const cx = size / 2;
|
|
2764
2772
|
const cy = size / 2;
|
|
2773
|
+
const circumference = 2 * Math.PI * r;
|
|
2765
2774
|
const pct2 = Math.max(0, Math.min(100, value)) / 100;
|
|
2775
|
+
const dash = pct2 * circumference;
|
|
2766
2776
|
const color = value >= 67 ? "var(--vos-good)" : value >= 33 ? "var(--vos-warn)" : "var(--vos-crit)";
|
|
2767
|
-
const endAngle = -Math.PI / 2 + pct2 * 2 * Math.PI;
|
|
2768
|
-
const x2 = cx + r * Math.cos(endAngle);
|
|
2769
|
-
const y2 = cy + r * Math.sin(endAngle);
|
|
2770
|
-
const largeArc = pct2 > 0.5 ? 1 : 0;
|
|
2771
2777
|
return /* @__PURE__ */ jsxs6("div", { className: "vos-donut", style: { width: size, height: size }, children: [
|
|
2772
2778
|
/* @__PURE__ */ jsxs6("svg", { width: size, height: size, "aria-hidden": "true", children: [
|
|
2773
2779
|
/* @__PURE__ */ jsx6(
|
|
@@ -2778,21 +2784,33 @@ function ConfidenceDonut({
|
|
|
2778
2784
|
r,
|
|
2779
2785
|
fill: "none",
|
|
2780
2786
|
stroke: "var(--vos-surface-2)",
|
|
2781
|
-
strokeWidth:
|
|
2787
|
+
strokeWidth: stroke
|
|
2782
2788
|
}
|
|
2783
2789
|
),
|
|
2784
2790
|
value > 0 ? /* @__PURE__ */ jsx6(
|
|
2785
|
-
"
|
|
2791
|
+
"circle",
|
|
2786
2792
|
{
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2793
|
+
cx,
|
|
2794
|
+
cy,
|
|
2795
|
+
r,
|
|
2796
|
+
fill: "none",
|
|
2790
2797
|
stroke: color,
|
|
2791
|
-
strokeWidth:
|
|
2798
|
+
strokeWidth: stroke,
|
|
2799
|
+
strokeDasharray: `${dash} ${circumference - dash}`,
|
|
2800
|
+
strokeDashoffset: 0,
|
|
2801
|
+
strokeLinecap: "round",
|
|
2802
|
+
transform: `rotate(-90 ${cx} ${cy})`
|
|
2792
2803
|
}
|
|
2793
2804
|
) : null
|
|
2794
2805
|
] }),
|
|
2795
|
-
/* @__PURE__ */ jsx6(
|
|
2806
|
+
/* @__PURE__ */ jsx6(
|
|
2807
|
+
"span",
|
|
2808
|
+
{
|
|
2809
|
+
className: "vos-donut-num vos-num",
|
|
2810
|
+
style: { fontSize: size > 60 ? 20 : 14 },
|
|
2811
|
+
children: Math.round(value)
|
|
2812
|
+
}
|
|
2813
|
+
)
|
|
2796
2814
|
] });
|
|
2797
2815
|
}
|
|
2798
2816
|
|
|
@@ -2962,35 +2980,10 @@ function ExperimentDetail({
|
|
|
2962
2980
|
}
|
|
2963
2981
|
)
|
|
2964
2982
|
] }),
|
|
2965
|
-
beliefs.length > 0 ? /* @__PURE__ */ jsx7("div", { className: "vos-reading-quotes", children: beliefs.map((b) => {
|
|
2966
|
-
const justification = String(b["Grading justification"] ?? "");
|
|
2967
|
-
if (!justification) return null;
|
|
2968
|
-
return /* @__PURE__ */ jsxs7(
|
|
2969
|
-
"div",
|
|
2970
|
-
{
|
|
2971
|
-
className: `vos-reading-rationale vos-verdict-border-${verdictTone2(b.Result)}`,
|
|
2972
|
-
children: [
|
|
2973
|
-
/* @__PURE__ */ jsxs7("span", { className: "vos-reading-quote-id vos-num", children: [
|
|
2974
|
-
b.assumptionId,
|
|
2975
|
-
" \xB7"
|
|
2976
|
-
] }),
|
|
2977
|
-
/* @__PURE__ */ jsx7("span", { className: "vos-reading-rationale-label", children: "grading rationale:" }),
|
|
2978
|
-
justification
|
|
2979
|
-
]
|
|
2980
|
-
},
|
|
2981
|
-
b.assumptionId
|
|
2982
|
-
);
|
|
2983
|
-
}) }) : null,
|
|
2984
|
-
/* @__PURE__ */ jsxs7("div", { className: "vos-reading-beliefs-label", children: [
|
|
2985
|
-
"ADDRESSES ",
|
|
2986
|
-
beliefs.length,
|
|
2987
|
-
" BELIEF",
|
|
2988
|
-
beliefs.length === 1 ? "" : "S",
|
|
2989
|
-
":"
|
|
2990
|
-
] }),
|
|
2991
2983
|
beliefs.map((b) => {
|
|
2992
2984
|
const bl = barLines.find((x) => x.assumptionId === b.assumptionId);
|
|
2993
2985
|
const a = (assumptions.records ?? []).find((x) => String(x.id) === b.assumptionId);
|
|
2986
|
+
const justification = String(b["Grading justification"] ?? "");
|
|
2994
2987
|
return /* @__PURE__ */ jsxs7("div", { className: `vos-belief-card vos-verdict-border-${verdictTone2(b.Result)}`, children: [
|
|
2995
2988
|
/* @__PURE__ */ jsxs7("div", { className: "vos-belief-head", children: [
|
|
2996
2989
|
/* @__PURE__ */ jsx7(
|
|
@@ -3006,7 +2999,12 @@ function ExperimentDetail({
|
|
|
3006
2999
|
/* @__PURE__ */ jsx7("span", { className: `vos-pill vos-pill-${verdictTone2(b.Result)}`, children: b.Result }),
|
|
3007
3000
|
/* @__PURE__ */ jsx7("span", { className: "vos-rung-tag", children: String(r.Rung ?? "") })
|
|
3008
3001
|
] }),
|
|
3002
|
+
justification ? /* @__PURE__ */ jsxs7("div", { className: `vos-belief-rationale vos-verdict-border-${verdictTone2(b.Result)}`, children: [
|
|
3003
|
+
/* @__PURE__ */ jsx7("span", { className: "vos-belief-rationale-label", children: "grading rationale:" }),
|
|
3004
|
+
justification
|
|
3005
|
+
] }) : null,
|
|
3009
3006
|
bl ? /* @__PURE__ */ jsxs7("div", { className: "vos-belief-bar", children: [
|
|
3007
|
+
/* @__PURE__ */ jsx7("div", { className: "vos-belief-bar-label", children: "Pre-registered bar" }),
|
|
3010
3008
|
/* @__PURE__ */ jsxs7("div", { children: [
|
|
3011
3009
|
/* @__PURE__ */ jsx7("strong", { children: "Right if:" }),
|
|
3012
3010
|
" ",
|
|
@@ -3021,8 +3019,7 @@ function ExperimentDetail({
|
|
|
3021
3019
|
"Bar verdict: ",
|
|
3022
3020
|
/* @__PURE__ */ jsx7("strong", { children: bl.barVerdict })
|
|
3023
3021
|
] }) : null
|
|
3024
|
-
] }) : null
|
|
3025
|
-
/* @__PURE__ */ jsx7("div", { className: "vos-belief-why", children: String(b["Grading justification"] ?? "") })
|
|
3022
|
+
] }) : null
|
|
3026
3023
|
] }, b.assumptionId);
|
|
3027
3024
|
})
|
|
3028
3025
|
] })
|
|
@@ -3244,6 +3241,7 @@ function ReadingDetail({
|
|
|
3244
3241
|
/* @__PURE__ */ jsx9("span", { className: "vos-belief-rationale-label", children: "grading rationale:" }),
|
|
3245
3242
|
justification
|
|
3246
3243
|
] }) : null,
|
|
3244
|
+
body ? /* @__PURE__ */ jsx9("div", { className: "vos-belief-context-link vos-muted", children: "see context above for the full quote" }) : null,
|
|
3247
3245
|
bl ? /* @__PURE__ */ jsxs9("div", { className: "vos-belief-bar", children: [
|
|
3248
3246
|
/* @__PURE__ */ jsx9("div", { className: "vos-belief-bar-label", children: "Pre-registered bar" }),
|
|
3249
3247
|
/* @__PURE__ */ jsxs9("div", { children: [
|
|
@@ -7037,15 +7035,6 @@ function ValidationOSDashboard({ config = {} }) {
|
|
|
7037
7035
|
brandName
|
|
7038
7036
|
] }),
|
|
7039
7037
|
/* @__PURE__ */ jsxs25("div", { className: "vos-topbar", children: [
|
|
7040
|
-
backendLabel ? /* @__PURE__ */ jsxs25("div", { className: "vos-backend", children: [
|
|
7041
|
-
/* @__PURE__ */ jsx25("span", { className: "vos-live-dot" }),
|
|
7042
|
-
" Backend: ",
|
|
7043
|
-
/* @__PURE__ */ jsx25("b", { children: backendLabel })
|
|
7044
|
-
] }) : null,
|
|
7045
|
-
agentLabel ? /* @__PURE__ */ jsxs25("span", { className: "vos-hint", children: [
|
|
7046
|
-
"Agent: ",
|
|
7047
|
-
/* @__PURE__ */ jsx25("b", { style: { color: "var(--vos-text)" }, children: agentLabel })
|
|
7048
|
-
] }) : null,
|
|
7049
7038
|
/* @__PURE__ */ jsx25("div", { className: "vos-spacer" }),
|
|
7050
7039
|
/* @__PURE__ */ jsx25("button", { type: "button", className: "vos-iconbtn", onClick: toggleTheme, children: "\u25D0 Theme" }),
|
|
7051
7040
|
user?.name ? /* @__PURE__ */ jsxs25("div", { className: "vos-user", children: [
|