|
@ -1657,9 +1657,14 @@ Network.prototype._setNodes = function(nodes) { |
|
|
*/ |
|
|
*/ |
|
|
Network.prototype._addNodes = function(ids) { |
|
|
Network.prototype._addNodes = function(ids) { |
|
|
var id; |
|
|
var id; |
|
|
|
|
|
var fieldId = this.nodesData._fieldId || null; |
|
|
for (var i = 0, len = ids.length; i < len; i++) { |
|
|
for (var i = 0, len = ids.length; i < len; i++) { |
|
|
id = ids[i]; |
|
|
id = ids[i]; |
|
|
var data = this.nodesData.get(id); |
|
|
var data = this.nodesData.get(id); |
|
|
|
|
|
if (fieldId) { |
|
|
|
|
|
data.id = data[fieldId]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
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)) { |
|
@ -1810,8 +1815,9 @@ Network.prototype._setEdges = function(edges) { |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
Network.prototype._addEdges = function (ids) { |
|
|
Network.prototype._addEdges = function (ids) { |
|
|
var edges = this.edges, |
|
|
|
|
|
edgesData = this.edgesData; |
|
|
|
|
|
|
|
|
var edges = this.edges; |
|
|
|
|
|
var edgesData = this.edgesData; |
|
|
|
|
|
var fieldId = this.edgesData._fieldId; |
|
|
|
|
|
|
|
|
for (var i = 0, len = ids.length; i < len; i++) { |
|
|
for (var i = 0, len = ids.length; i < len; i++) { |
|
|
var id = ids[i]; |
|
|
var id = ids[i]; |
|
@ -1822,6 +1828,9 @@ Network.prototype._addEdges = function (ids) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var data = edgesData.get(id, {"showInternalIds" : true}); |
|
|
var data = edgesData.get(id, {"showInternalIds" : true}); |
|
|
|
|
|
if (fieldId) { |
|
|
|
|
|
data.id = data[fieldId]; |
|
|
|
|
|
} |
|
|
edges[id] = new Edge(data, this, this.constants); |
|
|
edges[id] = new Edge(data, this, this.constants); |
|
|
} |
|
|
} |
|
|
this.moving = true; |
|
|
this.moving = true; |
|
|