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

Add event and test for updatemenus events #1128

Merged
merged 2 commits into from
Nov 9, 2016
Merged

Conversation

rreusser
Copy link
Contributor

@rreusser rreusser commented Nov 9, 2016

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
@@ -299,6 +299,8 @@ function drawButtons(gd, gHeader, gButton, menuOpts) {
setActive(gd, menuOpts, buttonOpts, gHeader, gButton, buttonIndex);

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

gd.emit('plotly_buttonclicked', {menu: menuOpts, button: buttonOpts, active: menuOpts.active});
Copy link
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
Copy link
Contributor

etpinard commented Nov 9, 2016

💃

@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.

None yet

2 participants