#16004: Update notebook to utilize pure javascript JSmol for default live 3-D
-------------------------------+----------------------------
Reporter: gutow | Owner: gutow
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.2
Component: notebook | Resolution:
Keywords: Jmol 3D 3-D | Merged in:
Authors: gutow | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: #16003 | Stopgaps:
-------------------------------+----------------------------
Old description:
> The notebook needs updates to utilize a pure javascript version of Jmol
> by default for live 3-D. This includes changes to make the notebook
> compatible with the newer jquery-1.9 (some things used in the notebook
> have been deprecated).
>
> Jmol is cross compiled to java and javascript. Because so many
> browser/OS combinations now actively try to avoid using java applets, it
> is necessary to have a pure javascript alternative. This solution
> provides all the functionality of Jmol, but as expected since javascript
> is interpreted rather than bytecode ("~3/4" of the way to compiled) the
> performance when interacting with the plot is slower.
>
> This first implementation removes the user tools that have appeared to
> the right of the 3-D plot as they need to be rewritten as well. In this
> first implementation it is not possible to choose to use the java applet
> instead.
>
> One added feature is a "load 3-D live" check box that can be used to make
> a worksheet load 3-D plots live when the worksheet is opened. For
> worksheets with a single interact or only 1-2 plots this should be OK.
>
> *This requires installation of an updated Jmol.spkg. See ticket #16003.
>
> Sorry for the github commit, but I could not get a notebook branch
> working in Sage.
> *
> https://github.com/gutow/sagenb/commit/c730aa4cf563c51e7f1f8ca92899bf515d365030
> *
> https://github.com/gutow/sagenb/commit/7ce561653aa3ffbb28eb36f487be381227018958
> *
> https://github.com/gutow/sagenb/commit/0242d2f495e4be79090e4aae83b4dade1d9a0f26
> *
> https://github.com/gutow/sagenb/commit/7aacbfa3957f237edbea448d492f7c2b7d34cec2
> *
> https://github.com/gutow/sagenb/commit/62a3775979c93b09def7487f9c4599554098b5c6
>
> How to test:
> 1. Clone the git repository https://github.com/gutow/sagenb to anywhere
> convenient on your system.
> 2. Do the following to make sage use the new repository.
> {{{
> $cd SAGE_ROOT/local/lib/python/site-packages/sagenb-0.10.8.2-py2.7.egg
> $mv sagenb sagenb_old
> $ln -s sagenb <path to the sagenb directory inside your new repository>
> }}}
>
> In my case the symlink looks like
> {{{ln -s sagenb ~/git/sagenb/sagenb }}}
New description:
The notebook needs updates to utilize a pure javascript version of Jmol by
default for live 3-D. This includes changes to make the notebook
compatible with the newer jquery-1.9 (some things used in the notebook
have been deprecated).
Jmol is cross compiled to java and javascript. Because so many browser/OS
combinations now actively try to avoid using java applets, it is necessary
to have a pure javascript alternative. This solution provides all the
functionality of Jmol, but as expected since javascript is interpreted
rather than bytecode ("~3/4" of the way to compiled) the performance when
interacting with the plot is slower.
This first implementation removes the user tools that have appeared to the
right of the 3-D plot as they need to be rewritten as well. In this first
implementation it is not possible to choose to use the java applet
instead.
One added feature is a "load 3-D live" check box that can be used to make
a worksheet load 3-D plots live when the worksheet is opened. For
worksheets with a single interact or only 1-2 plots this should be OK.
*This requires installation of an updated Jmol.spkg. See ticket #16003.
Sorry for the github commit, but I could not get a notebook branch working
in Sage.
*
https://github.com/gutow/sagenb/commit/c730aa4cf563c51e7f1f8ca92899bf515d365030
*
https://github.com/gutow/sagenb/commit/7ce561653aa3ffbb28eb36f487be381227018958
*
https://github.com/gutow/sagenb/commit/0242d2f495e4be79090e4aae83b4dade1d9a0f26
*
https://github.com/gutow/sagenb/commit/7aacbfa3957f237edbea448d492f7c2b7d34cec2
*
https://github.com/gutow/sagenb/commit/62a3775979c93b09def7487f9c4599554098b5c6
How to test:
1. Clone the git repository https://github.com/gutow/sagenb to anywhere
convenient on your system.
2. Do the following to make sage use the new repository.
{{{
$cd SAGE_ROOT/local/lib/python/site-packages/sagenb-0.10.8.2-py2.7.egg
$mv sagenb sagenb_old
$ln -s <path to the sagenb directory inside your new repository> sagenb
}}}
In my case the symlink looks like
{{{ln -s sagenb ~/git/sagenb/sagenb }}}
--
Comment (by kcrisman):
Okay, I got it working. Preliminary thoughts:
* Snappier than advertised. But SO SLOW with lots of points; a sparse
vector field or basic plot is not so horrible. Of course, so was the Java
version...
* How do you turn a plot "off" if there are too many open? (Or is that
not a problem like it was with the sleeping Java applets?)
* The load 3d live button is precisely what the doctor ordered.
* I see no way to get the things I used to with right-click (like stereo
glasses, color, axes, whatever). Does jsmol just not have that?
* The icon for activating the plot is ... not obvious. I still really
find the auto-disable piece annoying, and I know that some people have
just hacked that away, though I also know I won't convince you otherwise
;-)
* Please remove the icons for new cells. They are cute, and probably an
improvement, but it should really be orthogonal to this issue. There's
enough moving parts to think about as it is.
* I figure out what strogdon is talking about. Try activating a jsmol,
and then move it around a bit, and then try clicking in a cell *without*
clicking alllll the way on the right to "lose focus" from the jsmol.
(This is a problem anyway, of having to go all the way to the right to
scroll - not limited to jsmol, though, threejs in the cell server has this
problem as well.) You won't be able to, at least often not; you have to
somehow get off focus and there is some timing delay.
* I also haven't tried all the zillions of options out there for 3d plots
to see if it still obeys them all, but presumably if it's pretty similar
to jmol it will do fine.
* Does it require WebGL turned on? I think not, but I'm not sure.
Hope this helps! Actually, it's fairly comparable to the current setup,
so probably we could get it in sooner rather than later. Especially if
you have any thoughts on the "viewer" thing - to me, this would be by far
the easiest way to switch back and forth between functionality.
Once this has been tested enough and the "right" commits used, I think
that you can just do a pull request to sagenb on github with your branch
for this. Yay! Thanks for what is clearly very good hard work.
--
Ticket URL: <http://trac.sagemath.org/ticket/16004#comment:31>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.