Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SerpentineLayout

This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. Extensions can be found in the GoJS kit under the extensions or extensionsTS folders. See the Extensions intro page for more information.

Hierarchy

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

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.

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

If you want to experiment with this extension, try the Serpentine Layout sample.

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

spacing : Size

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

    The default value is 30x30.

wrap : number

Methods

Override cloneProtected

  • cloneProtected(copy: this): void
  • Copies properties to a cloned Layout.

    Parameters

    • copy: this

    Returns void

Override doLayout

  • 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. This respects the spacing and wrap properties to affect the layout.

    Parameters

    Returns void