简体   繁体   English

CytoscapeJS实现上下文菜单和菜单栏?

[英]CytoscapeJS implementing a context menu and menu bar?

I have recently started exploring CytoscapeJS . 我最近开始探索CytoscapeJS I used the 'cxtmenu' plugin and the example at How do I use the jquery.cxtmenu.js plugin packaged with cytoscape.js? 我使用了'cxtmenu'插件,以及如何使用与cytoscape.js打包在一起的jquery.cxtmenu.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. 我实际上希望我的Web应用程序具有一个简单的下拉上下文/弹出菜单 ,该菜单具有不同的选项,具体取决于单击的节点/边缘 (右键单击)以及其他子菜单。 Is this possible in cytoscapeJS ? 在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 ? 另外,有没有办法在图的顶部有一个简单的菜单栏 (如在Cytoscape Web中),或者我该在cytoscapeJS容器之外使用javascript / jquery吗? Thanks. 谢谢。

You can use any other libs with Cytoscape.js. 您可以在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. 这些扩展可以用于向Cytoscape.js添加新行为,也可以用于使与其他库的集成对开发人员更加方便。

You may be interested in this discussion re. 您可能对此讨论感兴趣。 traditional menus: https://github.com/cytoscape/cytoscape.js-cxtmenu/issues/11#issuecomment-64001388 传统菜单: https : //github.com/cytoscape/cytoscape.js-cxtmenu/issues/11#issuecomment-64001388

So, you could use widgets/libs from anywhere (eg Bootstrap, Foundation, etc). 因此,您可以在任何地方(例如Bootstrap,Foundation等)使用小部件/库。 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 径向子菜单,我已经在跟踪器中创建了此问题: https : //github.com/cytoscape/cytoscape.js-cxtmenu/issues/12

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM