Difference between revisions of "Jmol JavaScript Object/WebGL"

From Jmol
Jump to navigation Jump to search
(creating page, WebGL modality in JSmol - first go)
 
(WebGL; alternatives)
Line 14: Line 14:
 
== Browser support ==
 
== Browser support ==
 
Browser support is irregular, although growing. Chrome, Safari, Edge are compatible, Firefox may be depending on graphics card drivers. Please check e.g. [http://caniuse.com/#feat=webgl Can I use] for current status.
 
Browser support is irregular, although growing. Chrome, Safari, Edge are compatible, Firefox may be depending on graphics card drivers. Please check e.g. [http://caniuse.com/#feat=webgl Can I use] for current status.
 
== JSmol features ==
 
:''Please, if you have experienced with JSmol/WegGL feel free to add items here.''
 
=== Supported ===
 
...
 
=== Not supported ===
 
...
 
  
 
== Implementing the WebGL modality ==
 
== Implementing the WebGL modality ==
Line 28: Line 21:
 
# your page should call {{file|JSmol.GLmol.min.js}} in addition to {{file|JSmol.min.js}}
 
# your page should call {{file|JSmol.GLmol.min.js}} in addition to {{file|JSmol.min.js}}
 
# the <code>use</code> parameter of the <code>Info</code> variable must be set to <code>WebGL</code> (case-insensitive)
 
# the <code>use</code> parameter of the <code>Info</code> variable must be set to <code>WebGL</code> (case-insensitive)
 +
 +
 +
== JmolScript features ==
 +
:''Please, if you have experienced with JSmol/WegGL feel free to add items here.''
 +
=== Supported ===
 +
* ...
 +
=== Not supported ===
 +
* ...
 +
 +
== WebGL-based alternatives to JSmol ==
 +
There are several programs able to display molecular structures using the WebGL technology. This is a list of some of them, and an attempt for comparison.
 +
 +
=== GLmol ===
 +
* Main page: <nowiki>http://webglmol.osdn.jp/index-en.html</nowiki>
 +
Might have been the first WebGL viewer available. Some of its code has been
 +
used in the JSmol WebGL modality. Active development has apparently
 +
ceased.
 +
 +
=== 3Dmol.js ===
 +
* Main page: <nowiki>http://3dmol.csb.pitt.edu/index.html</nowiki>
 +
* Article in PMC: <nowiki>http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4393526/</nowiki>
 +
* Github Repo : <nowiki>https://github.com/3dmol/3Dmol.js</nowiki>
 +
Has a very simple embedding mechanism, based on HTML markup or
 +
url formatting. Abilities to compute isosurfaces in parallel (using web workers
 +
that don’t hang the web browser during the computation). Displays most common
 +
bio-molecular representations, labels, select and color abilities.
 +
 +
=== NGL ===
 +
by Alexander Rose
 +
* Main page: <nowiki>http://arose.github.io/ngl/doc/#User_manual/Introduction/Welcome</nowiki>
 +
* Demonstration: <nowiki>http://proteinformatics.charite.de/ngl/html/ngl.html</nowiki>
 +
* Article in Nucleic Acid Research <nowiki>http://nar.oxfordjournals.org/content/early/2015/04/28/nar.gkv402.full</nowiki>
 +
* Github Repo: <nowiki>https://github.com/arose/ngl</nowiki>
 +
Beautiful graphic capabilities. Many bio-molecular representations (some unique
 +
such as «hyperballs» and «ropes» ). Abilities to act on
 +
selections with a Jmol-like syntax.
 +
 +
=== PV ===
 +
PV Protein Viewer
 +
* Main page: <nowiki>http://biasmv.github.io/pv/</nowiki>
 +
* Dcoumentation: <nowiki>http://pv.readthedocs.org/en/latest/intro.html</nowiki>
 +
* GitHub repo: <nowiki>https://github.com/biasmv/pv</nowiki>
 +
Used by SwissModel and RCSB. Very clear documentation. Graphics are
 +
stylized but also really clear in their depiction. Common bio-molecular
 +
representations are available. Selections are based on javascript and a JSON
 +
syntax.
 +
 +
=== Chemdoodle Web Components ===
 +
* Examples: <nowiki>https://web.chemdoodle.com/demos/iza-zeolite-explorer/</nowiki>
 +
Handles bimolecular representations and has some capabilities to handle cif
 +
files and generate multiple cells. Viewer canvases can be linked to a range of
 +
different widgets (spectrum display, 2D formula, etc.). Selection and display
 +
is based on the manipulation of JavaScript objects.

Revision as of 20:38, 7 November 2015

WebGL modality in JSmol

JSmol has tentatively implemented a modality (additional to the Java and the HTML5 modalities) that makes use of the WebGL technology.

Please, note that this modality does not implement the full set of functionalities of Jmol/JSmol and there are no current plans to develop it further. Help from interested developers/programmers would be welcome.

WebGL is a hardware-accelerated technology for displaying 2D and 3D graphics inside web pages without using any plugins in the browser. It relies on capabilities of the user's graphics card, and so compatibility may be limited, although it is a growing standard feature.

The major advantage of using WebGL is a faster and smoother rendering of the model, rotation, movement, etc., over that obtained with JSmol/HTML5. In exchange, the latter offers a wider compatibility with devices.

Hardware support

Old graphics cards may not support WebGL.

Browser support

Browser support is irregular, although growing. Chrome, Safari, Edge are compatible, Firefox may be depending on graphics card drivers. Please check e.g. Can I use for current status.

Implementing the WebGL modality

You need to be aware that your users/visitors might not have a WebGL-compatible system, so be cautious with your design and offer alternatives.

In order to have JSmol in your pages use the WebGL modality:

  1. your page should call File icon.gifJSmol.GLmol.min.js in addition to File icon.gifJSmol.min.js
  2. the use parameter of the Info variable must be set to WebGL (case-insensitive)


JmolScript features

Please, if you have experienced with JSmol/WegGL feel free to add items here.

Supported

  • ...

Not supported

  • ...

WebGL-based alternatives to JSmol

There are several programs able to display molecular structures using the WebGL technology. This is a list of some of them, and an attempt for comparison.

GLmol

  • Main page: http://webglmol.osdn.jp/index-en.html

Might have been the first WebGL viewer available. Some of its code has been used in the JSmol WebGL modality. Active development has apparently ceased.

3Dmol.js

  • Main page: http://3dmol.csb.pitt.edu/index.html
  • Article in PMC: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4393526/
  • Github Repo : https://github.com/3dmol/3Dmol.js

Has a very simple embedding mechanism, based on HTML markup or url formatting. Abilities to compute isosurfaces in parallel (using web workers that don’t hang the web browser during the computation). Displays most common bio-molecular representations, labels, select and color abilities.

NGL

by Alexander Rose

  • Main page: http://arose.github.io/ngl/doc/#User_manual/Introduction/Welcome
  • Demonstration: http://proteinformatics.charite.de/ngl/html/ngl.html
  • Article in Nucleic Acid Research http://nar.oxfordjournals.org/content/early/2015/04/28/nar.gkv402.full
  • Github Repo: https://github.com/arose/ngl

Beautiful graphic capabilities. Many bio-molecular representations (some unique such as «hyperballs» and «ropes» ). Abilities to act on selections with a Jmol-like syntax.

PV

PV Protein Viewer

  • Main page: http://biasmv.github.io/pv/
  • Dcoumentation: http://pv.readthedocs.org/en/latest/intro.html
  • GitHub repo: https://github.com/biasmv/pv

Used by SwissModel and RCSB. Very clear documentation. Graphics are stylized but also really clear in their depiction. Common bio-molecular representations are available. Selections are based on javascript and a JSON syntax.

Chemdoodle Web Components

  • Examples: https://web.chemdoodle.com/demos/iza-zeolite-explorer/

Handles bimolecular representations and has some capabilities to handle cif files and generate multiple cells. Viewer canvases can be linked to a range of different widgets (spectrum display, 2D formula, etc.). Selection and display is based on the manipulation of JavaScript objects.

Contributors

AngelHerraez