# Class RadialLayout

GoJS® Diagramming Components
version 3.0.7
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
  - RadialLayout

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

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

#####
Index

### Constructors

constructor

### Accessors

layerThickness
maxLayers
root

### Methods

cloneProtected
commitLayers
commitLayout
computeBreadth
createNetwork
doLayout
rotateNode

#####
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.copy
Layout.getLayoutBounds
Layout.initialOrigin
Layout.invalidateLayout
Layout.makeNetwork
Layout.updateParts

## Constructors

### constructor

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

- #### Parameters

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

  #### Returns RadialLayout

## Accessors

### layerThickness
: number

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

  The default value is 100.

### maxLayers
: number

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

  The default value is Infinity.

### root
: Node

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

## Methods

### `Override` cloneProtected

- cloneProtected(copy: RadialLayout): void

- Copies properties to a cloned Layout.

  #### Parameters

  - ##### copy: RadialLayout

  #### Returns void

### `Virtual` commitLayers

- commitLayers(): void

- Override this method in order to create background circles indicating the layers of the radial layout. By default this method does nothing.

  #### Returns void

### `Override` commitLayout

- commitLayout(): void

- This override positions each Node and also calls rotateNode.

  #### Returns void

### computeBreadth

- computeBreadth(v: RadialVertex): number

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

  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: `computeBreadth(v) { return 1; }`

  In order to give each child of a vertex a fraction of arc proportional to how many children the child has: `computeBreadth(v) { return Math.max(1, v.children.length); }`

  #### Parameters

  - ##### v: RadialVertex

  #### Returns number

### `Override` createNetwork

- createNetwork(): LayoutNetwork

- Use a LayoutNetwork that always creates RadialVertexes.

  #### Returns LayoutNetwork

### `Override` doLayout

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

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

  #### Parameters

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

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

  #### Returns void

### `Virtual` rotateNode

- rotateNode(node: Node, angle: number, sweep: number, radius: number): void

- Override this method in order to modify each node as it is laid out. By default this method does nothing.

  #### Parameters

  - ##### node: Node

  - ##### angle: number

  - ##### sweep: number

  - ##### radius: number

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.