wxPython:网络图-可通过上下文菜单单击-是否有pkg? [英] wxPython: Network Graph - clickable with context menu - Any pkgs?

查看:75
本文介绍了wxPython:网络图-可通过上下文菜单单击-是否有pkg?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想用一个可以创建网络图的窗口创建一个wxpython应用程序.我听说过(从未使用过)graphviz和NetworkX,但是在我看来,它们仅在给定一些输入数据的情况下创建图形.我想做相反的事情-即从调色板菜单创建拖放节点和链接.节点和链接应可右键单击,并带有上下文菜单弹出窗口.例如,我应该能够右键单击一个节点,然后在上下文菜单中单击属性"-我可以在其中填写ip地址,端口数量,其mac地址等.

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.

我相信graphviz不允许我这样做.有什么好的包装可以做到这一点吗?必须是免费的/开源的.

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

推荐答案

看看wx.lib.ogl包.它具有构建形状,标签,线,箭头等图所需的基础知识,并且可以允许用户与它们进行交互以在窗口周围移动它们,等等.这不是完美的,但是人们可以相当多地将它用于这种类型的事情.

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.

您可能遇到的另一种可能是wx.lib.floatcanvas.他们都有自己的长处和短处,因此实际上取决于哪个最适合您的需求.

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.

这篇关于wxPython:网络图-可通过上下文菜单单击-是否有pkg?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆