Skip to content

Function: treemapLayout() ​

ts
function treemapLayout(items, extent?): TreemapCell[];

Defined in: charts/treemap.ts:59

Squarified treemap layout: sizes rects ∝ value, packing them into extent with aspect ratios kept near 1. Pure — no side effects. Zero/negative values and empty input yield no cells.

Parameters ​

ParameterTypeDefault value
itemsreadonly TreemapItem[]undefined
extentTreemapExtentDEFAULT_EXTENT

Returns ​

TreemapCell[]

MIT licensed. WebGL2 required.