Skip to main content
100%

Treemap Example

✓ Published0🌍 Public
HhelloHailey-sketch
Last edited Oct 15, 2022
Created on Oct 15, 2022
Forked from D3 Starter

This treemap visualizes the hierarchical flare dataset, showing relative leaf-node values as nested rectangles colored by their top-level parent category. Built with D3 v6 and rendered as SVG, the example implements a custom treemap layout algorithm via recursive space partitioning that alternates between horizontal and vertical splits. The code uses d3.scaleLinear for proportional sizing, d3.scaleOrdinal with d3.schemeCategory10 for colors, and calculates text visibility based on rectangle dimensions. Data is loaded from a JSON file and displayed with interactive hover effects absent, focusing purely on static hierarchical encoding.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes