wxPython: Network Graph - clickable with context menu - Any pkgs?

ぐ巨炮叔叔 提交于 2019-12-08 05:28:46

问题


Hi I would like to create a wxpython application with a window where I can create a network graph. I have heard (never used) of graphviz and NetworkX, but it seems to me that they only creates graph given some input data. I would like to do the opposite - i.e., create drag and drop nodes and links from a pallete menu. The nodes and links should be right-clickable with context menu popups. Eg., I should be able to right click a node and click "properties" in context menu - where I can fill in ip address, number of ports, their mac addresses etc.

I believe graphviz will not allow me to do that. Is there any good package to do this ? Must be free / open-source.


回答1:


Take a look at the wx.lib.ogl package. It has the basics of what you would need to build diagrams of shapes, labels, lines, arrows, etc. and you can allow the user to interact with them to move them around the window, etc. It is not perfect, but people are using it for this type of thing quite a bit.

Another possibility for you might be wx.lib.floatcanvas. They both have their strengths and weaknesses, so it really depends on which is the best fit for your needs.



来源:https://stackoverflow.com/questions/4447658/wxpython-network-graph-clickable-with-context-menu-any-pkgs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!