display

Function display 

Source
pub fn display<ID, T>(graph: &DirectedGraph<ID, T>, config: &Config<ID, T>)
where ID: Hash + Eq + Display,
Expand description

This is used to output the given Graph to the Terminal

§Usage

  1. Construct a DirectedGraph from your own Data-Structure
  2. 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);