blitzarx1 / egui_graphs

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

Let `to_graph_custom` accept generic closures #131

Closed oisyn closed 11 months ago

oisyn commented 11 months ago

This PR lets egui_graphs::to_graph_custom accept generic functions and closures.

This was still possible in 0.15, but unfortunately, starting from 0.16 it only accepts bare function pointers. This has the downside that it's no longer possible to reference external state while transforming a graph. Well, unless you hack something together using global variables but I was unwilling to go that route 😉.

blitzarx1 commented 11 months ago

Good point!