diff --git a/optuna_dashboard/ts/components/GraphContour.tsx b/optuna_dashboard/ts/components/GraphContour.tsx index 31af15f5..572cc25f 100644 --- a/optuna_dashboard/ts/components/GraphContour.tsx +++ b/optuna_dashboard/ts/components/GraphContour.tsx @@ -112,7 +112,8 @@ const ContourBackend: FC<{ const ContourFrontend: FC<{ study: StudyDetail | null }> = ({ study = null }) => { - const [graphComponentState, setGraphComponentState] = useState(GRAPH_COMPONENT_STATE.COMPONENT_WILL_MOUNT) + const [graphComponentState, setGraphComponentState] = + useState(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} - - { - graphComponentState !== GRAPH_COMPONENT_STATE.GRAPH_DID_RENDER && ( - - - - ) - } + + {graphComponentState !== GRAPH_COMPONENT_STATE.GRAPH_DID_RENDER && ( + + + + )} diff --git a/optuna_dashboard/ts/constants/graph.ts b/optuna_dashboard/ts/constants/graph.ts index 9ade0456..0f9b391e 100644 --- a/optuna_dashboard/ts/constants/graph.ts +++ b/optuna_dashboard/ts/constants/graph.ts @@ -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]; \ No newline at end of file +export type GraphComponentState = + (typeof GRAPH_COMPONENT_STATE)[keyof typeof GRAPH_COMPONENT_STATE]