pub trait Labeller<'a> {
type Node;
type Edge;
type Subgraph;
Show 17 methods
fn graph_id(&'a self) -> Result<Id<'a>>;
fn node_id(&'a self, n: &Self::Node) -> Result<Id<'a>>;
fn node_shape(&'a self, _node: &Self::Node) -> Option<Text<'a>> { ... }
fn node_label(&'a self, n: &Self::Node) -> Result<Text<'a>> { ... }
fn node_style(&'a self, _n: &Self::Node) -> Style { ... }
fn node_color(&'a self, _node: &Self::Node) -> Option<Text<'a>> { ... }
fn edge_end_arrow(&'a self, _e: &Self::Edge) -> Arrow { ... }
fn edge_start_arrow(&'a self, _e: &Self::Edge) -> Arrow { ... }
fn edge_label(&'a self, _e: &Self::Edge) -> Text<'a> { ... }
fn edge_style(&'a self, _e: &Self::Edge) -> Style { ... }
fn edge_color(&'a self, _e: &Self::Edge) -> Option<Text<'a>> { ... }
fn subgraph_id(&'a self, _s: &Self::Subgraph) -> Option<Id<'a>> { ... }
fn subgraph_label(&'a self, _s: &Self::Subgraph) -> Text<'a> { ... }
fn subgraph_style(&'a self, _s: &Self::Subgraph) -> Style { ... }
fn subgraph_shape(&'a self, _s: &Self::Subgraph) -> Option<Text<'a>> { ... }
fn subgraph_color(&'a self, _s: &Self::Subgraph) -> Option<Text<'a>> { ... }
fn kind(&self) -> Kind { ... }
}Expand description
Each instance of a type that implements Label<C> maps to a
unique identifier with respect to C, which is used to identify
it in the generated .dot file. They can also provide more
elaborate (and non-unique) label text that is used in the graphviz
rendered output.
The graph instance is responsible for providing the DOT compatible
identifiers for the nodes and (optionally) rendered labels for the nodes and
edges, as well as an identifier for the graph itself.
Associated Types
Required methods
Must return a DOT compatible identifier naming the graph.
Provided methods
fn node_shape(&'a self, _node: &Self::Node) -> Option<Text<'a>>
fn node_shape(&'a self, _node: &Self::Node) -> Option<Text<'a>>
Maps n to one of the graphviz shape names. If None
is returned, no shape attribute is specified.
fn node_label(&'a self, n: &Self::Node) -> Result<Text<'a>>
fn node_label(&'a self, n: &Self::Node) -> Result<Text<'a>>
Maps n to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is just the output from node_id.
fn node_style(&'a self, _n: &Self::Node) -> Style
fn node_style(&'a self, _n: &Self::Node) -> Style
Maps n to a style that will be used in the rendered output.
fn node_color(&'a self, _node: &Self::Node) -> Option<Text<'a>>
fn node_color(&'a self, _node: &Self::Node) -> Option<Text<'a>>
Maps n to one of the graphviz color names. If None
is returned, no color attribute is specified.
fn edge_end_arrow(&'a self, _e: &Self::Edge) -> Arrow
fn edge_end_arrow(&'a self, _e: &Self::Edge) -> Arrow
Maps e to arrow style that will be used on the end of an edge.
Defaults to default arrow style.
fn edge_start_arrow(&'a self, _e: &Self::Edge) -> Arrow
fn edge_start_arrow(&'a self, _e: &Self::Edge) -> Arrow
Maps e to arrow style that will be used on the end of an edge.
Defaults to default arrow style.
fn edge_label(&'a self, _e: &Self::Edge) -> Text<'a>
fn edge_label(&'a self, _e: &Self::Edge) -> Text<'a>
Maps e to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is in fact the empty string.
fn edge_style(&'a self, _e: &Self::Edge) -> Style
fn edge_style(&'a self, _e: &Self::Edge) -> Style
Maps e to a style that will be used in the rendered output.
fn edge_color(&'a self, _e: &Self::Edge) -> Option<Text<'a>>
fn edge_color(&'a self, _e: &Self::Edge) -> Option<Text<'a>>
Maps e to one of the graphviz color names. If None
is returned, no color attribute is specified.
fn subgraph_id(&'a self, _s: &Self::Subgraph) -> Option<Id<'a>>
fn subgraph_id(&'a self, _s: &Self::Subgraph) -> Option<Id<'a>>
Maps s to a unique subgraph identifier.
Prefix this identifier by cluster_ to draw this subgraph in its own distinct retangle.
fn subgraph_label(&'a self, _s: &Self::Subgraph) -> Text<'a>
fn subgraph_label(&'a self, _s: &Self::Subgraph) -> Text<'a>
Maps s to the corresponding subgraph label.
fn subgraph_style(&'a self, _s: &Self::Subgraph) -> Style
fn subgraph_style(&'a self, _s: &Self::Subgraph) -> Style
Maps s to the corresponding subgraph style (default to Style::None).
fn subgraph_shape(&'a self, _s: &Self::Subgraph) -> Option<Text<'a>>
fn subgraph_shape(&'a self, _s: &Self::Subgraph) -> Option<Text<'a>>
Maps s to the corresponding subgraph shape.
If None is returned (default), no shape attribute is specified.
fn subgraph_color(&'a self, _s: &Self::Subgraph) -> Option<Text<'a>>
fn subgraph_color(&'a self, _s: &Self::Subgraph) -> Option<Text<'a>>
Maps s to one of the [graphviz color names][1]. If None
is returned, no color attribute is specified.