Name: cytoscape.js-autopan-on-drag
Owner: iVis-at-Bilkent
Description: A Cytsocape.js extension to automatically pan when nodes are out of canvas bounds
Created: 2016-08-09 12:01:18.0
Updated: 2017-10-31 18:52:15.0
Pushed: 2017-12-19 12:04:49.0
Size: 34
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Cytsocape.js extension to automatically pan when nodes are out of canvas bounds distributed under The MIT License.
Download the library:
npm install cytoscape-autopan-on-drag
,bower install cytoscape-autopan-on-drag
, orrequire()
the library as appropriate for your project:
CommonJS:
cytoscape = require('cytoscape');
autopanOnDrag = require('cytoscape-autopan-on-drag');
panOnDrag( cytoscape ); // register extension
AMD:
ire(['cytoscape', 'cytoscape-autopan-on-drag'], function( cytoscape, autopanOnDrag ){
topanOnDrag( cytoscape ); // register extension
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
options = {
enabled: true, // Whether the extension is enabled on register
selector: 'node', // Which elements will be affected by this extension
speed: 1 // Speed of panning when elements exceed canvas bounds
instance = cy.autopanOnDrag( options );
An instance has a number of functions available:
ance.enable(); // enable the instance
ance.disable(); // disable the instance
You can also get an existing instance:
utopanOnDrag('get');
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-autopan-on-drag https://github.com/iVis-at-Bilkent/cytoscape.js-autopan-on-drag.git