mirror of https://gitee.com/bigwinds/arangodb
GraphViewer: All tests pass again
This commit is contained in:
parent
48cc20842d
commit
081ff35f5d
|
@ -122,20 +122,12 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) {
|
|||
if (error !== undefined && error !== null) {
|
||||
console.log(error);
|
||||
}
|
||||
var n = findNode(node);
|
||||
if (!n) {
|
||||
n = absAdapter.insertNode(node);
|
||||
} else {
|
||||
n.children = node.children;
|
||||
}
|
||||
var n = absAdapter.insertNode(node);
|
||||
self.requestCentralityChildren(nodeId, function(c) {
|
||||
n._centrality = c;
|
||||
});
|
||||
_.each(n.children, function(c) {
|
||||
var check = findNode(c), e;
|
||||
if (!check) {
|
||||
check = absAdapter.insertNode(c);
|
||||
}
|
||||
_.each(node.children, function(c) {
|
||||
var check = absAdapter.insertNode(c),
|
||||
e = {
|
||||
_from: n._id,
|
||||
_to: check._id,
|
||||
|
@ -145,7 +137,9 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) {
|
|||
self.requestCentralityChildren(check._id, function(c) {
|
||||
n._centrality = c;
|
||||
});
|
||||
delete check._data.children;
|
||||
});
|
||||
delete n._data.children;
|
||||
if (callback) {
|
||||
callback(n);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
adapter = new JSONAdapter(jsonPath, nodes, edges);
|
||||
});
|
||||
|
||||
it('should be able to load a tree node form a json file', function() {
|
||||
it('should be able to load a tree node from a json file', function() {
|
||||
var callbackCheck;
|
||||
|
||||
runs(function() {
|
||||
|
|
|
@ -32,6 +32,7 @@ module.exports = function(karma) {
|
|||
|
||||
// Core Modules
|
||||
'../graphViewer.js',
|
||||
'../graph/domObserverFactory.js',
|
||||
'../graph/colourMapper.js',
|
||||
'../graph/communityNode.js',
|
||||
'../graph/webWorkerWrapper.js',
|
||||
|
@ -63,6 +64,7 @@ module.exports = function(karma) {
|
|||
// Specs
|
||||
|
||||
'specColourMapper/colourMapperSpec.js',
|
||||
'specWindowObjects/domObserverFactorySpec.js',
|
||||
'specCommunityNode/communityNodeSpec.js',
|
||||
'specAdapter/interfaceSpec.js',
|
||||
'specAdapter/abstractAdapterSpec.js',
|
||||
|
@ -87,7 +89,7 @@ module.exports = function(karma) {
|
|||
'specGraphViewer/graphViewerPreviewSpec.js',
|
||||
'specNodeReducer/nodeReducerSpec.js',
|
||||
'specNodeReducer/modularityJoinerSpec.js',
|
||||
'specWebWorker/workerWrapperSpec.js',
|
||||
'specWindowObjects/workerWrapperSpec.js',
|
||||
'specJSLint/jsLintSpec.js'
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in New Issue