summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-05-03 19:28:44 +0300
committerAlon Levy <alon@pobox.com>2015-05-03 19:38:27 +0300
commit0dd1f3e1eacb905b5de4e74e6a1edb1bcbcc922b (patch)
tree73765b38f2a9f357a71cbcfb94006c0d1fe791fd /src/client
parent995e42f4d8a9588a94631eb696ecf9502827216a (diff)
client/graph_view: extract layout__reset
Diffstat (limited to 'src/client')
-rw-r--r--src/client/view/graph_view.js9
1 files changed, 8 insertions, 1 deletions
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();