Search
SpringLayout Class
Remarks See Also
 





Implements the Spring-Embedder graph layout algorithm.

Namespace: MindFusion.Diagramming.Layout
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public class SpringLayout : Layout

Visual Basic  Copy Code

Public Class SpringLayout
    Inherits Layout

 Remarks

Spring-Embedder produces layouts having uniform distribution of nodes by simulating a physical system in which nodes repulse each other and the links between them act as confining springs. Nodes are moved around in an iterative process. The forces that act on a node are calculated, taking in account the positions of surrounding nodes and links from the previous iteration.

To apply this layout to a diagram, call the Arrange method of a SpringLayout instance. Arrange lays out all subgraphs in a diagram, unless the Root property is set.

If the LayoutTraits value associated with a node through SpringLayoutTraits.Frozen is true, SpringLayout considers the repulsion forces exerted by the node on other nodes, but ignores forces acting on the node and keeps it in place.

The final appearance of arranged graphs depends mostly on the values of EnableClusters and NodeDistance properties that specify how nodes are distributed by the layout routine. Enabling the MinimizeCrossings property helps to decrease the number of link crossings, though that makes the algorithm run somewhat slower.

The layout routine runs as much iterations as set in IterationCount, calculating better node positions at each step. When that stage of the algorithm completes, if Anchoring is enabled, link ends are aligned to nodes' anchor points.

The Spring-Embedder layout algorithm produces best results if it can place link ends at arbitrary positions over nodes' outlines, that is, when using the Ignore value. If your application logic requires links to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.

 Inheritance Hierarchy

System.Object
    System.MarshalByRefObject
        System.ComponentModel.Component
            MindFusion.Diagramming.Layout.Layout
                MindFusion.Diagramming.Layout.SpringLayout

 See Also