2013-03-19 18 views
6

としてPNGまたはSVG画像を使用して:私はgraphvizの(ノード<code>d</code>)でカスタムイメージ]ノードを使用しようとしたgraphvizのノード

digraph foo { 
    rankdir=LR; 
    node [shape=record]; 
    a [label="{ <data> 12 | <ref> }", width=1.2] 
    b [label="{ <data> 99 | <ref> }"]; 
    c [label="{ <data> 37 | <ref> }"]; 
    d [image="X_Shape_Pillar_Yellow.png"]; 
    a:ref:c -> b:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false, arrowsize=1.2]; 
    b:ref:c -> c:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false]; 
    c:ref:c -> d  [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false]; 
} 

残念ながら、画像は表示されません。

enter image description here

dot -v -Tpng list.dot -o list.png 

私のコード、院生:

は、私が使用してドットファイルをコンパイルしましたpng画像を編集中です。is stored in github

置き換えノードdをカスタム画像に使用するにはどうすればよいですか?

答えて

6

は、単にこのノードの他の形状を定義する、例えばshape=noneため:

d [shape=none, label="", image="X_Shape_Pillar_Yellow.png"]; 

デフォルトとして定義record形状はnoneboxともplaintext行う一方、画像が表示されません。

同時に、ラベルには何も設定しないことをお勧めします。

+1

ありがとう! https://github.com/adamatan/graphviz_linked_list/blob/master/list.png –

関連する問題