Skip to content

Commit 4d6c155

Browse files
committed
Make each backtest window collapsible and show holdout date range in title
1 parent a7a596c commit 4d6c155

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

site/src/layouts/ForecastPage.astro

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,14 @@ const backtestBySeries = seriesIds.map((sid) => {
186186
<summary class="cursor-pointer font-semibold text-sm">Backfill testing + accuracies</summary>
187187
{back && back.windows.length > 0 ? (
188188
<div class="mt-3 space-y-4">
189-
{back.windows.map((wObj) => (
190-
<div class="rounded border border-slate-700 p-3">
191-
<div class="text-xs text-slate-300 mb-2">Backtest window {wObj.window} · actual vs predicted</div>
192-
<div class="overflow-x-auto">
189+
{back.windows.map((wObj) => {
190+
const firstScore = wObj.scores?.[0];
191+
const holdoutStart = firstScore ? String(firstScore.holdout_start) : 'n/a';
192+
const holdoutEnd = firstScore ? String(firstScore.holdout_end) : 'n/a';
193+
return (
194+
<details class="rounded border border-slate-700 p-3" open>
195+
<summary class="cursor-pointer text-xs text-slate-300 mb-2 font-semibold">Backtest window {wObj.window} · {holdoutStart}{holdoutEnd}</summary>
196+
<div class="overflow-x-auto mt-2">
193197
<svg viewBox={`0 0 ${wObj.chart.W} ${wObj.chart.H}`} class="min-w-[720px] w-full rounded bg-slate-950">
194198
<rect x={wObj.chart.PAD.l} y={wObj.chart.PAD.t} width={wObj.chart.innerW} height={wObj.chart.innerH} fill="none" stroke="#1e293b" />
195199

@@ -259,7 +263,9 @@ const backtestBySeries = seriesIds.map((sid) => {
259263
</table>
260264
</div>
261265
</div>
262-
))}
266+
</details>
267+
);
268+
})}
263269
</div>
264270
) : (
265271
<p class="mt-2 text-sm text-slate-400">No backtest rows for this series yet (need more history or windows).</p>

0 commit comments

Comments
 (0)