|
@ -1349,9 +1349,8 @@ Network.prototype._addNodes = function(ids) { |
|
|
var data = this.nodesData.get(id); |
|
|
var data = this.nodesData.get(id); |
|
|
var node = new Node(data, this.images, this.groups, this.constants); |
|
|
var node = new Node(data, this.images, this.groups, this.constants); |
|
|
this.nodes[id] = node; // note: this may replace an existing node
|
|
|
this.nodes[id] = node; // note: this may replace an existing node
|
|
|
|
|
|
|
|
|
if ((node.xFixed == false || node.yFixed == false) && (node.x === null || node.y === null)) { |
|
|
if ((node.xFixed == false || node.yFixed == false) && (node.x === null || node.y === null)) { |
|
|
var radius = 10 * 0.1*ids.length; |
|
|
|
|
|
|
|
|
var radius = 10 * 0.1*ids.length + 10; |
|
|
var angle = 2 * Math.PI * Math.random(); |
|
|
var angle = 2 * Math.PI * Math.random(); |
|
|
if (node.xFixed == false) {node.x = radius * Math.cos(angle);} |
|
|
if (node.xFixed == false) {node.x = radius * Math.cos(angle);} |
|
|
if (node.yFixed == false) {node.y = radius * Math.sin(angle);} |
|
|
if (node.yFixed == false) {node.y = radius * Math.sin(angle);} |
|
@ -1952,7 +1951,7 @@ Network.prototype._isMoving = function(vmin) { |
|
|
* |
|
|
* |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
Network.prototype._discreteStepNodes = function() { |
|
|
|
|
|
|
|
|
Network.prototype._discreteStepNodes = function(checkMovement) { |
|
|
var interval = this.physicsDiscreteStepsize; |
|
|
var interval = this.physicsDiscreteStepsize; |
|
|
var nodes = this.nodes; |
|
|
var nodes = this.nodes; |
|
|
var nodeId; |
|
|
var nodeId; |
|
@ -1975,7 +1974,7 @@ Network.prototype._discreteStepNodes = function() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (nodesPresent == true) { |
|
|
|
|
|
|
|
|
if (nodesPresent == true && (checkMovement === undefined || checkMovement == true)) { |
|
|
var vminCorrected = this.constants.minVelocity / Math.max(this.scale,0.05); |
|
|
var vminCorrected = this.constants.minVelocity / Math.max(this.scale,0.05); |
|
|
if (vminCorrected > 0.5*this.constants.maxVelocity) { |
|
|
if (vminCorrected > 0.5*this.constants.maxVelocity) { |
|
|
this.moving = true; |
|
|
this.moving = true; |
|
@ -2002,7 +2001,7 @@ Network.prototype._physicsTick = function() { |
|
|
this._doInAllActiveSectors("_initializeForceCalculation"); |
|
|
this._doInAllActiveSectors("_initializeForceCalculation"); |
|
|
this._doInAllActiveSectors("_discreteStepNodes"); |
|
|
this._doInAllActiveSectors("_discreteStepNodes"); |
|
|
if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) { |
|
|
if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) { |
|
|
this._doInSupportSector("_discreteStepNodes"); |
|
|
|
|
|
|
|
|
this._doInSupportSector("_discreteStepNodes", false); |
|
|
} |
|
|
} |
|
|
this._findCenter(this._getRange()) |
|
|
this._findCenter(this._getRange()) |
|
|
} |
|
|
} |
|
|