From 0699f4e4e7b8ec409afb9cfc9df335e3775797e9 Mon Sep 17 00:00:00 2001 From: Harman Waseer <2403hwaseer@gmail.com> Date: Mon, 22 Feb 2021 15:08:21 +0530 Subject: [PATCH] Enable multi-parameter visualisation for plot_slice --- .../static/components/GraphSlice.tsx | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/optuna_dashboard/static/components/GraphSlice.tsx b/optuna_dashboard/static/components/GraphSlice.tsx index 0ae8db2c..c2cb3204 100644 --- a/optuna_dashboard/static/components/GraphSlice.tsx +++ b/optuna_dashboard/static/components/GraphSlice.tsx @@ -125,16 +125,21 @@ export const GraphSlice: FC<{ color: "#185799" } } - updatelayout["xaxis2"] = { - title: paramName, - zerolinecolor: "#f2f5fa", - zerolinewidth: 1.5, - linecolor: "#f2f5fa", - linewidth: 5, - gridcolor: "#f2f5fa", - gridwidth:1, - - } + + type foo = keyof plotly.Layout + //@ts-ignore + const axisname:foo = `xaxis${i}` + //@ts-ignore + updatelayout[axisname] = { + title: paramName, + zerolinecolor: "#f2f5fa", + zerolinewidth: 1.5, + linecolor: "#f2f5fa", + linewidth: 5, + gridcolor: "#f2f5fa", + gridwidth:1, + } + } traces.push(trace) i++