Skip to content

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

Merged
archmoj merged 3 commits into
masterfrom
selection-events-in-draw-modes
Jul 15, 2022
Merged

Emit selection events in drawmode when an existing selection modified#6262
archmoj merged 3 commits into
masterfrom
selection-events-in-draw-modes

Conversation

@archmoj

@archmoj archmoj commented Jul 15, 2022

Copy link
Copy Markdown
Contributor

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

@archmoj archmoj added bug something broken status: reviewable labels Jul 15, 2022

@alexcjohnson alexcjohnson left a comment

Copy link
Copy Markdown
Collaborator

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

Labels

bug something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants