cytoscape
Advanced tools
Comparing version 2.7.8 to 2.7.9
{ | ||
"name": "cytoscape", | ||
"version": "2.7.8", | ||
"version": "2.7.9", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Graph theory (a.k.a. network) library for analysis and visualisation", |
# Cytoscape.js | ||
[![Build Status](https://travis-ci.org/cytoscape/cytoscape.js.svg?branch=master)](https://travis-ci.org/cytoscape/cytoscape.js) [![Build Status](https://travis-ci.org/cytoscape/cytoscape.js.svg?branch=unstable)](https://travis-ci.org/cytoscape/cytoscape.js) | ||
*(master branch, unstable branch)* | ||
Graph theory (a.k.a. network) library for analysis and visualisation : [http://js.cytoscape.org](http://js.cytoscape.org) | ||
@@ -7,10 +11,20 @@ | ||
## Test status | ||
## Description | ||
[![Build Status](https://travis-ci.org/cytoscape/cytoscape.js.svg?branch=master)](https://travis-ci.org/cytoscape/cytoscape.js) : `master` | ||
Cytoscape.js is a fully featured [graph theory](https://en.wikipedia.org/wiki/Graph_theory) library. Do you need to model and/or visualise relational data, like biological data or social networks? If so, Cytoscape.js is just what you need. | ||
[![Build Status](https://travis-ci.org/cytoscape/cytoscape.js.svg?branch=unstable)](https://travis-ci.org/cytoscape/cytoscape.js) : `unstable` | ||
Cytoscape.js contains a graph theory model and an optional renderer to display interactive graphs. This library was designed to make it as easy as possible for programmers and scientists to use graph theory in their apps, whether it's for server-side analysis in a Node.js app or for a rich user interface. | ||
You can get started with Cytoscape.js with one line: | ||
```js | ||
var cy = cytoscape({ elements: myElements, container: myDiv }); | ||
``` | ||
Learn more about the features of Cytoscape.js by reading [its documentation](http://js.cytoscape.org). | ||
## Documentation | ||
@@ -17,0 +31,0 @@ |
@@ -50,2 +50,5 @@ 'use strict'; | ||
// Randomize the initial positions of the nodes (true) or use existing positions (false) | ||
randomize: false, | ||
// Extra spacing between components in non-compound graphs | ||
@@ -133,5 +136,5 @@ componentSpacing: 100, | ||
// If required, randomize node positions | ||
// if (true === options.randomize) { | ||
randomizePositions( layoutInfo, cy ); | ||
// } | ||
if (options.randomize) { | ||
randomizePositions( layoutInfo, cy ); | ||
} | ||
@@ -138,0 +141,0 @@ var startTime = Date.now(); |
@@ -8,17 +8,22 @@ 'use strict'; | ||
var imageCache = r.imageCache = r.imageCache || {}; | ||
var cache = imageCache[ url ]; | ||
if( imageCache[ url ] && imageCache[ url ].image ){ | ||
return imageCache[ url ].image; | ||
} | ||
if( cache ){ | ||
if( !cache.image.complete ){ | ||
cache.image.addEventListener('load', onLoad); | ||
} | ||
var cache = imageCache[ url ] = imageCache[ url ] || {}; | ||
return cache.image; | ||
} else { | ||
cache = imageCache[ url ] = imageCache[ url ] || {}; | ||
var image = cache.image = new Image(); // eslint-disable-line no-undef | ||
image.addEventListener('load', onLoad); | ||
image.crossOrigin = 'Anonymous'; // prevent tainted canvas | ||
image.src = url; | ||
var image = cache.image = new Image(); // eslint-disable-line no-undef | ||
image.addEventListener('load', onLoad); | ||
image.crossOrigin = 'Anonymous'; // prevent tainted canvas | ||
image.src = url; | ||
return image; | ||
return image; | ||
} | ||
}; | ||
module.exports = BRp; |
@@ -265,15 +265,4 @@ 'use strict'; | ||
var bgY = textY; | ||
var bgY = textY - textH; | ||
switch( valign ){ | ||
case 'top': | ||
bgY -= textH; | ||
break; | ||
case 'center': | ||
bgY -= textH / 2; | ||
break; | ||
case 'bottom': | ||
break; | ||
} | ||
if( backgroundOpacity > 0 ){ | ||
@@ -351,10 +340,6 @@ var textFill = context.fillStyle; | ||
break; | ||
case 'center': | ||
case 'bottom': | ||
// nothing required | ||
textY -= ( lines.length - 1 ) * lineHeight; | ||
break; | ||
default: | ||
case 'center': | ||
textY -= ( lines.length - 1 ) * lineHeight / 2; | ||
} | ||
@@ -361,0 +346,0 @@ |
@@ -805,9 +805,22 @@ 'use strict'; | ||
var clean = function( obj, isValue ){ | ||
if( is.string( obj ) ){ | ||
return isValue ? '"' + obj + '"' : obj; | ||
var clean = function( obj ){ | ||
if( obj == null ){ | ||
return ''; | ||
} else { | ||
return obj; | ||
} | ||
return ''; | ||
}; | ||
var cleanVal = function( val ){ | ||
if( is.string( val ) ){ | ||
return '"' + val + '"'; | ||
} else { | ||
return clean( val ); | ||
} | ||
}; | ||
var space = function( val ){ | ||
return ' ' + val + ' '; | ||
}; | ||
var queryToString = function( query ){ | ||
@@ -827,3 +840,3 @@ var str = ''; | ||
if( data.value ){ | ||
str += '[' + data.field + clean( data.operator ) + clean( data.value, true ) + ']'; | ||
str += '[' + data.field + space( clean( data.operator ) ) + cleanVal( data.value ) + ']'; | ||
} else { | ||
@@ -836,3 +849,3 @@ str += '[' + clean( data.operator ) + data.field + ']'; | ||
var meta = query.meta[ j ]; | ||
str += '[[' + meta.field + clean( meta.operator ) + clean( meta.value, true ) + ']]'; | ||
str += '[[' + meta.field + space( clean( meta.operator ) ) + cleanVal( meta.value ) + ']]'; | ||
} | ||
@@ -839,0 +852,0 @@ |
@@ -68,3 +68,3 @@ 'use strict'; | ||
fn: { mapping: true, fn: true }, | ||
url: { regex: '^url\\s*\\(\\s*([^\\s]+)\\s*\\s*\\)|none|(.+)$' }, | ||
url: { regex: 'url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)|none|(.+)$' }, | ||
propList: { propList: true }, | ||
@@ -71,0 +71,0 @@ angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, |
@@ -1,1 +0,1 @@ | ||
"2.7.8" | ||
"2.7.9" |
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
731288
21233
95