Skip to main content
100%

Treemap in d3

✓ Published1🌍 Public
SSubhendu Karmakar
Last edited Mar 13, 2024
Created on Mar 13, 2024

This example demonstrates a treemap visualization of hierarchical data, with nested rectangles representing the A1, B1/B2, and C1/C2/C3 nodes. It uses d3.treemap to compute the layout based on summed values, with padding and a fixed size of 800 by 400 pixels. The d3.hierarchy API organizes the data structure, while descendants are rendered as SVG groups, rects, and text elements using d3.select and join. The visualization clearly shows proportional area encoding, with rectangles colored in semitransparent cadetblue and labeled for each node.

AI-generated description

D3 Hierarchies

MIT Licensed

Similar vizzes