From f96676da3b9f041f7bfac6304bb7f703b32753d4 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Fri, 6 Feb 2015 12:27:11 +0200 Subject: filter by node type: fix broken edit graph --- src/client/view/graph_view.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client/view/graph_view.js') diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js index 96ef4f0d..9f9bcc67 100644 --- a/src/client/view/graph_view.js +++ b/src/client/view/graph_view.js @@ -135,7 +135,7 @@ function GraphView(spec) { function node__is_shown(d) { var type = d.type; - return filter_states[d.type]; + return temporary || filter_states[d.type]; } function link__is_shown(d) { @@ -559,8 +559,10 @@ function GraphView(spec) { } if (force_enabled) { - force.nodes(graph.nodes().filter(node__is_shown)) - .links(graph.links().filter(link__is_shown)); + if (!temporary) { + force.nodes(graph.nodes().filter(node__is_shown)) + .links(graph.links().filter(link__is_shown)); + } if (relayout) { force.alpha(0.1).start(); @@ -755,10 +757,10 @@ function GraphView(spec) { // After initial placement we can make the nodes visible. node.attr('visibility', function (d, i) { - return !temporary && node__is_shown(d) ? 'visible' : 'hidden'; + return node__is_shown(d) ? 'visible' : 'hidden'; }); link.attr('visibility', function (d, i) { - return !temporary && link__is_shown(d) ? 'visible' : 'hidden'; + return link__is_shown(d) ? 'visible' : 'hidden'; }); } -- cgit v1.3.1