Hi:
yes, embed a matplotlib canvas is the best way. you can use plot with ‘-’ style to draw the arc, and with ‘o’ style to draw the node. every element in matplot can set a pick parameter. you can bind a method. you can get the graphic feature you clicked, then use a dict to store the <feature, node>.
a matplotlib demo show you how to edit node
this is my project, witch do something seems like
if you donot like using matplotlib, you must use dc to draw the graph, and treat the mouse event to analysis which node you clicked! If you want to treat these events yourself, shapely can help.
best
YXDragon
发件人:Chris Barker chris.barker@noaa.gov
收件人:wxpython-users wxpython-users@googlegroups.com
主题:Re: [wxPython-users] graph visualization implementation
日期:2017年07月08日 03点24分
The “trick” is that you’ll need to figure out the layout yourself – i.e. where to put the boxes so they don’t overlap, etc, etc… maybe networkx can help with that?
I just took a quick look at networkx – it provides some support for drawing graphs using matplotlib.
So you could embedd an MPL graph in your wx app, though it may be hard to get teh clicking behaviour you want.
Unfortunately, it looks like they used the non-OO interface to MPL, so if you want to draw to an embedded graph, and/or want to access the layout info without actually using MPL, you’ll need to go into the source and extract what you need I haven’t looked to see how well structured it is in side – could be easy or hard, depending.
-CHB
···
----- 原始邮件 -----
On Fri, Jul 7, 2017 at 12:17 PM, Chris Barker chris.barker@noaa.gov wrote:
–
Christopher Barker, Ph.D.
OceanographerEmergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
–
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.