move clear context out of conditional in cont

This commit is contained in:
Colin Megill
2017-11-17 14:57:22 -08:00
parent 670b2b22c3
commit e18f57e6f2
+7 -10
View File
@@ -100,27 +100,24 @@ class Continuous extends React.Component {
processedDimensions, processedDimensions,
}) })
this.props.dispatch({
type: "parallel coordinates axes have been drawn"
})
} }
} }
maybeDrawLines(nextProps) { maybeDrawLines(nextProps) {
if ( if (
nextProps.ranges && nextProps.ranges &&
nextProps.continuousSelection && nextProps.continuousSelection &&
this.state.axes /* this may cause things to never render :/ forceUpdate? */ nextProps.axesHaveBeenDrawn /* this may cause things to never render :/ forceUpdate? */
) { ) {
if (this.state._drawLinesCanvas) { if (this.state._drawLinesCanvas) {
this.state._drawLinesCanvas.invalidate(); this.state._drawLinesCanvas.invalidate();
this.state.ctx.clearRect(0,0,width,height);
this.state.ctx.globalAlpha = d3.min([
0.85 / Math.pow(this.props.initializeMetadata.length, 0.3),
1
]);
} }
console.log( _.filter(this.state.processedMetadata, (d) => { this.state.ctx.clearRect(0,0,width,height);
return nextProps.continuousSelection.indexOf(d.CellName) > -1
}))
const _drawLinesCanvas = drawLinesCanvas( const _drawLinesCanvas = drawLinesCanvas(
_.filter(this.state.processedMetadata, (d) => { _.filter(this.state.processedMetadata, (d) => {