From 79b50cc5005eb81b841cfafc6f483f7e4251f896 Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Thu, 2 Nov 2023 04:56:25 +0100 Subject: [PATCH] Address the mamu's comment --- .../ts/components/GraphIntermediateValues.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/optuna_dashboard/ts/components/GraphIntermediateValues.tsx b/optuna_dashboard/ts/components/GraphIntermediateValues.tsx index 9ee4a36dc..7ccce6374 100644 --- a/optuna_dashboard/ts/components/GraphIntermediateValues.tsx +++ b/optuna_dashboard/ts/components/GraphIntermediateValues.tsx @@ -85,12 +85,13 @@ const plotIntermediateValue = ( (iv) => iv.value !== "inf" && iv.value !== "-inf" && iv.value !== "nan" ) const isFeasible = trial.constraints.every((c) => c <= 0) - let name = `trial #${trial.number}` - if (trial.state === "Running") { - name += ` (running)` - } else { - name += isFeasible ? `` : ` (infeasible)` - } + const name = `trial #${trial.number} ${ + trial.state === "Running" + ? "(running)" + : !isFeasible + ? " (infeasible)" + : "" + }` return { x: values.map((iv) => iv.step), y: values.map((iv) => iv.value),