cytoscape-html-label
Description
This extension provide ability adding labels for Cytoscape nodes and edges. Simple example:
cyInstance.htmlLabel( [{ tpl: d => '<div>' + d + '</div>' }] );
Demo: https://onitsin.github.io/cytoscape-html-label/
Fitures
- optimised for high performance with high number nodes, for smooth panning and zooming.
- customizable any labels with different templates.
Dependencies
- Cytoscape.js ^3.5.0
Usage instructions
Download the library:
- via npm:
npm install cytoscape-html-label
, - via bower:
bower install cytoscape-html-label
, or - via direct download in the repository (probably from a tag).
Plain HTML/JS has the extension registered for you automatically:
RequireJs approach:
require()
the library as appropriate for your project:
CommonJS:
var cytoscape = ;var htmlLabel = ;; // register extension
AMD:
;
API
htmlLabel parameter is an array of options:
cyInstance;
Example usage
Code example:
// create Cy instancevar cyInstance = ; // set htmlLabel for your Cy instancecyInstance;
Demo here: https://onitsin.github.io/cytoscape-html-label/
how to build and develop:
- Run
npm start
- Create change in src/cytoscape-html-label.ts
- When finished =>
npm run test
- Prepare js and min files:
npm run build
git commit
Then, for version update and publish:- Create new npm version:
gulp patch
,gulp feature
orgulp release
npm publish