ChartsHierarchyFlow· 5 min read
Hierarchy & Flow: Treemap, Sunburst & Sankey
Squarified treemaps, radial sunbursts, directed Sankey flows, and Chord relationship matrices.
Visualizing relational structure and quantitative flow requires specialized space-filling algorithms. QuaCharts features deterministic squarified treemaps, multi-level sunbursts, and energy-conserving Sankey diagrams that auto-balance source-to-target links.
Hierarchy & Flow Types
| Visualization | Best Used For | Layout Algorithm |
|---|---|---|
| treemap | Market cap breakdown, disk usage, portfolio sector allocation | Bruls-Huizing-van Wijk Squarified Treemap |
| sunburst | Multi-tier categorical hierarchies, organizational trees | Concentric radial partition with angular weighting |
| sankey | Order routing flows, cash transfers, budget allocations | Layered directed acyclic graph (DAG) node relaxation |
| chord | Inter-bank liquidity exposures, cross-currency pairs | Circular bi-directional matrix ribbon layout |
Treemap Market Capitalization Example
treemap-demo.ts
1
import { createTreemap } from '@quatick/web-charts';
2
3
const treemap = createTreemap('#treemap', {
4
title: 'S&P 500 Market Cap & Daily Return Heat',
5
layoutAlgorithm: 'squarified',
6
levels: [
7
{ level: 1, layoutStartingDirection: 'horizontal' },
8
{ level: 2, colorVariation: { key: 'brightness', to: 0.25 } },
9
],
10
data: [
11
{ id: 'tech', name: 'Technology' },
12
{ id: 'aapl', name: 'Apple Inc.', parent: 'tech', value: 3500, colorValue: 1.45 },
13
{ id: 'msft', name: 'Microsoft Corp.', parent: 'tech', value: 3200, colorValue: -0.82 },
14
{ id: 'nvda', name: 'Nvidia Corp.', parent: 'tech', value: 3400, colorValue: 3.20 },
15
{ id: 'fin', name: 'Financials' },
16
{ id: 'jpm', name: 'JPMorgan Chase', parent: 'fin', value: 650, colorValue: 0.45 },
17
],
18
colorAxis: {
19
min: -3,
20
max: 3,
21
stops: [
22
[-3, '#ef4444'], // Dark Red (-3% drop)
23
[0, '#334155'], // Slate Neutral (0% flat)
24
[3, '#22c55e'], // Dark Green (+3% rally)
25
],
26
},
27
});