Also, I think flame graphs are easier to implement, and correspond better to the underlying data (fewer visual illusions)
Both of them take tree-shaped data, and a quantity, and you want to attribute the space of the children to the parents. For disk space it's:
100 /home/andy/foo.txt
42 /home/andy/src/bar.txt
For function profiles it's 100 f() g()
42 f() g() h()
So you can use both visualizations with both kinds of data.Also, ncdu is an curses UI for disk space, and I have to admit it's pretty much as effective in practice as tree maps. It doesn't necessarily give you a nice overview though.