egui/crates/egui_plot
jayzhudev e13cc69d76
Add a public API for overriding plot legend traces' visibilities (#3534)
Added a public API in `egui_plot -> legend` to allow `hidden_items` to
be overridden in the plot legend widget. This allows convenient control
of traces' visibilities the selection of traces from the application
code.

### Example
```rust
    let legend_config = if plot_selection_changed {
        let hidden_items = match plot_selection {
            PlotSelection::SelectAll => Vec::new(),
            PlotSelection::DeselectAll => all_trace_names,
        };

        Legend::default()
            .position(Corner::RightTop)
            .hidden_items(hidden_items) // Overrides `hidden_items`
    } else {
        Legend::default().position(Corner::RightTop)
    };

    Plot::new(id)
        .legend(legend_config)
        .show(ui, draw_plot);
```

Closes <https://github.com/emilk/egui/issues/3533>.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-01-06 22:35:54 +01:00
..
src Add a public API for overriding plot legend traces' visibilities (#3534) 2024-01-06 22:35:54 +01:00
CHANGELOG.md Release `egui_plot` 0.24.2 (#3763) 2024-01-03 09:42:56 +01:00
Cargo.toml Add @Bromeon and @EmbersArc as CODEOWNERS for egui_plot (#3711) 2023-12-21 09:08:16 +01:00
README.md Break out plotting to own crate `egui_plot` (#3282) 2023-08-27 17:22:49 +02:00

README.md

egui_plot

Latest version Documentation unsafe forbidden MIT Apache

Immediate mode plotting for egui.