Trait net_ensembles::traits::Dot
source · [−]pub trait Dot {
fn dot_from_indices<F, W, S1, S2>(
&self,
writer: W,
dot_options: S1,
f: F
) -> Result<(), Error>
where
S1: AsRef<str>,
S2: AsRef<str>,
W: Write,
F: FnMut(usize) -> S2;
fn dot_string_from_indices<F, S1, S2>(&self, dot_options: S1, f: F) -> String
where
S1: AsRef<str>,
S2: AsRef<str>,
F: FnMut(usize) -> S2,
{ ... }
fn dot_with_indices<S, W>(
&self,
writer: W,
dot_options: S
) -> Result<(), Error>
where
S: AsRef<str>,
W: Write,
{ ... }
fn dot_string_with_indices<S>(&self, dot_options: S) -> String
where
S: AsRef<str>,
{ ... }
fn dot<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>
where
S: AsRef<str>,
W: Write,
{ ... }
fn dot_string<S>(&self, dot_options: S) -> String
where
S: AsRef<str>,
{ ... }
}
Expand description
Trait, which enables you to write a dot file
- Dot files can be used to visualize a graph
- To visualize, you can use something like
twopi dotfile.dot -Tpdf > dotfile.pdf
circo dotfile.dot -Tpdf > dotfile.pdf
You can also try some of the other roadmaps.
Required Methods
sourcefn dot_from_indices<F, W, S1, S2>(
&self,
writer: W,
dot_options: S1,
f: F
) -> Result<(), Error>where
S1: AsRef<str>,
S2: AsRef<str>,
W: Write,
F: FnMut(usize) -> S2,
fn dot_from_indices<F, W, S1, S2>(
&self,
writer: W,
dot_options: S1,
f: F
) -> Result<(), Error>where
S1: AsRef<str>,
S2: AsRef<str>,
W: Write,
F: FnMut(usize) -> S2,
- use function
f
to create labels depending on the index - for valid
dot_options
usedot_options!
macro and take a look at moduledot_constants
Provided Methods
sourcefn dot_string_from_indices<F, S1, S2>(&self, dot_options: S1, f: F) -> Stringwhere
S1: AsRef<str>,
S2: AsRef<str>,
F: FnMut(usize) -> S2,
fn dot_string_from_indices<F, S1, S2>(&self, dot_options: S1, f: F) -> Stringwhere
S1: AsRef<str>,
S2: AsRef<str>,
F: FnMut(usize) -> S2,
- same as
self.dot_from_indices
but returns String instead
sourcefn dot_with_indices<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>where
S: AsRef<str>,
W: Write,
fn dot_with_indices<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>where
S: AsRef<str>,
W: Write,
- use index as labels for the nodes
- default implementation uses
dot_from_indices
sourcefn dot_string_with_indices<S>(&self, dot_options: S) -> Stringwhere
S: AsRef<str>,
fn dot_string_with_indices<S>(&self, dot_options: S) -> Stringwhere
S: AsRef<str>,
- same as
self.dot_with_indices
but returns String instead
sourcefn dot<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>where
S: AsRef<str>,
W: Write,
fn dot<S, W>(&self, writer: W, dot_options: S) -> Result<(), Error>where
S: AsRef<str>,
W: Write,
- create dot file with empty labels
- default implementation uses
dot_from_indices
sourcefn dot_string<S>(&self, dot_options: S) -> Stringwhere
S: AsRef<str>,
fn dot_string<S>(&self, dot_options: S) -> Stringwhere
S: AsRef<str>,
- same as
self.dot()
, but returns a String instead
Implementors
impl<T, A> Dot for GenericGraph<T, A>where
T: Node,
A: AdjContainer<T>,
impl<T, R> Dot for ErEnsembleC<T, R>where
T: Node,
impl<T, R> Dot for ErEnsembleM<T, R>where
T: Node,
impl<T, R> Dot for DogEnsemble<T, R>where
T: Node,
You should use neato if you want the correct spacial placement of nodes
impl<T, R> Dot for SpacialEnsemble<T, R>where
T: Node,
You should use neato if you want the correct spacial placement of nodes