The directed trees sample demonstrates the DirectedTreeLayoutManager layout management class in Essential Diagram.
The DirectedTreeLayoutManager implements a layout management solution for the diagrams which are composed of nodes forming a directed tree graph. It lets you orient the tree in any direction around the root node by specifying a suitable angle of rotation.
This sample also demonstrates a more conventional top-to-bottom, bottom-to-top, left-to-right and right-to-left tree layouts implemented using the DirectedTreeLayoutManager.
Features
To create the DirectedTreeLayoutManager with the tree rotation as "TopToBottom" (i.e.RotationAngle =0), horizontal and vertical spacing as 50 and 60 respectively, use the following code.
DirectedTreeLayoutManager dtlm = new DirectedTreeLayoutManager(this.diagram1.Model, 0, 50, 60);
//Sets the DirectedTreeLayoutManager as responsible for updating the layout of the diagram.
this.diagram1.LayoutManager = dtlm;
// Updates the layout of the nodes in the model.
this.diagram1.LayoutManager.UpdateLayout(null);