I

IFromSketchSubtreePlacer

A IFromSketchSubtreePlacer arranges the subtrees while taking the initial locations of the nodes into account.
ImplementsInheritance Hierarchy

Remarks

It provides a comparison which sorts the outgoing edges of a node according to the initial coordinates of their target nodes. Keeping the original order of nodes, this comparison function allows to incrementally add new nodes to the graph.

See Also

Developer's Guide

Members

Show:

Methods

Creates an edge comparison which takes the initial coordinates of the nodes into account.
Creates an optional ISubtreePlacerProcessor for pre- and post-processing.
This method is called by TreeLayout before arranging the SubtreeShapes. If no pre- or post-processing is needed, this method may return null.
abstract

Parameters

treeLayout: TreeLayout
the current TreeLayout instance
graph: LayoutGraph
the input graph
currentRoot: LayoutNode
the root node handled by this ISubtreePlacer

Return Value

ISubtreePlacerProcessor
a ISubtreePlacerProcessor instance or null
Provides the direction of the connector to the SubtreeShape for each child node.
This method is called by TreeLayout before the SubtreeShapes for the children of the local root node are calculated. The direction specifiers are stored in the given map for all child nodes of the local root.
abstract

Parameters

localRoot: LayoutNode
the local root node
connectorMap: IMapper<LayoutNode, ParentConnectorDirection>
the IMapper<K, V> that is used for storing the direction specifiers of the child nodes
Arranges the SubtreeShapes of the local root and its children and routes the edges that connect them.

This method is the main method of the tree layout algorithm. It is called by TreeLayout in each recursion step to place the local root in relation to its children. Their shapes will be merged into one SubtreeShape, which is returned by this method.

The SubtreeShape for the local root can be obtained from the nodeShapeProvider. subtreeShapeProvider contains the SubtreeShapes assigned to the child nodes.

Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this method the SubtreeShape of every descendant node has already been calculated.

abstract

Parameters

nodeShapeProvider: IMapper<LayoutNode, SubtreeShape>
the IMapper<K, V> for obtaining an initial shape of the root node
subtreeShapeProvider: IMapper<LayoutNode, SubtreeShape>
the IMapper<K, V> for accessing the pre-calculated shapes of the subtrees
graph: LayoutGraph
the input graph
localRoot: LayoutNode
the root of the subtree that should be arranged by this method
parentConnectorDirection: ParentConnectorDirection
the direction specifier for the connector of the local root node to its parent node

Return Value

SubtreeShape
the combined shape of the whole subtree