pub struct GraphEditor<'a, G: GraphAdapter> { /* private fields */ }Expand description
A graph editor to render and manipulate a graph throw the GraphAdapter trait.
Implementations§
Source§impl<'a, G: GraphAdapter> GraphEditor<'a, G>
impl<'a, G: GraphAdapter> GraphEditor<'a, G>
Sourcepub fn new(graph: G, id_source: impl Hash) -> Self
pub fn new(graph: G, id_source: impl Hash) -> Self
Creates a new GraphEditor.
Source§impl<'a, G: GraphAdapter> GraphEditor<'a, G>
impl<'a, G: GraphAdapter> GraphEditor<'a, G>
Sourcepub fn look_at(self, pos: Pos) -> Self
pub fn look_at(self, pos: Pos) -> Self
Move the viewport to make pos on the center of the viewport.
Sourcepub fn grid_stroke(self, stroke: impl Into<Stroke>) -> Self
pub fn grid_stroke(self, stroke: impl Into<Stroke>) -> Self
The stroke used to render the background grid.
Use Stroke::NONE to disable the grid.
Sourcepub fn view_aspect(self, view_aspect: f32) -> Self
pub fn view_aspect(self, view_aspect: f32) -> Self
width / height ratio of the editor region.
By default no fixed aspect ratio is set (and width/height will fill the ui it is in).
Sourcepub fn width(self, width: f32) -> Self
pub fn width(self, width: f32) -> Self
Width of the editor. By default it will fill the ui it is in.
If you set Self::view_aspect, the width can be calculated from the height.
Sourcepub fn height(self, height: f32) -> Self
pub fn height(self, height: f32) -> Self
Height of the editor. By default it will fill the ui it is in.
If you set Self::view_aspect, the height can be calculated from the width.
Sourcepub fn connection_renderer(
self,
connection_renderer: impl Into<ConnectionRenderer>,
) -> Self
pub fn connection_renderer( self, connection_renderer: impl Into<ConnectionRenderer>, ) -> Self
The ConnectionRenderer used to render the connections between sockets.
It can be one of the renderers defined in connection or
a CustomConnectionRenderer.
Defines a callback used to render the context menu of the editor.
See also Response::context_menu.
Defines a callback used to render the context menu of a node.
See also Response::context_menu.
Defines a callback used to render the context menu of a sockets.
See also Response::context_menu.
Source§impl<'a, G: GraphAdapter> GraphEditor<'a, G>
impl<'a, G: GraphAdapter> GraphEditor<'a, G>
Sourcepub fn show(self, ui: &mut Ui) -> GraphOutput
pub fn show(self, ui: &mut Ui) -> GraphOutput
Show the graph editor.