pub struct UiGraph(pub Graph<Entity, Entity, Directed, DefaultIx, DefaultNodeShape, DefaultEdgeShape>);Tuple Fields§
§0: Graph<Entity, Entity, Directed, DefaultIx, DefaultNodeShape, DefaultEdgeShape>Methods from Deref<Target = Graph<Entity, Entity, Directed, DefaultIx, DefaultNodeShape, DefaultEdgeShape>>§
pub fn node_by_screen_pos(
&self,
meta: &MetadataFrame,
screen_pos: Pos2,
) -> Option<NodeIndex<Ix>>
pub fn node_by_screen_pos( &self, meta: &MetadataFrame, screen_pos: Pos2, ) -> Option<NodeIndex<Ix>>
Finds node by position. Can be optimized by using a spatial index like quad-tree if needed.
pub fn edge_by_screen_pos(
&self,
meta: &MetadataFrame,
screen_pos: Pos2,
) -> Option<EdgeIndex<Ix>>
pub fn edge_by_screen_pos( &self, meta: &MetadataFrame, screen_pos: Pos2, ) -> Option<EdgeIndex<Ix>>
Finds edge by position.
pub fn g_mut( &mut self, ) -> &mut StableGraph<Node<N, E, Ty, Ix, Dn>, Edge<N, E, Ty, Ix, Dn, De>, Ty, Ix>
pub fn g( &self, ) -> &StableGraph<Node<N, E, Ty, Ix, Dn>, Edge<N, E, Ty, Ix, Dn, De>, Ty, Ix>
pub fn add_node(&mut self, payload: N) -> NodeIndex<Ix>
pub fn add_node(&mut self, payload: N) -> NodeIndex<Ix>
Adds node to graph setting default location and default label values
pub fn add_node_custom( &mut self, payload: N, node_transform: impl FnOnce(&mut Node<N, E, Ty, Ix, Dn>), ) -> NodeIndex<Ix>
pub fn add_node_with_location(
&mut self,
payload: N,
location: Pos2,
) -> NodeIndex<Ix>
pub fn add_node_with_location( &mut self, payload: N, location: Pos2, ) -> NodeIndex<Ix>
Adds node to graph setting custom location and default label value
pub fn add_node_with_label(
&mut self,
payload: N,
label: String,
) -> NodeIndex<Ix>
pub fn add_node_with_label( &mut self, payload: N, label: String, ) -> NodeIndex<Ix>
Adds node to graph setting default location and custom label value
pub fn add_node_with_label_and_location(
&mut self,
payload: N,
label: String,
location: Pos2,
) -> NodeIndex<Ix>
pub fn add_node_with_label_and_location( &mut self, payload: N, label: String, location: Pos2, ) -> NodeIndex<Ix>
Adds node to graph setting custom location and custom label value
pub fn remove_node(
&mut self,
idx: NodeIndex<Ix>,
) -> Option<Node<N, E, Ty, Ix, Dn>>
pub fn remove_node( &mut self, idx: NodeIndex<Ix>, ) -> Option<Node<N, E, Ty, Ix, Dn>>
Removes node by index. Returns removed node and None if it does not exist.
pub fn remove_edges_between(
&mut self,
start: NodeIndex<Ix>,
end: NodeIndex<Ix>,
) -> usize
pub fn remove_edges_between( &mut self, start: NodeIndex<Ix>, end: NodeIndex<Ix>, ) -> usize
Removes all edges between start and end node. Returns removed edges count.
pub fn add_edge(
&mut self,
start: NodeIndex<Ix>,
end: NodeIndex<Ix>,
payload: E,
) -> EdgeIndex<Ix>
pub fn add_edge( &mut self, start: NodeIndex<Ix>, end: NodeIndex<Ix>, payload: E, ) -> EdgeIndex<Ix>
Adds edge between start and end node with default label.
pub fn add_edge_with_label(
&mut self,
start: NodeIndex<Ix>,
end: NodeIndex<Ix>,
payload: E,
label: String,
) -> EdgeIndex<Ix>
pub fn add_edge_with_label( &mut self, start: NodeIndex<Ix>, end: NodeIndex<Ix>, payload: E, label: String, ) -> EdgeIndex<Ix>
Adds edge between start and end node with custom label setting correct order.
pub fn add_edge_custom( &mut self, start: NodeIndex<Ix>, end: NodeIndex<Ix>, payload: E, edge_transform: impl FnOnce(&mut Edge<N, E, Ty, Ix, Dn, De>), ) -> EdgeIndex<Ix>
pub fn remove_edge(
&mut self,
idx: EdgeIndex<Ix>,
) -> Option<Edge<N, E, Ty, Ix, Dn, De>>
pub fn remove_edge( &mut self, idx: EdgeIndex<Ix>, ) -> Option<Edge<N, E, Ty, Ix, Dn, De>>
Removes edge by index and updates order of the siblings. Returns removed edge and None if it does not exist.
pub fn edges_connecting(
&self,
start: NodeIndex<Ix>,
end: NodeIndex<Ix>,
) -> impl Iterator<Item = (EdgeIndex<Ix>, &Edge<N, E, Ty, Ix, Dn, De>)>
pub fn edges_connecting( &self, start: NodeIndex<Ix>, end: NodeIndex<Ix>, ) -> impl Iterator<Item = (EdgeIndex<Ix>, &Edge<N, E, Ty, Ix, Dn, De>)>
Returns iterator over all edges connecting start and end node.
pub fn nodes_iter(
&self,
) -> impl Iterator<Item = (NodeIndex<Ix>, &Node<N, E, Ty, Ix, Dn>)>
pub fn nodes_iter( &self, ) -> impl Iterator<Item = (NodeIndex<Ix>, &Node<N, E, Ty, Ix, Dn>)>
Provides iterator over all nodes and their indices.
pub fn edges_iter(
&self,
) -> impl Iterator<Item = (EdgeIndex<Ix>, &Edge<N, E, Ty, Ix, Dn, De>)>
pub fn edges_iter( &self, ) -> impl Iterator<Item = (EdgeIndex<Ix>, &Edge<N, E, Ty, Ix, Dn, De>)>
Provides iterator over all edges and their indices.
pub fn node(&self, i: NodeIndex<Ix>) -> Option<&Node<N, E, Ty, Ix, Dn>>
pub fn edge(&self, i: EdgeIndex<Ix>) -> Option<&Edge<N, E, Ty, Ix, Dn, De>>
pub fn edge_endpoints( &self, i: EdgeIndex<Ix>, ) -> Option<(NodeIndex<Ix>, NodeIndex<Ix>)>
pub fn node_mut( &mut self, i: NodeIndex<Ix>, ) -> Option<&mut Node<N, E, Ty, Ix, Dn>>
pub fn edge_mut( &mut self, i: EdgeIndex<Ix>, ) -> Option<&mut Edge<N, E, Ty, Ix, Dn, De>>
pub fn is_directed(&self) -> bool
pub fn edges_num(&self, idx: NodeIndex<Ix>) -> usize
pub fn edges_directed( &self, idx: NodeIndex<Ix>, dir: Direction, ) -> impl Iterator<Item = EdgeReference<'_, Edge<N, E, Ty, Ix, Dn, De>, Ix>>
pub fn selected_nodes(&self) -> &[NodeIndex<Ix>]
pub fn set_selected_nodes(&mut self, nodes: Vec<NodeIndex<Ix>>)
pub fn selected_edges(&self) -> &[EdgeIndex<Ix>]
pub fn set_selected_edges(&mut self, edges: Vec<EdgeIndex<Ix>>)
pub fn dragged_node(&self) -> Option<NodeIndex<Ix>>
pub fn set_dragged_node(&mut self, node: Option<NodeIndex<Ix>>)
pub fn hovered_node(&self) -> Option<NodeIndex<Ix>>
pub fn set_hovered_node(&mut self, node: Option<NodeIndex<Ix>>)
pub fn edge_count(&self) -> usize
pub fn node_count(&self) -> usize
pub fn set_bounds(&mut self, bounds: Rect)
pub fn bounds(&self) -> Rect
Trait Implementations§
Source§impl FromWorld for UiGraph
impl FromWorld for UiGraph
Source§fn from_world(world: &mut World) -> Self
fn from_world(world: &mut World) -> Self
Self using data from the given [World].impl Resource for UiGraph
Auto Trait Implementations§
impl Freeze for UiGraph
impl RefUnwindSafe for UiGraph
impl Send for UiGraph
impl Sync for UiGraph
impl Unpin for UiGraph
impl UnwindSafe for UiGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more