Skip to content

Commit

Permalink
Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
keisuke-umezawa committed Nov 12, 2024
1 parent b7a1d0d commit c0a8816
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions optuna_dashboard/ts/components/GraphRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ interface RankPlotInfo {
ytitle: string
xtype: plotly.AxisType
ytype: plotly.AxisType
xvalues: (string | number | boolean)[]
yvalues: (string | number | boolean)[]
xvalues: (string | number)[]
yvalues: (string | number)[]
colors: number[]
is_feasible: boolean[]
hovertext: string[]
Expand Down Expand Up @@ -213,8 +213,8 @@ const getRankPlotInfo = (
const xAxis = getAxisInfo(filteredTrials, xParam)
const yAxis = getAxisInfo(filteredTrials, yParam)

let xValues: (string | number | boolean)[] = []
let yValues: (string | number | boolean)[] = []
let xValues: (string | number)[] = []
let yValues: (string | number)[] = []
const zValues: number[] = []
const isFeasible: boolean[] = []
const hovertext: string[] = []
Expand Down Expand Up @@ -349,12 +349,8 @@ const plotRank = (
template: colorTheme,
}

const xValues = rankPlotInfo.xvalues.map((value) =>
typeof value === "boolean" ? (value ? 1 : 0) : value
)
const yValues = rankPlotInfo.yvalues.map((value) =>
typeof value === "boolean" ? (value ? 1 : 0) : value
)
const xValues = rankPlotInfo.xvalues
const yValues = rankPlotInfo.yvalues

const plotData: Partial<plotly.PlotData>[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion tslib/react/src/utils/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type AxisInfo = {
isLog: boolean
isCat: boolean
indices: (string | number)[]
values: (string | number | boolean | null)[]
values: (string | number | null)[]
}

// biome-ignore lint/suspicious/noExplicitAny: Accept any array.
Expand Down

0 comments on commit c0a8816

Please sign in to comment.