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 legend click interaction attrs #3862

Merged
merged 4 commits into from
May 21, 2019
Merged

Add legend click interaction attrs #3862

merged 4 commits into from
May 21, 2019

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented May 14, 2019

currently named itemclick and itemdoubleclick, both enumerated attributes with values 'toggle',
'focus' (now 'toggleothers'), false. This PR could be viewed as a follow-up of #2581

resolves #665 by setting

layout = {
  legend: {
    itemclick: false,
    itemdoubleclick: false
  }
}

resolves #674 by setting

layout = {
  legend: {
    itemclick: 'focus'
  }
}

and should help us offer solutions for #1462 and #3135


cc @plotly/plotly_js

- both enumerated with values 'toggle', 'focus', false
@etpinard etpinard added this to the v1.48.0 milestone May 14, 2019
@antoinerg
Copy link
Contributor

Codepen with the new feature: https://codepen.io/antoinerg/pen/XwpvaO

@antoinerg
Copy link
Contributor

Once a legend item is focused and we want to focus on another one, we have to first unfocus (it requires 2 actions):
Peek 2019-05-15 11-17
It might be nice to cut that down to 1 action: it could focus right away on the newly selected legend item. In order to unfocus and display all traces, one would have to click on the legend item currently having the focus.

Now I understand this would be a breaking change and I am not even suggesting that we include this new mode in this PR. However, we should probably think ahead of time what its name would be. Maybe it could be called focus and the current focus could be called toggleothers as suggested by @nicolaskruchten?

@antoinerg
Copy link
Contributor

Thank you for adding customizability to our legend interactions @etpinard

💃 💃

@etpinard etpinard merged commit 425900e into master May 21, 2019
@etpinard etpinard deleted the legend-trace-toggle branch May 21, 2019 15:05
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.

[Enhancement] Legend and traces toggling Add ability to disable legend trace toggling
3 participants