Nevron .NET Vision
Nevron.Diagram.Layout Namespace / NForceDirectedLayout Class
Members


In This Topic
    NForceDirectedLayout Class
    In This Topic
    The NForceDirectedLayout class is a graph layout, which layouts the graph vertices and edges, according to the forces acting on them. It serves as base class for all types of force directed layouts.
    Object Model
    NForceDirectedLayout Class
    Syntax
    'Declaration
     
    
    <System.ComponentModel.TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)>
    Public MustInherit Class NForceDirectedLayout 
       Inherits NGraphLayout
       Implements Nevron.Diagram.INMeasurements, Nevron.Diagram.INMeasurementUnit, Nevron.Diagram.INResolution, Nevron.Dom.INAttribute, Nevron.Dom.INHistoryCallback, Nevron.INReferenceHolder, Nevron.INReferenceProvider 
    'Usage
     
    
    Dim instance As NForceDirectedLayout
    [System.ComponentModel.TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
    public abstract class NForceDirectedLayout : NGraphLayout, Nevron.Diagram.INMeasurements, Nevron.Diagram.INMeasurementUnit, Nevron.Diagram.INResolution, Nevron.Dom.INAttribute, Nevron.Dom.INHistoryCallback, Nevron.INReferenceHolder, Nevron.INReferenceProvider  
    Remarks
    The force directed layout basically implements an iterative algorithm, which tries to minimize the physical energy (reach equilibrium), enduced by the forces in the provided graph. Different force directed layouts use different sets of forces, however all forces are derived from the base NForce class.

    In general the algorithm performs the following steps:

    • fixed vertices are such vertices, which cannot be moved in both X and Y directions. Their initial placement is controlled by an instance of the NFixedVertexPlacement class, accessible from the FixedVertexPlacement property.
    • free vertices are such vertices, which can be moved in X or Y directions. Their initial placement is controlled by an instance of the NFreeVertexPlacement class, accessible from the FreeVertexPlacement property.
    • the iteration phase is repeated until all enabled forces are activated. At each iteration phase the algorithm tries to reach equilibrium in the number of iterations specified by the MaxIterations property. At each iteration the algorithm first accumulates the forces acting on all vertices and then ask the enviroment to apply them (actually move the vertices). The enviroment is represented by an instance of the NForceEnvironment class, accessible from the ForceEnvironment property.
    The force directed layout provides the following optional force model:
    • The magnetic field force tries to impose an orientation of the edges in the graph. It is represented by an instance of the NMagneticFieldForce class, accessible from the MagneticFieldForce property.
    • The bounce back force forces tries to additionally repel overlapping vertices. It is represented by an instance of the NBounceBackForce class, accessible from the BounceBackForce property.
    • The gravity force forces tries to attact the vertices to the current barycenter of the graph. It is represented by an instance of the NGravityForce class, accessible from the GravityForce property.
    All of the above mentioned forces are by default disabled and their activation pass is set to 1. In this way, if any of those forces is enabled, the graph will be given a chance to relax during the first pass, in which only the primary force model will act.
    Inheritance Hierarchy

    System.Object
       Nevron.Dom.NAttribute
          Nevron.Diagram.Layout.NLayout
             Nevron.Diagram.Layout.NGraphPartsLayout
                Nevron.Diagram.Layout.NGraphLayout
                   Nevron.Diagram.Layout.NForceDirectedLayout
                      Nevron.Diagram.Layout.NBarycenterLayout
                      Nevron.Diagram.Layout.NSpringLayout
                      Nevron.Diagram.Layout.NSymmetricalLayout

    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