Skip to content

Commit

Permalink
Merge pull request #993 from porink0424/fix/categorical-choices-visua…
Browse files Browse the repository at this point in the history
…lization-issue

Fix plot visualization issues with categorical parameters
  • Loading branch information
c-bata authored Nov 20, 2024
2 parents 29ff5aa + d9d64bd commit dbb0862
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tslib/react/src/components/PlotParallelCoordinate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const plotCoordinate = (
if (s.distribution.type === "CategoricalDistribution") {
// categorical
const vocabArr: string[] = s.distribution.choices.map(
(c) => c?.toString() ?? "null"
(c) => c?.value ?? "null"
)
const tickvals: number[] = vocabArr.map((_, i) => i)
return {
Expand Down
2 changes: 1 addition & 1 deletion tslib/react/src/components/PlotSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const plotSlice = (
}
} else {
const vocabArr = selectedParamSpace.distribution.choices.map(
(c) => c?.toString() ?? "null"
(c) => c?.value ?? "null"
)
const tickvals: number[] = vocabArr.map((_v, i) => i)
layout.xaxis = {
Expand Down
2 changes: 1 addition & 1 deletion tslib/react/src/components/TrialTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const TrialTable: FC<{
const sortable = s.distribution.type !== "CategoricalDistribution"
const filterChoices: (string | null)[] | undefined =
s.distribution.type === "CategoricalDistribution"
? s.distribution.choices.map((c) => c?.toString() ?? "null")
? s.distribution.choices.map((c) => c?.value ?? "null")
: undefined
const hasMissingValue = trials.some(
(t) => !t.params.some((p) => p.name === s.name)
Expand Down

0 comments on commit dbb0862

Please sign in to comment.