Wrapper for the chemical structure viewer based on JMol.
Simple demo application available here.
JMol | Wrapper for the chemical structure viewer based on JMol. |
Functions | |
jmol | Convert DIV panel into JMol / JSmol viewer. |
Types | |
Options | |
Functions | |
setCSID | |
setSMILES | |
reload | Reloads jmol/jsmol based on currently set options |
setMOL | Show molecule with this mol. |
setMoleculeDisplayType | sets the display type of molecule in JMol |
setZoomScaling | Sets the zoom scale |
setSpinRates | Set the X, Y coordinate spins based on specified frames/second value |
setOptions | Set new options to update the widget’s view |
toggleSpin | If JSMol spin is on then it sets it to off, and vice-versa |
Convert DIV panel into JMol / JSmol viewer.
options | Initialization Options |
$('#jmolView').jmol ({ width: 300, height: 300, csid: 236, modality: 'JAVA', spin: true, spinRateX: 10, spinRateY: 14, spinFPS: 20, zoomScaling: 1.5, vibration: false, useSignedApplet: true });
width | Width of the widget in pixels. Default value - 300 |
height | Height of the widget in pixels. Default value - 300 |
csid | ChemSpider ID to be displayed |
smiles | SMILES string of the molecule that should be displayed |
mol | string containing contents of mol connection file of the molecule to be displayed (with each new line delimited by \n) e.g. mol:”” +”\n” +”\n” +”\n 2 1 0 0000 0 0 0 0 0999 V2000” +”\n 2.4000 -0.4625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0” +”\n 3.7167 -0.4667 0.0000 C 0 0 0 0 0 0 0 0 0 0 0” +”\n 2 1 2 0” +”\nM END” +”\n” +”\n$$$$\n” |
modality | determines the various options to be tried (applet and surrogates) and the order in which to try them. Note that Jmol-JSO cannot detect if the user has intentionally disabled Java in some browsers. |
spin | set to true to make molecule spin when displayed, or false if not |
spinRateX | set spin Rate of molecule in JSmol in x direction (if spin is set to true) |
spinRateY | set spin Rate of molecule in JSmol in y direction (if spin is set to true) |
spinFPS | set spin frames per second of molecule in JSmol (if spin is set to true) |
moleculeStyle | display style used for molecular representation. One of: ‘WIREFRAME|SPACEFILL|BALLSTICK |
zoomScaling | set zoom scaling factor of JSmol |
vibration | whether structure animation should vibrate |
useSignedApplet | When set to true, you can put applet files, model files and page files wherever you want to and run them from local disk. It also allows to load local files into Jmol faster than from elsewhere. |
setMOL: function ( mol )
Show molecule with this mol.
mol | contents of mol connection file defining structure |
jmol.setMOL("" +"\n" +"\n" +"\n 2 1 0 0000 0 0 0 0 0999 V2000" +"\n 2.4000 -0.4625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0" +"\n 3.7167 -0.4667 0.0000 C 0 0 0 0 0 0 0 0 0 0 0" +"\n 2 1 2 0" +"\nM END" +"\n" +"\n$$$$\n");
setSpinRates: function ( spinRateX, spinRateY, spinFPS )
Set the X, Y coordinate spins based on specified frames/second value
spinRateX | spin Rate of molecule in x direction |
spinRateY | spin Rate of molecule in y direction |
spinFPS | spin frames per second of molecule |
jmol.setSpinRates(10, 10, 25);
setCSID: function ( csid )
setSMILES: function ( smiles )
Reloads jmol/jsmol based on currently set options
reload: function ()
Show molecule with this mol.
setMOL: function ( mol )
sets the display type of molecule in JMol
setMoleculeDisplayType: function ( displayType )
Sets the zoom scale
setZoomScaling: function ( zoomScaling )
Set the X, Y coordinate spins based on specified frames/second value
setSpinRates: function ( spinRateX, spinRateY, spinFPS )
Set new options to update the widget’s view
setOptions: function ( options )
If JSMol spin is on then it sets it to off, and vice-versa
toggleSpin: function ()