Expand description
An egui-based visual graph editor.
GraphEditor
is a egui widget which create a visual graph editor.
The visual editor and the graph data interact via the adapter traits.
struct App {
// `MyGraph` implements the `GraphAdapter` trait and hold the state for the visual editor.
graph: MyGraph,
}
impl eframe::App for App {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
let graph = nodui::GraphEditor::new(&mut self.graph, "graph");
graph.show(ui);
});
}
}
Modules§
- adapter
- Types and traits for interactions between the ui editor and the graph data.
- connection
- Renderer for the connections between sockets.
- context_
menu - Contextual information for context menu of the graph editor.
- ui
- Defines how elements should be rendered in the ui editor.
Structs§
- Graph
Editor - A graph editor to render and manipulate a graph throw the
GraphAdapter
trait. - Graph
Output - The response of adding a
GraphEditor
to aUi
. - Pos
- A position in the graph coordinates system.
- Rendered
Socket - Data about a socket after being rendered.
Enums§
- Connection
Hint - A hint that indicates if a connection could be accepted or rejected.
Traits§
- Custom
Connection Renderer - A custom
ConnectionRenderer
use to render the connection between sockets. - Graph
Adapter - An adapter for a graph to interact with a visual editor.
- Id
- A cheap-to-clone unique identifier for the nodes and the sockets of a graph.
- Node
Adapter - An adapter that represent a node of a graph.
- Node
Iterator - A lending iterator over the node’s adapters of a graph.
- Socket
Adapter - An adapter that represent a socket of a graph.