#[non_exhaustive]pub struct Node {
pub id: SharedString,
pub label: SharedString,
pub category: SharedString,
pub properties: Vec<(SharedString, SharedString)>,
pub group: Option<SharedString>,
pub color: Option<Hsla>,
pub size: Option<f32>,
}Expand description
A vertex in the graph. Build with Node::new and the builder methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: SharedStringUnique id; edges refer to nodes by this.
label: SharedStringText drawn under the node.
category: SharedStringVertex type (e.g. Person). Nodes of one category share a palette color.
properties: Vec<(SharedString, SharedString)>Arbitrary key/value pairs, carried along for the host app (details panels, tooltips).
group: Option<SharedString>Community / cluster id, typically computed by the database (Louvain, label propagation, …). Members are drawn together, outlined by a hull, and can be collapsed into one node.
color: Option<Hsla>Overrides the category / group color.
size: Option<f32>Overrides NodeSizing with a fixed radius, in world units.
Implementations§
Source§impl Node
impl Node
pub fn new( id: impl Into<SharedString>, label: impl Into<SharedString>, category: impl Into<SharedString>, ) -> Self
pub fn property( self, key: impl Into<SharedString>, value: impl Into<SharedString>, ) -> Self
pub fn group(self, group: impl Into<SharedString>) -> Self
pub fn color(self, color: impl Into<Hsla>) -> Self
pub fn size(self, radius: f32) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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