2

I would like to use the QGraphicsView control and QGraphicsScene to layout GraphViz generated graphs using pydot. Is there a way to generate the graph in pydot, have GraphViz do the layout, and then extract the layout information (such as is included in the various output formats generated by pydot.write_xyz)? So far in my testing the get_pos() functions for Nodes, etc. return None.

xfrost11
  • 21
  • 1

1 Answers1

2

As you already said, you have to first output the graph with create_dot to a string, then generate the graph layout by passing that string to graph_from_dot_data:

graphWithPositions = pydot.graph_from_dot_data(graph.create_dot())
alexisdm
  • 29,448
  • 6
  • 64
  • 99