Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit selection events in drawmode when an existing selection modified #6262

Merged
merged 3 commits into from Jul 15, 2022

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jul 15, 2022

When a selection modified, selection events should be emitted in various drag modes i.e. including shape drawing modes,
like the example below:

Plotly.newPlot(gd, {"data": [{y: [1, 2, 3]}], "layout": {
    "dragmode": "drawrect",
    "selections": [{ x0: 0.5, x1: 1.5, y0: 1.5, y1: 2.5}]
}})

gd.on('plotly_selected', function(data) { console.log(data); });

Right now the v2.13.1 does not emit such events.
This PR fixes this bug.

@plotly/plotly_js

Copy link
Contributor

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃

@archmoj archmoj merged commit b5b32ef into master Jul 15, 2022
@archmoj archmoj deleted the selection-events-in-draw-modes branch July 15, 2022 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants