2011-08-11 101 views
2
digraph foo { 
a [label="<first> A | <rest> rest", shape=record]; 
b [label="<first> B | <rest> rest", shape=record]; 
a:rest -> b [label="foo", arrowtail=dot, dir=both]; 
} 

我想從a:rest(理想的是居中)開始邊緣(a到b)的尾部,這可能嗎?從一個節點開始邊緣

我想繪製鏈接列表使用框和指針像記譜法。

回答

3

是的,這是可能的。使用的屬性被稱爲tailclip

如果爲真,邊緣的尾部被夾到尾 節點的邊界;否則,邊緣的末端將轉到節點的中心,即 或端口的中心(如果適用)。

你的最後一行就變成

a:rest -> b [label="foo", arrowtail=dot, dir=both, tailclip=false]; 

編輯:@Kyborek在評論中提到,需要對graphviz的當前版本的附加指南針點:

a:rest:c -> b [label="foo", arrowtail=dot, dir=both, tailclip=false]; 

參見this answer

+0

好的,這是實現這個和這個_should_工作的指令,但它看起來好像不這樣做,這取決於系統和graphviz版本。它適用於http://graphviz-dev.appspot.com/,但不適用於我的本地安裝(graphviz 2.27和2.28)。 – marapet

+0

是的,我無法得到它的工作 - 任何想法,該網站使用的版本? – wmercer

+0

不,我不知道哪個版本。 – marapet