節點

2013-01-09 44 views
3

我用GraphViz的有以下點文件之間的力的GraphViz力距離:節點

digraph G 
{ 
    rankdir=LR; 
    subgraph commits 
    { 
     "5c071a6b2c" -> "968bda3251" -> "9754d40473" -> "9e59700d33" -> "2a3242efa4"; 
    } 
    subgraph annotations 
    { 
     "V1.0" [shape=box]; 
     "br/HEAD" [shape=box]; 
     "V1.0" -> "9e59700d33" [weight=0]; 
     "br/HEAD" -> "2a3242efa4" [weight=0]; 
    } 
} 

它給我這樣的事情: Bag thing

但我想這樣的事情:

         V1.0   br/HEAD 
              |    | 
             \/   \/ 

5c071a6b2c - > 968bda3251 - > 9754d40473 - > 9e59700d33 - > 2a3242efa4

我該怎麼做?

對您的幫助, 提前致謝。

回答

8

這將調整註釋與提交:

digraph G 
{ 
    rankdir=LR; 
    subgraph commits 
    { 
     "5c071a6b2c" -> "968bda3251" -> "9754d40473" -> "9e59700d33" -> "2a3242efa4"; 
    } 
    subgraph annotations1 
    { 
     rank="same"; 
     "V1.0" [shape=box]; 
     "V1.0" -> "9e59700d33" [weight=0]; 
    } 
    subgraph annotations2 
    { 
     rank="same"; 
     "br/HEAD" [shape=box]; 
     "br/HEAD" -> "2a3242efa4" [weight=0]; 
    } 
} 

由於rank="same";影響整個子,我在兩個不同的子圖分割的註釋。

結果是: Result

+0

它的工作原理,謝謝。 – GlinesMome