ASP.NET Pack Programmer's Guide
LayeredLayout Class
Remarks See Also
 





Implements a layered graph layout algorithm.

Namespace: MindFusion.Graphs
Package: LayeredLayout.js

 Syntax

JavaScript  Copy Code

// class
LayeredLayout.prototype = {}

 Remarks

This algorithm assigns diagram nodes to distinct horizontal or vertical layers. While arranging the layers, the layout routine seeks to meet the following criteria:

To apply this layout to a diagram, create a LayeredLayout instance, set its members and invoke the arrange method of the Diagram class. The method lays out all subgraphs in a diagram.

The final appearance of arranged graphs depends mostly on the direction value, which defines the overall orientation of the layout. The layerDistance and nodeDistance values specify how much space to leave between adjacent layers and adjacent nodes in a layer.

 Example

The following example applies a LayeredLayout to a diagram:

JavaScript  Copy Code
var layout = new MindFusion.Graphs.LayeredLayout();
layout.direction = MindFusion.Graphs.LayoutDirection.TopToBottom;
layout.siftingRounds = 3;
diagram.arrange(layout);

 See Also

LayeredLayout Members
MindFusion.Graphs Namespace