Class SerpentineLayout

GoDiagram®
v10.0.12
by Northwoods Software®

A custom Layout that lays out a chain of nodes in a snake-like fashion.

Inheritance
SerpentineLayout
Namespace: Northwoods.Go.Layouts.Extensions
Assembly: SerpentineWinForms.dll
Syntax
public class SerpentineLayout : Layout
Remarks

This layout assumes the graph is a chain of Nodes, positioning nodes in horizontal rows back and forth, alternating between left-to-right and right-to-left within the Wrap limit. Spacing controls the distance between nodes. LeftSpot and RightSpot determine the Spots to use for the FromSpot and ToSpot.

When this layout is the Diagram.Layout, it is automatically invalidated when the viewport changes size.

Constructors

SerpentineLayout()

Constructs a SerpentineLayout and sets the IsViewportSized property to true.

Declaration
public SerpentineLayout()

Properties

LeftSpot

Gets or sets the Spot to use on the left side of a Node.

Declaration
public Spot LeftSpot { get; set; }
Property Value
Type Description
Spot
Remarks

The default value is Left.

RightSpot

Gets or sets the Spot to use on the right side of a Node.

Declaration
public Spot RightSpot { get; set; }
Property Value
Type Description
Spot
Remarks

The default value is Right.

Root

Gets or sets the starting node of the sequence.

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

The default value is null, which causes the layout to look for a node without any incoming links.

Spacing

Gets or sets the Size whose width specifies the horizontal space between nodes and whose height specifies the minimum vertical space between nodes.

Declaration
public Size Spacing { get; set; }
Property Value
Type Description
Size
Remarks

The default value is 30x30.

Wrap

Gets or sets the total width of the layout.

Declaration
public double Wrap { get; set; }
Property Value
Type Description
double
Remarks

The default value is NaN, which for Layouts means that it uses the ViewportBounds.

Methods

DoLayout(IEnumerable<Part>)

This method actually positions all of the Nodes, assuming that the ordering of the nodes is given by a single link from one node to the next.

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

A collection of Parts.

Overrides
Remarks

This respects the Spacing and Wrap properties to affect the layout.