Apply formatter

This commit is contained in:
porink0424
2024-04-17 19:08:00 +09:00
parent 5d74323c21
commit 99ab2cbaff
2 changed files with 26 additions and 23 deletions
+20 -18
View File
@@ -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>
+6 -5
View File
@@ -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]