diff options
| author | Alon Levy <alon@pobox.com> | 2015-02-06 12:27:11 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-02-06 12:27:11 +0200 |
| commit | f96676da3b9f041f7bfac6304bb7f703b32753d4 (patch) | |
| tree | 905aed25a0da9e9afe8d4c259fd81c271ff2fd66 | |
| parent | b9797ed3e4d887c15acdfd48fca851d3c3dc9158 (diff) | |
filter by node type: fix broken edit graph
| -rw-r--r-- | src/client/view/graph_view.js | 12 |
1 files changed, 7 insertions, 5 deletions
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'; }); } |
