diff --git a/src/components/continuous/histogramBrush.js b/src/components/continuous/histogramBrush.js index 49241253..4ac59c34 100644 --- a/src/components/continuous/histogramBrush.js +++ b/src/components/continuous/histogramBrush.js @@ -36,6 +36,7 @@ class HistogramBrush extends React.Component { this.width = 300; this.height = 100; this.marginBottom = 20; + this.histogramCache = {}; this.state = { svg: null, @@ -55,8 +56,6 @@ class HistogramBrush extends React.Component { nextProps.metadataField ); - this.histogramCache = {}; - this.histogramCache.x = d3 .scaleLinear() .domain([nextProps.ranges.min, nextProps.ranges.max]) @@ -81,7 +80,7 @@ class HistogramBrush extends React.Component { componentWillReceiveProps(nextProps) { if ( this.props.metadataField !== nextProps.metadataField || - !this.histogramCache + !this.histogramCache.x ) { this.calcHistogramCache(nextProps); }