Charts & Visual Data
Treemap Chart Formula: Proportional Tile Area (px^2) & Squarified Aspect Ratio
Calculate exact rectangular tile pixel areas, strip thicknesses, and Bruls-Huizing-van Wijk Squarified Aspect Ratios MAX(w/h, h/w) for hierarchical Treemap Charts without negative-value distortions.
Why modern Treemaps optimize tile squareness (Aspect Ratio -> 1.0) instead of skinny slice-and-dice ribbons!
Invented by Ben Shneiderman (1992) to visualize nested hard-drive directories and refined by Mark Bruls, Kees Huizing, and Jarke J. van Wijk (2000, "Squarified Treemaps"), a Treemap partitions a canvas of width W and height H (Total Area A_canvas = W * H) into nested rectangles whose areas A_i = A_canvas * (Value_i / SUM(Values)) are strictly proportional to positive magnitudes (filtering out <= 0 entries, which cannot occupy negative geometric area!).
If you slice a 600 × 400 px canvas (240,000 px^2) vertically in one strip, a 6% item (14,400 px^2) becomes a 36 × 400 px ribbon with terrible Aspect Ratio AR = MAX(w / h, h / w) = 400 / 36 = 11.11 (impossible to read or compare)! Placing a group of tiles totaling Area S_strip along the shorter canvas side L_short = MIN(W, H) gives Strip Thickness t = S_strip / L_short and individual Tile Span s_i = A_i / t, driving MAX(t / s_i, s_i / t) down toward the ideal square limit 1.00!
| Treemap Layout Metric (600 × 400 px Canvas = 240,000 px^2, Total = $1,000) | Formula | Evaluated Value |
|---|---|---|
| Item #1 Area ($250 = 25% Share) | W * H * (Val_1 / Total) | 60,000 px^2 |
| Strip Subtotal ($250 + $150 = $400 -> 96,000 px^2 along L_short = 400 px) | t = S_strip / MIN(W, H) | Strip Width t = 240.0 px |
| Item #1 Tile Height along Strip (s_1 = A_1 / t) | 60,000 / 240 | 250.0 px |
| Item #1 Squarified Aspect Ratio MAX(t/s_1, s_1/t) | MAX(240/250, 250/240) | 1.0417 (Nearly Perfect Square!) |
Proportional Treemap Tile Pixel Area A_i (Excluding <= 0 Entries)
Allocates Canvas_W * Canvas_H * (Item_Value / Positive_Total) across Canvas Width B2 (px), Canvas Height B3 (px), Item Value B4 (> 0), and Grand Positive Sum B5.
=IF(OR(B2 <= 0, B3 <= 0, B4 <= 0, B5 < B4), "Treemap Tiles Require Positive Dimensions and 0 < Item <= Positive Total", ROUND((B2 * B3) * (B4 / B5), 1))Squarified Strip Tile Aspect Ratio MAX(t / s_i, s_i / t) (>= 1.0)
Given Strip Subtotal Value B6 (>= B4) laid along shorter canvas edge MIN(B2, B3), computes strip thickness t = A_strip / MIN(W, H), tile length s_i = A_i / t, and Bruls-Huizing-van Wijk aspect ratio (>= 1.0, lower = squarer).
=IF(OR(B2 <= 0, B3 <= 0, B4 <= 0, B5 < B6, B6 < B4), "Invalid Treemap Strip Inputs", ROUND(MAX((((B2 * B3) * (B6 / B5)) / MIN(B2, B3)) / (((B2 * B3) * (B4 / B5)) / (((B2 * B3) * (B6 / B5)) / MIN(B2, B3))), (((B2 * B3) * (B4 / B5)) / (((B2 * B3) * (B6 / B5)) / MIN(B2, B3))) / (((B2 * B3) * (B6 / B5)) / MIN(B2, B3))), 4))Try the example
Use the original values or change them to test your understanding.