@ -616,7 +616,6 @@ class LayoutEngine {
// get the size of the largest hubs and check if the user has defined a level for a node.
// get the size of the largest hubs and check if the user has defined a level for a node.
let node , nodeId ;
let node , nodeId ;
let definedLevel = false ;
let definedLevel = false ;
let definedPositions = true ;
let undefinedLevel = false ;
let undefinedLevel = false ;
this . lastNodeOnLevel = { } ;
this . lastNodeOnLevel = { } ;
this . hierarchical = new HierarchicalStatus ( ) ;
this . hierarchical = new HierarchicalStatus ( ) ;
@ -624,9 +623,6 @@ class LayoutEngine {
for ( nodeId in this . body . nodes ) {
for ( nodeId in this . body . nodes ) {
if ( this . body . nodes . hasOwnProperty ( nodeId ) ) {
if ( this . body . nodes . hasOwnProperty ( nodeId ) ) {
node = this . body . nodes [ nodeId ] ;
node = this . body . nodes [ nodeId ] ;
if ( node . options . x === undefined && node . options . y === undefined ) {
definedPositions = false ;
}
if ( node . options . level !== undefined ) {
if ( node . options . level !== undefined ) {
definedLevel = true ;
definedLevel = true ;
this . hierarchical . levels [ nodeId ] = node . options . level ;
this . hierarchical . levels [ nodeId ] = node . options . level ;
@ -779,7 +775,7 @@ class LayoutEngine {
}
}
return [ min , max , minSpace , maxSpace ] ;
return [ min , max , minSpace , maxSpace ] ;
} ;
}
// check what the maximum level is these nodes have in common.
// check what the maximum level is these nodes have in common.
@ -832,8 +828,11 @@ class LayoutEngine {
// check the largest distance between the branches
// check the largest distance between the branches
let maxLevel = getCollisionLevel ( node1 , node2 ) ;
let maxLevel = getCollisionLevel ( node1 , node2 ) ;
let [ min1 , max1 , minSpace1 , maxSpace1 ] = getBranchBoundary ( branchNodes1 , maxLevel ) ;
let [ min2 , max2 , minSpace2 , maxSpace2 ] = getBranchBoundary ( branchNodes2 , maxLevel ) ;
let branchNodeBoundary1 = getBranchBoundary ( branchNodes1 , maxLevel ) ;
let branchNodeBoundary2 = getBranchBoundary ( branchNodes2 , maxLevel ) ;
let max1 = branchNodeBoundary1 [ 1 ] ;
let min2 = branchNodeBoundary2 [ 0 ] ;
let minSpace2 = branchNodeBoundary2 [ 2 ] ;
//console.log(node1.id, getBranchBoundary(branchNodes1, maxLevel), node2.id,
//console.log(node1.id, getBranchBoundary(branchNodes1, maxLevel), node2.id,
// getBranchBoundary(branchNodes2, maxLevel), maxLevel);
// getBranchBoundary(branchNodes2, maxLevel), maxLevel);
@ -935,7 +934,9 @@ class LayoutEngine {
getBranchNodes ( node , branchNodes ) ;
getBranchNodes ( node , branchNodes ) ;
branches [ node . id ] = branchNodes ;
branches [ node . id ] = branchNodes ;
}
}
let [ minBranch , maxBranch , minSpaceBranch , maxSpaceBranch ] = getBranchBoundary ( branches [ node . id ] ) ;
let branchBoundary = getBranchBoundary ( branches [ node . id ] ) ;
let minSpaceBranch = branchBoundary [ 2 ] ;
let maxSpaceBranch = branchBoundary [ 3 ] ;
let diff = guess - nodePosition ;
let diff = guess - nodePosition ;
@ -1389,7 +1390,7 @@ class LayoutEngine {
let minLevel = 100000 ;
let minLevel = 100000 ;
// TODO: this should come from options.
// TODO: this should come from options.
let customCallback = function ( nodeA , nodeB , edge ) {
let customCallback = function ( nodeA , nodeB , edge ) { // eslint-disable-line no-unused-vars
} ;
} ;