Skip to main content

Module treemap

Module treemap 

Source
Expand description

Treemap — weighted rectangles, area ∝ value, laid out by a deterministic slice-and-dice algorithm that alternates split direction by depth-of-cut so the tiling stays readable. The layout (squarify) is a pure function returning (index, Rect) pairs, tested independently of any painter. Tile fills come from a theme-derived sequential Ramp.

Structs§

Tile
A labelled, weighted item.
TreemapState
Persistent, observable interaction state (FC-3): the original tile index the pointer last hovered. Serialized so it round-trips headlessly.
TreemapView
A treemap over a flat list of weighted tiles.

Enums§

TreemapEffect
FC-8: the treemap does no I/O.
TreemapMsg
FC-2 input surface. One input: the hovered tile changing (hit-tested purely in TreemapView::render, applied in TreemapView::update).

Functions§

squarify
Lay weights out into area, area ∝ weight, via squarified slice-and-dice. Returns (original index, rect) for each positive-weight item, in input order. Zero/negative weights are skipped. Pure geometry → directly testable.