From c8d77a914654bcc5f989b28f6e11eac6e32a623b Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 5 Mar 2022 02:35:41 +0900 Subject: [PATCH] Run prettier --- .../static/components/DataGrid.tsx | 15 ++-- .../static/components/GraphEdf.tsx | 21 +++-- .../static/components/GraphHistory.tsx | 30 +++++-- .../GraphHyperparameterImportances.tsx | 19 ++-- .../components/GraphIntermediateValues.tsx | 2 +- .../components/GraphParallelCoordinate.tsx | 23 ++--- .../static/components/GraphParetoFront.tsx | 38 ++++---- .../static/components/GraphSlice.tsx | 45 ++++++---- .../static/components/StudyDetail.tsx | 90 +++++++++++-------- .../static/components/StudyList.tsx | 34 +++---- 10 files changed, 185 insertions(+), 132 deletions(-) diff --git a/optuna_dashboard/static/components/DataGrid.tsx b/optuna_dashboard/static/components/DataGrid.tsx index 155965e3..b8c5b099 100644 --- a/optuna_dashboard/static/components/DataGrid.tsx +++ b/optuna_dashboard/static/components/DataGrid.tsx @@ -9,9 +9,10 @@ import { TableRow, TableSortLabel, Collapse, - IconButton, useTheme, + IconButton, + useTheme, } from "@mui/material" -import { styled } from "@mui/system"; +import { styled } from "@mui/system" import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown" import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp" import { Clear } from "@mui/icons-material" @@ -114,10 +115,10 @@ function DataGrid(props: { const emptyRows = rowsPerPage - Math.min(rowsPerPage, sortedRows.length - page * rowsPerPage) - const RootDiv = styled('div')({ + const RootDiv = styled("div")({ width: "100%", }) - const HiddenSpan = styled('span')({ + const HiddenSpan = styled("span")({ border: 0, clip: "rect(0 0 0 0)", height: 1, @@ -128,7 +129,7 @@ function DataGrid(props: { top: 20, width: 1, }) - const TableHeaderCellSpan = styled('span')({ + const TableHeaderCellSpan = styled("span")({ display: "inline-flex", }) return ( @@ -238,9 +239,9 @@ function DataGridRow(props: { handleClickFilterCell, } = props const [open, setOpen] = React.useState(false) - const theme = useTheme(); + const theme = useTheme() - const FilterableDiv = styled('div')({ + const FilterableDiv = styled("div")({ color: theme.palette.primary.main, textDecoration: "underline", cursor: "pointer", diff --git a/optuna_dashboard/static/components/GraphEdf.tsx b/optuna_dashboard/static/components/GraphEdf.tsx index 286b3262..57cb81fc 100644 --- a/optuna_dashboard/static/components/GraphEdf.tsx +++ b/optuna_dashboard/static/components/GraphEdf.tsx @@ -6,7 +6,9 @@ import { FormLabel, MenuItem, Select, - Typography, SelectChangeEvent, useTheme, + Typography, + SelectChangeEvent, + useTheme, } from "@mui/material" const plotDomId = "graph-edf" @@ -14,12 +16,10 @@ const plotDomId = "graph-edf" export const Edf: FC<{ study: StudyDetail | null }> = ({ study = null }) => { - const theme = useTheme(); + const theme = useTheme() const [objectiveId, setObjectiveId] = useState(0) - const handleObjectiveChange = ( - event: SelectChangeEvent - ) => { + const handleObjectiveChange = (event: SelectChangeEvent) => { setObjectiveId(event.target.value as number) } @@ -36,10 +36,13 @@ export const Edf: FC<{ EDF {study !== null && study.directions.length !== 1 ? ( - + Objective ID: {study.directions.map((d, i) => ( @@ -90,7 +93,10 @@ export const GraphHistory: FC<{ ) : null} - + Log y scale: - + Filter state: - + X-axis: = ({ study = null, studyId }) => { - const theme = useTheme(); + const theme = useTheme() const [objectiveId, setObjectiveId] = useState(0) const numOfTrials = study?.trials.length || 0 - const handleObjectiveChange = ( - event: SelectChangeEvent - ) => { + const handleObjectiveChange = (event: SelectChangeEvent) => { setObjectiveId(event.target.value as number) } @@ -71,14 +71,17 @@ export const GraphHyperparameterImportances: FC<{ - + Hyperparameter importance {study !== null && study.directions.length !== 1 ? ( - + }} + > Objective ID: {study.directions.map((d, i) => ( diff --git a/optuna_dashboard/static/components/GraphParetoFront.tsx b/optuna_dashboard/static/components/GraphParetoFront.tsx index 66d1b6cd..c60f450a 100644 --- a/optuna_dashboard/static/components/GraphParetoFront.tsx +++ b/optuna_dashboard/static/components/GraphParetoFront.tsx @@ -6,7 +6,9 @@ import { FormLabel, MenuItem, Select, - Typography, SelectChangeEvent, useTheme + Typography, + SelectChangeEvent, + useTheme, } from "@mui/material" const plotDomId = "graph-pareto-front" @@ -14,19 +16,15 @@ const plotDomId = "graph-pareto-front" export const GraphParetoFront: FC<{ study: StudyDetail | null }> = ({ study = null }) => { - const theme = useTheme(); + const theme = useTheme() const [objectiveXId, setObjectiveXId] = useState(0) const [objectiveYId, setObjectiveYId] = useState(1) - const handleObjectiveXChange = ( - event: SelectChangeEvent - ) => { + const handleObjectiveXChange = (event: SelectChangeEvent) => { setObjectiveXId(event.target.value as number) } - const handleObjectiveYChange = ( - event: SelectChangeEvent - ) => { + const handleObjectiveYChange = (event: SelectChangeEvent) => { setObjectiveYId(event.target.value as number) } @@ -41,13 +39,16 @@ export const GraphParetoFront: FC<{ {study !== null && study.directions.length !== 1 ? ( - + Pareto Front - + Objective X ID: - + Objective Y ID: {study.directions.map((d, i) => ( @@ -79,10 +82,13 @@ export const GraphSlice: FC<{ ) : null} - + Parameter - + Log y scale: { } export const StudyDetail: FC = () => { - const theme = useTheme(); + const theme = useTheme() const action = actionCreator() const { studyId } = useParams() const studyIdNumber = parseInt(studyId, 10) @@ -69,7 +71,7 @@ export const StudyDetail: FC = () => { useEffect(() => { const localStoragePreferences = localStorage.getItem("savedPref") if (localStoragePreferences !== null) { - const merged = {...preferences, ...JSON.parse(localStoragePreferences)} + const merged = { ...preferences, ...JSON.parse(localStoragePreferences) } setPreferences(merged) } }, []) @@ -114,11 +116,13 @@ export const StudyDetail: FC = () => { return (
- + Preferences { label="Slice" /> - Reload Interval + + Reload Interval +