Add missing value filter

This commit is contained in:
nabenabe0928
2023-12-28 07:37:39 +01:00
parent 8e86bc6c0e
commit 797a8cdce5
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -282,7 +282,7 @@ function DataGridHeaderColumn<T>(props: {
<CheckBoxOutlineBlankIcon color="primary" />
)}
</ListItemIcon>
{choice}
{choice ?? "(missing value)"}
</MenuItem>
))}
</Menu>
@@ -87,20 +87,26 @@ export const TrialTable: FC<{
}))
columns.push(...objectiveColumns)
}
const isDynamicSpace =
studyDetail?.union_search_space.length !==
studyDetail?.intersection_search_space.length
studyDetail?.union_search_space.forEach((s) => {
const sortable = s.distribution.type !== "CategoricalDistribution"
const filterChoices =
s.distribution.type === "CategoricalDistribution"
? s.distribution.choices.map((c) => c.value)
: undefined
const filterChoicesWithNull: (string | null)[] | undefined = filterChoices
? [...filterChoices, null]
: undefined
columns.push({
field: "params",
label: `Param ${s.name}`,
toCellValue: (i) =>
trials[i].params.find((p) => p.name === s.name)
?.param_external_value || null,
trials[i].params.find((p) => p.name === s.name)?.param_external_value ||
null,
sortable: sortable,
filterChoices: filterChoices,
filterChoices: isDynamicSpace ? filterChoicesWithNull : filterChoices,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
less: (firstEl, secondEl, _): number => {
const firstVal = firstEl.params.find(