From af3b6686d3419957e6098ed03858e3f7c19dd10f Mon Sep 17 00:00:00 2001 From: David Manthey Date: Mon, 9 May 2016 12:32:25 -0400 Subject: [PATCH] Reset node neighborhood query limits. Each time a node is expanded, we query additional neighbors. This allows handling large neighbors by limiting the amount that is shown by default. However, each time a node was queries, the limit would be increased if the node had been visible in the previous graph. By reseting it, selecting an entity will always result in the same 1-hop network prior to expanding nodes. --- client/cliqueMongoAdapter.js | 9 +++++++++ client/entity-align.js | 2 ++ 2 files changed, 11 insertions(+) diff --git a/client/cliqueMongoAdapter.js b/client/cliqueMongoAdapter.js index 2f77b98..6ca32bc 100644 --- a/client/cliqueMongoAdapter.js +++ b/client/cliqueMongoAdapter.js @@ -167,6 +167,15 @@ pendingRequests.requests = {}; }; + /* Clear any query limits that have been set on nodes */ + this.clearNodeLimits = function () { + _.each(this.accessors, function (node, key) { + if ('limit' in node) { + delete node['limit']; + } + }); + }; + return this; }; }(window.clique, window.jQuery, window._, window.Backbone, window.moment)); diff --git a/client/entity-align.js b/client/entity-align.js index 0e98a9a..4740f4b 100644 --- a/client/entity-align.js +++ b/client/entity-align.js @@ -463,6 +463,8 @@ function initGraph1WithClique () { '#info1'); entityAlign.graph1 = graph; + graph.graph.adapter.clearNodeLimits(); + graph.graph.adapter.findNode({name: centralHandle}).then(function (center) { console.log('center:', center); if (center) {