mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 23:28:11 +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:
@@ -81,7 +81,7 @@ class CategoryValue extends React.Component {
|
|||||||
get shouldRenderStackedBarOrHistogram() {
|
get shouldRenderStackedBarOrHistogram() {
|
||||||
const { colorAccessor, isColorBy, annotations } = this.props;
|
const { colorAccessor, isColorBy, annotations } = this.props;
|
||||||
|
|
||||||
return colorAccessor && !isColorBy && !annotations.isEditingLabelName;
|
return !!colorAccessor && !isColorBy && !annotations.isEditingLabelName;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDeleteValue = () => {
|
handleDeleteValue = () => {
|
||||||
@@ -439,7 +439,9 @@ class CategoryValue extends React.Component {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
!this.shouldRenderStackedBarOrHistogram ||
|
!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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user