Bruce, It is on my list of things to do. However, higher priority was to get Jmol communicating more cleanly with the Sage notebook server. I'm working on this on the side as my department/university does not seem to consider contributions to these projects valuable. I do use both Jmol and Sage in the classes I teach, so go figure! Long story short, I think I may get to it this summer.
Jonathan On Jun 8, 12:38 am, Bruce Cohen <math.co...@gmail.com> wrote: > Late last year there were a series of posts (in sage-edu) about > getting 3d data from sage that could be used by a stand-alone jmol > webpage to display a 3d math graphic. I was excited to try the > example listed in the original posting (see below). Has any progress > been made on getting sage to generate and save the .zip file needed in > this process? > > Thanks. > > -Bruce > -------------------------------------------- > ps. I attempted to cross-post this to sage-devel via the Cc: > but that did not work. I will cross-post this in sage-devel via cut- > paste > -------------------------------------------- > re:http://groups.google.com/group/sage-edu/browse_thread/thread/d497a28a... > > On Dec 8 2009, 4:18 pm, Paul Pearson <paultpear...@gmail.com> wrote:> Dear > Jonathan and others, > > > I am a webwork developer, though not one of the main developers. I > > have been successful at displaying a SAGE generated 3d plot from > > within webwork using the Jmol applet provided that the plot data file > > uses no pmesh input files. Sage generates a zipped plot data file > > sage0...stuff...zip which contains a SCRIPT file and may contain > > several pmesh data files. I am able to get Jmol to read the SCRIPT > > file, but the lines in the SCRIPT file that load the pmesh files are > > not executing correctly. I have emailed Robert Hanson (the upstream > > Jmol contact) about this, and his advice was as follows > > > ---------- begin email correspondence -------------------- > > > Jmol opens and reads selected files within a zip file. To do this, > > just use "|" to specify directories within the zip file: > > > script cylinder-jmol.zip|SCRIPT > > > since the other files are in that zip file as well, you also have to > > indicate a default path: > > > set defaultdirectory "cylinder-jmol.zip|" > > > Note the vertical line to indicate we want files within the zip file's > > main directory. > > > then when you execute > > > script SCRIPT > > > it works. > > > ---------- end email correspondence ---------------------- > > > I am guessing that the SAGE developers have already figured out how to > > make this "defaultdirectory" issue work for zip files in remote > > directories, and if you would be able to describe to me how you make > > it work, that would be greatly appreciated. I like your idea of > > having a single input file for Jmol that is "portable" in the sense > > that it can be put anywhere, read as input to Jmol, and it will work. > > However, I also think that there ought to be a way to make the current > > system of zip files work (even though I haven't fully figured it out > > yet). > > > I have been able to get things to work correctly when loading the zip > > file locally (from my own computer) but not remotely (from the webwork > > server). Here's what I have done. Get the zip file with the SCRIPT > > and pmesh files from > > >http://math.webwork.rochester.edu/webwork2_course_files/fall08mth142/... > > > and save it to a local directory that contains "Jmol.js" and > > "JmolApplet.jar". Notice that the first line of the SCRIPT file was > > added by me and uses verbatim the advice from Robert Hanson about > > setting the default directory. Create a html file in that same local > > directory with the following code: > > > ------------------- begin html ---------------------------- > > > <html> > > <head> > > <script type="text/javascript" src="Jmol.js"></script> > > </head> > > <body> > > <!-- > > <script> > > jmolInitialize(".",useSignedApplet) > > </script> > > --> > > > <!-- read cylinder-jmol.zip locally --> > > <script type="text/javascript"> > > jmolApplet(["450","450"],"script cylinder-jmol.zip|SCRIPT") > > </script> > > > <!-- read cylinder-jmol.zip remotely --> > > <script type="text/javascript"> > > jmolSetAppletColor("white"); > > jmolApplet(["400","400"],"scripthttp://math.webwork.rochester.edu/webwork2_course_files/fall08mth142/...") > > </script> > > > </body> > > </html> > > > --------------------- end html ------------------------- > > > You should see a closed cylinder with some vectors on the left from > > the local copy, and a blank Jmol applet (except for the word Jmol) on > > the right from the remote copy. The output from the Java Console is > > given below, in case you're interested in tracing the errors. -- You received this message because you are subscribed to the Google Groups "sage-edu" group. To post to this group, send email to sage-...@googlegroups.com. To unsubscribe from this group, send email to sage-edu+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-edu?hl=en.