Setting nodes positions in neato

Hello, I want to use GraphViz(2.38.0) lib and neato algorithm for rendering graph and enable user interactive work with it. User will have ability move nodes to different positions. I'm using cgraph lib and Qt Graphics View Framework for this. So I need to set position of node every time when user moves my graphic representation of node and call gvLayout again to calculate graph layout.

I'm computing position of node using formula x' = x*dpi; y' = y*dpi; y', x' - output position in points; x, y - input position in inches;

But setting position for node do not gives result I want to see.
For example:
_graph = agopen("SomeGraph", Agdirected, 0);

agattr(_graph, AGRAPH, "splines", "true");
agattr(_graph, AGRAPH, "sep", "1");

Agnode_t *node1 = agnode(_graph, "node1", 1);
agsafeset(node1, "pin", "true", "");
agsafeset(node1, "pos", "-2.0,-2.0!", "");
Agnode_t * agnode(_graph, "node2", 1);
agsafeset(node2, "pin", "true", "");
agsafeset(node2, "pos", "-1.0,-1.0!", "");
gvLayout(gvc, someGraph, "neato");

So im' expecting following results after calling gvLayout: (dpi
ND_coord(node1).x;//-2.0*dpi (dpi == 72 -> -2.0*72 == -144)
ND_coord(node1).y;//-2.0*dpi (dpi == 72 -> -2.0*72 == -144)
ND_coord(node1).x;//-1.0*dpi (dpi == 72 -> -1.0*72 == -72)
ND_coord(node2).y;//-1.0*dpi (dpi == 72 -> -1.0*72 == -72)

But results are:
ND_coord(node1).x;//-108
ND_coord(node1).y;//-108
ND_coord(node1).x;//108
ND_coord(node2).y;//108

Same example in dot format:
digraph {
splines=true;
sep=1;
node1 [shape=circle, style=filled,pos="-2.0,-2.0!", color="#CCFFFF"];
node2 [width=1.02852, shape=circle, style=filled,pos="1.0,1.0!", color="#CCFF00"];

node1 -> node2 [penwidth=0.644654, color="#CCFF00"];
node2 -> node1 [penwidth=0.644654, color="#CCFF00"];
}

So is it possible to make such interactive tool using GraphViz.

I'll be very thankful for any help with issue.

Recent comments