# [−][src]Function reingold_tilford::layout

pub fn layout<N, T>(tree: &T, root: N) -> HashMap<T::Key, Coordinate> where

N: Copy,

T: NodeInfo<N>,

Returns the coordinates for the *centre* of each node.

The origin of the coordinate system will be at the top left of the tree. The coordinates take into account the width of the left-most node and shift everything so that the left-most border of the left-most node is at 0 on the x-axis.

# Important

This algorithm *does* account for the height of nodes but this is only to allow each row of
nodes to be aligned by their centre. If your tree has some nodes at a given depth which are
significantly larger than others and you want to avoid large gaps between rows then a more
general graph layout algorithm is required.