# Class TreeMapLayout

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

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

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

#####
Index

### Constructors

constructor

### Accessors

isTopLevelHorizontal

### Methods

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

- #### Parameters

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

  #### Returns TreeMapLayout

## Accessors

### 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 go.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 go.Diagram or a go.Group or a collection of go.Parts.

  #### Returns void

Copyright © 1998-2024 by Northwoods Software Corporation.