On Mon, Aug 3, 2009 at 7:13 PM, Jason Grout<jason-s...@creativetrax.com> wrote:
>
> Rado wrote:
>> Let's try to divert the topic away from the embarrassing mistake i
>> made:)
>>
>> For the graph editor I am still struggling with the update function,
>> because the original graph variable name is lost once graph_editor is
>> called.
>>
>> python function graph_editor(g) gets the graph representation and
>> sends it to the JS. Once JS is done, its spits out the data. But now
>> question to overwrite the python variable which is locally 'g', but
>> globally something else.
>>
>> that is if the user calls graph_editor(my_graph), how can the JS later
>> call 'my_graph=....' (when the user hits update button).
>>
>
>
> The user has to pass the name, not the value.
>
> graph_editor('my_graph')

Alternatively, since graphs G are mutable, graphs can support a
function such as:

   G.set_from_dict

that takes a dict (or whatever) as input that describes a graph, and
changes G to be the graph defined by that data.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to