Skip to content

Layout treemap

Place nodes on the screen using a treemap layout.

Transforms a set of columns (normally categorical) to x and y positions using a treemap layout.

The treemap will be created hierarchically according to the order of columns in the input.

At the lowest level of the treemap, points within the same category may be ordered from top to bottom and left to right using an optional numerical column.

Usage


The following are the step's expected inputs and outputs and their specific types.

Step signature
layout_treemap(*columns: category|number, {"param": value}) -> (x: column, y: column)

where the object {"param": value} is optional in most cases and if present may contain any of the parameters described in the corresponding section below.

Example

The following configuration transforms the categories into a treemap and uses the numerical column to order the nodes in the final squares.

Example call (in recipe editor)
layout_treemap(ds.salary, ds.position, ds.average_montly_hours, {
  "numerical_col": "average_montly_hours",
  "node_size": 8
}) -> (ds.x, ds.y)

Inputs


*columns: column:category|number

Outputs


x: column

Numerical column with the x position in the graph.


y: column

Numerical column with the y position in the graph.

Parameters


numerical_col: string

Name of the numerical column. Used to order the nodes consecutively in the final treemap.


node_size: integer = 8

Size of the nodes in pixels.

Range: 1 ≤ node_size < inf


v2: boolean = False

Enable use of version 2 of algorithm.

Back to top