Next: Horizon Tree Up: Visualization of Navigation Previous: Layout strategies

Tree layout algorithm

The layout algorithm used in the current implementation of WebMap to calculate the node positions for a spanning tree is based on the following principles: Assume a new node is to be inserted into an existing tree as child . The precondition is characterized by:

  1. All leaf nodes have even x-coordinates.
  2. The horizontal distance between two neighboring leaves is 2.
  3. The y-coordinate of the root node is zero.
The y-coordinate of incremented by one. If the x-coordinate will be the same as . 's rightmost descendant incremented by 2.

After determining the position of the new node all nodes of the tree ``above'' and ``to the right'' of are moved to a new position using a simple recursion:

This is illustrated in Fig.
5. The nodes which moved to the right after the insertion of a new node with the x-coordinate 8 are surrounded by a dotted line.

The algorithm causes each node to be located one level above its children and in the middle between its leftmost and its rightmost descendant, which means that its x-coordinate always satisfies the following equation: Here 's leftmost descendant and 's subtree. Note, that all node's coordinates are represented by integer values.



Next: Horizon Tree Up: Visualization of Navigation Previous: Layout strategies


Peter Dömel (doemel@informatik.uni-frankfurt.de)