如何使用 Dot 和 Graphviz 循环布局完整的图形?
How to layout complete graphs circularly using Dot and Graphviz?
如何在图表中布置节点"circularly",类似于下图中的图表:
Graphviz 提供 circo layout engine 圆形布局。
circo draws graphs using a circular layout (see Six and Tollis, GD ’99
and ALENEX ’99, and Kaufmann and Wiese, GD ’02.) The tool identifies
biconnected components and draws the nodes of the component on a
circle. The block-cutpoint tree is then laid out using a recursive
radial algorithm. Edge crossings within a circle are minimized by
placing as many edges on the circle’s perimeter as possible. In
particular, if the component is outerplanar, the component will have a
planar layout. If a node belongs to multiple non-trivial biconnected
components, the layout puts the node in one of them. By default, this
is the first non-trivial component found in the search from the root
component.
K3 的一个简单示例是:
graph K3 {
layout=circo;
node[shape=point, color=red];
a--b--c--a;
}
但是,大多数图表的方向与您图片上的方向不同。 K3 示例将产生以下结果:
要在线测试其他布局引擎,您可以使用 GraphvizOnline。
如何在图表中布置节点"circularly",类似于下图中的图表:
Graphviz 提供 circo layout engine 圆形布局。
circo draws graphs using a circular layout (see Six and Tollis, GD ’99 and ALENEX ’99, and Kaufmann and Wiese, GD ’02.) The tool identifies biconnected components and draws the nodes of the component on a circle. The block-cutpoint tree is then laid out using a recursive radial algorithm. Edge crossings within a circle are minimized by placing as many edges on the circle’s perimeter as possible. In particular, if the component is outerplanar, the component will have a planar layout. If a node belongs to multiple non-trivial biconnected components, the layout puts the node in one of them. By default, this is the first non-trivial component found in the search from the root component.
K3 的一个简单示例是:
graph K3 {
layout=circo;
node[shape=point, color=red];
a--b--c--a;
}
但是,大多数图表的方向与您图片上的方向不同。 K3 示例将产生以下结果:
要在线测试其他布局引擎,您可以使用 GraphvizOnline。