harshsikhwal / csdot

A c# based DOT (graphviz) framework
https://graphviz.org/resources/
MIT License
32 stars 6 forks source link

[LoadDigraph] Subgraph name can be avoided if no ID is associated #23

Closed harshsikhwal closed 3 years ago

harshsikhwal commented 3 years ago

File: Resources\test\Issues[LoadDigraph] Subgraph name can be avoided if no ID is associated\rank.dot

Subgraph as a keyword can be removed if no ID is associated:

Original:

digraph R {
  node [shape=record];
  { rank=same rA sA tA }
  { rank=same uB vB wB }
   rA -> sA;
   sA -> vB;
   t  -> rA;
   uB -> vB;
   wB -> u;
   wB -> tA;
}

Output:

graph R
{
    node [ shape = "record" ]
    subgraph 
    {
        rank = "same"
        rA;
        sA;
        tA;
    }
    subgraph 
    {
        rank = "same"
        uB;
        vB;
        wB;
    }
    rA -> sA 
    sA -> vB 
    t -> rA 
    uB -> vB 
    wB -> u 
    wB -> tA 
}
Vibaswan commented 3 years ago

issue fixed please see commit 3825b9a276ec8b0e7cc8f001fbe91f8b8c3e9838