Skip to content

Instantly share code, notes, and snippets.

@clementbat
Created February 26, 2019 11:13
Show Gist options
  • Save clementbat/8a2e0de6c02ad21fa5db3854fb583077 to your computer and use it in GitHub Desktop.
Save clementbat/8a2e0de6c02ad21fa5db3854fb583077 to your computer and use it in GitHub Desktop.
treemap algorithm
procedure squarify(list of real children, list of real row,real w)
begin
real c = head(children);
if worst(row, w) ≤ worst(row++[c], w) then
squarify(tail(children), row++[c], w)
else
layoutrow(row);
squarify(children, [], width());
fi
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment