pub fn display<ID, T>(graph: &DirectedGraph<ID, T>, config: &Config<ID, T>)Expand description
This is used to output the given Graph to the Terminal
§Usage
- Construct a
DirectedGraphfrom your own Data-Structure - Pass the Graph to this function along with a Configuration specifying how it looks
§Example
use termgraph::{DirectedGraph, IDFormatter, Config};
let config = Config::new(IDFormatter::new(), 3);
let mut graph = DirectedGraph::new();
graph.add_nodes([(0, "first"), (1, "second"), (2, "third")]);
graph.add_edges([(0, 1), (0,2), (1, 2)]);
termgraph::display(&graph, &config);