Skip to content

Commit

Permalink
Merge pull request optuna#791 from knshnb/plot-fetch-n-trials
Browse files Browse the repository at this point in the history
Fetch plot API when num_trials is updated
  • Loading branch information
c-bata authored Feb 5, 2024
2 parents 8f95d59 + 35baab0 commit c571e1f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion optuna_dashboard/ts/components/GraphContour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,7 +47,7 @@ const ContourBackend: FC<{
.catch((err) => {
console.error(err)
})
}, [studyId])
}, [studyId, numCompletedTrials])
return <Box id={plotDomId} sx={{ height: "450px" }} />
}

Expand Down
4 changes: 3 additions & 1 deletion optuna_dashboard/ts/components/GraphParallelCoordinate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -111,7 +113,7 @@ const GraphParallelCoordinateBackend: FC<{
.catch((err) => {
console.error(err)
})
}, [studyId])
}, [studyId, numCompletedTrials])
return <Box id={plotDomId} sx={{ height: "450px" }} />
}

Expand Down
4 changes: 3 additions & 1 deletion optuna_dashboard/ts/components/GraphRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -56,7 +58,7 @@ const GraphRankBackend: FC<{
.catch((err) => {
console.error(err)
})
}, [studyId])
}, [studyId, numCompletedTrials])
return <Box id={plotDomId} sx={{ height: "450px" }} />
}

Expand Down
4 changes: 3 additions & 1 deletion optuna_dashboard/ts/components/GraphSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,7 +59,7 @@ const GraphSliceBackend: FC<{
.catch((err) => {
console.error(err)
})
}, [studyId])
}, [studyId, numCompletedTrials])
return <Box id={plotDomId} sx={{ height: "450px" }} />
}

Expand Down

0 comments on commit c571e1f

Please sign in to comment.