Skip to content

Commit

Permalink
emit 'plotly_doubleclick' events,
Browse files Browse the repository at this point in the history
  on dragbox double clicks and select/lasso double clicks
  • Loading branch information
etpinard committed Feb 15, 2016
1 parent bd6995e commit 10cded2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plots/cartesian/graph_interact.js
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
}
}

gd.emit('plotly_doubleclick', {});
gd.emit('plotly_doubleclick', null);
Plotly.relayout(gd, attrs);
}

Expand Down
2 changes: 1 addition & 1 deletion src/plots/cartesian/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
searchInfo.selectPoints(searchInfo, false);
}

gd.emit('plotly_doubleclick', {});
gd.emit('plotly_doubleclick', null);
}
else {
dragOptions.gd.emit('plotly_selected', eventData);
Expand Down

3 comments on commit 10cded2

@etpinard
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdtusz @alexcjohnson I'm debating whether we should two distinct events here.

Perhaps we could have:

  • one plotly_doubleclick fired from the draglayer while reset the axis ranges and
  • one plotly_unselect fires the selection drag box while clearing the selection

Thoughts?

@etpinard
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, the event data is set to null at the moment as per @cpsievert 's request.

Maybe we could give more info to the users? I'm open to suggestions.

@cpsievert
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • one plotly_doubleclick fired from the draglayer while reset the axis ranges and
  • one plotly_unselect fires the selection drag box while clearing the selection

👍

Please sign in to comment.