10

I'm looking for a library to which nodes and edges can be supplied and which generates a coordinate list of all the nodes laid out nicely. However, it should be possible to supply fixed positions for some, but not all nodes which the layout algorithm should respect.

I have tried graphviz (fdp, neato) so far, which does not seem able to keep the position of certain nodes and built the layout around them.

The library has to be usable with python, so it should be either python or c/c++ so we could write our own binding.

The following pictures illustrates exactly what I'm looking for (this is the uDraw-project, which does not seem to exist as a library).

uDraw incremental layout

4

1 回答 1

2

如果这对您有用,您可以graphviz 反过来执行此操作。为此,您将首先绘制右侧图,然后绘制左侧图,其中节点 15、16 和 17 设置为style=invis。这将为您提供与此处显示的布局大致相同的布局。

首先绘制左侧图表时我可以察觉的一个问题是,软件(dot或其他东西)自然会尝试绘制没有节点 15、16 和 17 的“漂亮”图表,并且可能没有足够的空间如果以后需要,将安装节点 15、16 和 17。例如,如果我们尝试在节点 11 和 12 之间插入节点 12a,则上图中的该节点将没有空间。另一方面,如果节点 12a 最初被绘制但不可见,则软件将为它分配空间,以后可以将其包含在其中。

于 2013-05-29T22:48:51.923 回答