Reference

Relationships

After parsing, Mantou builds a relationship index so expressions can walk the graph cheaply.

Accessors#

  • node.parent — the explicit parent reference
  • node.children — direct children
  • node.ancestors — parent chain to the root
  • node.descendants — everything beneath
  • node.neighbors — nodes connected by an edge
  • node.incoming / node.outgoing — edges

Deep styling#

mantou
style node {
background: node.selected ? chili
  : node.ancestors.any(selected) ? bamboo
  : node.descendants.any(status == "failed") ? danger
  : cream
border: node.parent.selected ? scallion : border
}

Select Root or Backend below — descendants tint via ancestors.any(selected), and any branch containing a failed node turns danger.

🥟

Org / Dependency Tree

Mini Map
🥟

Nothing selected

Click a node or edge to inspect it. Connected nodes light up, the rest dim.