# Class SpiralLayout

GoJS® Diagramming Components
version 3.0.5
by Northwoods Software®

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. See the Extensions intro page for more information.

#### Hierarchy

- Layout
  - SpiralLayout

A custom go.Layout that lays out a chain of nodes in a spiral.

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

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

#####
Index

### Constructors

constructor

### Accessors

clockwise
radius
spacing

### Methods

cloneProtected
diameter
doLayout

#####
Inherited Index

### Accessors

Layout.arrangementOrigin
Layout.boundsComputation
Layout.diagram
Layout.group
Layout.isInitial
Layout.isOngoing
Layout.isRealtime
Layout.isRouting
Layout.isValidLayout
Layout.isViewportSized
Layout.network

### Methods

Layout.collectParts
Layout.commitLayout
Layout.copy
Layout.createNetwork
Layout.getLayoutBounds
Layout.initialOrigin
Layout.invalidateLayout
Layout.makeNetwork
Layout.updateParts

## Constructors

### constructor

- new SpiralLayout(init?: Partial<SpiralLayout>): SpiralLayout

- #### Parameters

  - ##### `Optional` init: Partial<SpiralLayout>

  #### Returns SpiralLayout

## Accessors

### 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

- cloneProtected(copy: SpiralLayout): void

- Copies properties to a cloned Layout.

  #### Parameters

  - ##### copy: SpiralLayout

  #### Returns void

### diameter

- diameter(v: LayoutVertex): number

- Compute the effective diameter of a Node.

  #### Parameters

  - ##### v: LayoutVertex

  #### Returns number

### `Override` doLayout

- doLayout(coll: Diagram | Iterable<Part> | Group): void

- 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

  - ##### coll: Diagram | Iterable<Part> | Group

    A go.Diagram or a go.Group or a collection of go.Parts.

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.