From: Bob H. <ha...@st...> - 2006-02-09 19:07:58
|
I'm looking at the Jmol callback issue. The Needs: (1) A reliable way for a web application to get information about a model being displayed in Jmol. (2) A reliable way of determining how the user is interacting with the model, such as rotating, zooming, atom picking, making measurements, etc. The Current Situation: In Version 10.00 the only way to return information to a web page is through the callback mechanism. With this mechanism, one identifies JavaScript functions that are to be called when an "event" occurs. These events include: -a file is loaded (loadStructCallback) -new frame/model (animFrameCallback) -an atom is picked (pickCallback) -a message is generated due to the action of a script command (messageCallback) The Problems: (1) Callback functions are notoriously undependable in a multi-platform environment. (2) The mechanism allows for limited information return. (3) This mechanism is not supported in Jmol.js. The Proposed Solution: I propose that there be a fundamentally different mechanism that does not rely upon callback functions (but could be backward-compatible with these if desired). The details of the implementation aren't particularly important right now (on this list). But, basically, it would involve one JavaScript timer per applet and the idea of "polling" -- the web page periodically polls the applet -- say, 10 times per second, -- looking for changes of interest to particular properties of the model. It's relatively simple to implement -- that's not the issue. The issue is this: AS A USER, WHAT DO YOU WANT? a) Do you implement callbacks? If so, which ones? b) What WOULD you use if you had it available? c) What sort of information (exactly) are you looking for? d) Is there a particular format that you would like to see, other than just the current text-stream of messages? e) Is it important to you that this mechanism be backward compatible? MORE SPECIFC QUESTION: 1. There are currently four callbacks: animFrameCallback loadStructCallback pickCallback messageCallback Each of these fulfills an obvious need. Should there be more "callback-like" options? If so, what? The evolving test page for this project can be found at http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm Bob Hanson -- Robert M. Hanson, ha...@st..., 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:ha...@st... http://www.stolaf.edu/people/hansonr "Imagination is more important than knowledge." - Albert Einstein |