mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-23 13:30:25 +08:00
Fix CLS issue
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as plotly from "plotly.js-dist-min"
|
||||
import React, { ChangeEvent, FC, useEffect, useState } from "react"
|
||||
import {
|
||||
Box,
|
||||
Grid,
|
||||
FormControl,
|
||||
FormLabel,
|
||||
@@ -163,7 +164,12 @@ export const GraphHistory: FC<{
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item xs={9}>
|
||||
<div id={plotDomId} />
|
||||
<Box
|
||||
id={plotDomId}
|
||||
sx={{
|
||||
height: "450px",
|
||||
}}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
)
|
||||
|
||||
@@ -89,21 +89,19 @@ export const StudyHistory: FC<{ studyId: number }> = ({ studyId }) => {
|
||||
</CardContent>
|
||||
</Card>
|
||||
) : null}
|
||||
{studyDetail !== null ? (
|
||||
<Card
|
||||
sx={{
|
||||
margin: theme.spacing(2),
|
||||
}}
|
||||
>
|
||||
<CardContent>
|
||||
<GraphHistory
|
||||
studies={[studyDetail]}
|
||||
includePruned={includePruned}
|
||||
logScale={logScale}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
) : null}
|
||||
<Card
|
||||
sx={{
|
||||
margin: theme.spacing(2),
|
||||
}}
|
||||
>
|
||||
<CardContent>
|
||||
<GraphHistory
|
||||
studies={studyDetail !== null ? [studyDetail] : []}
|
||||
includePruned={includePruned}
|
||||
logScale={logScale}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Grid2 container spacing={2} sx={{ padding: theme.spacing(0, 2) }}>
|
||||
{studyDetail !== null &&
|
||||
studyDetail.directions.length == 1 &&
|
||||
|
||||
@@ -201,6 +201,9 @@ export const useObjectiveAndUserAttrTargetsFromStudies = (
|
||||
defaultTarget.identifier()
|
||||
)
|
||||
const minDirections = useMemo<number>(() => {
|
||||
if (studies.length === 0) {
|
||||
return 0
|
||||
}
|
||||
return studies.reduce((acc, study) => {
|
||||
return Math.min(acc, study.directions.length)
|
||||
}, Number.MAX_VALUE)
|
||||
|
||||
Reference in New Issue
Block a user