Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
apply () {
let A = create2dArray(this._nodes.length, this._nodes.length);
// build the adjacency matrix
for (let i=0; i a+b, 0);
}
let foo = new EigenvalueDecomposition(A);
const iii = twoSmallest(foo.realEigenvalues);
const foo_ = foo.eigenvectorMatrix.transpose();
const x = foo_[iii[0]];
const y = foo_[iii[1]];
const xy = normalize(x, y);
// var fooo = new Matrix.EigenvalueDecomposition(A);
// var fooo = new Matrix.EigenvalueDecomposition(A);
// recipe from http://www.sfu.ca/personal/archives/richards/Pages/NAS.AJS-WDR.pdf
// and implemented in networkx/drawing/layout.py
this._nodes.forEach(function(node, i){
node.x = xy[0][i];
node.y = xy[1][i];
});
}
};