bra0-layout 0.2.2

bra0 graph layout engine — Rust for compute, WASM for browser
Documentation

bra0-layout

crates.io docs.rs

A pure-Rust Sugiyama-style layered layout engine for directed graphs. Builds natively and to WebAssembly.

[dependencies]
bra0-layout = "0.2"
use bra0_layout::{layout_hierarchical, LayoutNode, LayoutEdge, LayoutOptions};

let nodes = vec![
    LayoutNode { id: "a".into(), width: 40.0, height: 20.0 },
    LayoutNode { id: "b".into(), width: 40.0, height: 20.0 },
];
let edges = vec![LayoutEdge { source: "a".into(), target: "b".into() }];

let result = layout_hierarchical(&nodes, &edges, &LayoutOptions::default());
// result.positions: node id -> { x, y }

License

MIT OR Apache-2.0, at your option.