plotly / plotly/plotly.py

New legend_groupclick option to mix toggle item and group

Open
#5,432 4 comments 0 reactions 1 assignee View on GitHub

@alexshoe is already working on this.

Since Nov 26, 2025.

Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

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…

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.