Networks and hierarchies

Network and hierarchy charts show how things nest or connect, from trees and treemaps to force layouts and flows between stages.

LLMs

Tidy tree

Pass treeLayout dotted name paths to get node and link positions, then draw them with link, dot and text marks.

Treemap

Use the treemap mark to size each class by its value as nested rectangles, colored by package and labeled inside each cell.

Sunburst

Put a sunburst mark inside polar to draw the same hierarchy as rings, with each package and its classes as arcs.

Drillable sunburst

Change rootId from onSelect to open a package on click, with a motion() renderer animating the rings and a center button to go back.

Force-directed network

Run forceLayout over nodes and links to place characters by who shares scenes, then color each one by its group.

Sankey

Give sankeyDiagram nodes and weighted links to draw flows whose width follows their value, here orders splitting between two warehouses and merging into deliveries.

Income statement

Color each sankeyDiagram flow by profit or cost and label every node with its amount, tracing revenue down to net profit.