pub fn svg(&self, path: impl AsRef<Path>) -> Result<()> {
        let path = path.as_ref();
        if let Some(parent) = path.parent() {
            fs::create_dir_all(parent)?;
        }
        let mut command = Command::new("dot");
        command
            .args(&["-T", "svg", "-Gsplines=ortho", "-o"])
            .arg(path);
        if log::log_enabled!(log::Level::Debug) {
            command.arg("-v");
        }
        let mut dot = command.stdin(Stdio::piped()).spawn()?;

        dot.stdin
            .as_ref()
            .unwrap()
            .write_all(self.dot().as_bytes())?;

        ensure!(dot.wait()?.success(), "Failed to generate SVG");

        Ok(())
    }
/// Save the graph as a SVG file.
///
/// This requires that a binary called `dot` be available. Tested with version 2.43.0.
/// You can install it with the `graphviz` package.
Save the graph as a SVG file.
This requires that a binary called `dot` be available.
Save the graph as a SVG file . This requires that a binary called ` dot ` be available .
pub fn svg(&self, path: impl AsRef<Path>) -> Result<()> {
        let path = path.as_ref();
        if let Some(parent) = path.parent() {
            fs::create_dir_all(parent)?;
        }
        let mut command = Command::new("dot");
        command
            .args(&["-T", "svg", "-Gsplines=ortho", "-o"])
            .arg(path);
        if log::log_enabled!(log::Level::Debug) {
            command.arg("-v");
        }
        let mut dot = command.stdin(Stdio::piped()).spawn()?;
        dot.stdin
            .as_ref()
            .unwrap()
            .write_all(self.dot().as_bytes())?;
        ensure!(dot.wait()?.success(), "Failed to generate SVG");
        Ok(())
    }
pub fn svg ( & self , path : impl AsRef < Path > ) -> Result < ( ) > { let path = path . as_ref ( ) ; if let Some ( parent ) = path . parent ( ) { fs :: create_dir_all ( parent ) ? ; } let mut command = Command :: new ( " " ) ; command . args ( & [ " " , " " , " " , " " ] ) . arg ( path ) ; if log :: log_enabled ! ( log Level Debug ) { command . arg ( " " ) ; } let mut dot = command . stdin ( Stdio :: piped ( ) ) . spawn ( ) ? ; dot . stdin . as_ref ( ) . unwrap ( ) . write_all ( self . dot ( ) . as_bytes ( ) ) ? ; ensure ! ( dot wait ( ) success ( ) " " ) ; Ok ( ( ) ) }
Save the graph as a SVG file.
Save the graph as a SVG file .
&self
path
impl AsRef<Path>
&self
path
impl AsRef<Path>