So I've added a few things there -- like instant Ramachandran Plot. The idea
there is to get a listing of data from Jmol in a format that Flot can read.
That is basically:

[
 [x1,y1]
 [x2,y2]
 [x3,y3]
]

but what is really nice is that Flot ignores anything else in the data, so
this can ready:

[
 [x1,y1,infoa1,infob1]
 [x2,y2,infoa2,infob2]
 [x3,y3,infoa2,infob3]
]

This then allows you to do special things with the Flot hover and pick
callbacks.

So, for example for the Ramachandran plot we are plotting phi and psi, but
we want the Flot hover label and the Jmol selection to be something else.
The call to Jmol to set up the data is:

 var   A = jmolGetData('*.ca','%f,%p,\'%n %r:%c\',\'%r:%c\'')

%f is phi, %p is psi -- those are our x and y. But then we also add
additional information for the Flot hover label in [2] and the selection for
Jmol in [3].

jmolGetData is simply:

function jmolGetData(selection,format) {
    var s = jmolEvaluate('"[" + {' + selection + '}.label("[' + format +
']").join(",") + "]"')
    return eval(s.replace(/\,\]/g,",null]"))
}

That last bit is necessary because Jmol returns [3,] when the value of a
variable is not available. Conveniently, Flot reads "[3,null]" as "skip this
point and turn the line off"


Bob



On Sat, May 9, 2009 at 6:55 PM, Dean Johnston <[email protected]> wrote:

> Looks very nice - I'll contribute what I can.  I can think of lots of
> really cool you could do...
>
> Dean
>
> On Sat, May 9, 2009 at 8:34 AM, Robert Hanson <[email protected]> wrote:
>
>> OK, I'm sold. Check this out: Jmol with flot (
>> http://code.google.com/p/flot/)
>>
>> http://chemapps.stolaf.edu/jmol/docs/examples-11/jmol-flot.htm
>>
>> That give you any ideas? :)
>>
>>
>> Bob
>>
>> --
>> Robert M. Hanson
>> Professor of Chemistry
>> St. Olaf College
>> 1520 St. Olaf Ave.
>> Northfield, MN 55057
>> http://www.stolaf.edu/people/hansonr
>> phone: 507-786-3107
>>
>>
>> If nature does not answer first what we want,
>> it is better to take what answer we get.
>>
>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>>
>>
>> ------------------------------------------------------------------------------
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
>> i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
> i700
> Series Scanner you'll get full speed at 300 dpi even with all image
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to