Structure Viewer

Summary
Structure Viewer
Functions
molviewerConvert DIV panel into a molecular structure viewer
Types
Options
Functions
setCSID
setWidgetTypeSets the type of widget for mol display
setOptionsSet new options to update the widget’s view
toggleSpinIf spin is on then it sets it to off, and vice-versa

Functions

molviewer

Convert DIV panel into a molecular structure viewer

Parameters

optionsInitialization Options
$('#molcontainer').structureviewer({
    width: 300,
    height: 300,
    csid: 236,
    color: "0xC0C0C0",
    bondWidth: 4,
    zoomScaling: 1.5,
    pinchScaling: 2.0,
    multipleBondSpacing: 2,
    spinRateX: 0.2,
    spinRateY: 0.5,
    spinFPS: 20,
    spin:true
});

Types

Options

Properties

widthWidth of the widget in pixels.  Default value - 300
heightHeight of the widget in pixels.  Default value - 300
csidChemSpider ID to be displayed
smilesSMILES string of the molecule that should be displayed
molstring 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”
colorset background color of JSmol.  Can be specified as decimal [red,green,blue] or hexadecimal [xRRGGBB] triplets - see http://jmol.sourceforge.net/jscolors/ for more details
modalitydetermines the various options to be tried (applet and surrogates) and the order in which to try them.
moleculeStyledisplay style used for molecular representation.  One of: ‘WIREFRAME|SPACEFILL|BALLSTICK
bondWidthset bond width (JSmol)
spinset to true to make molecule spin when displayed, or false if not
zoomScalingset zoom scaling factor of JSmol
pinchScalingset pinch scaling factor of JSmol
multipleBondSpacingset multiple Bond Spacing of JSmol
spinRateXset spin Rate of molecule in JSmol in x direction (if spin is set to true)
spinRateYset spin Rate of molecule in JSmol in y direction (if spin is set to true)
spinFPSset spin frames per second of molecule in JSmol (if spin is set to true)
useSignedAppletWhen set to true, allows to load local files into Jmol faster than from elsewhere
widgetslist of widgets what should be used for spectrum representation.  Default value - JMOL|LIGHTWEIGHT

Functions

setCSID

setCSID: function (csid)
Show molecule with this ChemSpider IDretrieves mol from ChemSpider webservice.

Parameters

csidChemSpider ID
molviewer.setCSID(10368587);

setWidgetType

setWidgetType: function (type)

Sets the type of widget for mol display

Parameters

typeJMOL| LW
molviewer.setWidgetType('JMOL');

setOptions

setOptions: function (options)

Set new options to update the widget’s view

molviewer.setOptions({
        bondWidth: 2,
        spinRateX: 0.1,
        spinRateY: 0.1
});

toggleSpin

toggleSpin: function ()

If spin is on then it sets it to off, and vice-versa

jmol.toggleSpin();
setCSID: function (csid)
setWidgetType: function (type)
Sets the type of widget for mol display
setOptions: function (options)
Set new options to update the widget’s view
toggleSpin: function ()
If spin is on then it sets it to off, and vice-versa