Skip to content

Commit

Permalink
Merge pull request #869 from hrntsm/Make-first-legend-item-selectable
Browse files Browse the repository at this point in the history
Update legend position in Graph components
  • Loading branch information
c-bata authored Apr 24, 2024
2 parents d1ca778 + e57a2fa commit d502d24
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions optuna_dashboard/ts/components/GraphEdf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ const plotEdf = (
b: 50,
},
template: colorTheme,
legend: {
x: 1.0,
y: 0.95,
},
}

const plotData: Partial<plotly.PlotData>[] = edfPlotInfos.map((h) => {
Expand Down
4 changes: 4 additions & 0 deletions optuna_dashboard/ts/components/GraphHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ const plotHistory = (
},
showlegend: historyPlotInfos.length === 1 ? false : true,
template: colorTheme,
legend: {
x: 1.0,
y: 0.95,
},
}

const getAxisX = (trial: Trial): number | Date => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ const plotParamImportance = (
bargroupgap: 0.1,
uirevision: "true",
template: colorTheme,
legend: {
x: 1.0,
y: 0.95,
},
}

if (document.getElementById(plotDomId) === null) {
Expand Down
4 changes: 4 additions & 0 deletions optuna_dashboard/ts/components/GraphIntermediateValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ const plotIntermediateValue = (
},
uirevision: "true",
template: colorTheme,
legend: {
x: 1.0,
y: 0.95,
},
}
if (trials.length === 0) {
plotly.react(plotDomId, [], layout)
Expand Down
4 changes: 4 additions & 0 deletions optuna_dashboard/ts/components/GraphTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ const plotTimeline = (
},
uirevision: "true",
template: colorTheme,
legend: {
x: 1.0,
y: 0.95,
},
}

const makeTrace = (bars: Trial[], state: string, color: string) => {
Expand Down

0 comments on commit d502d24

Please sign in to comment.