To answer one of my issues..
I figured out how to get the buttons to delete more than one vertex in
your html example. I used this code...
'subgraph_vertices=vertices.difference
([to_delete,to_delete2,to_delete3,to_delete4])' and it seems to work
nicely. Does this seem like the best solution?
Still can't get the buttons to default to 'none'.
And I am using letters as my vertices. So my original info looks like
this...
fw=DiGraph({'A':{'I':'1.0'}, 'B':{'D':'1.0','E':'0.3','G':'0.4'}.....
But the button selectors are 0-10 and they don't correspond to my
letters so they don't do anything. How can I either...
1. make the buttons be letters and recognize my vertices. -or-
2. map the 0-10 to the letters A-J?
And is there a way to size the html table - it is way to wide to see
both graphs side by side effectively? I tried the html.table? but
there doesn't seem to be an argument for size. Either that or perhaps
if I can scale the graph down to a smaller size, the table will shrink
with it. But figsize='x' doesn't seem to work here. Or if I add it
as plot(blah blah blah).show(figsize=[5,5]) it removes the graphs from
the html table and thus they are no longer side by side. Any ideas?
Tom
On Aug 19, 3:27 pm, docfleetwood <[email protected]> wrote:
> 1. Rado Kirov's javascript version to create/manipulate a graph is
> awesome - that would be an excellent thing to insert into Sage. (says
> he who doesn't know how to program) - very young students could work
> with that and then progress up to 'the code'. In fact, just using the
> page referenced above to create a graph and copy/paste the code into
> Sage is an excellent use of the tool if the 'look' of the graph is
> important - much less tedious than entering positions by hand.
> Although I don't know why it comes out with fairly ugly black lines
> and vertices if I make it a DiGraph, rather than the Sage default
> look.
>
> 2. The new items you added to the interactive subgraph are MUCH
> closer to what I am trying to do. Especially the one where they are
> side by side in the html table. (which was a clever way to add a
> title, btw) I was trying to add a second 'to_delete' button row (ie.
> to_delete2) so I could delete more than one vertex but was woefully
> unsuccessful. Well, I did add the row but I couldn't figure out how
> to get it to read both bits of info (from to_delete and to_delete2)
> and graph it correctly. Any thoughts on how I can add the ability to
> delete more. I want the students to basically create a ripple effect
> through the web given a set of predefined rules based on weights. So
> they would delete a vertex and then make a decision on what to delete
> next (if anything). Also, is there a way to add a 'reset' button to
> start over without having to go back to the original matrix cell and
> 'shift-enter' your way back down the page? And is it possible to
> start with no vertex selected rather than zero automatically going
> away? I tried 'default=None' but it didn't work. I suppose I could
> always have one extra number in the range and default select that
> number but I figure there is probably a way to select nothing at the
> start and have two identical graphs side by side.
>
> Thanks for your help - I am learning a great deal. And I will
> definitely be introducing Sage to the math department at my high
> school!
>
> Tom
>
> On Aug 19, 12:13 am, [email protected] wrote:
>
> > docfleetwood wrote:
> > > Thanks, I have looked at a number of interact examples.
>
> > > I suppose what I should really say is that I still need to figure out
> > > how to 'program' an interactive that will get the job done.
>
> > Does the examples athttp://sagenb.org/home/pub/733/helpmore?
>
> > I just noticed that the interact documentation is not in the reference
> > manual. That's a shame.
>
> > You can read the documentation by doing:
>
> > interact?
>
> > Thanks,
>
> > Jason
>
> > > Although I recall reading in one of these groups that someone was
> > > working on a java or javascript method to be able to use your mouse
> > > and simply drag/drop edges or vertices. Does anyone know anything
> > > about that?
>
> > > Tom
>
> > > On Aug 18, 2:20 am, Rob Beezer <[email protected]> wrote:
>
> > >> On Aug 17, 10:10 pm, docfleetwood <[email protected]> wrote:
>
> > >>> Although I still need to figure out a good interactive mechanism to
> > >>> delete a vertex and redraw the graph. Hmmmm...
>
> > >> Have you looked at the examples athttp://wiki.sagemath.org/interact?
>
> > >> There you can pretty quickly see the variety of input widgets you can
> > >> use in an interact.
>
> > >> You could use two text boxes where the students would just input the
> > >> labels of the two vertices to be deleted, though you'd not get the
> > >> protection against bogus input that comes free with a slider.
>
> > >> Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-edu" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-edu?hl=en
-~----------~----~----~----~------~----~------~--~---