Drawing directed graphs using dagre-d3 javascript library