Merge pull request #791 from knshnb/plot-fetch-n-trials

Fetch plot API when num_trials is updated
This commit is contained in:
c-bata
2024-02-05 09:36:10 +09:00
committed by GitHub
4 changed files with 12 additions and 4 deletions
@@ -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" }} />
}
+3 -1
View File
@@ -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" }} />
}