11 Hierarchical visualizations
This chapter covers
- Constructing a root node from hierarchical data.
- Using hierarchical layout generators.
- Drawing a circle pack.
- Drawing a tree chart.
In the early chapters of this book, we used data visualizations to encode numerical data. For example, the length of the bars in the bar chart from chapter 3 represented the number of related survey responses. Similarly, the position of data points in chapter 4’s line chart depicted temperature. In this chapter, we will discuss hierarchical visualizations, which encode parent-child relationships and can reveal patterns that would go unnoticed with the simpler visualizations we have worked with so far.
Hierarchical visualizations communicate parent-child relationships via enclosure, connections, or adjacency. Figure 11.1 shows two examples of hierarchical visualizations that use enclosure: the circle pack and the treemap. As its name says, the circle pack is a group of circles. There's a root parent, the most outer circle, and subsequent levels of children called nodes. All children of a node are "packed" into that node, and the size of the circles is proportional to the number of nodes they contain. The size of the leaf nodes, the children at the lowest level, can represent an arbitrary property. The treemap works similarly but uses nested rectangles instead of circles. Treemaps can be more space efficient than circle packs, and we often meet them in visualizations related to finances.