diff --git a/frontend/src/app.ts b/frontend/src/app.ts index 6cd8489..737935a 100644 --- a/frontend/src/app.ts +++ b/frontend/src/app.ts @@ -582,6 +582,10 @@ function renderLossPlaceholder(context: CanvasRenderingContext2D, width: number, } function renderLossChart(): void { + lossCanvas.hidden = state.stageKey !== "solver"; + if (lossCanvas.hidden) { + return; + } const context = lossCanvas.getContext("2d"); if (!context) { return; @@ -600,10 +604,6 @@ function renderLossChart(): void { context.lineTo(width, y); context.stroke(); } - if (state.stageKey !== "solver") { - renderLossPlaceholder(context, width, state.stageLabel, state.statusText); - return; - } const losses = state.frames .filter((frame) => typeof frame.loss === "number") .map((frame) => frame.loss as number); diff --git a/src/repixelizer/gui_static/app.js b/src/repixelizer/gui_static/app.js index d6e4e9e..fd852ac 100644 --- a/src/repixelizer/gui_static/app.js +++ b/src/repixelizer/gui_static/app.js @@ -456,6 +456,10 @@ function renderLossPlaceholder(context, width, heading, detail) { drawWrappedCanvasText(context, detail, { x: 18, y: 38, maxWidth: width - 36, lineHeight: 20 }); } function renderLossChart() { + lossCanvas.hidden = state.stageKey !== "solver"; + if (lossCanvas.hidden) { + return; + } const context = lossCanvas.getContext("2d"); if (!context) { return; @@ -474,10 +478,6 @@ function renderLossChart() { context.lineTo(width, y); context.stroke(); } - if (state.stageKey !== "solver") { - renderLossPlaceholder(context, width, state.stageLabel, state.statusText); - return; - } const losses = state.frames .filter((frame) => typeof frame.loss === "number") .map((frame) => frame.loss); diff --git a/src/repixelizer/gui_static/index.html b/src/repixelizer/gui_static/index.html index acaeed0..19eaaec 100644 --- a/src/repixelizer/gui_static/index.html +++ b/src/repixelizer/gui_static/index.html @@ -55,7 +55,7 @@ No frames yet - +
Input