What Is Embedded 3Dmol Viewer

Q

What Is Embedded 3Dmol Viewer?

✍: FYIcenter.com

A

Embedded 3Dmol Viewer is a built-in 3Dmol viewer in the 3Dmol.js library. You can assign the Embedded 3Dmol Viewer to a DIV element in your HTML document using a special "class=viewer_3Dmoljs" attribute.

Molecule data, display styles and other options can be specified through "data-*=..." attributes listed below:

  • data-pdb - The value describes a PDB ID to be loaded into the viewer.
  • data-cid - The value describes a PubChem compound id to be loaded into the viewer.
  • data-href - The value is a URL to a molecular data file.
  • data-element - The value is the id of an HTML element on the current page that has molecular data embedded in it.
  • data-type - The value is the file format (default pdb; can be pdb, sdf, xyz, mol2, or cube).
  • data-backgroundcolor - The background color (default black).
  • data-backgroundalpha - The background alpha (default opaque: 1.0).
  • data-select - The value is an AtomSpec selection specification.
  • data-style - The value is a style specification.
  • data-surface - A surface style specification.
  • data-labelres - A residue label style specification.
  • data-zoomto - An AtomSpec selection specification to zoom to.
  • data-spin - If set will spin the model using $3Dmol.GLViewer#spin. Can specify axis and speed (e.g. data-spin='axis:z;speed:10')
  • data-ui - If set will show the UI for the viewer.

For more information on the online server of 3Dmol Viewer, read the "Embedding a 3Dmol Viewer" tutorial.

 

Assign Embedded 3Dmol Viewer to DIV

Using Embedded 3Dmol Viewer

Using Embedded 3Dmol Viewer

⇑⇑ 3Dmol.js FAQ

2023-02-05, 342🔥, 0💬