pub struct GraphDesc {
pub nodes: Vec<NodeDesc>,
pub edges: Vec<EdgeDesc>,
}Expand description
A whole graph description: the single input type of every layout pass.
Node and edge ORDER is meaningful: it is the deterministic tiebreak
for every heuristic in this crate (same GraphDesc in, same
crate::Layout out — golden-test-pinned).
use abstracttui_graph::{layered, GraphDesc, LayeredOpts};
let desc = GraphDesc::new()
.node("a", 8, 3)
.node("b", 8, 3)
.edge("a", "b");
let layout = layered(&desc, &LayeredOpts::default());
assert_eq!(layout.nodes.len(), 2);Fields§
§nodes: Vec<NodeDesc>Nodes, in caller order.
edges: Vec<EdgeDesc>Edges, in caller order. Layout edges echo their index here so
metadata (label/style) maps back even with duplicate endpoints.
Implementations§
Trait Implementations§
impl Eq for GraphDesc
impl StructuralPartialEq for GraphDesc
Auto Trait Implementations§
impl Freeze for GraphDesc
impl RefUnwindSafe for GraphDesc
impl Send for GraphDesc
impl Sync for GraphDesc
impl Unpin for GraphDesc
impl UnsafeUnpin for GraphDesc
impl UnwindSafe for GraphDesc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more