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` (for loading via script tags),`extensionsTS` (UMD modules), or `extensionsJSM` (ES6 modules) folders. See the Extensions intro page for more information.

### Hierarchy

- Layout
  - TreeMapLayout

A custom Layout that lays out hierarchical data using nested rectangles.

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

## Index

### Constructors

- constructor

### Properties

- isTopLevelHorizontal

### Methods

- cloneProtected
- computeTotals
- doLayout

## Inherited Members

### Properties

- 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 TreeMapLayout(init?: Partial<Layout>): TreeMapLayout

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

  #### Parameters

  - ##### Optional init: Partial<Layout>

    Optional initialization properties.

  #### Returns TreeMapLayout

## Properties

### isTopLevelHorizontal: boolean

- Gets or sets whether top level Parts are laid out horizontally.

## Methods

### Override cloneProtected

- cloneProtected(copy: TreeMapLayout): void

- Copies properties to a cloned Layout.

  #### Parameters

  - ##### copy: TreeMapLayout

  #### Returns void

### computeTotals

- computeTotals(diagram: Diagram): void

- Compute the `data.total` for each node in the Diagram, with a Group's being a sum of its members.

  #### Parameters

  - ##### diagram: Diagram

  #### Returns void

### Override doLayout

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

- This method actually positions all of the nodes by determining total area and then recursively tiling nodes from the top-level down.

  #### Parameters

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

    A Diagram or a Group or a collection of Parts.

  #### Returns void

Copyright © 1998-2022 by Northwoods Software Corporation.