Diseño de gráfico: rediseño conservando la forma del dibujo

I'd like to draw a gráfico composed of nodes and edges, using a spring layout algorithm (a kind of force directed layout) Once the graph is laid out, I'd like to let the user interactively add new nodes, and let the layout evolve, i.e. positioning the new nodes while maintaining the previous "shape" (not moving the already positioned nodes too much).

I mean something like what WordVis está haciendo en http://www.wordvis.com.

I'm currently using the spring layouter available in the GraphDracula library. It's a "simple" one, meaning that if you re-layout the graph, you may get a completely different layout (this is due, I think, to the calls to Math.rand in the algorithm)

What is the algorithm/strategy to do what I'd like to do?

I see that the graphdracula's layouter sets the initial node pos to zero, and then iterates to calculate the final nodes' positions. Suppose I add a set of nodes newNodes adjacent to an expandedNode: to maintain the existing shape, is it enough to set the initial pos of each of the newNodes al de expandedNode and then apply the forces to the all of the nodes once again?

Do you have any pointer to an algorithm that not only lays out the graph once, but also lets you add new nodes re-layouting the whole graph without changing the drawing too much?

Cualquier sugerencia es bienvenida.

I'm currently working with javascript, but the language is not important.

preguntado el 01 de febrero de 12 a las 14:02

1 Respuestas

Podrías usar Gephi para eso:

  1. Import your graph
  2. In Layouts panel, render your graph with ForceAtlas then stop the layout.
  3. Select all nodes, right-click and "Settle" the nodes. They won't move.
  4. Add new nodes and links.
  5. Run the same layout again.

Of course it's not a perfect solution but this trick will work reasonably if not adding too much new nodes that connect different regions of the graph.

Respondido 25 Feb 12, 19:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.