Skip to content

Commit

Permalink
Merge pull request #968 from c-bata/follow-up-964
Browse files Browse the repository at this point in the history
Follow-up 964: Apply color theme in PlotEdf
  • Loading branch information
c-bata authored Sep 19, 2024
2 parents 51be0a5 + fb71ea6 commit 982eb27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optuna_dashboard/ts/components/GraphEdf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
Expand Down

0 comments on commit 982eb27

Please sign in to comment.