cytoscape-node-resize
This package is deprecated in favor of package cytoscape-node-editing.
Description
A Cytoscape.js extension to provide grapples to resize nodes and a visual cue to resize node to its label, 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 (simple) or here (undoable) for demos
Default Options
cy;
API
var api = cy.nodeResize('get')
To get the extension instance after initialization.
api.refreshGrapples()
Refresh rendered node grapples if any. It is an expensive operation and is supposed to be called in rare cases (When it is really needed).
api.removeGrapples()
Remove grapples while node is selected. This is useful when a node is selected but no need to show grapples.
Dependencies
- Cytoscape.js ^3.2.0
- jquery ^1.7.0 || ^2.0.0 || ^3.0.0
- konva ^1.6.3
- cytoscape-undo-redo ^1.0.10 (optional)
Usage instructions
Download the library:
- via npm:
npm install cytoscape-node-resize
, - via bower:
bower install cytoscape-node-resize
, or - via direct download in the repository (probably from a tag).
require()
the library as appropriate for your project:
CommonJS:
var cytoscape = ;var nodeResize = ;var konva = ; ; // register extension
AMD:
;
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
Emitted Events
cy.on("noderesize.resizestart", function(e, type, node){ })
cy.on("noderesize.resizeend", function(e, type, node){ })
cy.on("noderesize.resizedrag", function(e, type, node){ })
cy.on("noderesize.resizetocontent", function(e, node){ })
type
param can be topleft
, topcenter
, topright
, centerright
,
bottomright
, bottomcenter
, bottomleft
, centerleft
node
param corresponds to currently resizing node.
Publishing instructions
This project is set up to automatically be published to npm and bower. To publish:
- Set the version number environment variable:
export VERSION=1.2.3
- Publish:
gulp publish
- If publishing to bower for the first time, you'll need to run
bower register cytoscape-node-resize https://github.com/iVis-at-Bilkent/cytoscape.js-node-resize.git