cytoscape-auto-pan-on-out-of-canvas-bounds
!!!Important Warning
This extension is renamed as cytoscape-autopan-on-drag. It will be maintained with that name. Please use it.
New npm repository address is 'https://www.npmjs.com/package/cytoscape-autopan-on-drag'
New GitHub repository address is 'https://github.com/iVis-at-Bilkent/cytoscape.js-autopan-on-drag'
Description
An extension to automatically pan when nodes are out of canvas bounds.
Dependencies
- Cytoscape.js ^2.7.0
Usage instructions
Download the library:
- via npm:
npm install cytoscape-auto-pan-on-out-of-canvas-bounds
, - via bower:
bower install cytoscape-auto-pan-on-out-of-canvas-bounds
, or - via direct download in the repository (probably from a tag).
require()
the library as appropriate for your project:
CommonJS:
var cytoscape = ;var auto-pan-on-out-of-canvas-bounds = ; auto-pan-on-out-of-canvas-; // register extension
AMD:
;
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
Default Options
var 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;
API
var instance = cy;
An instance has a number of functions available:
instance; // enable the instance instance; // disable the instance
You can also get an existing instance:
cy;
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-auto-pan-on-out-of-canvas-bounds https://github.com/iVis-at-Bilkent/cytoscape.js-auto-pan-on-out-of-canvas-bounds.git