First commit.

Signed-off-by: Chen Xiao <abigwc@gmail.com>
This commit is contained in:
Chen Xiao
2026-05-08 14:43:16 +08:00
commit 0b64e2de94
10989 changed files with 2253791 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
var LNode = require('../LNode');
function FDLayoutNode(gm, loc, size, vNode) {
// alternative constructor is handled inside LNode
LNode.call(this, gm, loc, size, vNode);
//Spring, repulsion and gravitational forces acting on this node
this.springForceX = 0;
this.springForceY = 0;
this.repulsionForceX = 0;
this.repulsionForceY = 0;
this.gravitationForceX = 0;
this.gravitationForceY = 0;
//Amount by which this node is to be moved in this iteration
this.displacementX = 0;
this.displacementY = 0;
//Start and finish grid coordinates that this node is fallen into
this.startX = 0;
this.finishX = 0;
this.startY = 0;
this.finishY = 0;
//Geometric neighbors of this node
this.surrounding = [];
}
FDLayoutNode.prototype = Object.create(LNode.prototype);
for (var prop in LNode) {
FDLayoutNode[prop] = LNode[prop];
}
FDLayoutNode.prototype.setGridCoordinates = function (_startX, _finishX, _startY, _finishY)
{
this.startX = _startX;
this.finishX = _finishX;
this.startY = _startY;
this.finishY = _finishY;
};
module.exports = FDLayoutNode;