如何使用 graphviz 的控制点在两点之间绘制样条曲线?

How to draw a spline curve between 2 points with a control points with graphviz?

我想以红点为控制点在蓝点和绿点之间创建一条样条曲线。

Graphviz 文档说:

  1. splines attribute,bool 或 string 类型,在 Graphs
  2. 上有效
  3. splineType 模式:spline ( ';' spline )* 是 pos 属性的有效类型
  4. pos attribute 在边和节点上有效

我试过这张图

graph G{     
layout ="neato" outputorder="edgesfirst" splines="true"
a[shape="point" pos="0,0!"        color="blue"]
b[shape="point" pos="1,0!"        color="green"]
c[shape="point" pos=" 0.5,0.5!"   color="red"]
a -- b [pos="e,1,0 s,0,0 0.5,0.5!"]   
}

然后 Windows 10 PowerShell :

neato.exe -Tsvg .\spline.dot > .\spline.svg

neato - graphviz version 2.49.3 (20211023.0002)

结果

实现此目标的正确方法是什么?

谢谢。

关闭,但是...

所以:

graph G{
// default units for pos values are in points (72/inch)
// multiplied by 100 out of laziness 
// ! only applies to nodes, not edges
layout ="neato"
outputorder="edgesfirst"  // why???
splines="true"

a[shape="point" pos="0,0!"        color="blue"]
b[shape="point" pos="100,0!"        color="green"]
c[shape="point" pos="50,50!"   color="red"]
// "s" arrowhead must preceed "e" arrowhead,  so swaped them
// BUT, "--" says non-directed graph, NO arrowheads, so they are deleted
// also need 4, 7, 11, ... points NOT including arrowhead points
// so added points (just guesses)
a -- b [pos="0,0 30,66 70,66 100,0"]   
}

给出: