Opened 8 years ago

Last modified 7 years ago

#16004 closed enhancement

Update notebook to utilize pure javascript JSmol for default live 3-D — at Version 24

Reported by: gutow Owned by: gutow
Priority: major Milestone: sage-6.4
Component: notebook Keywords: Jmol 3D 3-D
Cc: kcrisman, novoselt, strogdon, jason, chapoton Merged in:
Authors: gutow Reviewers:
Report Upstream: Reported upstream. Developers acknowledge bug. Work issues:
Branch: Commit:
Dependencies: #16003 Stopgaps:

Status badges

Description (last modified by gutow)

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.

How to test:

  1. Clone the git repository https://githum.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

Change History (24)

comment:1 Changed 8 years ago by gutow

  • Component changed from PLEASE CHANGE to notebook
  • Description modified (diff)

comment:2 Changed 8 years ago by gutow

  • Owner changed from (none) to gutow

comment:3 Changed 8 years ago by gutow

  • Description modified (diff)

comment:4 Changed 8 years ago by gutow

  • Description modified (diff)

comment:5 Changed 8 years ago by gutow

  • Description modified (diff)
  • Status changed from new to needs_review

comment:6 Changed 8 years ago by kcrisman

  • Dependencies changed from 16003 to #16003

comment:7 Changed 8 years ago by kcrisman

  • Cc kcrisman novoselt strogdon added; krisman nosvelt strongdon removed

comment:8 Changed 8 years ago by kcrisman

  • Description modified (diff)

comment:9 follow-up: Changed 8 years ago by gutow

I'm not sure it has to do with this or something broken in my jquery.form.min.js installation, but I can no longer rename worksheets. Does anybody else seeing this or have an idea how this could have anything to do with the changes in this ticket?

comment:10 in reply to: ↑ 9 Changed 8 years ago by gutow

Replying to gutow:

I'm not sure it has to do with this or something broken in my jquery.form.min.js installation, but I can no longer rename worksheets. Does anybody else seeing this or have an idea how this could have anything to do with the changes in this ticket?

I think I've found it. This may be painful. The newer jquery seems to be killing stuff in jquery-ui-1.8.11.custom.js. I will look for a version that is compatible with the newer jquery.

comment:11 Changed 8 years ago by gutow

jquery-ui is definitely out-of-date. The 1.8.11 release is from 2011. Does anybody know what selections need to be made to get the theme for the notebook to look right? I think to get everything working will require updating to the latest 1.10.4.

comment:12 Changed 8 years ago by novoselt

  • Cc jason added

First of all, thanks for all your work on this, Jonathan!

And perhaps Jason can provide some insight in jquery problems?

comment:13 Changed 8 years ago by jason

See my message to sage-devel: https://groups.google.com/d/msg/sage-devel/8zS6qofxxwk/K5LcLsCWBeMJ for the configuration we use in the cell server with jquery-ui 1.10.something.

comment:15 follow-up: Changed 8 years ago by gutow

  • Description modified (diff)

comment:16 in reply to: ↑ 15 Changed 8 years ago by gutow

Replying to gutow: With Jason's directions for building the theme and a little tweaking, I believe I have everything working again along with the javascript 3-D. As a bonus we now how little icons to click on for adding compute and rich-text cells, so forgetful people like me do not have to remember which key-click combinations to use. The real reason for the icons is that I could not get the key combinations to work:)

Last edited 8 years ago by gutow (previous) (diff)

comment:17 follow-up: Changed 8 years ago by gutow

  • Status changed from needs_review to needs_work

Some jquery-ui image paths broken (probably issue of symlinks)...

comment:18 Changed 8 years ago by kcrisman

Hey, just a quick question as I hopefully will be able to get testing this soon - can the 'load 3-D live" checkbox work just as well with jmol as with jsmol? Also, I presume it will be evident once I finally get it going, but how does one get the Jmol instead of jsmol (say, locally, so that things are snappier)?

comment:19 Changed 8 years ago by kcrisman

  • Description modified (diff)

comment:20 in reply to: ↑ 17 Changed 8 years ago by kcrisman

Some jquery-ui image paths broken (probably issue of symlinks)...

Is this fixed in https://github.com/gutow/sagenb/commit/7aacbfa3957f237edbea448d492f7c2b7d34cec2 ?

comment:21 Changed 8 years ago by kcrisman

I think that creating a new branch inside sagenb is now not possible with the new layout (not directly git-related). One has to even figure out where sagenb lives... annoying. So to test this one really needs a new sagenb spkg to download, or create one. Harrumph.

comment:22 Changed 8 years ago by strogdon

Unless I've missed something it would seem that a new sagenb spkg is needed. The problem is the upstream sagenb-0.10.8.2 tarball is a tarball of tarballs. And it is the sagenb sub-tarball that has to be modified. Now I was able to generate patches that could be applied directly to the local/lib/python2.7/site-packages/sagenb-0.10.8.2-py2.7.egg folder by cloning https://github.com/gutow/sagenb. It seems that there are a couple more commits needed than listed above. But generating these patches is a lot of work! I'm able to see the icons and to turn on 3-D which is very, very slow. However, I see no way to evaluate an individual cell.

comment:23 Changed 8 years ago by kcrisman

Actually, ppurka has a good solution for this at this sage-devel thread. At least I assume it works - I can't check right this second.

$ cd ~/sagenb/sagenb
$ rm flask_version
$ mv ../flask_version .
$ cd ~/sage/local/lib/python/site-packages/sagenb-0.10.8.2-py2.7.egg
$ mv sagenb{,-0.10.8.2}
$ ln -s ~/sagenb/sagenb .

comment:24 Changed 8 years ago by gutow

  • Description modified (diff)

I'm updating the instructions above to include a fix that leaves the sagenb egg unchanged and allows you to work with multiple notebook development repositories.

To answer another question above the very latest commit to the repository does include the path fixes for jquery-ui images.

Note: See TracTickets for help on using tickets.