2016-05-09 40 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