1
0
Fork 0

GraphViewer: Prepared the adapter to support NodeReducer as a worker

This commit is contained in:
Michael Hackstein 2013-07-04 12:37:31 +02:00
parent 630712c017
commit bf01f6b8a0
1 changed files with 15 additions and 15 deletions

View File

@ -288,6 +288,17 @@ function AbstractAdapter(nodes, edges) {
});
nodes.push(commNode);
},
requestCollapse = function (focus) {
var com = reducer.getCommunity(limit, focus);
collapseCommunity(com);
},
checkNodeLimit = function (focus) {
if (limit < nodes.length) {
requestCollapse(focus);
}
},
expandCommunity = function (commNode) {
var commId = commNode._id,
@ -296,8 +307,7 @@ function AbstractAdapter(nodes, edges) {
com;
removeNode(commNode);
if (limit < nodes.length + nodesToAdd.length) {
com = reducer.getCommunity(limit);
collapseCommunity(com);
requestCollapse();
}
_.each(nodesToAdd, function(n) {
delete joinedInCommunities[n._id];
@ -336,21 +346,11 @@ function AbstractAdapter(nodes, edges) {
}
},
checkNodeLimit = function (focus) {
if (limit < nodes.length) {
var com = reducer.getCommunity(limit, focus);
collapseCommunity(com);
}
},
setNodeLimit = function (pLimit, callback) {
limit = pLimit;
if (limit < nodes.length) {
var com = reducer.getCommunity(limit);
collapseCommunity(com);
if (callback !== undefined) {
callback();
}
checkNodeLimit();
if (callback !== undefined) {
callback();
}
},