From 0311535e122a2f2b93e726627aa62c3b83daeafc Mon Sep 17 00:00:00 2001 From: Dominik Haentsch Date: Tue, 26 Sep 2023 16:17:22 +0200 Subject: [PATCH] feat: fix legend rendering error for `null` category --- src/components/shared/Plot/Legend/CategoricalLegend.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/shared/Plot/Legend/CategoricalLegend.tsx b/src/components/shared/Plot/Legend/CategoricalLegend.tsx index e779bc57..0d37bd5e 100644 --- a/src/components/shared/Plot/Legend/CategoricalLegend.tsx +++ b/src/components/shared/Plot/Legend/CategoricalLegend.tsx @@ -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) }; });