﻿ NForceDirectedGraphLayout Class
Nevron Open Vision Documentation
Nevron.Nov.Diagram.Layout Namespace / NForceDirectedGraphLayout Class
Members

In This Topic
NForceDirectedGraphLayout Class
In This Topic
The NForceDirectedGraphLayout 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
Syntax
```'Declaration

Public MustInherit Class NForceDirectedGraphLayout
Inherits NGraphLayout
Implements Nevron.Nov.Dom.INDomDeepEquals, Nevron.Nov.Dom.INDomDeeplyCloneable, Nevron.Nov.INDeeplyCloneable ```
```'Usage

Dim instance As NForceDirectedGraphLayout```
`public abstract class NForceDirectedGraphLayout : NGraphLayout, Nevron.Nov.Dom.INDomDeepEquals, Nevron.Nov.Dom.INDomDeeplyCloneable, Nevron.Nov.INDeeplyCloneable  `
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 respectively.
• The repulse overllaped 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
Requirements

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

See Also