From 475eaa78e188045253ad07d60e5eb45e2bf0a87b Mon Sep 17 00:00:00 2001 From: hrntsm Date: Sun, 24 Sep 2023 21:56:23 +0900 Subject: [PATCH] Update to not redirect when selecting lines --- optuna_dashboard/ts/components/GraphHistory.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/optuna_dashboard/ts/components/GraphHistory.tsx b/optuna_dashboard/ts/components/GraphHistory.tsx index da09fb60..65f845a2 100644 --- a/optuna_dashboard/ts/components/GraphHistory.tsx +++ b/optuna_dashboard/ts/components/GraphHistory.tsx @@ -73,12 +73,14 @@ export const GraphHistory: FC<{ if (element != null && studies.length >= 1) { // @ts-ignore element.on("plotly_click", function (data) { - const link = - URL_PREFIX + - `/studies/${ - studies[Math.floor(data.points[0].curveNumber / 2)].id - }/trials?numbers=${data.points[0].x}` - window.location.href = link + if (data.points[0].data.mode !== "lines") { + const link = + URL_PREFIX + + `/studies/${ + studies[Math.floor(data.points[0].curveNumber / 2)].id + }/trials?numbers=${data.points[0].x}` + window.location.href = link + } }) return () => { // @ts-ignore