pub struct GraphLayout { /* private fields */ }Expand description
Graph layout engine
Implementations§
Source§impl GraphLayout
impl GraphLayout
Sourcepub fn force_directed() -> Self
pub fn force_directed() -> Self
Creates a new GraphLayout using the force-directed algorithm.
Sourcepub fn with_algorithm(self, algorithm: GraphLayoutAlgorithm) -> Self
pub fn with_algorithm(self, algorithm: GraphLayoutAlgorithm) -> Self
Sets the algorithm for the layout.
Sourcepub fn with_config(self, config: GraphLayoutConfig) -> Self
pub fn with_config(self, config: GraphLayoutConfig) -> Self
Sets the configuration for the layout.
Sourcepub fn with_repulsion(self, repulsion: f64) -> Self
pub fn with_repulsion(self, repulsion: f64) -> Self
Sets the repulsion strength for the force-directed layout.
Sourcepub fn with_attraction(self, attraction: f64) -> Self
pub fn with_attraction(self, attraction: f64) -> Self
Sets the spring strength for the force-directed layout.
Sourcepub fn with_iterations(self, iterations: usize) -> Self
pub fn with_iterations(self, iterations: usize) -> Self
Sets the number of iterations for the force-directed layout.
Sourcepub fn visualize(&self, graph: &Graph) -> Result<String>
pub fn visualize(&self, graph: &Graph) -> Result<String>
Visualizes the graph as an SVG string.
Sourcepub fn layout_graph(&self, graph: &Graph) -> Result<Layout>
pub fn layout_graph(&self, graph: &Graph) -> Result<Layout>
Computes the layout for the given graph.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphLayout
impl RefUnwindSafe for GraphLayout
impl Send for GraphLayout
impl Sync for GraphLayout
impl Unpin for GraphLayout
impl UnsafeUnpin for GraphLayout
impl UnwindSafe for GraphLayout
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