Skip to content

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

@WickedShell

Description

@WickedShell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions