Skip to content

Commit

Permalink
Improve settings component
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Aug 28, 2024
1 parent 38c5b32 commit 36d094a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
4 changes: 2 additions & 2 deletions optuna_dashboard/ts/components/AppDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ export const AppDrawer: FC<{
left: "50%",
transform: "translate(-50%, -50%)",
overflow: "scroll",
width: "500px",
height: "400px",
width: "600px",
height: "600px",
bgcolor: "background.paper",
}}
>
Expand Down
50 changes: 28 additions & 22 deletions optuna_dashboard/ts/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import ClearIcon from "@mui/icons-material/Clear"
import {
Box,
IconButton,
Link,
MenuItem,
Select,
SelectChangeEvent,
Expand Down Expand Up @@ -68,31 +69,29 @@ export const Settings = ({ handleClose }: SettingsProps) => {
</Typography>
{theme.palette.mode === "dark" ? (
<>
<Stack direction="row" spacing={2} alignItems="center">
<Typography variant="h6">Dark Mode</Typography>
<Select
disabled
value={plotlyColorTheme.dark}
onChange={handleDarkModeColorChange}
>
{(
[{ value: "default", label: "Default" }] as {
value: PlotlyColorThemeDark
label: string
}[]
).map((v) => (
<MenuItem key={v.value} value={v.value}>
{v.label}
</MenuItem>
))}
</Select>
</Stack>
<Typography variant="h6">Dark Mode</Typography>
<Typography color="textSecondary">
Only the "Default" color scale is supported in dark mode
</Typography>
<Select
disabled
value={plotlyColorTheme.dark}
onChange={handleDarkModeColorChange}
>
{(
[{ value: "default", label: "Default" }] as {
value: PlotlyColorThemeDark
label: string
}[]
).map((v) => (
<MenuItem key={v.value} value={v.value}>
{v.label}
</MenuItem>
))}
</Select>
</>
) : (
<Stack direction="row" spacing={2} alignItems="center">
<>
<Typography variant="h6">Light Mode</Typography>
<Select
value={plotlyColorTheme.light}
Expand All @@ -114,7 +113,7 @@ export const Settings = ({ handleClose }: SettingsProps) => {
</MenuItem>
))}
</Select>
</Stack>
</>
)}
</Stack>

Expand All @@ -123,7 +122,14 @@ export const Settings = ({ handleClose }: SettingsProps) => {
variant="h5"
sx={{ fontWeight: theme.typography.fontWeightBold }}
>
Use Plotlypy
Use Plotly Python library
</Typography>
<Typography color="textSecondary">
{"If enabled, the plots will be rendered using the "}
<Link href="https://optuna.readthedocs.io/en/stable/reference/visualization/index.html">
optuna.visualization module
</Link>
.
</Typography>
<Switch
checked={plotBackendRendering}
Expand Down

0 comments on commit 36d094a

Please sign in to comment.