blitzarx1 / egui_graphs

Interactive graph visualization widget for rust powered by egui and petgraph
https://docs.rs/crate/egui_graphs
MIT License
388 stars 29 forks source link

upgrade egui dependency to 0.28 #195

Closed nacl42 closed 1 month ago

nacl42 commented 1 month ago

The library looks very promising and I enjoyed the examples.

As a next step, I wanted to integrate a simple graph in my own application (egui_graphs = "0.20.0", petgraph = "0.6.5"). This fails whenever I use egui_graph in conjunction with egui or eframe in the version 0.28. The actual error message is:

error[E0277]: the trait bound `&mut egui_graphs::GraphView<'_, (), ()>: eframe::egui::Widget` is not satisfied
    --> src/graph.rs:35:16
     |
35   |         ui.add(widget);
     |            --- ^^^^^^ the trait `for<'a> FnMut(&'a mut eframe::egui::Ui)` is not implemented for `&mut egui_graphs::GraphView<'_, (), ()>`, which is required by `&mut egui_graphs::GraphView<'_, (), ()>: eframe::egui::Widget`
     |            |
     |            required by a bound introduced by this call
     |
     = help: the following other types implement trait `eframe::egui::Widget`:
               &eframe::epaint::PaintStats
               &mut eframe::egui::Frame
               &mut eframe::egui::Margin
               &mut eframe::egui::Rounding
               &mut eframe::egui::Shadow
               &mut eframe::egui::Stroke
               &mut eframe::epaint::TessellationOptions
               eframe::egui::Button<'_>
             and 15 others
     = note: required for `&mut egui_graphs::GraphView<'_, (), ()>` to implement `for<'a> FnOnce(&'a mut eframe::egui::Ui)`
     = note: required for `&mut egui_graphs::GraphView<'_, (), ()>` to implement `eframe::egui::Widget`
note: required by a bound in `eframe::egui::Ui::add`
    --> /home/nv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.28.1/src/ui.rs:1309:40
     |
1309 |     pub fn add(&mut self, widget: impl Widget) -> Response {
     |                                        ^^^^^^ required by this bound in `Ui::add`

I reproduced this by increasing the egui version to 0.28 in one of the examples from the egui_graphs crate.

Would it be possible for you to update your dependencies? I know that this might involve some work, as egui is in a constant flow. However, your help would be really appreciated.

blitzarx1 commented 1 month ago

Hey! thanks for the trying out the lib. I 've bumped the version and will make new release.

blitzarx1 commented 1 month ago

You can find updated version on v0.21.0

nacl42 commented 1 month ago

Thanks so very much for your quick help! I can confirm that it is working now and I can now start to implement the graphs into my app.