Alright, I wrote up how the graph_editor works. You can find the README.txt in the Trac ticket. Hopefully, I used hg properly.
One final note is that dragging vertices too far (not only out of the canvas but out of the sage output cell) currently has a bit weird behavior. I had a solution for that but it caused errors while loading because the event was firing before the graph was in place, so Pat LeSmith commented it out. Some smart use of Jquery should be able to fix this eventually. Rado On Jan 21, 4:56 pm, William Stein <wst...@gmail.com> wrote: > On Thu, Jan 21, 2010 at 2:14 PM, Pat LeSmithe <qed...@gmail.com> wrote: > > On 01/21/2010 12:22 PM, William Stein wrote: > >> > >> local/lib/python/site-packages/sagenb-0.6-py2.6.egg/sagenb/data/graph_editor/ > > >> It would be *GREAT* if there were a README.txt file in that directory > >> that explained what all the js files actually are, something about how > >> the graph editor works, where the code that does spring layout > >> dynamically is located, etc. I looked at the code for five minutes > >> and couldn't deduce answers to any of those questions. > > > Just a quick note: I think the main files are > > Thanks! I've made this:http://trac.sagemath.org/sage_trac/ticket/8033 > > > > > > > a. sage/graphs/graph_editor.py > > b. graph_editor.html > > c. graph_editor.js > > d. processing.editor.min.js > > > Evaluating graph_editor(G) (see (a)) in an input cell generates > > code/markup for an inline frame, which the notebook inserts into the > > corresponding output cell. The iframe loads (b) as its content. In > > turn, (b) draws in jQuery / UI, the layout algorithms in (c), and the > > HTML5 canvas rendering engine in (d). > > > According to > > > http://trac.sagemath.org/sage_trac/ticket/1321#comment:31 > > > Rado adapted (d) from a project called Processing.js > > >http://processingjs.org/ > >http://processingjs.org/reference > >http://processingjs.org/download > > > whose original and minified source files are > > > e. processing.js > > f. processing.min.js > > > To make it somewhat easier to understand the differences between (f) and > > (d), I put (d) through a JS "beautifier" > > > http://jsbeautifier.org/ > > > The result is > > > g. processing.editor.js > > > But I decided not to give the same treatment to (e) and attempt to make > > a concise diff. > > > All errors are my own. > > > -- > > 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 > > athttp://groups.google.com/group/sage-devel > > URL:http://www.sagemath.org > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org -- 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 URL: http://www.sagemath.org