Skip to content

Rings in rings

Radial containers inside a radial container. A container with one child puts it at the center.

Edit it

Rings in ringsPlayground →
Rings in rings: the layoutgalaxysunbinarylonelyplanet-1planet-2planet-3planet-4planet-5star-1star-2moon

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

The input

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

nested-rings.ts
import { layout } from "ireko";
const input = {
"root": {
"id": "galaxy",
"layout": "radial",
"mode": "nested",
"children": [
{
"id": "sun",
"layout": "radial",
"mode": "nested",
"children": [
{
"id": "planet-1"
},
{
"id": "planet-2"
},
{
"id": "planet-3"
},
{
"id": "planet-4"
},
{
"id": "planet-5"
}
]
},
{
"id": "binary",
"layout": "radial",
"mode": "nested",
"children": [
{
"id": "star-1"
},
{
"id": "star-2"
}
]
},
{
"id": "lonely",
"layout": "radial",
"mode": "nested",
"children": [
{
"id": "moon"
}
]
}
]
}
};
const result = layout(input, {"nodeSize":{"width":72,"height":32},"spacing":12});