pub fn dump(
        &self,
        mut f: impl Write,
        offset: usize,
        use_element_names: bool,
    ) -> std::io::Result<()> {
        let active_node = self.first_unfull_node_id();

        for (i, j) in self.atoms.iter().enumerate() {
            if use_element_names {
                let label = crate::Atoms::label(*j);
                if active_node.is_some() && active_node.unwrap() == i {
                    writeln!(
                        f,
                        r#"  {} [shape=circle, label="{}", color=blue];"#,
                        i + offset,
                        label
                    )?;
                } else {
                    writeln!(f, r#"  {} [shape=circle, label="{}"];"#, i + offset, label)?;
                }
            } else {
                writeln!(f, r#"  {} [shape=circle, label="{}"];"#, i + offset, j)?;
            }
        }

        for j in 0..self.size() as usize {
            for i in 0..j {
                for _ in 0..*self.bonds.get(i as usize, j as usize) {
                    writeln!(
                        f,
                        r#"  {} -- {} [type=s, splines=none];"#,
                        i + offset,
                        j + offset
                    )?;
                }

                if *self.bonds.get(i as usize, j as usize) == 0
                    && self.is_edge_possible(i as usize, j as usize)
                {
                    writeln!(
                        f,
                        r#"  {} -- {} [splines=none, color=green];"#,
                        i + offset,
                        j + offset
                    )?;
                }
            }
        }

        std::io::Result::Ok(())
    }
/// Prints the graph using dot format.
/// Misses the first and last line (graph { and }).
/// You can specify if you want the node ids to start from a different number than 0
/// and if you want to replace element numbers with their abbreviated element name.
Prints the graph using dot format.
Misses the first and last line (graph { and }).
You can specify if you want the node ids to start from a different number than 0
and if you want to replace element numbers with their abbreviated element name.
Prints the graph using dot format . Misses the first and last line ( graph { and } ) . You can specify if you want the node ids to start from a different number than 0 and if you want to replace element numbers with their abbreviated element name .
pub fn dump(
        &self,
        mut f: impl Write,
        offset: usize,
        use_element_names: bool,
    ) -> std::io::Result<()> {
        let active_node = self.first_unfull_node_id();
        for (i, j) in self.atoms.iter().enumerate() {
            if use_element_names {
                let label = crate::Atoms::label(*j);
                if active_node.is_some() && active_node.unwrap() == i {
                    writeln!(
                        f,
                        r#"  {} [shape=circle, label="{}", color=blue];"#,
                        i + offset,
                        label
                    )?;
                } else {
                    writeln!(f, r#"  {} [shape=circle, label="{}"];"#, i + offset, label)?;
                }
            } else {
                writeln!(f, r#"  {} [shape=circle, label="{}"];"#, i + offset, j)?;
            }
        }
        for j in 0..self.size() as usize {
            for i in 0..j {
                for _ in 0..*self.bonds.get(i as usize, j as usize) {
                    writeln!(
                        f,
                        r#"  {} -- {} [type=s, splines=none];"#,
                        i + offset,
                        j + offset
                    )?;
                }
                if *self.bonds.get(i as usize, j as usize) == 0
                    && self.is_edge_possible(i as usize, j as usize)
                {
                    writeln!(
                        f,
                        r#"  {} -- {} [splines=none, color=green];"#,
                        i + offset,
                        j + offset
                    )?;
                }
            }
        }
        std::io::Result::Ok(())
    }
pub fn dump ( & self , mut f : impl Write , offset : usize , use_element_names : bool , ) -> std :: io :: Result < ( ) > { let active_node = self . first_unfull_node_id ( ) ; for ( i , j ) in self . atoms . iter ( ) . enumerate ( ) { if use_element_names { let label = crate :: Atoms :: label ( * j ) ; if active_node . is_some ( ) && active_node . unwrap ( ) == i { writeln ! ( f r#"  {} [shape=circle, label="{}", color=blue];"# i offset label ) ? ; } else { writeln ! ( f r#"  {} [shape=circle, label="{}"];"# i offset label ) ? ; } } else { writeln ! ( f r#"  {} [shape=circle, label="{}"];"# i offset j ) ? ; } } for j in 0 .. self . size ( ) as usize { for i in 0 .. j { for _ in 0 .. * self . bonds . get ( i as usize , j as usize ) { writeln ! ( f r#"  {} -- {} [type=s, splines=none];"# i offset j offset ) ? ; } if * self . bonds . get ( i as usize , j as usize ) == 0 && self . is_edge_possible ( i as usize , j as usize ) { writeln ! ( f r#"  {} -- {} [splines=none, color=green];"# i offset j offset ) ? ; } } } std :: io :: Result :: Ok ( ( ) ) }
Prints the graph using dot format.
Prints the graph using dot format .
&self
f
impl Write
offset
usize
use_element_names
bool