Modules

Treemap

moduleSource

Available on macOS, Linux, Windows, Wasm

#import "Treemap";

Procedures#

(children: [] *Treemap_Node, unsized_cursor: int, child_index: int, display: *Treemap_Display, root_corner: Vector2, fill_weight_total: float64, horizontal: bool, size: Vector2) -> flushed_node_weight: float64

Places one row of children along the short side of the free area, and returns their total weight.

Types#

:: struct

One rectangle's worth of data: a name and a size, with children inside it. A leaf's size is set by the caller; a parent's is the sum of its children's, filled in by recompute_if_dirty. The user_data_ fields are free for the program.

name: string
size: float64
parent: *Treemap_Node
children: [..] *Treemap_Node
user_data_pointer: *void
user_data_s64: s64
user_data_float64: float64
:: #type (corner: Vector2, outer_dimensions: Vector2, node: *Treemap_Node, parent: *Display_Node, border_values: *[4] float)

Called while laying out to say how much room a node keeps free along each edge for its own frame or label; the children are laid out inside what is left. Fill border_values (see Border_Direction); the default is zero.