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

sudoremo
  • 2,274
  • 2
  • 22
  • 39
  • 1
    did you find a solution to this problem? – C. Reed Nov 05 '13 at 05:09
  • I am working on something similar with partial graphs in a 3d space, but it is hard. You have to store coordinates relative to the bigger nodes somehow, unless you want to send the whole graph data to the clients by each update. I don't have a solution yet. Did you find anything useful? – inf3rno May 06 '15 at 20:30

1 Answers1

2

You can do this in graphviz in reverse, if that is useful to you. To do that, you would plot the right-hand graph first, and then plot the left-hand graph with nodes 15, 16 and 17 set to style=invis. That would give you much the same layout as is shown here.

A problem that I could perceive with plotting the left-hand graph first is that the software (dot or something else) would naturally try to plot a "nice-looking" graph without nodes 15, 16 and 17 and that might not leave enough space for nodes 15, 16 and 17 to be fitted in if they're needed later. For example, if we tried to insert a node 12a between nodes 11 and 12, there wouldn't be room for that node in the graphs shown above. On the other hand, if node 12a was initially plotted but invisible, then the software would allocate the space for it, where it could be included later.

Simon
  • 10,679
  • 1
  • 30
  • 44