Implements algorithms for arranging tree structures.
Namespace: MindFusion.Graphs
Package: TreeLayout.js
JavaScript Copy Code |
---|
// class |
To apply this layout to a diagram, create a TreeLayout instance, set its members and invoke the arrange method of the Diagram class. The method lays out all subtrees in a diagram.
As long as the graph is a tree, the algorithm can find the root node automatically. The distance between the root and the second level and between all subsequent levels can be set through the levelDistance field. The distance between adjacent nodes in the same level is set through nodeDistance.
In addition to arranging the tree nodes, TreeLayout also sets the shape of links as set through its linkType property.
The following example applies a TreeLayout to a diagram:
JavaScript Copy Code |
---|
var layout = new MindFusion.Graphs.TreeLayout(); |
MindFusion.Graphs.Layout
MindFusion.Graphs.TreeLayout