mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-10-30 13:30:17 +08:00
Add redirect to history
This commit is contained in:
1 parent
02917ab3e5
commit
186f7ac952
2 files changed
+18
-1
No files matched your search
@@ -69,6 +69,21 @@ export const GraphHistory: FC<{
|
||||
theme.palette.mode,
|
||||
markerSize
|
||||
)
|
||||
const element = document.getElementById(plotDomId)
|
||||
if (element != null && studies.length === 1) {
|
||||
// @ts-ignore
|
||||
element.on("plotly_click", function (data) {
|
||||
const link =
|
||||
URL_PREFIX +
|
||||
`/studies/${studies[0].id}}/trials?numbers=${data.points[0].x}`
|
||||
console.log(link)
|
||||
window.location.href = link
|
||||
})
|
||||
return () => {
|
||||
// @ts-ignore
|
||||
element.removeAllListeners("plotly_click")
|
||||
}
|
||||
}
|
||||
}, [studies, selected, logScale, xAxis, theme.palette.mode, markerSize])
|
||||
|
||||
const handleObjectiveChange = (event: SelectChangeEvent<string>) => {
|
||||
|
||||
@@ -42,7 +42,9 @@ export const GraphParetoFront: FC<{
|
||||
const plotTextInfo = JSON.parse(
|
||||
data.points[0].text.replace(/<br>/g, "")
|
||||
)
|
||||
const link =URL_PREFIX + `/studies/${study.id}}/trials?numbers=${plotTextInfo.number}`
|
||||
const link =
|
||||
URL_PREFIX +
|
||||
`/studies/${study.id}}/trials?numbers=${plotTextInfo.number}`
|
||||
window.location.href = link
|
||||
})
|
||||
return () => {
|
||||
|
||||
Reference in new issue
Block a user