Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SpiralLayout

This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. 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 spiral.

This layout assumes the graph is a chain of Nodes, spacing controls the spacing between nodes.

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

Index

Constructors

constructor

  • Create a minimal layout that only positions Nodes that do not have a location.

    Returns SpiralLayout

Properties

clockwise : boolean

  • Gets or sets whether the spiral should go clockwise or counter-clockwise.

    The default value is true.

radius : number

  • Gets or sets the radius distance.

    The default value is NaN.

spacing : number

  • Gets or sets the spacing between nodes.

    The default value is 100.

Methods

Override cloneProtected

  • Copies properties to a cloned Layout.

    Parameters

    Returns void

diameter

  • Compute the effective diameter of a Node.

    Parameters

    Returns number

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 property to affect the layout.

    Parameters

    Returns void