# Class FishboneLayout

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

- TreeLayout
  - FishboneLayout

FishboneLayout is a custom go.Layout derived from go.TreeLayout for creating "fishbone" diagrams. A fishbone diagram also requires a go.Link class that implements custom routing, FishboneLink.

This only works for angle === 0 or angle === 180.

This layout assumes Links are automatically routed in the way needed by fishbone diagrams, by using the FishboneLink class instead of go.Link.

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

#####
Index

### Constructors

constructor

### Methods

assignTreeVertexValues
commitLinks
commitNodes
makeNetwork
shift
shiftAll

#####
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
TreeLayout.alignment
TreeLayout.alternateAlignment
TreeLayout.alternateAngle
TreeLayout.alternateBreadthLimit
TreeLayout.alternateChildPortSpot
TreeLayout.alternateCommentMargin
TreeLayout.alternateCommentSpacing
TreeLayout.alternateCompaction
TreeLayout.alternateComparer
TreeLayout.alternateDefaults
TreeLayout.alternateLayerSpacing
TreeLayout.alternateLayerSpacingParentOverlap
TreeLayout.alternateNodeIndent
TreeLayout.alternateNodeIndentPastParent
TreeLayout.alternateNodeSpacing
TreeLayout.alternatePortSpot
TreeLayout.alternateRowIndent
TreeLayout.alternateRowSpacing
TreeLayout.alternateSetsChildPortSpot
TreeLayout.alternateSetsPortSpot
TreeLayout.alternateSorting
TreeLayout.angle
TreeLayout.arrangement
TreeLayout.arrangementSpacing
TreeLayout.breadthLimit
TreeLayout.childPortSpot
TreeLayout.commentMargin
TreeLayout.commentSpacing
TreeLayout.comments
TreeLayout.compaction
TreeLayout.comparer
TreeLayout.layerSpacing
TreeLayout.layerSpacingParentOverlap
TreeLayout.layerStyle
TreeLayout.nodeIndent
TreeLayout.nodeIndentPastParent
TreeLayout.nodeSpacing
TreeLayout.path
TreeLayout.portSpot
TreeLayout.rootDefaults
TreeLayout.roots
TreeLayout.rowIndent
TreeLayout.rowSpacing
TreeLayout.setsChildPortSpot
TreeLayout.setsPortSpot
TreeLayout.sorting
TreeLayout.treeStyle

### Methods

Layout.cloneProtected
Layout.collectParts
Layout.copy
Layout.getLayoutBounds
Layout.initialOrigin
Layout.invalidateLayout
Layout.updateParts
TreeLayout.addComments
TreeLayout.arrangeTrees
TreeLayout.commitLayers
TreeLayout.commitLayout
TreeLayout.createNetwork
TreeLayout.doLayout
TreeLayout.initializeTreeVertexValues
TreeLayout.layoutComments

## Constructors

### constructor

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

- Constructs a FishboneLayout and sets the following properties:

  - TreeLayout.alignment = go.TreeAlignment.BusBranching
  - TreeLayout.setsPortSpot = false
  - TreeLayout.setsChildPortSpot = false

  #### Parameters

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

  #### Returns FishboneLayout

## Methods

### `Override` assignTreeVertexValues

- assignTreeVertexValues(v: TreeVertex): void

- Add a direction property to each vertex and modify go.TreeVertex.layerSpacing.

  #### Parameters

  - ##### v: TreeVertex

  #### Returns void

### `Override` commitLinks

- commitLinks(): void

- This override stops links from being committed since the work is done by the FishboneLink class.

  #### Returns void

### `Override` commitNodes

- commitNodes(): void

- Assigns go.Link.fromSpots and go.Link.toSpots based on branching and angle and moves vertexes based on dummy locations.

  #### Returns void

### `Override` makeNetwork

- makeNetwork(coll: Diagram | Iterable<Part> | Group): LayoutNetwork

- Create and initialize a go.LayoutNetwork with the given nodes and links. This override creates dummy vertexes, when necessary, to allow for proper positioning within the fishbone.

  #### Parameters

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

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

  #### Returns LayoutNetwork

### shift

- shift(v: TreeVertex): void

- Shifts subtrees within the fishbone based on angle and node spacing.

  #### Parameters

  - ##### v: TreeVertex

  #### Returns void

### shiftAll

- shiftAll(direction: number, absolute: number, root: TreeVertex, v: TreeVertex): void

- Shifts a subtree.

  #### Parameters

  - ##### direction: number

  - ##### absolute: number

  - ##### root: TreeVertex

  - ##### v: TreeVertex

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.