Add dblclick event (demo)
- Cytoscape.js ^3.2.0
Download the library:
- via npm:
npm install cytoscape-dblclick
, - via unpkg:
https://unpkg.com/cytoscape-dblclick/dist/index.js
Import the library as appropriate for your project:
ES import:
import cytoscape from 'cytoscape';
import dblclick from 'cytoscape-dblclick';
cytoscape.use( dblclick );
CommonJS require:
let cytoscape = require('cytoscape');
let dblclick = require('cytoscape-dblclick');
cytoscape.use( dblclick ); // register extension
AMD:
require(['cytoscape', 'cytoscape-dblclick'], function( cytoscape, dblclick ){
dblclick( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require()
is needed.
// With default interval (500ms)
cy.dblclick();
// Specify interval (in milliseconds)
const interval = 300;
cy.dblclick(interval);
dblclick
: Emitted when two click has emitted within the interval (default: 500 ms)dblclick:timeout
: Emitted when the internal timer has timed-out. Useful to detect a single click
npm run build
: Build./src/**
intodist/index.js
npm run lint
: Run eslint on the source
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 .