当您查看上图时,您可以很容易地看到a-> b的箭头与节点b重叠。箭头的尖端应该在b节点框之前停止,就像c-> d中的情况一样。产生此结果的代码是:
digraph{
node[shape="box"]
a->b[color=blue, penwidth=20]
c->d[color=blue]
}
正在使用的布局引擎是“点”布局引擎。
答案 0 :(得分:1)
headclip(和尾部剪裁)使得绘制边缘的笔的中心在穿过由形状笔的中心绘制的假想线时停止。这是预期的行为。 graphviz不会补偿笔宽,因为它设计用于图形布局。你必须发布过程或手动编辑点引擎的输出(svg或点)。
digraph{ ranksep=0.5 nodesep=0.5 margin=0.5
node[shape="box"]
{ node[penwidth=1] a c e}
{ node[penwidth=20] b d f}
a->b->c [color=blue penwidth=20]
d->e->f [color=blue]
}
png显示圆形笔边(和令人讨厌的剪裁)
svg在边缘和形状上显示尖锐的提示
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: %8851 Pages: 1 -->
<svg width="224pt" height="260pt"
viewBox="36.00 36.00 188.00 224.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(40 220)">
<title>%8851</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-184 148,-184 148,4 -4,4"/>
<!-- a -->
<g id="node1" class="node"><title>a</title>
<polygon fill="none" stroke="black" points="54,-180 0,-180 0,-144 54,-144 54,-180"/>
<text text-anchor="middle" x="27" y="-158.3" font-family="Times New Roman,serif" font-size="14.00">a</text>
</g>
<!-- b -->
<g id="node4" class="node"><title>b</title>
<polygon fill="none" stroke="black" stroke-width="20" points="54,-108 0,-108 0,-72 54,-72 54,-108"/>
<text text-anchor="middle" x="27" y="-86.3" font-family="Times New Roman,serif" font-size="14.00">b</text>
</g>
<!-- a->b -->
<g id="edge1" class="edge"><title>a->b</title>
<path fill="none" stroke="blue" stroke-width="20" d="M27,-143.697C27,-135.983 27,-126.712 27,-118.112"/>
<polygon fill="blue" stroke="blue" stroke-width="20" points="44.5001,-118.104 27,-108.104 9.5001,-118.105 44.5001,-118.104"/>
</g>
<!-- c -->
<g id="node2" class="node"><title>c</title>
<polygon fill="none" stroke="black" points="54,-36 0,-36 0,-0 54,-0 54,-36"/>
<text text-anchor="middle" x="27" y="-14.3" font-family="Times New Roman,serif" font-size="14.00">c</text>
</g>
<!-- e -->
<g id="node3" class="node"><title>e</title>
<polygon fill="none" stroke="black" points="144,-108 90,-108 90,-72 144,-72 144,-108"/>
<text text-anchor="middle" x="117" y="-86.3" font-family="Times New Roman,serif" font-size="14.00">e</text>
</g>
<!-- f -->
<g id="node6" class="node"><title>f</title>
<polygon fill="none" stroke="black" stroke-width="20" points="144,-36 90,-36 90,-0 144,-0 144,-36"/>
<text text-anchor="middle" x="117" y="-14.3" font-family="Times New Roman,serif" font-size="14.00">f</text>
</g>
<!-- e->f -->
<g id="edge4" class="edge"><title>e->f</title>
<path fill="none" stroke="blue" d="M117,-71.6966C117,-63.9827 117,-54.7125 117,-46.1124"/>
<polygon fill="blue" stroke="blue" points="120.5,-46.1043 117,-36.1043 113.5,-46.1044 120.5,-46.1043"/>
</g>
<!-- b->c -->
<g id="edge2" class="edge"><title>b->c</title>
<path fill="none" stroke="blue" stroke-width="20" d="M27,-71.6966C27,-63.9827 27,-54.7125 27,-46.1124"/>
<polygon fill="blue" stroke="blue" stroke-width="20" points="44.5001,-46.1042 27,-36.1043 9.5001,-46.1045 44.5001,-46.1042"/>
</g>
<!-- d -->
<g id="node5" class="node"><title>d</title>
<polygon fill="none" stroke="black" stroke-width="20" points="144,-180 90,-180 90,-144 144,-144 144,-180"/>
<text text-anchor="middle" x="117" y="-158.3" font-family="Times New Roman,serif" font-size="14.00">d</text>
</g>
<!-- d->e -->
<g id="edge3" class="edge"><title>d->e</title>
<path fill="none" stroke="blue" d="M117,-143.697C117,-135.983 117,-126.712 117,-118.112"/>
<polygon fill="blue" stroke="blue" points="120.5,-118.104 117,-108.104 113.5,-118.104 120.5,-118.104"/>
</g>
</g>
</svg>