Ajit Singh
Ajit Singh

Reputation: 115

CytoscapeJS implementing a context menu and menu bar?

I have recently started exploring CytoscapeJS. I used the 'cxtmenu' plugin and the example at How do I use the jquery.cxtmenu.js plugin packaged with cytoscape.js? to make a simple circular context menu. However, I do not know if it allows users to have sub-menus within each context menu item.

I actually want my web app to have a simple dropdown context/ popup menu with different options depending on the node/ edge clicked (on right click) with further sub-menus. Is this possible in cytoscapeJS ?

Also, is there a way to have a simple menu bar at the top of the graph (as in Cytoscape Web) or do I use javascript/ jquery outside the cytoscapeJS container for that ? Thanks.

Upvotes: 1

Views: 2496

Answers (1)

maxkfranz
maxkfranz

Reputation: 12242

You can use any other libs with Cytoscape.js. The extensions can be used to add new behaviour to Cytoscape.js, or they can be used to make integrations with other libraries more convenient for the dev.

You may be interested in this discussion re. traditional menus: https://github.com/cytoscape/cytoscape.js-cxtmenu/issues/11#issuecomment-64001388

So, you could use widgets/libs from anywhere (e.g. Bootstrap, Foundation, etc). If you want, you could make reusable extensions if that helps to make your code easier or more readable. You're free to take whatever approach you like best.

Re. radial submenus, I have created this issue in the tracker: https://github.com/cytoscape/cytoscape.js-cxtmenu/issues/12

Upvotes: 1

Related Questions