plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Clicking on legend group titles should always toggle the group, even when groupclick=item

Open nicolaskruchten opened this issue 4 years ago • 5 comments

Follow up on https://github.com/plotly/plotly.js/pull/5906

nicolaskruchten avatar Aug 27 '21 20:08 nicolaskruchten

This would be a huge plus and make groupclick much more useful. I flip back and forth between the modes as I visualize data from multiple sources and each source provides multiple "views" of the same data. Sometimes all views from a producer will be unhelpful but sometimes a producer that produces many views will have one useful view. So in that case I want be able to easily say "Give me all views from producer 1, no views from producer 2, and the third view from producer 3" which can be cumbersome if each producer gives me up to 100 views.

If anyone has any other suggestions/workarounds in the mean time that would also be helpful.

ryanh153 avatar Oct 26 '21 19:10 ryanh153

Is this the function that would need to change? I can't identify the line it handles legend group title clicks.

https://github.com/plotly/plotly.js/blob/8050b274d5373586af5c1612c5627645cea5050d/src/components/legend/handle_click.js#L64-L70

janosh avatar Nov 30 '21 13:11 janosh

Am I missing something or you want to revert a previous work with groupclick="toggleitem" in legend ? I can't really make it work anyway

Yukams avatar Jan 20 '22 17:01 Yukams

Am I missing something or you want to revert a previous work with groupclick="toggleitem" in legend ? I can't really make it work anyway

No we are not going to revert the previous work. Just labeled it as a current bug.

archmoj avatar Jan 20 '22 17:01 archmoj

Any updates?

AhmedThahir avatar Jul 18 '22 06:07 AhmedThahir

Am I missing something or you want to revert a previous work with groupclick="toggleitem" in legend ? I can't really make it work anyway

No we are not going to revert the previous work. Just labeled it as a current bug.

If the group title is clicked then shouldn't it do togglegroup? For example, if I have groupclick = "toggleitem", I want the individual trace to be toggled, but if the group title is clicked I want the group itself to be toggled. Is there a way to implement that?

hchaudhr avatar Oct 31 '22 18:10 hchaudhr

Am I missing something or you want to revert a previous work with groupclick="toggleitem" in legend ? I can't really make it work anyway

No we are not going to revert the previous work. Just labeled it as a current bug.

If the group title is clicked then shouldn't it do togglegroup? For example, if I have groupclick = "toggleitem", I want the individual trace to be toggled, but if the group title is clicked I want the group itself to be toggled. Is there a way to implement that?

This is what exactly what I'm looking for. I really need this

AhmedThahir avatar Nov 01 '22 14:11 AhmedThahir

Hi! Could anyone please shed some light on this: Is it so that the desired behavior is to have a possibility to run a setup like Something like

        legend: {
          groupclick: 'togglegroup',
          itemclick: 'toggle',
        },

and thus toggle group via group title click and individual trace via respective trace item click? I know that for my use case this is certainly the desired behavior, just checking if there is consensus about this.

And is it so that this is not currently supported?

In my experience with 2.16.3 individual trace toggling only works with groupclick: 'toggleitem'. Confusingly, doubleclick, which if i gather correctly defaults to itemdoubleclick:'toggleothers' toggles other groups but keeps other traces within the group, item of which was double clicked, untoggled

secretwpn avatar Dec 30 '22 07:12 secretwpn