Skip to main content

Module depgraph_layout

Module depgraph_layout 

Source
Expand description

Pure (no-egui) dependency-graph layout + edge classification — a re-home of nornir’s src/viz/depgraph_layout.rs. Domain-agnostic: instead of nornir’s CrossRepoEdge it takes a generic DepEdge (from/to + a via label list), so any host (nornir’s dep graph, a package graph, a graph- DB browse) lays out the same way.

Egui-free → inject-and-assert testable (feed a known multi-level graph and assert the transitive closure, the direct-vs-transitive edge classification, and the laid-out node positions) + introspectable (DepGraphLayout::state_json folds straight into a viz state_json so a robot reads the rendered structure without a screenshot).

Two display modes:

  • direct — only the edges the host recorded, one column per topo rank.
  • deep — the FULL transitive closure: every from gets an edge to every node reachable from it, the synthesised ones flagged so a renderer dims them.

Click-to-expand: a node can be collapsed, hiding the subtree reachable only through it; DepGraphLayout::visible reports which nodes survive.

Structs§

DepEdge
One recorded dependency edge: from depends on to, justified by the via labels (e.g. the crates the consumer pulls from the producer). The generic stand-in for nornir’s CrossRepoEdge.
DepGraphLayout
The complete laid-out dependency graph in one display mode.
LaidEdge
A laid-out edge: endpoints + classification + the via labels (empty for a synthesised transitive edge) + the shortest hop distance.
LaidNode
A laid-out node: placed on a column/row grid.

Enums§

EdgeClass
How an edge in the laid-out graph relates to the recorded input.