cytoscape-node-html-label
This project was forked off https://github.com/kaluginserg/cytoscape-node-html-label I forked it off because the projected seemed abandoned, if the author comes back I'll try to push my changes there.
Description
This extension provide ability adding labels for Cytoscape nodes. Simple example:
cyInstance.nodeHtmlLabel( [{ tpl: d => '<div>' + d + '</div>' }] );
Demo: https://kaluginserg.github.io/cytoscape-node-html-label/
Features
- optimised for high performance with high number nodes, for smooth panning and zooming.
- customizable any labels with different templates.
Dependencies
- Cytoscape.js ^3.0.0
Usage instructions
Download the library:
- via npm:
npm install cytoscape-node-html-label
, - via bower:
bower install cytoscape-node-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 nodeHtmlLabel = ;; // register extension
AMD:
;
API
nodeHtmlLabel parameter is an array of options:
cyInstance;
Example usage
Code example:
// create Cy instancevar cyInstance = ; // set nodeHtmlLabel for your Cy instancecyInstance; // cyInstance.nodeHtmlLabel returns a `CytoscapeNodeHtmlLabel` instance, you will get the// same instance if calling on it more times. // Listening for changescyInstance; // Requesting an update of a node labelcyInstance
Demo here: https://kaluginserg.github.io/cytoscape-node-html-label/
how to build and develop:
- Run
npm start
- Create change in src/cytoscape-node-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