I also think that an interactive graph editor would be a very cool feature. Perhaps a good project to work on at Sage Days 15? David
On Thu, Apr 30, 2009 at 5:14 PM, Rob Beezer <goo...@beezer.cotse.net> wrote: > > On Apr 30, 12:05 am, Rado <rki...@gmail.com> wrote: > > I decided to see how hard it > > would be to implement that. > > Hi Rado, > > Very nice! This is a Beautiful Thing. ;-) I've built a couple of > programs in the past that would link a graph editor to computational > routines to allow one to experiment with changing a graph and > instantly learning how certain parameters or properties would react. > It'd be great to see something like this in Sage, so off and on I've > been giving it some thought. > > Would something like the following be possible? > > sage: g = graph_editor() > > would pop up a graph editing area like you have built, and any changes > made in the editing area would be reflected in the Graph object g for > the lifetime of the editing area. So for example, one could edit the > visual representation and then subsequently execute > > sage: g.is_eulerian() > > to obtain the property of the updated version of g. Eventually, > something like this could be packaged up into an @interact, which I > think would be an extremely useful tool for both teaching and > research. > > Some user-interface ideas: > > 1. Is it possible to add a right-click context-menu to vertices? You > can pack a lot of infrequently-used commands there: delete, color, > weight, label, etc. > > 2. I like to make new vertices by clicking on "empty" space (or not > too close to any existing vertices). > > 3. To handle edges, I'd use a click on one vertex to highlight it > (like you have used red coloring, but I'd change the shape to a > slightly larger "target" shape, since I wanted to allow for coloring > of vertices). Then a second click on a subsequent vertex would add/ > remove the edge (ie toggle) and clear the highlight. > > I've got a few items at the top of my Sage to-do list at the moment, > but I'd be interested in working with anybody who wants to carry this > idea forward. > > Rob > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---