diff --git a/client/src/components/categorical/value/index.js b/client/src/components/categorical/value/index.js index f40a9a99..c04af970 100644 --- a/client/src/components/categorical/value/index.js +++ b/client/src/components/categorical/value/index.js @@ -453,7 +453,9 @@ class CategoryValue extends React.Component { label, CHART_WIDTH, VALUE_HEIGHT - ) ?? {}; + ) ?? {}; // if createHistogramBins returns empty object assign null to deconstructed + + if (!xScale || !yScale || !bins) return null; return ( { - const { obsOrVarContinuousFieldDisplayName } = this.props; + const { obsOrVarContinuousFieldDisplayName, bins } = this.props; if ( prevProps.obsOrVarContinuousFieldDisplayName !== - obsOrVarContinuousFieldDisplayName + obsOrVarContinuousFieldDisplayName || + prevProps.bins !== bins ) this.drawHistogram(); };