cytoscape
Advanced tools
Comparing version 3.5.8 to 3.5.9
{ | ||
"build/cytoscape.umd.js": { | ||
"bundled": 899986, | ||
"minified": 333283, | ||
"bundled": 900125, | ||
"minified": 333266, | ||
"gzipped": 103715 | ||
}, | ||
"build/cytoscape.cjs.js": { | ||
"bundled": 829196, | ||
"minified": 350557, | ||
"gzipped": 105769 | ||
"bundled": 829339, | ||
"minified": 350548, | ||
"gzipped": 105759 | ||
}, | ||
"build/cytoscape.esm.js": { | ||
"bundled": 829023, | ||
"minified": 350414, | ||
"gzipped": 105732, | ||
"bundled": 829166, | ||
"minified": 350405, | ||
"gzipped": 105727, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 327979, | ||
"code": 327962, | ||
"import_statements": 51 | ||
}, | ||
"webpack": { | ||
"code": 329846 | ||
"code": 329829 | ||
} | ||
@@ -24,0 +24,0 @@ } |
{ | ||
"name": "cytoscape", | ||
"version": "3.5.8", | ||
"version": "3.5.9", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -160,2 +160,4 @@ import * as util from '../util'; | ||
elesfn.hasElementWithId = function( id ){ | ||
id = '' + id; // id must be string | ||
return this._private.map.has( id ); | ||
@@ -165,2 +167,4 @@ }; | ||
elesfn.getElementById = function( id ){ | ||
id = '' + id; // id must be string | ||
let cy = this._private.cy; | ||
@@ -189,2 +193,4 @@ let entry = this._private.map.get( id ); | ||
elesfn.indexOfId = function( id ){ | ||
id = '' + id; // id must be string | ||
return this._private.map.get( id ).index; | ||
@@ -218,9 +224,9 @@ }; | ||
if( src != null && src !== data.source ){ | ||
spec.source = src; | ||
if( src != null && src != data.source ){ | ||
spec.source = '' + src; // id must be string | ||
move = true; | ||
} | ||
if( tgt != null && tgt !== data.target ){ | ||
spec.target = tgt; | ||
if( tgt != null && tgt != data.target ){ | ||
spec.target = '' + tgt; // id must be string | ||
move = true; | ||
@@ -235,3 +241,3 @@ } | ||
if( (parent != null || data.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 | ||
@@ -241,2 +247,6 @@ parent = null; | ||
if( parent != null ){ | ||
parent = '' + parent; // id must be string | ||
} | ||
ele = ele.move({ parent }); | ||
@@ -450,4 +460,9 @@ } | ||
src._private.edges.push( edge ); | ||
tgt._private.edges.push( edge ); | ||
// only one edge in node if loop | ||
if (src.same(tgt)) { | ||
src._private.edges.push( edge ); | ||
} else { | ||
src._private.edges.push( edge ); | ||
tgt._private.edges.push( edge ); | ||
} | ||
@@ -733,5 +748,7 @@ edge._private.source = src; | ||
let toString = id => id == null ? id : '' + id; // id must be string | ||
if( struct.source !== undefined || struct.target !== undefined ){ | ||
let srcId = struct.source; | ||
let tgtId = struct.target; | ||
let srcId = toString(struct.source); | ||
let tgtId = toString(struct.target); | ||
let srcExists = srcId != null && cy.hasElementWithId( srcId ); | ||
@@ -763,3 +780,3 @@ let tgtExists = tgtId != null && cy.hasElementWithId( tgtId ); | ||
} else if( struct.parent !== undefined ){ // move node to new parent | ||
let parentId = struct.parent; | ||
let parentId = toString(struct.parent); | ||
let parentExists = parentId === null || cy.hasElementWithId( parentId ); | ||
@@ -766,0 +783,0 @@ |
import easings from './easings'; | ||
import ease from './ease'; | ||
import * as is from '../../is'; | ||
import {bound} from '../../math'; | ||
@@ -113,3 +114,3 @@ function step( self, ani, now, isCore ){ | ||
if( valid( startZoom, endZoom ) ){ | ||
_p.zoom = ease( startZoom, endZoom, percent, easing ); | ||
_p.zoom = bound( _p.minZoom, ease( startZoom, endZoom, percent, easing ), _p.maxZoom ); | ||
} | ||
@@ -116,0 +117,0 @@ |
@@ -263,3 +263,3 @@ import window from '../window'; | ||
mount: function( container, rendererOptions ){ | ||
mount: function( container ){ | ||
if( container == null ){ return; } | ||
@@ -271,5 +271,2 @@ | ||
let rOpts = rendererOptions ? rendererOptions : { name: 'canvas' }; | ||
options.renderer = rOpts; | ||
if( !is.htmlElement( container ) && is.htmlElement( container[0] ) ){ | ||
@@ -288,3 +285,3 @@ container = container[0]; | ||
cy.initRenderer( rOpts ); | ||
cy.initRenderer( util.assign({}, options, options.renderer) ); | ||
@@ -337,3 +334,3 @@ cy.startAnimationLoop(); | ||
let json = jsons[ i ]; | ||
let id = json.data.id; | ||
let id = '' + json.data.id; // id must be string | ||
let ele = cy.getElementById( id ); | ||
@@ -340,0 +337,0 @@ |
@@ -247,2 +247,4 @@ import window from '../../../../window'; | ||
var bb = _p.labelBounds[prefix || 'main']; | ||
var text = ele.pstyle( prefixDash + 'label' ).value; | ||
@@ -254,6 +256,2 @@ var eventsEnabled = ele.pstyle( 'text-events' ).strValue === 'yes'; | ||
var rstyle = _p.rstyle; | ||
var bw = ele.pstyle('text-border-width').pfValue; | ||
var pw = ele.pstyle('text-background-padding').pfValue; | ||
var lw = preprop( rstyle, 'labelWidth', prefix ) + bw + 2*th + 2*pw; | ||
var lh = preprop( rstyle, 'labelHeight', prefix ) + bw + 2*th + 2*pw; | ||
var lx = preprop( rstyle, 'labelX', prefix ); | ||
@@ -264,6 +262,6 @@ var ly = preprop( rstyle, 'labelY', prefix ); | ||
var lx1 = lx - lw / 2; | ||
var lx2 = lx + lw / 2; | ||
var ly1 = ly - lh / 2; | ||
var ly2 = ly + lh / 2; | ||
var lx1 = bb.x1 - th; | ||
var lx2 = bb.x2 + th; | ||
var ly1 = bb.y1 - th; | ||
var ly2 = bb.y2 + th; | ||
@@ -301,11 +299,2 @@ if( theta ){ | ||
} else { // do a cheaper bb check | ||
var bb = { | ||
w: lw, | ||
h: lh, | ||
x1: lx1, | ||
x2: lx2, | ||
y1: ly1, | ||
y2: ly2 | ||
}; | ||
if( math.inBoundingBox( bb, x, y ) ){ | ||
@@ -312,0 +301,0 @@ addEle( ele ); |
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
3754510
101901