Skip to content

A wide tree

Linked children make one row by default, so no edge crosses a sibling. The orthogonal router draws a comb.

Edit it

A wide treePlayground →
A wide tree: the layouthubleaf-1leaf-2leaf-3leaf-4leaf-5leaf-6leaf-7leaf-8leaf-9leaf-10leaf-11leaf-12

13 boxes, 12 edges. The audit finds no defect.

The input

The same layout in TypeScript. The input is plain data, so it can come from JSON.

wide.ts
import { layout } from "ireko";
const input = {
"root": {
"id": "hub",
"children": [
{
"id": "leaf-1"
},
{
"id": "leaf-2"
},
{
"id": "leaf-3"
},
{
"id": "leaf-4"
},
{
"id": "leaf-5"
},
{
"id": "leaf-6"
},
{
"id": "leaf-7"
},
{
"id": "leaf-8"
},
{
"id": "leaf-9"
},
{
"id": "leaf-10"
},
{
"id": "leaf-11"
},
{
"id": "leaf-12"
}
]
}
};
const result = layout(input, {"nodeSize":{"width":64,"height":28},"spacing":12,"router":"orthogonal"});