Skip to main content

squarify

Function squarify 

Source
pub fn squarify(area: Area, weights: &[u64]) -> Vec<Area>
Expand description

Bruls, Huizing and van Wijk’s squarified treemap.

One rectangle per weight, in the order given — which the caller has already sorted descending, because the algorithm’s aspect-ratio bound assumes it. Weights of zero get an empty rectangle rather than being dropped, so the two lists stay index-for-index.

The rectangles tile area exactly: each one’s share of the total area equals its share of the total weight, which is the whole claim a treemap makes and the one thing worth asserting about it.