Skip to content

Commit

Permalink
Merge pull request #1188 from hangzho/zoom-bug-in-entropy-panel
Browse files Browse the repository at this point in the history
Fix the shift/option + mouseWheel zoom bug in entropy panel
  • Loading branch information
jameshadfield authored Aug 3, 2020
2 parents 08e9522 + f0d4d59 commit fa43865
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/entropy/entropyD3.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,16 @@ EntropyChart.prototype._addBrush = function _addBrush() {
/* If selected gene or clicked on entropy, hide zoom coords */
this.props.dispatch(changeZoom([undefined, undefined]));
}
} else if (_isZoomEvent(d3event)) {
this.props.dispatch(changeZoom(this.zoomCoordinates));
}
};

/* ZoomEvent is emitted by d3-zoom when shift/option + mouseWheel on the entropy panel. */
function _isZoomEvent(d3Event) {
return d3Event && d3Event.sourceEvent && d3Event.sourceEvent.type === 'zoom';
}

/* zooms in by modifing the domain of xMain scale */
this._zoom = function _zoom(start, end) {
const s = [start, end];
Expand Down

0 comments on commit fa43865

Please sign in to comment.