Class ForceDirectedLayouter
Reposition the nodes in a network using a physics-based approach. The nodes are interpreted as point masses, and the connections are represented by springs. This system, along with a few additional forces such as friction and a horizontal force, is then simulated to calculate the new position of the nodes.
Inheritance
System.Object
ForceDirectedLayouter
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NodeNetwork.Toolkit.Layout.ForceDirected
Assembly: NodeNetworkToolkit.dll
Syntax
public class ForceDirectedLayouter
Methods
| Improve this Doc View SourceLayout(Configuration, Int32)
Layout the nodes in the network.
Declaration
public void Layout(Configuration config, int maxIterations)
Parameters
Type | Name | Description |
---|---|---|
Configuration | config | The configuration to use. |
System.Int32 | maxIterations | The maximum amount of iterations after which the physics simulation ends. |
LayoutAsync(Configuration, CancellationToken)
Layout the nodes in the network, updating the user interface at each iteration. This method, contrary to Layout(), lets users see the simulation as it happens. The cancellation token should be used to end the simulation.
Declaration
public async Task LayoutAsync(Configuration config, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
Configuration | config | The configuration to use. |
System.Threading.CancellationToken | token | A cancellation token to end the layout process. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The async task |