Crate termgraph

Source
Expand description

A Crate to output graphs on the Terminal

§Intended Use-Case

This is mostly intended to help in developing other Software that uses Graphs and needs a way to easily display them, either during Debugging or as Output to display to the User.

§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);

Structs§

Config
The Configuration to use for displaying a Graph
DirectedGraph
A Directed Graph that can be displayed using display
IDFormatter
Returns the ID for Formatting
LineGlyphBuilder
This builder is used to construct a LineGlyphs instance
LineGlyphs
Describes the Glyphs that should be used to display the lines in the Graph.
ValueFormatter
Returns the Value for Formatting

Enums§

Color
The Colors that can be displayed in the console

Traits§

NodeFormat
Specifies how the Nodes of the Graph should be formatted

Functions§

display
This is used to output the given Graph to the Terminal
fdisplay
This function is essentially the same as display, but allows you to specify the Output Target.