@interact
def experiment(G=graph_input(200,300)):
L = G.line_graph()
print "G: ", G.eigenvalues()
print "L(G): ", L.eigenvalues()
plot(L)
So rather than begging for somebody else to tackle this, I tore into
it last night, totally unprepared. I can
(1) make a new control in sagenb/notebook/interact.py
(2) it "works" in an interact setup, though does not display on the
"canvas" (rather just before it)
(3) and the rest of the interact functions properly.
(4) I can locate the graph information (adjacencies, positions) in the
graph editor, and get them to display in an alert box
What I can't do is get information about the changed graph reflected
in the interact output, either on changes in the graph, or changes in
other interact controls. I don't know if the graph editor needs to be
modified to be a "control" or if I just don't know how to burrow into
it properly to get what I want. I think it is the control's
value_js and/or _adaptor methods that I don't know how to
implement (or which need support in the editor).
There needs to be some configurable way to say *when* the graph has
changed (edge/vertex deletion/creation, with or without vertex-
location rearrangement). In other words, when filling out an input
box, hitting enter/return says the input is complete, so the graph
editor needs to do something similar, I imagine.
So now I am admitting I'm stuck and am reduced to begging. ;-)
Anybody with the right tools, knowledge, and/or experience motivated
to make this happen? I'd love to collaborate, test, review, write
docstrings, etc, etc. to get this done.
Thanks,
Rob
[1] http://groups.google.com/group/sage-devel/browse_thread/thread/c262901cfafd3f45
[2] http://trac.sagemath.org/sage_trac/ticket/8222
It would be nice if there was something like "developer's guide to
interacts", explaining the logic behind interacts and the minimum code
to get a new interact (with any random JS) into Sage. Considering this
is the second request for interact extensions (there was the sage
bounty), seems to be quite a desirable direction to go. Also the small
matrix editor I posted a few days ago, could be wrapped as matrix
interact.
Rado
> [1]http://groups.google.com/group/sage-devel/browse_thread/thread/c26290...
> [2]http://trac.sagemath.org/sage_trac/ticket/8222
If you write the Javascript side, then I can do the interact side.
>
> It would be nice if there was something like "developer's guide to
> interacts", explaining the logic behind interacts and the minimum code
> to get a new interact (with any random JS) into Sage. Considering this
> is the second request for interact extensions (there was the sage
> bounty), seems to be quite a desirable direction to go. Also the small
> matrix editor I posted a few days ago, could be wrapped as matrix
> interact.
I think you basically have to follow what is done by any other
interact control in the file
interact.py, which is part of the Sage notebook code.
> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to sage-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>
> To unsubscribe from this group, send email to sage-devel+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
Thanks, Rado and William! I've created a ticket, and will try to post
soon about my (limited) progress and what I think this needs on the
Javascript side.
http://trac.sagemath.org/sage_trac/ticket/8631
Rob