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

New legend_groupclick option to mix toggle item and group

Open wabiloo opened this issue 1 month ago • 2 comments

For as long as I remember, placing plot legends into legendgroup caused clicking on any single legend in a group (or its title) to hide/show as a group. Then with 5.3 it became possible to toggle a single item even when in a legendgroup - as explained and illustrated in https://plotly.com/python/legend/#group-click-toggle-behavior

fig.update_layout(legend=dict(groupclick="toggleitem"))

Now, I would love it if Plotly could offer the following "mixed" behaviour:

  • when clicking on a sub-item → toggle that item
  • when clicking on the group title → toggle the whole group

That would bring the best of both worlds, in my view…

wabiloo avatar Nov 25 '25 20:11 wabiloo

@alexshoe I know you were working on this. Do we have a duplicate issue for this already?

robertclaus avatar Nov 26 '25 16:11 robertclaus

@robertclaus Not yet! Good to have this tracked. I'll add additional details to this later when I start working on this

alexshoe avatar Nov 26 '25 20:11 alexshoe