Skip to main content
100%

TreeMap Layout

✓ Published2🌍 Public
Ffloresh
Last edited Sep 23, 2019
Created on Sep 1, 2019
Forked from Tree Layout

This example demonstrates a treemap layout using D3 v5, displaying hierarchical data as nested rectangles sized proportionally to their values. The visualization shows four labeled nodes—three leaf nodes (C1, C2, C3) with varying values beneath a parent node (B1), alongside a sibling node (B2)—all enclosed within root A1, with padding and gaps between groups. It uses `d3.hierarchy` to structure the data and `d3.treemap` to compute the layout, rendering rectangles and text as SVG elements. The treemap applies an outer padding of 16 pixels and scales to a 400×200 pixel area, with a static dataset defined in the code.

AI-generated description

d3indepth.com/layouts/ TreeMap Layout

MIT Licensed

Similar vizzes