LayoutAlgorithm

Trait LayoutAlgorithm 

Source
pub trait LayoutAlgorithm<N, E> {
    // Required methods
    fn name(&self) -> &str;
    fn apply(&mut self, graph: &mut Graph<N, E>) -> Result<()>;

    // Provided methods
    fn is_running(&self) -> bool { ... }
    fn stop(&mut self) -> Result<()> { ... }
    fn progress(&self) -> f64 { ... }
    fn can_interrupt(&self) -> bool { ... }
}
Expand description

Trait for layout algorithms

Required Methods§

Source

fn name(&self) -> &str

Name of the layout algorithm

Source

fn apply(&mut self, graph: &mut Graph<N, E>) -> Result<()>

Apply the layout to the graph

Provided Methods§

Source

fn is_running(&self) -> bool

Check if the algorithm is running

Source

fn stop(&mut self) -> Result<()>

Stop the algorithm if it’s running

Source

fn progress(&self) -> f64

Get the progress (0.0 to 1.0)

Source

fn can_interrupt(&self) -> bool

Check if the algorithm can be interrupted

Implementors§