I'm implementing a stepwise graph transformation algorithm where nodes are removed or added in each step and want to keep a trace of all the intermediate graphs as images files where a node keeps rendered at the same position until removed. This will help make a final animation.
I thought about getting the nodes positions from the initial step as computed by the layout engine and then pass them as a node attribute for next steps.
I'm using the graphviz library, but I could not find any way to get the nodes coordinates (pos
attribute) in the rendered graphs. Here is a code excerpt.
from graphviz import Digraph
dot = Digraph()
dot.node('x', label='hello')
dot.node('y', label='world')
dot.edge('x', 'y')
dot.render(filename='hello.gv', view=True, cleanup=False)
I also inspected the dot
object, but found nothing. Am I missing some thing? I could not conform whether positions are exported via the API or no. In this case, which different library can help?