emilk / emilk/egui_plot

Legend: Allow hiding an element from the legend, while leacving it drawn

Open
#228 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
468
Forks
108
Avg merge
15m
Merged PRs (30d)
3

Description

**Is your feature request related to a problem? Please describe.**
With the recent addition of spans (very happy with them by the way). There's a fair amount of information that can be hinted to the user directly with the label on the span. When there are many spans used this ends up filling the legend with excess information that is already directly duplicated on screen with the spans label.

As a concrete example, I'm using it to indicate vehicle modes here, but the information clutters the legend, and makes it obscure far more then it needs to.

Image

**Describe the solution you'd like**
I'd like to look at extending the legend API to have something similar to `hidden_items`, but instead of toggling visibility on the plot I want to use it to control if the item is added to the legend at all.

**Describe alternatives you've considered**
A different option would be to make it so that spans, or plot items could explicitly have their visibility in the legend toggled on the item, but it didn't seem like it necessarily fit well with the rest.

**Additional context**
I'm actually happy to take a stab at getting this done, just wanted to look at the API first.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.