What is a Treemap?

A treemap is a visualization tool used for displaying vast amounts of hierarchically structured data.

Particular levels in a treemap are shown in rectangles containing other rectangles sized and ordered by a quantitative variable. ​Every level represents a column or an expression in a data table, and every individual rectangle on a level represents a category in a column. 

The use case of treemap

Treemaps are an excellent choice to visualize data when there is a need to visualize part-to-whole relationships amongst many categories, and precise comparisons between them are not crucial. As treemaps use area (and color if needed) to encode the values of a variable can indicate just general relationships between data (the area is not easy “to decode” at a glance).  

TreeMap is also the name of a function in Java, but it is an entirely different thing.