Crate nodui

Source
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§

GraphEditor
A graph editor to render and manipulate a graph throw the GraphAdapter trait.
GraphOutput
The response of adding a GraphEditor to a Ui.
Pos
A position in the graph coordinates system.
RenderedSocket
Data about a socket after being rendered.

Enums§

ConnectionHint
A hint that indicates if a connection could be accepted or rejected.

Traits§

CustomConnectionRenderer
A custom ConnectionRenderer use to render the connection between sockets.
GraphAdapter
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.
NodeAdapter
An adapter that represent a node of a graph.
NodeIterator
A lending iterator over the node’s adapters of a graph.
SocketAdapter
An adapter that represent a socket of a graph.