This is an alternative version of Jmol object that, using the HTML5 canvas like JSmol, has a very small file size, loads very fast and has a high responsiveness. It is particularly adequate for a quick startup and for systems with limited resources and power, like phones. It offers minimal functionality: just a simplified ball and stick rendering from MOL-formatted files, no scripting.
Initialization and loading
The essential and minimal call to create a lightweight JSmol object is simply:
- Note: the reason for the name is that this lightweight alternative was inspired on a viewer named TwirlyMol.
However, in most situations you will want to customize some aspects, like the size of the object and the file paths.
The regular call to create a Jmol object with specified characteristics is
to define an
Info variable, which is an associative array (a set of key+value pairs) that indicates all the desired characteristics of the Jmol object.
The Jmol-JSO library will provide a default
Info variable, so you only need to specify those keys which values you want to customize.
Info has been defined, you create and insert the lightweight JSmol object in the page using this:
- Note that myJmol and Info are user-defined variables and may hence have any name you wish. In contrast, Jmol (right at the beginning) must be written as such, since it is the internal name and identification of the unique Jmol object constructor.
To customize the object, and also partially compensate for the lack of scripting, specific parameters of the Info variable are available. These are explained below.
For general information about setting parameters and for details about the parameters shared in common with Java and HTML5 modalities, please visit the Info parameters page.
(The values shown in the listings below are the defaults)
Jmol object definition
""(model from a MOL file)
""(by name or id, from NIH-CACTUS or PubChem databases)
false(also from NIH-CACTUS or PubChem databases, with user-entered names)
These are exclusive of Lightweight JSmol and partially compensate for the lack of scripting.
- If set
true, will apply a shading to atoms to give some 3D appearance. This is experimental and may slow down rendering considerably, so use it consciously.
- Default spinning of the model.
Customization or extras
Interacting with the object
tf is either true or false.