Skip to content

Commit

Permalink
fix: Continuous legend properly disappears after coloring by continuo…
Browse files Browse the repository at this point in the history
…us 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 <atarashansky@CZIMACOS3990.hsd1.ma.comcast.net>
  • Loading branch information
atarashansky and atarashansky authored Oct 21, 2022
1 parent a75caf1 commit fa59fa5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/components/continuousLegend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ class ContinuousLegend extends React.Component<Props> {
}
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;
}}
Expand Down

0 comments on commit fa59fa5

Please sign in to comment.