pub fn to_dot<W: Write>(
        &self,
        w: &mut W,
        settings: &GraphvizSettings,
        as_subgraph: bool,
    ) -> io::Result<()> {
        if as_subgraph {
            write!(w, "subgraph cluster_{}", self.name)?;
        } else {
            write!(w, "digraph {}", self.name)?;
        }

        writeln!(w, " {{")?;

        if let Some(graph_attrs) = &settings.graph_attrs {
            writeln!(w, r#"    graph [{}];"#, graph_attrs)?;
        }
        if let Some(node_attrs) = &settings.node_attrs {
            writeln!(w, r#"    node [{}];"#, node_attrs)?;
        }
        if let Some(edge_attrs) = &settings.edge_attrs {
            writeln!(w, r#"    edge [{}];"#, edge_attrs)?;
        }
        if let Some(label) = &settings.graph_label {
            writeln!(w, r#"    label=<{}>;"#, label)?;
        } else {
            if as_subgraph {
                writeln!(w, "    label=\"{}\";", self.name)?;
            }
        }

        for node in self.nodes.iter() {
            write!(w, r#"    {} [shape="none", label=<"#, node.label)?;
            node.to_dot(w)?;
            writeln!(w, ">];")?;
        }

        for edge in self.edges.iter() {
            edge.to_dot(w)?;
        }

        writeln!(w, "}}")
    }
/// Returns the dot representation of the given graph.
/// This can rendered using the graphviz program.
Returns the dot representation of the given graph.
This can rendered using the graphviz program.
Returns the dot representation of the given graph . This can rendered using the graphviz program .
pub fn to_dot<W: Write>(
        &self,
        w: &mut W,
        settings: &GraphvizSettings,
        as_subgraph: bool,
    ) -> io::Result<()> {
        if as_subgraph {
            write!(w, "subgraph cluster_{}", self.name)?;
        } else {
            write!(w, "digraph {}", self.name)?;
        }
        writeln!(w, " {{")?;
        if let Some(graph_attrs) = &settings.graph_attrs {
            writeln!(w, r#"    graph [{}];"#, graph_attrs)?;
        }
        if let Some(node_attrs) = &settings.node_attrs {
            writeln!(w, r#"    node [{}];"#, node_attrs)?;
        }
        if let Some(edge_attrs) = &settings.edge_attrs {
            writeln!(w, r#"    edge [{}];"#, edge_attrs)?;
        }
        if let Some(label) = &settings.graph_label {
            writeln!(w, r#"    label=<{}>;"#, label)?;
        } else {
            if as_subgraph {
                writeln!(w, "    label=\"{}\";", self.name)?;
            }
        }
        for node in self.nodes.iter() {
            write!(w, r#"    {} [shape="none", label=<"#, node.label)?;
            node.to_dot(w)?;
            writeln!(w, ">];")?;
        }
        for edge in self.edges.iter() {
            edge.to_dot(w)?;
        }
        writeln!(w, "}}")
    }
pub fn to_dot < W : Write > ( & self , w : & mut W , settings : & GraphvizSettings , as_subgraph : bool , ) -> io :: Result < ( ) > { if as_subgraph { write ! ( w " " self name ) ? ; } else { write ! ( w " " self name ) ? ; } writeln ! ( w " " ) ? ; if let Some ( graph_attrs ) = & settings . graph_attrs { writeln ! ( w r#"    graph [{}];"# graph_attrs ) ? ; } if let Some ( node_attrs ) = & settings . node_attrs { writeln ! ( w r#"    node [{}];"# node_attrs ) ? ; } if let Some ( edge_attrs ) = & settings . edge_attrs { writeln ! ( w r#"    edge [{}];"# edge_attrs ) ? ; } if let Some ( label ) = & settings . graph_label { writeln ! ( w r#"    label=<{}>;"# label ) ? ; } else { if as_subgraph { writeln ! ( w " \" \" " self name ) ? ; } } for node in self . nodes . iter ( ) { write ! ( w r#"    {} [shape="none", label=<"# node label ) ? ; node . to_dot ( w ) ? ; writeln ! ( w " " ) ? ; } for edge in self . edges . iter ( ) { edge . to_dot ( w ) ? ; } writeln ! ( w " " ) }
Returns the dot representation of the given graph.
Returns the dot representation of the given graph .
&self
w
&mut W
settings
&GraphvizSettings
as_subgraph
bool
&self
w
&mut W
settings
&GraphvizSettings
as_subgraph
bool