mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-16 21:37:59 +08:00
Correctly check if mini histograms shouldn't be rendered (#1809)
* ensure that function returns a boolean value * change function used to check if mini histogram should not render
This commit is contained in:
committed by
GitHub
parent
54b42607ae
commit
437fd5feda
@@ -81,7 +81,7 @@ class CategoryValue extends React.Component {
|
||||
get shouldRenderStackedBarOrHistogram() {
|
||||
const { colorAccessor, isColorBy, annotations } = this.props;
|
||||
|
||||
return colorAccessor && !isColorBy && !annotations.isEditingLabelName;
|
||||
return !!colorAccessor && !isColorBy && !annotations.isEditingLabelName;
|
||||
}
|
||||
|
||||
handleDeleteValue = () => {
|
||||
@@ -439,7 +439,9 @@ class CategoryValue extends React.Component {
|
||||
|
||||
if (
|
||||
!this.shouldRenderStackedBarOrHistogram ||
|
||||
!AnnotationsHelpers.isContinuousAnnotation(schema, colorAccessor)
|
||||
// This function returns true on categorical annotations(when stacked bar should not render),
|
||||
// in cases where the colorAccessor is a gene this function will return undefined since genes do not live on the schema
|
||||
AnnotationsHelpers.isCategoricalAnnotation(schema, colorAccessor) === true
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user