cytoscape
Advanced tools
Comparing version 3.2.21 to 3.2.22
{ | ||
"name": "cytoscape", | ||
"version": "3.2.21", | ||
"version": "3.2.22", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -205,3 +205,7 @@ let util = require('../util'); | ||
if( parent != null && parent !== data.parent ){ | ||
if( (parent != null || data.parent != null) && parent !== data.parent ){ | ||
if( parent === undefined ){ // can't set undefined imperatively, so use null | ||
parent = null; | ||
} | ||
ele = ele.move({ parent }); | ||
@@ -208,0 +212,0 @@ } |
@@ -79,2 +79,6 @@ let step = require('./step'); | ||
if( ani_p.step != null ){ | ||
ani_p.step(now); | ||
} | ||
if( ani.completed() ){ | ||
@@ -81,0 +85,0 @@ current.splice( i, 1 ); |
@@ -301,2 +301,3 @@ let window = require( '../window' ); | ||
let toAdd = []; | ||
let toMod = []; | ||
@@ -311,3 +312,3 @@ for( let i = 0; i < jsons.length; i++ ){ | ||
if( ele.length !== 0 ){ // existing element should be updated | ||
ele.json( json ); | ||
toMod.push({ ele, json }); | ||
} else { // otherwise should be added | ||
@@ -323,2 +324,8 @@ if( gr ){ | ||
cy.add( toAdd ); | ||
for( let i = 0; i < toMod.length; i++ ){ | ||
let { ele, json } = toMod[i]; | ||
ele.json(json); | ||
} | ||
}; | ||
@@ -342,5 +349,16 @@ | ||
// elements not specified in json should be removed | ||
eles.stdFilter( function( ele ){ | ||
return !idInJson[ ele.id() ]; | ||
} ).remove(); | ||
for( let i = 0; i < eles.length; i++ ){ | ||
let ele = eles[i]; | ||
let remove = !idInJson[ ele.id() ]; | ||
if( remove ){ | ||
if( ele.isParent() ){ | ||
ele.children().move({ parent: null }); // so that children are not removed w/ parent | ||
ele.remove(); // remove parent | ||
} else { | ||
ele.remove(); | ||
} | ||
} | ||
} | ||
} | ||
@@ -347,0 +365,0 @@ |
@@ -1,1 +0,1 @@ | ||
module.exports = "3.2.21"; | ||
module.exports = "3.2.22"; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2641830
68996