🌍 Public
Viewing a saved revision (read-only)
afb4e78efdf24d7e964e3d4e588bfffe
Fork of D3 Starter
This example demonstrates a treemap visualization that recursively partitions a rectangular canvas into nested rectangles, with each leaf node sized proportionally to its value. The code builds the layout manually using D3’s `scaleLinear` for area allocation and `scaleOrdinal` with the `schemeCategory10` color palette. It also computes text dimensions with a custom `visualWidth` helper and uses CSS-based font-family detection for cross-system compatibility. The data is loaded from a local JSON file and rendered as SVG rectangles and text labels.
AI-generated descriptionA demonstration of how to start using D3 version 6.