Skip to content

Add legendgroup for annotations #4680

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

Closed
ryandrew14 opened this issue Mar 25, 2020 · 8 comments
Closed

Add legendgroup for annotations #4680

ryandrew14 opened this issue Mar 25, 2020 · 8 comments

Comments

@ryandrew14
Copy link

One common use case I have run into for annotations is in multi-trace plots to have a series of annotations (one per trace) that each describe the same quality in their respective data. For use cases like this, where annotations are associated with specific traces, it would be awesome to be able to give them a legendgroup attribute so that they can be shown/hidden in the exact same situations as the traces they correspond to (turns out it's hard to replicate Plotly's native trace show/hide behavior with plotly_legendclick/doubleclick).

@ryandrew14
Copy link
Author

@nicolaskruchten not sure who to go to, but are you open to a PR with this feature?

@nicolaskruchten
Copy link
Contributor

Interesting idea! I think that would make sense to me, yes. @alexcjohnson thoughts? Better to tie it to a trace UID instead maybe?

@alexcjohnson
Copy link
Collaborator

Yeah, nice! I think I agree with @nicolaskruchten that tying to a trace UID would be cleaner. That way you can still group traces using legendgroup without needing to keep track of that on the annotations; and if we ever get around to highlighting the hovered trace that could also flow through to the annotation independent of legendgroup.

Also would be cool to do the same thing for shapes!

Now, what attribute name? Perhaps showwithtrace? linkedtrace? The attribute value would be a string, and the annotation would only be visible if a trace with matching uid attribute is also visible.

@ryandrew14
Copy link
Author

Interesting! I have actually never come upon the trace uid -- could you point me to some documentation for how I'd discover and link it?

@gohsu
Copy link

gohsu commented Nov 18, 2022

Hi! Any update on this? Would be a really useful feature to have.

@gvwilson
Copy link
Contributor

gvwilson commented Jul 4, 2024

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

@gvwilson gvwilson closed this as completed Jul 4, 2024
@daltunay
Copy link

I would still be interested by this feature. Currently using plotly==5.24.1.

@ssaunders-hbk
Copy link

I would still be interested by this feature. Currently using plotly==5.24.1.

I agree, this would definitely be a useful feature. I use R plotly, currently plotly_4.10.4.

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

No branches or pull requests

7 participants