From 0dd1f3e1eacb905b5de4e74e6a1edb1bcbcc922b Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 3 May 2015 19:28:44 +0300 Subject: client/graph_view: extract layout__reset --- src/client/view/graph_view.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/client') diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js index 7cdd0d30..cdfbc063 100644 --- a/src/client/view/graph_view.js +++ b/src/client/view/graph_view.js @@ -837,7 +837,7 @@ function GraphView(spec) { } if (relayout) { - layout.alpha(0.1).start(); + layout__reset(0.1); } else { // XXX If we are stopped we need to update the text of the links at least, // and this is the simplest way @@ -1306,6 +1306,13 @@ function GraphView(spec) { }); } + function layout__reset(alpha) { + alpha = alpha | 0.1; + layout.nodes_links(nodes__visible(), links__visible()) + .alpha(alpha) + .start(); + } + function set_layout(new_layout) { if (layout !== undefined) { layout.save(); -- cgit v1.3.1