From fa59fa5a8d6ec651b00fa82edbb47a01b62c6acc Mon Sep 17 00:00:00 2001 From: atarashansky Date: Fri, 21 Oct 2022 19:32:50 -0400 Subject: [PATCH] fix: Continuous legend properly disappears after coloring by continuous metadata and subsequently coloring by anything else (#513) * branch init * ensure colorbar is removed if asyncProps contains colorMode=color by categorical * remove log Co-authored-by: atarashansky --- client/src/components/continuousLegend/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/components/continuousLegend/index.tsx b/client/src/components/continuousLegend/index.tsx index bdac7a8c3..fa7e64812 100644 --- a/client/src/components/continuousLegend/index.tsx +++ b/client/src/components/continuousLegend/index.tsx @@ -265,7 +265,11 @@ class ContinuousLegend extends React.Component { } this.cachedAsyncProps = asyncProps; // if asyncProps is null (no colorAccessor), remove legend - if (!asyncProps) + // or if colorMode is categorical, remove legend + if ( + !asyncProps || + asyncProps.colorMode === "color by categorical metadata" + ) d3.select("#continuous_legend").selectAll("*").remove(); return null; }}