Follow-up 964: Apply color theme in PlotEdf

This commit is contained in:
c-bata
2024-09-19 16:40:55 +09:00
parent 51be0a50c9
commit fb71ea6eff
+5 -1
View File
@@ -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)