-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bba0d2
commit de2efee
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
import { useTheme } from "@mui/material" | ||
import { PlotHistory } from "@optuna/react" | ||
import React, { FC } from "react" | ||
import { useNavigate } from "react-router-dom" | ||
import { StudyDetail } from "ts/types/optuna" | ||
import { useConstants } from "../constantsProvider" | ||
import { usePlotlyColorTheme } from "../state" | ||
|
||
export const GraphHistory: FC<{ | ||
studies: StudyDetail[] | ||
logScale: boolean | ||
includePruned: boolean | ||
}> = ({ studies, logScale, includePruned }) => { | ||
const { url_prefix } = useConstants() | ||
const theme = useTheme() | ||
const colorTheme = usePlotlyColorTheme(theme.palette.mode) | ||
const linkURL = (studyId: number, trialNumber: number) => { | ||
return url_prefix + `/studies/${studyId}/trials?numbers=${trialNumber}` | ||
} | ||
const navigate = useNavigate() | ||
|
||
return ( | ||
<PlotHistory | ||
studies={studies} | ||
logScale={logScale} | ||
includePruned={includePruned} | ||
colorTheme={colorTheme} | ||
linkURL={linkURL} | ||
router={navigate} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters