1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! # dagre-rs
//!
//! A faithful Rust port of [dagre-js](https://github.com/dagrejs/dagre) — a directed-graph
//! layout engine that assigns **x/y coordinates** to nodes and **bend-point sequences** to
//! edges, while keeping edge crossings to a minimum.
//!
//! ## Quick start
//!
//! ```rust
//! use dagre_dgl_rs::{Graph, GraphLabel, NodeLabel, EdgeLabel, layout};
//!
//! let mut g = Graph::default();
//! g.set_graph(GraphLabel {
//! rankdir: Some("LR".to_string()),
//! nodesep: Some(50.0),
//! ranksep: Some(50.0),
//! ..Default::default()
//! });
//!
//! g.set_node("a", NodeLabel { width: 100.0, height: 40.0, ..Default::default() });
//! g.set_node("b", NodeLabel { width: 100.0, height: 40.0, ..Default::default() });
//! g.set_edge("a", "b", EdgeLabel::default(), None);
//!
//! layout(&mut g);
//!
//! let a = g.node("a");
//! println!("node a: ({:?}, {:?})", a.x, a.y);
//! ```
//!
//! ## Modules
//!
//! Most users only need the items re-exported at the crate root. The sub-modules
//! (`acyclic`, `rank`, `order`, `position`, …) contain the individual pipeline stages
//! and are public for advanced use or testing.
/// Graph data structures used internally by the layout pipeline (e.g. doubly-linked list).
/// Entry point for the full dagre layout pipeline ([`layout::layout`]).
/// Shared utility functions used across the layout pipeline.
/// Core graph types: [`Graph`], [`NodeLabel`], [`EdgeLabel`], [`GraphLabel`], [`Edge`],
/// [`Point`], and [`SelfEdge`].
pub use ;
/// Run the full dagre layout pipeline on a graph. See [`layout::layout`] for details.
pub use layout;