Skip to content

Add event and test for updatemenus events#1128

Merged
rreusser merged 2 commits into
masterfrom
updatemenus-events
Nov 9, 2016
Merged

Add event and test for updatemenus events#1128
rreusser merged 2 commits into
masterfrom
updatemenus-events

Conversation

@rreusser

@rreusser rreusser commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

This PR adds an event for updatemenus. There's really only one event: plotly_buttonclicked. It sends the menu, the button, and the index of the active button. The analogous open/close menu options didn't seem so relevant for this case.

@rreusser rreusser added the feature something new label Nov 9, 2016

Plots.executeAPICommand(gd, buttonOpts.method, buttonOpts.args);

gd.emit('plotly_buttonclicked', {menu: menuOpts, button: buttonOpts, active: menuOpts.active});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some people have been asking for an event on legend item click.

I'm not suggesting we should have a lone event for updatemenu button click and legend item click, but we should make sure the event names are consistent.

I'm thinking plotly_buttonclicked and plotly_legendclick, unless someone find the two confusing.

@etpinard etpinard added this to the v1.20.0 milestone Nov 9, 2016
@etpinard

etpinard commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

💃

@rreusser
rreusser merged commit 40aca01 into master Nov 9, 2016
@rreusser
rreusser deleted the updatemenus-events branch November 9, 2016 22:50
GeorgeGhiottone pushed a commit to GeorgeGhiottone/plotly.js that referenced this pull request Nov 30, 2016
GeorgeGhiottone pushed a commit to GeorgeGhiottone/plotly.js that referenced this pull request Dec 1, 2016
GeorgeGhiottone pushed a commit to GeorgeGhiottone/plotly.js that referenced this pull request Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature something new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants