use super::LabelText::{self, EscStr, HtmlStr, LabelStr};
use super::{render, Edges, GraphWalk, Id, Labeller, Nodes, Style};
use std::io;
use std::io::prelude::*;
use NodeLabels::*;
/// each node is an index in a vector in the graph.
type Node = usize;
struct Edge {
from: usize,
to: usize,
label: &'static str,
style: Style,
}
fn edge(from: usize, to: usize, label: &'static str, style: Style) -> Edge {
Edge { from, to, label, style }
}
struct LabelledGraph {
/// The name for this graph. Used for labeling generated `digraph`.
name: &'static str,
/// Each node is an index into `node_labels`; these labels are
/// used as the label text for each node. (The node *names*,
/// which are unique identifiers, are derived from their index
/// in this array.)
///
/// If a node maps to None here, then just use its name as its
/// text.
node_labels: Vec