Skip to content

Commit

Permalink
feat: fix legend rendering error for null category
Browse files Browse the repository at this point in the history
  • Loading branch information
neindochoh committed Sep 26, 2023
1 parent 31bdb5b commit 0311535
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/shared/Plot/Legend/CategoricalLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export const CategoricalTransferFunctionLegend: React.FunctionComponent<
const map = transferFunction.domain.map((v) => {
const label = isCategorical(transferFunction.dType)
? transferFunction.dType.invertedCategories[v] ?? 'None'
: v === null
? 'null'
: v.toString();
return { label, color: transferFunction(v) };
});
Expand Down

0 comments on commit 0311535

Please sign in to comment.