Module graphviz_rust::cmd

source ·
Expand description

It allows to execute cmd engine passing extra parameters

It is important: to execute it properly it needs to have an executable package on the system

The extra information can be found in layouts and outputs

Example:

    use dot_structures::*;
    use dot_generator::*;
    use graphviz_rust::attributes::*;
    use graphviz_rust::cmd::{CommandArg, Format};
    use graphviz_rust::exec;
    use graphviz_rust::printer::{PrinterContext,DotPrinter};

 fn graph_to_output(){
    let mut g = graph!(id!("id");
            node!("nod"),
            subgraph!("sb";
                edge!(node_id!("a") => subgraph!(;
                   node!("n";
                   NodeAttributes::color(color_name::black), NodeAttributes::shape(shape::egg))
               ))
           ),
           edge!(node_id!("a1") => node_id!(esc "a2"))
       );
       let graph_svg = exec(g, &mut PrinterContext::default(), vec![
           CommandArg::Format(Format::Svg),
       ]).unwrap();

 }
 fn graph_to_file(){
        let mut g = graph!(id!("id"));
        let mut ctx = PrinterContext::default();
        ctx.always_inline();
        let empty = exec(g.print(&mut ctx), vec![
           CommandArg::Format(Format::Svg),
           CommandArg::Output("1.svg".to_string())
       ]);

 }

Enums

Command arguments that can be passed to exec. The list of possible commands