2016-05-09 45 views
0

我在Graphviz中有佈局問題。我尋找一種有點通用的方法,讓入站邊沿進入一個節點,均勻地分佈在左側,並從右側中間退出。如何使用點佈局布爾組合系統

總之我想讓這樣的事情,

goal

但不是我的標記生成此

current

從這個代碼

graph g { 
    splines=ortho; 
    nodesep=0.005 
    rankdir="LR"; 

    node [shape=box width=.5]; 

    x [shape=none]; 
    y1 [label="y" shape=none]; 
    y2 [label="y" shape=none]; 
    z [shape=none]; 
    f [label="f(x,y,z)" shape=none]; 

    A [label="&"]; 
    B [label="1" ]; 
    C [label="&" ]; 
    D [label="≥1"]; 

    x -- A; 
    y1 -- A; 
    A -- D; 
    y2 -- B; 
    B -- C [arrowtail="odot"]; 
    z -- C; 
    C -- D; 
    D -- f; 

    { rank=same; x y1 y2 z } 
    { rank=same; A B } 
    { rank=same; C } 
    { rank=same; D } 
    { rank=same; f } 
} 

我我已經嘗試過e樣條,nodsep和pos屬性都沒有取得可接受的結果。

回答

0

HTML-like labels將是解決方案。不幸的是ports不能與splines=orthoissue)一起使用,並且樣條線在邏輯圖表上看起來不太好。這個端口/鄰接錯誤也適用於記錄形狀節點。所以基本上你都迷路了。

digraph logic { rankdir=LR 
    node [shape=plaintext] 
    nand [label=< 
     <TABLE CELLBORDER="0" CELLSPACING="0"> 
      <TR> 
       <TD><TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"> 
        <TR><TD BORDER="0" PORT="1">1</TD></TR> 
        <TR><TD BORDER="0" PORT="2">2</TD></TR> 
       </TABLE></TD> 
       <TD BORDER="0" PORT="out">&amp;</TD> 
      </TR> 
     </TABLE>>]; 
    1 -> nand:1:w [dir=none] 
    2 -> nand:2:w [dir=none] 
    nand:out:e -> out [dir=back arrowtail=odot] 
} 

enter image description here

+0

這太糟糕了,也許我應該看看tikz代替 – davl