-
Book Overview & Buying
-
Table Of Contents
Learn D3.js - Second Edition
By :
In the last chapter, we explored hierarchical datasets using trees and dendrograms. This chapter focuses on representing hierarchies with partitions and enclosures—topologies that efficiently highlight containment and proportion without relying on lines to show child-parent relationships.
Partitions use rectangles and arcs to represent hierarchies as a stack of nodes with the root at its base or center. Child nodes branch upward, downward, or outward as segments from their parents. Common partition types include icicle or flame charts, as well as sunburst diagrams.
Enclosures represent a tree as a circle or box that contains all its descendants. In treemaps, descendants appear as nested rectangles, whereas circle packs display child nodes as tightly packed nested circles.
Partitions and enclosures are created in D3 using layout generators from the d3-hierarchy module, introduced in Chapter 15. These layouts also require hierarchical...