Richard Spinney wrote:


I would also like to replicate Chime’s ability to use interactive scripts between one Chime display of the jcamp file and a second display of a molecule (there are examples of this at MDL’s web site for Chime). The script is contained in the jcamp file and defines “hot zones” in the spectra. When a user clicks in the hot zone the script is sent to the molecule display window and changes the display or starts/stops an animation. The problem we are having is trying to determine how to pass the script from the jcamp viewer and Jmol which I would like to use for displaying the molecule. Any ideas?


Richard,

A simple solution would be to have two JavaScript message callbacks -- one for each applet -- or, slicker, one message callback function for which the parameters are the same. Jmol uses

function messageCallback(strAppletId,strMessage)

So, if you set this up with your applet, then you can handle all callbacks with the same function. When the user clicks a hot zone, have the applet send the script in strMessage, OR, better, perhaps, add a third parameter, strData, and have strMessage just define the type of data being delivered:

function messageCallback(strAppletId,strMessage,strData)

The original and appropriate use of JavaScript is to tie different modules together. Here is a perfect example -- two applets using JavaScript to talk to each other. Depending upon the strAppletId, the user could have this function either display the animation or, based on clicking on atoms, perhaps, highlight the spectral region. Sounds like loads of fun to me.

To be really slick, have the JCamp file embed the coordinates and vibrational correlation to the spectra. User loads the spectrum, your applet sends the data for Jmol to construct the model with vibrational modes -- note -- just vibrational mode vectors, NOT ANIMATION SEQUENCES-- using the .loadInLine() function, and you are ready to go. This data can be quite compact.

I wish all the people starting to put together applets that display spectra could get together and agree on some basic principles or even consolidate your efforts. So far I know of three -- you, Jennifer Muzyka, and Robert Lancashire. What would it take to get you all in one room and talk about the possibilities so there isn't so much duplication of effort? It would be nice to define the goals and how to reach them. Faster if everyone takes a chunk. This, of course, is the essence of openSource. I hope people are beyond competing in this regard.

By the way, if anyone's interested, I've written a few JCAMP-decoding functions in JavaScript. See

http://www.stolaf.edu/people/hansonr/nmr/24-7/client/readdata.js

or for actual application of such for non-applet (crude) specral display:

http://www.stolaf.edu/people/hansonr/nmr/24-7/client/index1.htm


Bob Hanson


--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge."  - Albert Einstein


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to