Name: cytoscape.js-view-utilities
Owner: iVis-at-Bilkent
Description: A Cytoscape.js extension to provide miscellenaous view utilities such as hiding and highlighting nodes/edges
Created: 2016-06-27 07:50:36.0
Updated: 2017-11-17 00:28:19.0
Pushed: 2017-12-28 08:07:05.0
Size: 722
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This Cytoscape.js extension provides miscellenaous view utilities such as hiding and highlighting nodes/edges, distributed under The MIT License.
Click here (no undo) or here (undoable) for a demo
var instance = cy.viewUtilities(options)
Initializes the extension and sets options. This can be used to override default options.
An instance has a number of functions available:
instance.highlight(eles)
Highlights eles & unhighlights others at first use.
instance.unhighlight(eles)
Just unighlights eles.
instance.highlightNeighbors(eles)
instance.highlightNeighbours(eles)
Highlights eles' neighborhood & unhighlights others' neighborhood at first use.
instance.unhighlightNeighbors(eles)
instance.unhighlightNeighbours(eles)
Just unhighlights eles and their neighbors.
instance.removeHighlights(eles)
Remove highlights & unhighlights from eles. If eles parameter is not specified sets it to 'cy.elements()'.
instance.hide(eles)
Hides given eles.
instance.show(eles)
Unhides given eles.
node: {
highlighted: {}, // styles for when nodes are highlighted.
unhighlighted: { // styles for when nodes are unhighlighted.
'opacity': 0.3
}
},
edge: {
highlighted: {}, // styles for when edges are highlighted.
unhighlighted: { // styles for when edges are unhighlighted.
'opacity': 0.3
}
},
setVisibilityOnHide: false, // whether to set visibility on hide/show
setDisplayOnHide: true, // whether to set display on hide/show
neighbor: function(node){ // return desired neighbors of (shift + tapheld) node
return false;
},
neighborSelectTime: 500 //ms, time to taphold to select desired neighbors
ur.do("highlight", eles)
ur.do("highlightNeighbors", eles)
ur.do("highlightNeighbours", eles)
ur.do("unhighlight", eles)
ur.do("unhighlightNeighbors", eles)
ur.do("unhighlightNeighbours", eles)
ur.do("removeHighlights")
ur.do("hide", eles)
ur.do("show", eles)
Download the library:
npm install cytoscape-view-utilities
,bower install cytoscape-view-utilities
, orrequire()
the library as appropriate for your project:
CommonJS:
cytoscape = require('cytoscape');
jquery = require('jquery');
viewUtilities = require('cytoscape-view-utilities');
Utilities( cytoscape, jquery ); // register extension
AMD:
ire(['cytoscape', 'cytoscape-view-utilities'], function( cytoscape, view-utilities ){
ew-utilities( cytoscape ); // register extension
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
This project is set up to automatically be published to npm and bower. To publish:
export VERSION=1.2.3
gulp publish
bower register cytoscape-view-utilities https://github.com/iVis-at-Bilkent/view-utilities.git