cytoscape
Advanced tools
Comparing version 3.3.2 to 3.3.3
{ | ||
"build/cytoscape.umd.js": { | ||
"bundled": 887661, | ||
"minified": 328855, | ||
"gzipped": 102237 | ||
"bundled": 887520, | ||
"minified": 328780, | ||
"gzipped": 102224 | ||
}, | ||
"build/cytoscape.cjs.js": { | ||
"bundled": 817540, | ||
"minified": 345792, | ||
"gzipped": 104228 | ||
"bundled": 817403, | ||
"minified": 345722, | ||
"gzipped": 104217 | ||
}, | ||
"build/cytoscape.esm.js": { | ||
"bundled": 817367, | ||
"minified": 345655, | ||
"gzipped": 104197, | ||
"bundled": 817230, | ||
"minified": 345585, | ||
"gzipped": 104184, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 323609, | ||
"code": 323534, | ||
"import_statements": 51 | ||
}, | ||
"webpack": { | ||
"code": 325752 | ||
"code": 325677 | ||
} | ||
@@ -24,0 +24,0 @@ } |
{ | ||
"name": "cytoscape", | ||
"version": "3.3.2", | ||
"version": "3.3.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -6,2 +6,5 @@ import * as util from './util'; | ||
let Animation = function( target, opts, opts2 ){ | ||
let isCore = is.core(target); | ||
let isEle = !isCore; | ||
let _p = this._private = util.extend( { | ||
@@ -25,2 +28,24 @@ duration: 1000 | ||
if( isEle ){ | ||
let pos = target.position(); | ||
_p.startPosition = _p.startPosition || { | ||
x: pos.x, | ||
y: pos.y | ||
}; | ||
_p.startStyle = _p.startStyle || target.cy().style().getAnimationStartStyle( target, _p.style ); | ||
} | ||
if( isCore ){ | ||
let pan = target.pan(); | ||
_p.startPan = { | ||
x: pan.x, | ||
y: pan.y | ||
}; | ||
_p.startZoom = target.zoom(); | ||
} | ||
// for future timeline/animations impl | ||
@@ -27,0 +52,0 @@ this.length = 1; |
@@ -34,3 +34,3 @@ import * as util from '../util'; | ||
let layoutEles = options.eles; // nodes & edges | ||
let getMemoizeKey = ( node, i ) => node.id() + '$' + i; | ||
let getMemoizeKey = node => node.id(); | ||
let fnMem = util.memoize( fn, getMemoizeKey ); // memoized version of position function | ||
@@ -37,0 +37,0 @@ |
function startAnimation( self, ani, now, isCore ){ | ||
let isEles = !isCore; | ||
let ele = self; | ||
let ani_p = ani._private; | ||
let cy = isCore ? self : self.cy(); | ||
let style = cy.style(); | ||
if( isEles ){ | ||
let pos = ele.position(); | ||
ani_p.startPosition = ani_p.startPosition || { | ||
x: pos.x, | ||
y: pos.y | ||
}; | ||
ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle( ele, ani_p.style ); | ||
} | ||
if( isCore ){ | ||
let pan = cy._private.pan; | ||
ani_p.startPan = ani_p.startPan || { | ||
x: pan.x, | ||
y: pan.y | ||
}; | ||
ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; | ||
} | ||
ani_p.started = true; | ||
@@ -31,0 +5,0 @@ ani_p.startTime = now - ani_p.progress * ani_p.duration; |
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
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3701123
100690