summaryrefslogtreecommitdiff
path: root/src/client/view/graph_view.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-02-06 12:27:11 +0200
committerAlon Levy <alon@pobox.com>2015-02-06 12:27:11 +0200
commitf96676da3b9f041f7bfac6304bb7f703b32753d4 (patch)
tree905aed25a0da9e9afe8d4c259fd81c271ff2fd66 /src/client/view/graph_view.js
parentb9797ed3e4d887c15acdfd48fca851d3c3dc9158 (diff)
filter by node type: fix broken edit graph
Diffstat (limited to 'src/client/view/graph_view.js')
-rw-r--r--src/client/view/graph_view.js12
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';
});
}