2017-07-10 36 views
2
digraph G { 
    compound=true; 

    subgraph SJC { 
     node [style="filled"]; 
     label = "SJC"; 
     channel [shape=cylinder]; 

    } 
    subgraph Fleet { 
     node [style="filled"]; 
     App1 [shape=cylinder]; 
     App2 [shape=cylinder]; 
     App3 [shape=cylinder]; 
     label = "Fleet of machines"; 
     style="filled"; 
     color="lightgrey"; 

    } 

    App1 -> channel [ltail=SJC, lhead=Fleet]; 

} 

通過上面的代碼,我的期望是得到2個與子圖對應的容器框。不過,我收到相關圖片如下:無法繪製子圖

enter image description here

而且,我得到兩次警告。

Warning: cluster named Fleet not found 
Warning: cluster named SJC not found 

回答

1

這是你的更正後的代碼:

digraph G { 
compound=true; 

subgraph cluster_SJC { 
    node [style="filled"]; 
    label = "SJC"; 
    channel [shape=cylinder]; 
} 

subgraph cluster_Fleet { 
    node [style="filled"]; 
    App1 [shape=cylinder]; 
    App2 [shape=cylinder]; 
    App3 [shape=cylinder]; 
    label = "Fleet of machines"; 
    style="filled"; 
    color="lightgrey"; 
} 

App1 -> channel [lhead=cluster_SJC, ltail=cluster_Fleet]; 

}

我的 「缸」 呈現爲框。從來沒有讓圓柱體形狀在Graphviz 2.38.0中工作。

子圖名前的cluster_約定是dot語言構造,所有引擎都不支持該構造。 enter image description here

1

有兩個錯誤:

  1. 作爲另一個post解釋,前綴 「集羣」 被失蹤子的名字。
  2. 尾巴和頭部扭轉。