GoDiagram Win Reference
GoLayoutForceDirected Class
Members  Example 

GoLayoutForceDirected provides an auto-layout algorithm for graphs which utilizes a force-directed method.
Syntax
'Declaration
 
<SerializableAttribute()>
Public Class GoLayoutForceDirected 
   Inherits GoLayout
[SerializableAttribute()]
public class GoLayoutForceDirected : GoLayout 
Remarks
The graph is viewed as a system of bodies with forces acting between the bodies. The algorithm seeks a configuration of the bodies with locally minimal energy, i.e., a position such that the sum of the forces on each body is zero.
Example
Typical usage: To lay out only a portion of a document, you will need to construct a GoLayoutForceDirectedNetwork, initialize it with just the nodes and links that you want to use, and set the Network property. Read the GoLayout User Guide for more details.
GoDocument doc = goView1.Document;
doc.StartTransaction();
GoLayoutForceDirected layout = new GoLayoutForceDirected();
layout.Document = doc;
// ...maybe set other properties...
layout.PerformLayout();
doc.FinishTransaction("layout");
GoDocument doc = goView1.Document;
doc.StartTransaction();
GoLayoutForceDirected layout = new GoLayoutForceDirected();
layout.Document = doc;
layout.Network = layout.CreateNetwork();
// if you want to start off with the network representing the complete document,
// and then remove the nodes (or links) that you don't want:
layout.Network.AddNodesAndLinksFromCollection(doc, true);
foreach (GoObject obj in doc) {
  if (...obj is a node that you want to exclude from the layout...) {
    layout.Network.DeleteNode(obj);  // there is also a DeleteLink method
  }
}
// ...maybe set other properties...
layout.PerformLayout();
doc.FinishTransaction("layout");
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Northwoods.Go.Layout.GoLayout
            Northwoods.Go.Layout.GoLayoutForceDirected

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GoLayoutForceDirected Members
Northwoods.Go.Layout Namespace

 

 


© 2015. Northwoods Software Corporation. All Rights Reserved.

Send Feedback