Skip to main content
100%

Fork of D3 Starter

✓ Published0🌍 Public
HhelloHailey-sketch
Last edited Oct 16, 2022
Created on Oct 16, 2022
Forked from 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 description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes