Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/zoom-bar' into zoom-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniferChao-tc committed Jun 19, 2020
2 parents 15d4ddf + f328cc1 commit e09064e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/core/src/components/axes/zoom-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ export class ZoomBar extends Component {
// @todo find a better way to handel the situation when selection is null
// select behavior is completed, but nothing selected
if (selection === null) {
brushArea.call(this.brush.move, xScale.range()); // default to full range
this.updateBrushHandle(
this.getContainerSVG(),
xScale.range()
);
this.brushed(zoomDomain, xScale, xScale.range());
} else if (selection[0] === selection[1]) {
// select behavior is not completed yet, do nothing
} else {
Expand Down Expand Up @@ -259,10 +255,12 @@ export class ZoomBar extends Component {
];

// be aware that the value of d3.event changes during an event!
// update zoomDomain only if the event comes from mousemove event
// update zoomDomain only if the event comes from mouse event
if (
event.sourceEvent != null &&
event.sourceEvent.type === "mousemove"
(event.sourceEvent.type === "mousemove" ||
event.sourceEvent.type === "mouseup" ||
event.sourceEvent.type === "mousedown")
) {
// only if zoomDomain is never set or needs update
if (
Expand Down

0 comments on commit e09064e

Please sign in to comment.