Skip to main content
100%

Tree Layout Orientations

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 26, 2012

Four small multiples show the same minimal tree rendered in four orientations: top-to-bottom, right-to-left, bottom-to-top, and left-to-right. Each panel uses `d3.layout.tree` to compute node positions, then draws curved links with `d3.svg.diagonal` and circles for nodes. The orientation is applied by projecting the layout coordinates through per-panel accessor functions that swap or invert x and y values. The tree data comes from a small `graph.json` file with two nested children.

AI-generated description

In response to a Stack Overflow question, Tree drawing orientation.

gpl-3.0 Licensed

Similar vizzes