cytoscape
Advanced tools
Comparing version 3.5.2 to 3.5.3
{ | ||
"build/cytoscape.umd.js": { | ||
"bundled": 898297, | ||
"minified": 332729, | ||
"gzipped": 103531 | ||
"bundled": 899335, | ||
"minified": 332984, | ||
"gzipped": 103638 | ||
}, | ||
"build/cytoscape.cjs.js": { | ||
"bundled": 827583, | ||
"minified": 349941, | ||
"gzipped": 105572 | ||
"bundled": 828573, | ||
"minified": 350196, | ||
"gzipped": 105676 | ||
}, | ||
"build/cytoscape.esm.js": { | ||
"bundled": 827410, | ||
"minified": 349798, | ||
"gzipped": 105539, | ||
"bundled": 828400, | ||
"minified": 350053, | ||
"gzipped": 105644, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 327425, | ||
"code": 327680, | ||
"import_statements": 51 | ||
}, | ||
"webpack": { | ||
"code": 329292 | ||
"code": 329547 | ||
} | ||
@@ -24,0 +24,0 @@ } |
{ | ||
"name": "cytoscape", | ||
"version": "3.5.2", | ||
"version": "3.5.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
@@ -268,2 +268,8 @@ import * as util from '../util'; | ||
let updateGrKeyWStr = (strVal, grKey) => { | ||
for( let j = 0; j < strVal.length; j++ ){ | ||
updateGrKey(strVal.charCodeAt(j), grKey); | ||
} | ||
}; | ||
// - hashing works on 32 bit ints b/c we use bitwise ops | ||
@@ -285,8 +291,21 @@ // - small numbers get cut off (e.g. 0.123 is seen as 0 by the hashing function) | ||
let grKey = propInfo.groupKey; | ||
let normalizedNumberVal; | ||
if( propInfo.hashOverride != null ){ | ||
normalizedNumberVal = propInfo.hashOverride(ele, parsedProp); | ||
} else if( parsedProp.pfValue != null ){ | ||
normalizedNumberVal = parsedProp.pfValue; | ||
} | ||
// might not be a number if it allows enums | ||
let numberVal = propInfo.enums == null ? parsedProp.value : null; | ||
let haveNormNum = normalizedNumberVal != null; | ||
let haveUnitedNum = numberVal != null; | ||
let haveNum = haveNormNum || haveUnitedNum; | ||
let units = parsedProp.units; | ||
// numbers are cheaper to hash than strings | ||
// 1 hash op vs n hash ops (for length n string) | ||
if( type.number ){ | ||
// use pfValue if available (e.g. normalised units) | ||
let v = parsedProp.pfValue != null ? parsedProp.pfValue : parsedProp.value; | ||
if( type.number && haveNum ){ | ||
let v = haveNormNum ? normalizedNumberVal : numberVal; | ||
@@ -300,8 +319,8 @@ if( type.multiple ){ | ||
} | ||
} else { | ||
let strVal = parsedProp.strValue; | ||
for( let j = 0; j < strVal.length; j++ ){ | ||
updateGrKey(strVal.charCodeAt(j), grKey); | ||
if( !haveNormNum && units != null ){ | ||
updateGrKeyWStr(units); | ||
} | ||
} else { | ||
updateGrKeyWStr(parsedProp.strValue); | ||
} | ||
@@ -308,0 +327,0 @@ } |
@@ -235,5 +235,13 @@ import * as util from '../util'; | ||
let nodeSizeHashOverride = (ele, parsedProp) => { | ||
if( parsedProp.value === 'label' ){ | ||
return -ele.poolIndex(); // no hash key hits is using label size (hitrate for perf probably low anyway) | ||
} else { | ||
return parsedProp.pfValue; | ||
} | ||
}; | ||
let nodeBody = [ | ||
{ name: 'height', type: t.nodeSize, triggersBounds: diff.any }, | ||
{ name: 'width', type: t.nodeSize, triggersBounds: diff.any }, | ||
{ name: 'height', type: t.nodeSize, triggersBounds: diff.any, hashOverride: nodeSizeHashOverride }, | ||
{ name: 'width', type: t.nodeSize, triggersBounds: diff.any, hashOverride: nodeSizeHashOverride }, | ||
{ name: 'shape', type: t.nodeShape, triggersBounds: diff.any }, | ||
@@ -240,0 +248,0 @@ { name: 'shape-polygon-points', type: t.polygonPointList, triggersBounds: diff.any }, |
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
3751274
101857