Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of D3 Starter

Public visualization

Viewing a saved revision (read-only)

afb4e78efdf24d7e964e3d4e588bfffe

Fork of D3 Starter

0 stars0🌍 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.