cytoscape-view-utilities
A Cytoscape.js extension to provide miscellenaous view utilities such as hiding and highlighting nodes/edges
https://github.com/ivis-at-bilkent/cytoscape.js-view-utilities
Science Score: 75.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 14 committers (7.1%) from academic institutions -
✓Institutional organization owner
Organization ivis-at-bilkent has institutional domain (www.cs.bilkent.edu.tr) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.0%) to scientific vocabulary
Keywords
Repository
A Cytoscape.js extension to provide miscellenaous view utilities such as hiding and highlighting nodes/edges
Basic Info
Statistics
- Stars: 54
- Watchers: 13
- Forks: 7
- Open Issues: 1
- Releases: 16
Topics
Metadata Files
README.md
cytoscape-view-utilities
Description
This Cytoscape.js extension provides miscellenaous view utilities such as hide/show, highlight, marquee zoom and free form selection, distributed under The MIT License.

Please cite the following paper when using this extension:
U. Dogrusoz , A. Karacelik, I. Safarli, H. Balci, L. Dervishi, and M. C. Siper, "Efficient methods and readily customizable libraries for managing complexity of large networks", PLoS ONE, 13(5): e0197238, 2018.
Demo
Click here (no undo) or here (undoable) for a demo
API
var instance = cy.viewUtilities(options)
@param options — If not provided, default options will be used. See the below section for default options.
highlightStyles is array of objects. The objects should follow the format {node: ..., edge: ...}. selectStyles will be used if you want to override the highlighted styles when the objects are selected.
lassoStyle will be used to override the lasso line style.
e.g
js
var options = {
highlightStyles: [
{ node: { 'border-color': '#0b9bcd', 'border-width': 3 }, edge: {'line-color': '#0b9bcd', 'source-arrow-color': '#0b9bcd', 'target-arrow-color': '#0b9bcd', 'width' : 3} },
{ node: { 'border-color': '#04f06a', 'border-width': 3 }, edge: {'line-color': '#04f06a', 'source-arrow-color': '#04f06a', 'target-arrow-color': '#04f06a', 'width' : 3} },
],
selectStyles: {
node: {'border-color': 'black', 'border-width': 3, 'background-color': 'lightgrey'},
edge: {'line-color': 'black', 'source-arrow-color': 'black', 'target-arrow-color': 'black', 'width' : 3}
},
setVisibilityOnHide: false, // whether to set visibility on hide/show
setDisplayOnHide: true, // whether to set display on hide/show
zoomAnimationDuration: 1500, // default duration for zoom animation speed
neighbor: function(ele){
return ele.closedNeighborhood();
},
neighborSelectTime: 500,
lassoStyle: {lineColor: "#d67614", lineWidth: 3} // default lasso line color, dark orange, and default line width
htmlElem4marqueeZoom: '', // should be string like `#cy` or `.cy`. `#cy` means get element with the ID 'cy'. `.cy` means the element with class 'cy'
marqueeZoomCursor: 'se-resize', // the cursor that should be used when marquee zoom is enabled. It can also be an image if a URL to an image is given
isShowEdgesBetweenVisibleNodes: true // When showing elements, show edges if both source and target nodes become visible
};
var api = cy.viewUtilities(options);
instance.highlight(eles, idx = 0)
@param eles — a cytoscape.js collection (collection of elements) to be highlighted
@param idx — The index of the cytoscape.js style. If you don't specify it, the first style will be used.
Apply style class to the specified elements. Style class is specified with its index
instance.highlightNeighbors(eles, idx = 0)
@param eles — a cytoscape.js collection (collection of elements) to be highlighted
@param idx — The index of the cytoscape.js style. If you don't specify it, the first style will be used.
Highlights elements' neighborhood (based on the color option). Similar to the highlight function, either the elements and highlighting option can both be sent in the arguments. If only the elements are sent, then the default highlight color is used.
instance.removeHighlights(eles)
@param eles — elements to remove highlights
Remove highlights from eles.
instance.hide(eles)
@param eles — elements to hide
Hides given eles.
instance.show(eles)
@param eles — elements to show
Unhides given eles.
instance.showHiddenNeighbors(eles)
@param eles — elements to show hidden neighbors
Unhides hidden neigbors of given eles. Note that compound nodes are not respected as expected.
instance.zoomToSelected(eles)
@param eles — elements to zoom
Zoom to selected eles.
instance.enableMarqueeZoom(callback)
@param callback — is called at the end of the function
Enables marquee zoom. It is automatically called when CTRL+Shift keys are down.
instance.disableMarqueeZoom()
Disables marquee zoom. It is automatically called when CTRL+Shift keys are up.
instance.enableLassoMode(callback)
@param callback — is called at the end of the function
Enables lasso tool.
instance.disableLassoMode()
Disables lasso tool.
instance.getHighlightStyles()
Returns current highlightStyles which is an array of objects like below
[
{ node: { 'border-color': '#0b9bcd', 'border-width': 3 }, edge: {'line-color': '#0b9bcd', 'source-arrow-color': '#0b9bcd', 'target-arrow-color': '#0b9bcd', 'width' : 3} },
{ node: { 'border-color': '#bf0603', 'border-width': 3 }, edge: {'line-color': '#bf0603', 'source-arrow-color': '#bf0603', 'target-arrow-color': '#bf0603', 'width' : 3} },
],
instance.getAllHighlightClasses()
Returns all currently used cytoscape.js style classes
instance.changeHighlightStyle(idx, nodeStyle, edgeStyle)
@param idx — index of the style that is going to be changed
@param nodeStyle — cytoscape style for nodes
@param edgeStyle — cytoscape style for edges
Changes the style specified with idx.
instance.addHighlightStyle(nodeStyle, edgeStyle)
@param nodeStyle — cytoscape style for nodes
@param edgeStyle — cytoscape style for edges
Adds a new style to the highlightStyles array.
instance.removeHighlightStyle(styleIdx): void
@param styleIdx — index of the style to delete (0 based)
Removes the style from highlightStyles array.
instance.changeLassoStyle(styleObj)
@param styleObj — lasso line style object with lineColor and/or lineWidth properties
Default Options
js
var options = {
highlightStyles: [],
selectStyles: {},
setVisibilityOnHide: false, // whether to set visibility on hide/show
setDisplayOnHide: true, // whether to set display on hide/show
zoomAnimationDuration: 1500, // default duration for zoom animation speed
neighbor: function (ele) { // return desired neighbors of tapheld element
return false;
},
neighborSelectTime: 500, // ms, time to taphold to select desired neighbors in addition to the taphold event detect time by cytoscape
lassoStyle: {lineColor: "#d67614", lineWidth: 3} // default lasso line color, dark orange, and default line width
};
Default Undo-Redo Actions
ur.do("highlight", args)
ur.do("highlightNeighbors", args)
ur.do("highlightNeighbours", args)
ur.do("removeHighlights")
ur.do("hide", eles)
ur.do("show", eles)
Dependencies
- Cytoscape.js ^3.2.0
- Geometric.js ^2.2.3
- cytoscape-undo-redo.js ^1.0.8 (optional)
Usage instructions
Download the library:
* via npm: npm install cytoscape-view-utilities ,
* via bower: bower install cytoscape-view-utilities , or
* via direct download in the repository (probably from a tag).
require() the library as appropriate for your project:
CommonJS:
``` js var cytoscape = require('cytoscape'); var viewUtilities = require('cytoscape-view-utilities');
viewUtilities(cytoscape); // register extension ```
AMD:
js
require(['cytoscape', 'cytoscape-view-utilities'], function(cytoscape, view - utilities) {
view - utilities(cytoscape); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require() is needed.
Build targets
npm run build: Build./src/**intocytoscape-view-utilities.jsin production environment and minimize the file.npm run build:dev: Build./src/**intocytoscape-view-utilities.jsin development environment without minimizing the file.
Publishing instructions
This project is set up to automatically be published to npm and bower. To publish:
- Build the extension :
npm run build - Commit the build :
git commit -am "Build for release" - Bump the version number and tag:
npm version major|minor|patch - Push to origin:
git push && git push --tags - Publish to npm:
npm publish . - If publishing to bower for the first time, you'll need to run
bower register cytoscape-view-utilities https://github.com/iVis-at-Bilkent/view-utilities.git
Team
- Hasan Balci, Metin Can Siper, Huseyin Eren Calik, Mubashira Zaman, and Ugur Dogrusoz of i-Vis at Bilkent University
Alumni
Owner
- Name: i-Vis at Bilkent
- Login: iVis-at-Bilkent
- Kind: organization
- Website: http://www.cs.bilkent.edu.tr/~ivis/
- Twitter: iVisAtBilkent
- Repositories: 50
- Profile: https://github.com/iVis-at-Bilkent
i-Vis Research Lab at Bilkent University
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
- family-names: "Karacelik"
given-names: "Alper"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Safarli"
given-names: "Ilkin"
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dervishi"
given-names: "Leonard"
- family-names: "Siper"
given-names: "Metin Can"
title: "cytoscape-view-utilities"
version: 6.0.0
date-released: 2021-06-16
url: "https://github.com/iVis-at-Bilkent/cytoscape.js-view-utilities"
preferred-citation:
type: article
authors:
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
- family-names: "Karacelik"
given-names: "Alper"
orcid: "https://orcid.org/0000-0000-0000-0000"
- family-names: "Safarli"
given-names: "Ilkin"
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dervishi"
given-names: "Leonard"
- family-names: "Siper"
given-names: "Metin Can"
doi: "10.1371/journal.pone.0197238"
journal: "PLOS ONE"
month: 5
start: 1 # First page number
end: 18 # Last page number
title: "Efficient methods and readily customizable libraries for managing complexity of large networks"
issue: 5
volume: 13
year: 2018
GitHub Events
Total
- Watch event: 4
- Fork event: 1
Last Year
- Watch event: 4
- Fork event: 1
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Hasan Balcı | b****9@g****m | 67 |
| canbax | y****z@g****m | 24 |
| mrsfy | m****y@o****m | 21 |
| MobiZaman | m****n@l****m | 17 |
| ugurdogrusoz | u****z@g****m | 14 |
| Salih Altun | m****n@g****m | 12 |
| metincansiper | m****r@g****m | 11 |
| Mubashira Zaman | 3****n@u****m | 9 |
| kaansancak | k****k@g****m | 9 |
| Nasim Saleh | n****h@g****m | 5 |
| Salih Altun | s****n@u****r | 5 |
| H. Eren Calik | e****k@g****m | 4 |
| kinimesi | k****i@u****m | 4 |
| Rumeysa Ozaydin | 4****n@u****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 27
- Total pull requests: 13
- Average time to close issues: about 1 month
- Average time to close pull requests: 6 days
- Total issue authors: 11
- Total pull request authors: 7
- Average comments per issue: 2.44
- Average comments per pull request: 0.38
- Merged pull requests: 11
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ugurdogrusoz (8)
- hasanbalci (4)
- maxkfranz (3)
- metincansiper (3)
- canbax (3)
- dshenderson (1)
- KonradHoeffner (1)
- nasimsaleh (1)
- msalihaltun (1)
- mafar (1)
- bootrino (1)
Pull Request Authors
- herencalik (4)
- hasanbalci (3)
- kaansancak (2)
- gomezhyuuga (1)
- MobiZaman (1)
- msalihaltun (1)
- metincansiper (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- npm 5,906 last-month
-
Total dependent packages: 4
(may contain duplicates) -
Total dependent repositories: 27
(may contain duplicates) - Total versions: 50
- Total maintainers: 6
npmjs.org: cytoscape-view-utilities
Package of view utilities for cytoscape.js
- Homepage: https://github.com/iVis-at-Bilkent/cytoscape.js-view-utilities
- License: MIT
-
Latest release: 6.0.0
published over 4 years ago
Rankings
Maintainers (6)
bower.io: cytoscape-view-utilities
Package of view utilities for cytoscape.js
- License: MIT
-
Latest release: v6.0.0
published over 4 years ago
Rankings
repo1.maven.org: org.webjars.bower:cytoscape-view-utilities
WebJar for cytoscape-view-utilities
- Homepage: http://webjars.org
- Documentation: https://appdoc.app/artifact/org.webjars.bower/cytoscape-view-utilities/
- License: MIT
-
Latest release: 2.0.6
published over 8 years ago
Rankings
Dependencies
- 535 dependencies
- @babel/core ^7.11.6 development
- @babel/preset-env ^7.11.5 development
- babel-loader ^8.1.0 development
- camelcase ^6.0.0 development
- cross-env ^7.0.2 development
- webpack ^4.44.2 development
- webpack-cli ^3.3.12 development
- geometric ^2.2.3