Network and hierarchy charts show relationships rather than values on two independent quantitative axes. Their node positions usually come from an application-owned layout algorithm, then flow into ordinary links, dots, and text marks.
Use these views only when topology is the question. Dense networks quickly become less legible than a matrix, grouped summary, or searchable table.
| Reader question | Start with |
|---|---|
| What is the parent-child structure and depth? | Tidy hierarchy tree |
| Which positioned observations are spatial neighbors? | Delaunay adjacency network |
| Which dependency clusters emerge without fixed positions? | Force-directed network |
| How large are branches within a strict hierarchy? | Packed or rectangular hierarchy |
| Must many entities be compared by attributes, not connections? | A table, facets, or quantitative chart |
Layout, traversal, grouping, and collision handling belong to data preparation. Scales and D3 routes those algorithms to the official D3 documentation while TanStack Charts renders the typed result.
A tidy tree assigns one position per node and one link per parent-child relationship. Direct labels make a small hierarchy readable without requiring hover.
Validate the hierarchy before layout:
The layout output can retain each original record while adding x, y, depth, and parent coordinates. Render links first, then nodes and labels. See Rules, Links, Arrows, Vectors, and Ticks and Dot and Hexagon Marks.
A Delaunay network connects points that are neighbors in a triangulation. It answers local spatial adjacency; it does not imply a business or causal relationship unless the data model defines one.
Deduplicate undirected edges during preparation and retain the source node IDs on each edge. If the point positions change with responsive scale ranges, recompute pixel-space adjacency from the final plot geometry rather than reusing stale edges.
When Delaunay is used only for nearest-point lookup, keep the triangulation in a ChartSpatialIndexFactory instead of painting its edges. See Tooltips and Focus.
A force-directed layout can reveal clusters and bridges when positions are not already meaningful. It also introduces motion, stochastic initialization, and collision policy that can make comparison unstable.
Run the simulation outside the renderer and feed settled coordinates to the chart. For repeatable output, use deterministic initialization and a defined stopping rule. Preserve node keys so data updates reconcile existing geometry instead of replacing the complete network.
If drag-to-reposition is part of the product, store the resulting positions in application state and provide a keyboard-accessible alternative or detail control. The chart scene should remain a projection of that controlled state.
Custom link paths or non-cartesian layouts may need a public custom mark. Start with built-in links, dots, and text, then use Custom Marks and Renderers only for geometry that composition cannot express.