summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/view/graph_view.js10
-rw-r--r--src/client/view/layouts.js5
2 files changed, 10 insertions, 5 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index 564c3a25..cdf98ba2 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -733,9 +733,10 @@ function GraphView(spec) {
}
function layout__load_graph() {
- layout
- .nodes(graph.nodes().filter(node__is_shown))
- .links(graph.links().filter(link__is_shown));
+ var nodes_subset = graph.nodes().filter(node__is_shown),
+ links_subset = graph.links().filter(link__is_shown);
+
+ layout.nodes_links(nodes_subset, links_subset);
}
function segment_in_segment(inner_low, inner_high, outer_low, outer_high)
@@ -1231,8 +1232,7 @@ function GraphView(spec) {
.size([w, h])
.on("tick", pushRedraw)
.on("end", record_position_to_local_storage)
- .nodes(graph.nodes())
- .links(graph.links())
+ .nodes_links(graph.nodes(), graph.links())
.restore()
.start();
}
diff --git a/src/client/view/layouts.js b/src/client/view/layouts.js
index 8af9e9b6..7d67011e 100644
--- a/src/client/view/layouts.js
+++ b/src/client/view/layouts.js
@@ -95,6 +95,11 @@ function(consts, $, d3, _, rz_core) {
restore: restore,
stop: save,
start: restore,
+ nodes_links: function (nodes, links) {
+ // to update nodes and links atomically, required for stp and other changes
+ layout.nodes(nodes);
+ return layout.links(links);
+ },
// data
graph: graph,
_nodes: [],