Ticket #8033 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

add a README.txt for the graph_editor, to encourage development

Reported by: was Owned by: was
Priority: minor Milestone: sage-4.3.3
Component: notebook Keywords:
Cc: rkirov Work issues:
Report Upstream: N/A Reviewers: Mitesh Patel, Radoslav Kirov
Authors: Radoslav Kirov, Mitesh Patel Merged in: sagenb-0.7.5
Dependencies: Stopgaps:

Description

Hi,

The new graph editor in sage by Rado is AWESOME.  One can try it
easily at http://sagenb.org by typing:

 g = graphs.CompleteGraph(10)
 graph_editor(g)

The actual source code is at

  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.

So, could somebody familiar with the graph editor write something and
post a patch.  Or just respond to this email with what would go in a
README.txt?   I have two undergrads who might want to work on that
code, but it would help a lot of there were some docs.

Attachments

8033.patch Download (2.8 KB) - added by rkirov 3 years ago.
contains README.TXT
trac_8033-graph_editor_readme.patch Download (3.2 KB) - added by mpatel 3 years ago.
Various changes. Replaces previous. sagenb repo.

Change History

comment:1 Changed 3 years ago by was

And here is the content (from Mitesh Patel):

The main files are

       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.

Changed 3 years ago by rkirov

contains README.TXT

comment:2 Changed 3 years ago by rkirov

  • Status changed from new to needs_review

Added a small file README.txt that has a summary of how the graph_editor works. Comments are welcome.

Changed 3 years ago by mpatel

Various changes. Replaces previous. sagenb repo.

comment:3 Changed 3 years ago by mpatel

I've attached an update with some changes. Feel free to make further changes!

comment:4 Changed 3 years ago by mpatel

Just a quick thought: Using $(window).load(... instead of $(document).ready(... in graph_editor.js might resolve the "mouse_out" problem mentioned at the bottom of graph_editor.py.

comment:5 Changed 3 years ago by mpatel

  • Cc rkirov added
  • Authors set to Radoslav Kirov, Mitesh Patel

Hi Rado -- If this looks good to you, we can change the status to "positive review."

comment:6 Changed 3 years ago by rkirov

  • Status changed from needs_review to positive_review

definitively, its ready to be merged.

comment:7 Changed 3 years ago by mpatel

  • Status changed from positive_review to closed
  • Reviewers set to Mitesh Patel, Radoslav Kirov
  • Resolution set to fixed
  • Merged in set to sagenb-0.7.5
Note: See TracTickets for help on using tickets.