dagre.layout()
.nodes(nodes)
.edges(edges)
.run();
This will add dagree properties to the nodes, which contains x and y positions. These properties must be pushed to the jointjs nodes and scaled appropriately:
// scale the values
_.values(nodes).forEach(function(node) {
var rawX = FLIP_AXES ? node.dagre.y : node.dagre.x;
var rawY = FLIP_AXES ? node.dagre.x : node.dagre.y;
var newX = rawX * X_SCALE + X_TRANSLATE;
var newY = rawY * Y_SCALE + Y_TRANSLATE;
node.joint.attributes.position = {x: newX, y: newY};
});
I just played around with the x and y scales until I was happy with them. Also, flipping axes can rotate the graph.
Hope this helps.