cytoscape-navigator
Description
Bird's eye view pan and zoom control for Cytoscape.js
Dependencies
- Cytoscape.js ^2.6.0
- jQuery ^1.4.0 || ^2.0.0
Usage instructions
Download the library:
- via npm:
npm install cytoscape-navigator
, - via bower:
bower install cytoscape-navigator
, or - via direct download in the repository (probably from a tag).
require()
the library as appropriate for your project:
CommonJS:
var cytoscape = require('cytoscape');
var navigator = require('cytoscape-navigator');
navigator( cytoscape );
AMD:
require(['cytoscape', 'cytoscape-navigator'], function( cytoscape, navigator ){
navigator( cytoscape );
});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
API
var cy = cytoscape({ });
var defaults = {
container: false
, viewLiveFramerate: 0
, thumbnailEventFramerate: 30
, thumbnailLiveFramerate: false
, dblClickDelay: 200
, removeCustomContainer: true
, rerenderDelay: 100
};
var nav = cy.navigator( defaults );
You may call nav.destroy()
to remove the navigator widget and associated cleanup.
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-navigator https://github.com/cytoscape/cytoscape.js-navigator.git