1
0
Fork 0

GraphViewer: Fixed a bug in the JSONAdapter, which caused the UI Tests to Fail, as the _id was not generated properly anymore

This commit is contained in:
Michael Hackstein 2013-07-22 14:14:24 +02:00
parent 01dab07c3b
commit f6f5039e7d
1 changed files with 9 additions and 4 deletions

View File

@ -124,7 +124,7 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) {
}
var n = findNode(node);
if (!n) {
n = insertNode(node);
n = absAdapter.insertNode(node);
} else {
n.children = node.children;
}
@ -132,11 +132,16 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) {
n._centrality = c;
});
_.each(n.children, function(c) {
var check = findNode(c);
var check = findNode(c), e;
if (!check) {
check = insertNode(c);
check = absAdapter.insertNode(c);
}
insertEdge(n, check);
e = {
_from: n._id,
_to: check._id,
_id: n._id + "-" + check._id
};
absAdapter.insertEdge(e);
self.requestCentralityChildren(check._id, function(c) {
n._centrality = c;
});