|
@ -329,7 +329,7 @@ function Network (container, data, options) { |
|
|
network.start(); |
|
|
network.start(); |
|
|
}, |
|
|
}, |
|
|
'update': function (event, params) { |
|
|
'update': function (event, params) { |
|
|
network._updateNodes(params.items, params.data); |
|
|
|
|
|
|
|
|
network._updateNodes(params.items); |
|
|
network.start(); |
|
|
network.start(); |
|
|
}, |
|
|
}, |
|
|
'remove': function (event, params) { |
|
|
'remove': function (event, params) { |
|
@ -1687,12 +1687,14 @@ Network.prototype._addNodes = function(ids) { |
|
|
* @param {Number[] | String[]} ids |
|
|
* @param {Number[] | String[]} ids |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
Network.prototype._updateNodes = function(ids,changedData) { |
|
|
|
|
|
|
|
|
Network.prototype._updateNodes = function(ids) { |
|
|
|
|
|
var nodesData = this.nodesData.get(ids); |
|
|
var nodes = this.nodes; |
|
|
var nodes = this.nodes; |
|
|
|
|
|
|
|
|
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]; |
|
|
var node = nodes[id]; |
|
|
var node = nodes[id]; |
|
|
var data = changedData[i]; |
|
|
|
|
|
|
|
|
var data = nodesData[i]; |
|
|
if (node) { |
|
|
if (node) { |
|
|
// update node
|
|
|
// update node
|
|
|
node.setProperties(data, this.constants); |
|
|
node.setProperties(data, this.constants); |
|
|