A method for determining the location of a shape to be inserted into a
diagram representing a data graph is disclosed. The method comprises
determining a starting shape within the diagram; retrieving the number of
nodes associated with the node associated with the starting shape; and
comparing a preferred number of child nodes associated with the node
associated with the starting shape to the current number of child nodes
associated with the node. The results of the comparison are used to
determine the node to be inserted in the data graph, the location of the
node in the data graph, and the location of the shape in the diagram.