From 437fd5fedae4e312d510ef80592bb9f05c6cdb62 Mon Sep 17 00:00:00 2001 From: Severiano Badajoz Date: Tue, 1 Sep 2020 16:45:50 -0700 Subject: [PATCH] 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 --- client/src/components/categorical/value/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/components/categorical/value/index.js b/client/src/components/categorical/value/index.js index c04af970..f71df03e 100644 --- a/client/src/components/categorical/value/index.js +++ b/client/src/components/categorical/value/index.js @@ -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; }