Skip to main content

compute_layout

Function compute_layout 

Source
pub fn compute_layout<N, E, Ix>(
    graph: &Graph<N, E, Ix>,
    algorithm: &LayoutAlgorithm,
    width: f64,
    height: f64,
) -> Result<GraphLayout<N>>
where N: Node + Clone + Debug, E: EdgeWeight + Into<f64>, Ix: IndexType,
Expand description

Compute a graph layout using the specified algorithm

§Arguments

  • graph - The graph to lay out
  • algorithm - Which layout algorithm to use
  • width - Canvas width in pixels
  • height - Canvas height in pixels

§Returns

A GraphLayout with computed node positions