From 6eb8515ddf6a066081abc08cb16bc87ab990ba76 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Sun, 18 Jan 2015 19:57:12 +0000 Subject: let's use the Dagre starting positions anyway Can't do any harm ... --- html/js/git-deps-graph.coffee | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'html') diff --git a/html/js/git-deps-graph.coffee b/html/js/git-deps-graph.coffee index e7b7530..6461547 100644 --- a/html/js/git-deps-graph.coffee +++ b/html/js/git-deps-graph.coffee @@ -199,12 +199,14 @@ draw_graph = (commitish) -> g_enter = nodes.enter().append("g") .attr("class", "node") - # Failed attempt to use dagre layout as starting positions - # https://github.com/tgdwyer/WebCola/issues/63 - # .each((d, i) -> - # n = gdl.node d.sha1 - # d.x = n.x - # d.y = n.y + # Questionable attempt to use dagre layout as starting positions + # https://github.com/tgdwyer/WebCola/issues/63 + nodes.each (d, i) -> + n = gdl.node d.sha1 + d.x = n.x + d.y = n.y + nodes.attr "transform", (d) -> + translate d.x, d.y # N.B. has to be done on the update selection, i.e. *after* the enter! nodes.call(d3cola.drag) -- cgit