[][src]Trait net_ensembles::traits::Dot

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>
, { ... } }

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

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 use dot_options! macro and take a look at module dot_constants
Loading content...

Provided methods

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, 

  • same as self.dot_from_indices but returns String instead

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

fn dot_string_with_indices<S>(&self, dot_options: S) -> String where
    S: AsRef<str>, 

  • same as self.dot_with_indices but returns String instead

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

fn dot_string<S>(&self, dot_options: S) -> String where
    S: AsRef<str>, 

  • same as self.dot(), but returns a String instead
Loading content...

Implementors

impl<T, A> Dot for GenericGraph<T, A> where
    T: Node,
    A: AdjContainer<T>, 
[src]

Loading content...