mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Merge pull request #791 from knshnb/plot-fetch-n-trials
Fetch plot API when num_trials is updated
This commit is contained in:
@@ -34,6 +34,8 @@ const ContourBackend: FC<{
|
||||
study: StudyDetail | null
|
||||
}> = ({ study = null }) => {
|
||||
const studyId = study?.id
|
||||
const numCompletedTrials =
|
||||
study?.trials.filter((t) => t.state === "Complete").length || 0
|
||||
useEffect(() => {
|
||||
if (studyId === undefined) {
|
||||
return
|
||||
@@ -45,7 +47,7 @@ const ContourBackend: FC<{
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}, [studyId])
|
||||
}, [studyId, numCompletedTrials])
|
||||
return <Box id={plotDomId} sx={{ height: "450px" }} />
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ const GraphParallelCoordinateBackend: FC<{
|
||||
study: StudyDetail | null
|
||||
}> = ({ study = null }) => {
|
||||
const studyId = study?.id
|
||||
const numCompletedTrials =
|
||||
study?.trials.filter((t) => t.state === "Complete").length || 0
|
||||
useEffect(() => {
|
||||
if (studyId === undefined) {
|
||||
return
|
||||
@@ -111,7 +113,7 @@ const GraphParallelCoordinateBackend: FC<{
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}, [studyId])
|
||||
}, [studyId, numCompletedTrials])
|
||||
return <Box id={plotDomId} sx={{ height: "450px" }} />
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ const GraphRankBackend: FC<{
|
||||
study: StudyDetail | null
|
||||
}> = ({ study = null }) => {
|
||||
const studyId = study?.id
|
||||
const numCompletedTrials =
|
||||
study?.trials.filter((t) => t.state === "Complete").length || 0
|
||||
useEffect(() => {
|
||||
if (studyId === undefined) {
|
||||
return
|
||||
@@ -56,7 +58,7 @@ const GraphRankBackend: FC<{
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}, [studyId])
|
||||
}, [studyId, numCompletedTrials])
|
||||
return <Box id={plotDomId} sx={{ height: "450px" }} />
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ const GraphSliceBackend: FC<{
|
||||
study: StudyDetail | null
|
||||
}> = ({ study = null }) => {
|
||||
const studyId = study?.id
|
||||
const numCompletedTrials =
|
||||
study?.trials.filter((t) => t.state === "Complete").length || 0
|
||||
useEffect(() => {
|
||||
if (studyId === undefined) {
|
||||
return
|
||||
@@ -57,7 +59,7 @@ const GraphSliceBackend: FC<{
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
}, [studyId])
|
||||
}, [studyId, numCompletedTrials])
|
||||
return <Box id={plotDomId} sx={{ height: "450px" }} />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user