https://github.com/fixpoint/cytoscape-dblclick
Add dblclick event to cytoscape.js
https://github.com/fixpoint/cytoscape-dblclick
cytoscape cytoscapejs-extension
Last synced: 6 months ago
JSON representation
Add dblclick event to cytoscape.js
- Host: GitHub
- URL: https://github.com/fixpoint/cytoscape-dblclick
- Owner: fixpoint
- License: mit
- Created: 2019-03-04T13:50:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-07T06:40:28.000Z (over 6 years ago)
- Last Synced: 2025-04-10T10:15:13.751Z (6 months ago)
- Topics: cytoscape, cytoscapejs-extension
- Language: HTML
- Homepage: https://www.npmjs.com/package/cytoscape-dblclick
- Size: 18.1 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cytoscape-dblclick
## Description
Add dblclick event ([demo](https://lambdalisue.github.io/cytoscape-dblclick))
## Dependencies
* Cytoscape.js ^3.2.0
## Usage instructions
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:
```js
import cytoscape from 'cytoscape';
import dblclick from 'cytoscape-dblclick';cytoscape.use( dblclick );
```CommonJS require:
```js
let cytoscape = require('cytoscape');
let dblclick = require('cytoscape-dblclick');cytoscape.use( dblclick ); // register extension
```AMD:
```js
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.
## API
```js
// With default interval (500ms)
cy.dblclick();// Specify interval (in milliseconds)
const interval = 300;
cy.dblclick(interval);
```## Events
- `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## Build targets
* `npm run build` : Build `./src/**` into `dist/index.js`
* `npm run lint` : Run eslint on the source## Publishing instructions
This project is set up to automatically be published to npm and bower. To publish:
1. Build the extension : `npm run build`
1. Commit the build : `git commit -am "Build for release"`
1. Bump the version number and tag: `npm version major|minor|patch`
1. Push to origin: `git push && git push --tags`
1. Publish to npm: `npm publish .`