# bra0-layout
[](https://crates.io/crates/bra0-layout)
[](https://docs.rs/bra0-layout)
A pure-Rust Sugiyama-style layered layout engine for directed graphs. Builds natively and
to WebAssembly.
```toml
[dependencies]
bra0-layout = "0.2"
```
```rust
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.