A flexible context menu for Cytoscape. [Demo incoming]
- Cytoscape.js ^3.2.0
Download the library:
- via npm:
npm install flexible-context-menu,
- via bower:
bower install flexible-context-menu, or
- via direct download in the repository (Look at the releases tab).
Import the library as appropriate for your project:
let cytoscape = ;let FlexibleContextMenu = ;cytoscape; // register extension
Plain HTML/JS has the extension registered for you automatically, because no
require() is needed.
The extension supports adding menu items for a selected node in the graph. They are, for now, displayed in a circle around the selected node. It exposes only one function -
flexibleContextMenu - which is attached to Cytoscape.
The initialisation for the menu requires the following:
;;Cytoscape;const cytoscape = ;const options: Options = ... ;cytoscape;
This only needs to be run once. After that, the contextual menu will appear and disappear based on the conditions you have specified in the