From ad7fb4d1b0795cf8214b8b5067d386eec2eb47dc Mon Sep 17 00:00:00 2001 From: Harman Waseer <2403hwaseer@gmail.com> Date: Tue, 16 Feb 2021 20:22:01 +0530 Subject: [PATCH] fix errors --- optuna_dashboard/static/components/GraphSlice.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/optuna_dashboard/static/components/GraphSlice.tsx b/optuna_dashboard/static/components/GraphSlice.tsx index cea073a3..355ee889 100644 --- a/optuna_dashboard/static/components/GraphSlice.tsx +++ b/optuna_dashboard/static/components/GraphSlice.tsx @@ -44,6 +44,7 @@ export const GraphSlice: FC<{ if (paramNames.size === 0) { + plotly.react(plotDomId, []) return } @@ -78,14 +79,16 @@ export const GraphSlice: FC<{ } else{ let i=0 - let trace = { + let trace: Partial = { type: "scatter", + //@ts-ignore dimensions :dimensions, mode :"markers", xaxis : "x" } - let traces :{type: string, dimensions: { label: string; values: number[]; range: number[]; }[], mode: string, xaxis: string} [] = undefined + // let traces :{type: string, dimensions: { label: string; values: number[]; range: number[]; }[], mode: string, xaxis: string} [] = [] + let traces: Partial[]= [] paramNames.forEach((paramName) => { const valueStrings = filteredTrials.map((t) => { @@ -105,12 +108,14 @@ export const GraphSlice: FC<{ } trace = { type: "scatter", + //@ts-ignore dimensions: dimensions, mode:"markers", xaxis: `x ${i}` } - traces.push(trace) + traces.push(trace) + i++ }) const plotData: Partial[] = traces @@ -119,7 +124,5 @@ export const GraphSlice: FC<{ } } - - - + \ No newline at end of file