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

- Layout
  - TreeLayout
    - ParallelLayout

A custom TreeLayout that requires a "Split" node and a "Merge" node, by category. The "Split" node should be the root of a tree-like structure if one excludes links to the "Merge" node. This will position the "Merge" node to line up with the "Split" node.

Assume there is a pair of nodes that "Split" and "Merge", along with any number of nodes extending in a tree-structure from the "Split" node. You can set all of the TreeLayout properties that you like, except that for simplicity this code just works for angle === 0 or angle === 90.

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

## Index

### Constructors

- constructor

### Properties

- mergeNode
- splitNode

### Methods

- commitLinks
- commitNodes
- makeNetwork

## Constructors

### constructor

- new ParallelLayout(): ParallelLayout

- Constructs a ParallelLayout and sets the following properties:

  - isRealtime = false
  - alignment = TreeLayout.AlignmentCenterChildren
  - compaction = TreeLayout.CompactionNone
  - alternateAlignment = TreeLayout.AlignmentCenterChildren
  - alternateCompaction = TreeLayout.CompactionNone

  #### Returns ParallelLayout

## Properties

### Read-only mergeNode : Node | null

- This read-only property returns the node that the tree will converge at.

### Read-only splitNode : Node | null

- This read-only property returns the node that the tree will extend from.

## Methods

### Override commitLinks

- commitLinks(): void

- Finds links into the merge node and adjusts spots and maybe points.

  #### Returns void

### Override commitNodes

- commitNodes(): void

- Assigns a position for the merge node once the other nodes have been committed.

  #### Returns void

### Override makeNetwork

- makeNetwork(coll: Iterable<Part>): LayoutNetwork

- Create and initialize a LayoutNetwork with the given nodes and links. This override finds the split and merge nodes and sets the focus of any Groups.

  #### Parameters

  - ##### coll: Iterable<Part>

    a collection of Parts.

  #### Returns LayoutNetwork

Copyright © 1998-2020 by Northwoods Software Corporation.