2 unstable releases

0.2.0 Feb 18, 2022
0.1.0 Nov 2, 2021

#2579 in Rust patterns

Download history 2283/week @ 2024-03-14 7348/week @ 2024-03-21 8328/week @ 2024-03-28 6953/week @ 2024-04-04 5896/week @ 2024-04-11 4187/week @ 2024-04-18 2128/week @ 2024-04-25 2812/week @ 2024-05-02 3070/week @ 2024-05-09 4228/week @ 2024-05-16 3690/week @ 2024-05-23 5880/week @ 2024-05-30 3877/week @ 2024-06-06 3338/week @ 2024-06-13 3336/week @ 2024-06-20 2321/week @ 2024-06-27

13,826 downloads per month
Used in 24 crates (5 directly)

Custom license

24KB
391 lines

The set of macroses helping to generate the elements of graphviz

The set helps to generate the major components of the graphviz dot notation endevouring to follow comparatively close to the language notation

Description:

In overall, the format of macros is the following one:

  • name or id or any other markers
  • list of vec with a prefix , or seq of elems with a prefix ;

#Note:

  • for the list of items the way to pass vec is the following one: element(.. , vec of items)
  • for the seq of items the way to pass several items is the following one: element(.. ; items+)

Examples:

       fn graph_test() {
       use dot_generator::*;
       use dot_structures::*;

       let g = r#"
       strict digraph t {
           aa[color=green]
           subgraph v {
               aa[shape=square]
               subgraph vv{a2 -> b2}
               aaa[color=red]
               aaa -> bbb
           }
           aa -> be -> subgraph v { d -> aaa}
           aa -> aaa -> v
       }
       "#;

           graph!(strict di id!("t");
             node!("aa";attr!("color","green")),
             subgraph!("v";
               node!("aa"; attr!("shape","square")),
               subgraph!("vv"; edge!(node_id!("a2") => node_id!("b2"))),
               node!("aaa";attr!("color","red")),
               edge!(node_id!("aaa") => node_id!("bbb"))
               ),
             edge!(node_id!("aa") => node_id!("be") => subgraph!("v"; edge!(node_id!("d") => node_id!("aaa")))),
             edge!(node_id!("aa") => node_id!("aaa") => node_id!("v"))
           );
   }

Dependencies