Class RadialLayout

GoDiagram®
v10.0.12
by Northwoods Software®

Given a root Node, this arranges connected nodes in concentric rings, layered by the minimum link distance from the root.

Namespace: Northwoods.Go.Layouts.Extensions
Assembly: RadialAvalonia.dll
Syntax
public class RadialLayout : NetworkLayout<RadialNetwork, RadialVertex, RadialEdge, RadialLayout>

Constructors

RadialLayout()

Create a Radial layout.

Declaration
public RadialLayout()

Properties

LayerThickness

Gets or sets the thickness of each ring representing a layer.

Declaration
public int LayerThickness { get; set; }
Property Value
Type Description
int
Remarks

The default value is 100.

MaxLayers

Gets or sets the maximum number of layers to be shown, in addition to the root node at layer zero.

Declaration
public int MaxLayers { get; set; }
Property Value
Type Description
int
Remarks

The default value is int.MaxValue.

Root

Gets or sets the Node that acts as the root or central node of the radial layout.

Declaration
public Node Root { get; set; }
Property Value
Type Description
Node

Methods

CommitLayers()

Override this method in order to create background circles indicating the layers of the radial layout.

Declaration
public virtual void CommitLayers()
Remarks

By default this method does nothing.

CommitLayout()

Commit changes to the diagram by setting Node positions and by routing the Links. This is called by UpdateParts() within a transaction.

Declaration
protected override void CommitLayout()
Overrides
Northwoods.Go.Layouts.NetworkLayout<Northwoods.Go.Layouts.Extensions.RadialNetwork, Northwoods.Go.Layouts.Extensions.RadialVertex, Northwoods.Go.Layouts.Extensions.RadialEdge, Northwoods.Go.Layouts.Extensions.RadialLayout>.CommitLayout()
Remarks

You should not call this method -- it is a "protected virtual" method. This may be overridden by subclasses of NetworkLayout. By default this method is implemented as follows:

protected virtual void CommitLayout() {
  if (Network == null) return;
  foreach (var vert in Network.Vertexes) {
    vert.Commit();
  }
  if (IsRouting) {
    foreach (var edge in Network.Edges) {
      edge.Commit();
    }
  }
}

Please read the Introduction page on Extensions for how to override methods and how to call this base method.

ComputeBreadth(RadialVertex)

Compute the proportion of arc that the given vertex should take relative to its siblings.

Declaration
public virtual double ComputeBreadth(RadialVertex v)
Parameters
Type Name Description
RadialVertex v
Returns
Type Description
double
Remarks

The default behavior is to give each child arc according to the sum of the maximum breadths of each of its children. This assumes that all nodes have the same breadth -- i.e. that they will occupy the same sweep of arc. It does not take the Node.ActualBounds into account, nor the angle at which the node will be location relative to the origin, nor the distance the node will be from the root node.

In order to give each child of a vertex the same fraction of arc, override this method:

public override double ComputeBreadth(RadialVertex v) { return 1; }

In order to give each child of a vertex a fraction of arc proportional to how many children the child has:

public override double ComputeBreadth(RadialVertex v) { return Math.Max(1, v.Children.Count); }

DoLayout(IEnumerable<Part>)

Find distances between root and vertexes, and then lay out radially.

Declaration
public override void DoLayout(IEnumerable<Part> coll = null)
Parameters
Type Name Description
IEnumerable<Part> coll
Overrides

RotateNode(Node, double, double, double)

Override this method in order to modify each node as it is laid out.

Declaration
public virtual void RotateNode(Node node, double angle, double sweep, double radius)
Parameters
Type Name Description
Node node
double angle
double sweep
double radius
Remarks

By default this method does nothing.