mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Follow-up 964: Apply color theme in PlotEdf
This commit is contained in:
@@ -32,6 +32,8 @@ const domId = "graph-edf"
|
||||
const GraphEdfBackend: FC<{
|
||||
studies: StudyDetail[]
|
||||
}> = ({ studies }) => {
|
||||
const theme = useTheme()
|
||||
const colorTheme = usePlotlyColorTheme(theme.palette.mode)
|
||||
const { apiClient } = useAPIClient()
|
||||
const { graphComponentState, notifyGraphDidRender } = useGraphComponentState()
|
||||
|
||||
@@ -49,7 +51,9 @@ const GraphEdfBackend: FC<{
|
||||
apiClient
|
||||
.getCompareStudiesPlot(studyIds, CompareStudiesPlotType.EDF)
|
||||
.then(({ data, layout }) => {
|
||||
plotly.react(domId, data, layout).then(notifyGraphDidRender)
|
||||
plotly
|
||||
.react(domId, data, { ...layout, template: colorTheme })
|
||||
.then(notifyGraphDidRender)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
|
||||
Reference in New Issue
Block a user