mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Apply formatter
This commit is contained in:
@@ -112,7 +112,8 @@ const ContourBackend: FC<{
|
||||
const ContourFrontend: FC<{
|
||||
study: StudyDetail | null
|
||||
}> = ({ study = null }) => {
|
||||
const [graphComponentState, setGraphComponentState] = useState<GraphComponentState>(GRAPH_COMPONENT_STATE.COMPONENT_WILL_MOUNT)
|
||||
const [graphComponentState, setGraphComponentState] =
|
||||
useState<GraphComponentState>(GRAPH_COMPONENT_STATE.COMPONENT_WILL_MOUNT)
|
||||
useEffect(() => {
|
||||
setGraphComponentState(GRAPH_COMPONENT_STATE.COMPONENT_DID_MOUNT)
|
||||
}, [])
|
||||
@@ -146,7 +147,10 @@ const ContourFrontend: FC<{
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (study != null && graphComponentState !== GRAPH_COMPONENT_STATE.COMPONENT_WILL_MOUNT) {
|
||||
if (
|
||||
study != null &&
|
||||
graphComponentState !== GRAPH_COMPONENT_STATE.COMPONENT_WILL_MOUNT
|
||||
) {
|
||||
plotContour(study, objectiveId, xParam, yParam, colorTheme)?.then(() => {
|
||||
setGraphComponentState(GRAPH_COMPONENT_STATE.GRAPH_DID_RENDER)
|
||||
})
|
||||
@@ -210,22 +214,20 @@ const ContourFrontend: FC<{
|
||||
) : null}
|
||||
</Grid>
|
||||
<Grid item xs={9}>
|
||||
<Box component="div" id={plotDomId} sx={{ height: "450px" }} >
|
||||
{
|
||||
graphComponentState !== GRAPH_COMPONENT_STATE.GRAPH_DID_RENDER && (
|
||||
<Box
|
||||
component="div"
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
<Box component="div" id={plotDomId} sx={{ height: "450px" }}>
|
||||
{graphComponentState !== GRAPH_COMPONENT_STATE.GRAPH_DID_RENDER && (
|
||||
<Box
|
||||
component="div"
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
height: "100%",
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
export const GRAPH_COMPONENT_STATE = {
|
||||
COMPONENT_WILL_MOUNT: 'componentWillMount',
|
||||
COMPONENT_DID_MOUNT: 'componentDidMount',
|
||||
GRAPH_DID_RENDER: 'graphDidRender',
|
||||
} as const;
|
||||
COMPONENT_WILL_MOUNT: "componentWillMount",
|
||||
COMPONENT_DID_MOUNT: "componentDidMount",
|
||||
GRAPH_DID_RENDER: "graphDidRender",
|
||||
} as const
|
||||
|
||||
export type GraphComponentState = typeof GRAPH_COMPONENT_STATE[keyof typeof GRAPH_COMPONENT_STATE];
|
||||
export type GraphComponentState =
|
||||
(typeof GRAPH_COMPONENT_STATE)[keyof typeof GRAPH_COMPONENT_STATE]
|
||||
|
||||
Reference in New Issue
Block a user