Revert "Switch back to local weighting, so we can do direction weights"
This reverts commit e284b76718.
This commit is contained in:
10
architype.js
10
architype.js
@@ -420,10 +420,9 @@ class Architype {
|
||||
|
||||
iterate(graph) {
|
||||
this.sortByMostTension(graph.nodes);
|
||||
let newPos = null;
|
||||
let newTension = this.getTotalTension(graph.nodes);
|
||||
for (let node of graph.nodes) {
|
||||
let newPos = null;
|
||||
let newTension = node.tension;
|
||||
|
||||
let origPos = node.pos;
|
||||
let offsets = new Map();
|
||||
let addOffset = (x, y) => {
|
||||
@@ -440,8 +439,9 @@ class Architype {
|
||||
if (graph.nodesByPos.has(testPos.toString())) {
|
||||
continue;
|
||||
}
|
||||
let testVec = this.findVec(testPos, node.affinity);
|
||||
let testTension = this.findTension(testVec);
|
||||
node.pos = testPos;
|
||||
let testTension = this.getTotalTension(graph.nodes);
|
||||
node.pos = origPos;
|
||||
if (testTension < newTension) {
|
||||
newPos = testPos;
|
||||
newTension = testTension;
|
||||
|
||||
Reference in New Issue
Block a user