-
Notifications
You must be signed in to change notification settings - Fork 0
Archive Trac dn jsmol
Legacy Trac archive page imported from
dn_jsmol. Source: https://genapp.rocks/wiki/wiki/dn_jsmol. Review age, links, and examples before treating as current.
-
assuming $GENAPP is set to your genapp source base:
-
jsmol is part of the jmol package with scripting control jsmol nightlies
-
if you download a new version to integrate with genapp for html5/php type atomicstructure output
- download the zip of jmol
- unzip
- set $JMOL to the directory created, e.g.
$ JMOL=/where/i/created/the/directory/jmol-xx-yy-zz
- copy over the new files
$ cd $JMOL/jsmol/js
$ cp JSmoljQueryExt.js JSmolCore.js JSmol.js JSmolApplet.js JSmolControls.js JSmolApi.js j2sjmol.js $GENAPP/languages/html5/jsmol/
$ cd $JMOL/jsmol
$ cp -R j2s $GENAPP/languages/html5/add/j2s
- these are currently the only files needed, but you may want to check $JMOL/jsmol/README.TXT in for the JSmol.min.nojq.js inclusion listing for any new files required
- if you need to add another .js file, make sure you also add it to html5.json in the assembly for inputs
- the $GENAPP/languages/html5/add/j2s directory may need to be resync'd with svn, maybe best to svn delete the directory, svn commit, then copy over the directory then svn add, svn commit
- otherwise you may have unneeded extra files
- this could also be useful
$ diff --brief -r $JMOL/jsmol/j2s $GENAPP/languages/html5/add/j2s
- edit $GENAPP/languages/html5/jsmol/JSmolCore.js and MAKE SURE _debugCode is set to false:
_debugCode: false, // set false in process of minimization
-
every distribution I have seen has it set to true and this will kill performance!
-
note: that if you just use JSmol.min.nojq.js as distributed, it is set ok, but we want access to modify the internals as needed, so we recreate an equivalent of JSmol.min.nojq.js
-
if you are working with the code in $GENAPP/languages/html5/jsmol
- when running genapp, it is best to have a minifier and a the google closure compiler available
- I simply "minify":"copy" during debugging to have access to the unmolested code in my js debugger
- I use npm's minifier for simple minification
- I use the google closure compiler for distribution
- it is much slower but seems to do a better job
- ADVANCED_OPTIMIZATIONS should probably be applied for jsmol with export of used symbols
- maybe this should be done with inclusion of j2s source
- note: $GENAPP/languages/html5.json defines whether to use minify or closure or copy
- e.g.
# uncomment only one of the definitions below
# "minify" : "minify",
# "minify" : "closure",
# "minify" : "copy",
- jsmol users list archive
- hint about including a console
There are probably several ways you can try for your purposes (although I am not sure to closely understand your setup). Here are some tips:
-
Do not use "zap", as it clears one model before starting to load the next. Maybe just load file1.xyz; load append file2.xyz; or load files "file1.xyz" "file2.xyz"; http://chemapps.stolaf.edu/jmol/docs/#loadappend http://chemapps.stolaf.edu/jmol/docs/#loadfiles
-
If the atoms and bonds are the same in all models, you can try load trajectory but probably that may not be done with several files, only with a multimodel file http://chemapps.stolaf.edu/jmol/docs/#loadtrajectory
-
If you are calculating the coordinates, there is no need to save files, you could try loading the data using the "data" or "load data" commands http://chemapps.stolaf.edu/jmol/docs/#loaddata
-
It is indeed possible to change atom coordinates of the current model inside Jmol, avoiding the need to load a second, third... files. For this, you access and set the atom properties (x, y, z, xyz, atomX, atomY, atomZ). See http://chemapps.stolaf.edu/jmol/docs/#atomproperties Example: {atomno=3}.x = 0.123; {atomno=3}.y = 2.03; {atomno=3}.z = -0.31;
I am quite sure if you explore those you will find your solution. Jmol scripting is very flexible and powerful. Good luck and let us know the outcome,
## fyi - mouse bindings
- http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm
On 08/29/2015 12:02 AM, Robert Hanson wrote:
Go to http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm
In the search box, enter
! set debug
do your mouse/key actions
then click on the "show" link under the applet next to "info"
The messages are identical in Firefox and Chromium although the bindings work in Chromium and don't work in Firefox:
--- SHIFT+RIGHT+drag ---- SHIFT+RIGHT+down SHIFT+RIGHT+up
--- MIDDLE+drag ---- MIDDLE+down MIDDLE+up
--- CTRL+RIGHT+drag ---- CTRL+RIGHT+down CTRL+RIGHT+up
## future
- [https://slack-redir.net/link?url=http%3A%2F%2Fsdpbs.math.uwm.edu%2Fsolvation_jsmol.php&v=3]
- [jmol as editor](http://wiki.jmol.org/index.php/Jmol_as_editor)
- [jmol loading spinner](http://wiki.jmol.org/index.php/Loading_Notice#Spinner_while_JSmol_loads)