🌍 Public
Viewing a saved revision (read-only)
889928aaa6a24eef99177cccc2831115
d3 template
This example renders a treemap visualization using D3.js v6 in a React environment. It displays hierarchical data as nested rectangles, with each leaf node's area representing its value and labeled with its name. The code loads JSON data from a remote GitHub source, converts it into a hierarchy using `d3.hierarchy`, then computes the spatial layout with `d3.treemap`. The resulting SVG rectangles and text labels are appended to the chart, with leaves filled in slate blue, providing a clear visual breakdown of the data's composition.
AI-generated descriptionReact Starter code.