| 1 | use graplot::{Graph, graph::{EdgeColor, GraphDesc}, RED, MAGENTA}; |
| 2 | |
| 3 | fn main() { |
| 4 | let mut graph = Graph::new(); |
| 5 | graph.graph_desc = GraphDesc { |
| 6 | title: String::from("Graph"), |
| 7 | node_color: RED, |
| 8 | egde_color: EdgeColor::Use(MAGENTA), |
| 9 | ..Default::default() |
| 10 | }; |
| 11 | let a = graph.add_node(vec![]); |
| 12 | let b = graph.add_node(vec![]); |
| 13 | let c = graph.add_node(vec![]); |
| 14 | |
| 15 | let d = graph.add_node(vec![a.idx, b.idx]); |
| 16 | let e = graph.add_node(vec![a.idx, c.idx]); |
| 17 | |
| 18 | let _f = graph.add_node(vec![d.idx, e.idx, b.idx]); |
| 19 | |
| 20 | graph.show(); |
| 21 | } |