Explaining the squarified treemap algorithm

As part of the visualization support, Glamorous Toolkit offers an implementation of a squarified Treemap. The algorithm is responsible for creating visualizations such as this one:

gtoolkit book
Oh hey, this is basically the type of algorithm that tools like WinDirStat, WizTree, GrandPerspective etc. use to visualize file and directory sizes in a filesystem.