Skip to content

fix: Properly include shapes when toggling legend visibility#7813

Merged
camdecoster merged 5 commits into
masterfrom
cam/6771/fix-legendgroup-toggling-shapes
May 29, 2026
Merged

fix: Properly include shapes when toggling legend visibility#7813
camdecoster merged 5 commits into
masterfrom
cam/6771/fix-legendgroup-toggling-shapes

Conversation

@camdecoster
Copy link
Copy Markdown
Contributor

@camdecoster camdecoster commented May 28, 2026

Description

Include shapes with legendgroup specified when handling legend visibility toggling.

Closes #6771.

Changes

  • Update shape default coercion to properly set legend, legendgroup attributes
  • Update filtering for shapes when toggling legend visibility
  • Add test

Screenshots/Videos

Before:

Screencast.From.2026-05-28.17-12-40.mp4

After:

Screencast.From.2026-05-28.17-12-04.mp4

Notes

  • There were two bugs:
    • Shapes with a legendgroup and also showlegend as false were getting filtered out of the check for handling legend clicks to toggle visibility
    • Certain shape attributes were gated behind a check on showlegend, so those attributes weren't getting populated
  • This update matches the behavior of traces and legendgroup visibility toggling

@camdecoster camdecoster changed the title Add test fix: Properly include shapes when toggling legend visibility May 28, 2026
@camdecoster camdecoster marked this pull request as ready for review May 28, 2026 23:16
emilykl
emilykl previously approved these changes May 29, 2026
Copy link
Copy Markdown
Contributor

@emilykl emilykl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@emilykl
Copy link
Copy Markdown
Contributor

emilykl commented May 29, 2026

hold up @camdecoster -- any chance the failing image test is related to these changes, since the failure is that some images are not showing up? Maybe shapes and images share some coercion logic.

edit: Never mind, unrelated

@camdecoster camdecoster merged commit dbefbad into master May 29, 2026
155 of 161 checks passed
@camdecoster camdecoster deleted the cam/6771/fix-legendgroup-toggling-shapes branch May 29, 2026 17:25
@zdimension
Copy link
Copy Markdown

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

legendgroup visibility toggling does not work for shapes when showlegend is false

3 participants