Catalog npm
PACKAGE EXPLORERView in registry

3dmol

npm

JavaScript/TypeScript molecular visualization library

Versions collected51
Direct dependencies37From release 2.5.5
Last observed20 Oct, 19:40 UTC

README

Current package documentation

3Dmol.js

CDNJS codecov Github CI

3Dmol.js is an object-oriented, WebGL accelerated JavaScript library for online molecular visualization.

Since 3Dmol.js is licensed under the permissive BSD open-source license, you are free to use it in any project, as long the code is properly acknowledged and cited.

With 3Dmol.js, you can add beautifully rendered molecular visualizations to your web applications. Features include:

  • support for pdb, sdf, mol2, xyz, cif, cdjson, mmtf, prmtop, gro, pqr, cube, and vasp formats
  • parallelized molecular surface computation
  • sphere, stick, line, cross, cartoon, and surface styles
  • atom property based selection and styling
  • labels
  • clickable interactivity with molecular data
  • geometric shapes including spheres and arrows

See the documentation to learn how to use 3Dmol.js as a hosted viewer, embeddable viewer, or as a component of a larger application.

Examples

HTML

<script src="https://3Dmol.org/build/3Dmol-min.js"></script>     
 
 <div style="width: 400px; height: 400px;" 
        class='viewer_3Dmoljs' data-pdb='4N8T' data-style='cartoon:color=spectrum'
        data-surface='opacity:.7;color:white'></div>

JavaScript

We support the use of both PDB queries as well as PDB files.

Alt Text

First you simply create the viewer with a div's id.

var viewer = $3Dmol.createViewer($("#div"));

Then you can download a protein data bank model (here pdb:1MO8) and display it with the styling of your choosing.

$3Dmol.download("pdb:1MO8",viewer,{multimodel:true, frames:true},function(){
	viewer.setStyle({}, {cartoon:{color:"spectrum"}});
	viewer.render();
});

Surfaces

We also support the use of surfaces that are asynchronously loaded and support different color schemes

Alt Text

viewer.addSurface($3Dmol.SurfaceType.VDW, {
    opacity:0.85,
    voldata: new $3Dmol.VolumeData(volumedata, "cube"),
    volscheme: new $3Dmol.Gradient.ROYGB(range[1],range[0])
},{});

Shapes

The use of different shapes and styles is supported.

Alt Text

viewer.addCylinder({start:{x:0.0,y:2.0,z:0.0},
    end:{x:0.0,y:10.0,z:0.0},
    radius:0.5,
    fromCap:false,
    toCap:true,
    color:'teal'});
viewer.addCylinder({start:{x:15.0,y:0.0,z:0.0},
    end:{x:20.0,y:0.0,z:0.0},
    radius:1.0,
    color:'black',
    fromCap:false,
    toCap:false});

Documentation

Please check out our documentation at 3dmol.js. We have tutorials, as well as the stable release of the platform.

Contact

Please address any questions or concerns to dkoes@pitt.edu. You may also submit an issue on github.

Citing

If you use 3Dmol.js, please cite our Bioinformatics paper.

Funding

3DMol.js is funded through R35GM140753 (and previously R01GM108340) from the National Institute of General Medical Sciences. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institute of General Medical Sciences or the National Institutes of Health.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 51

Collected releases
VersionPublishedDirect dependenciesOpen version
2.5.5Registry latest22 May 202637
2.5.422 Jan 202637
2.5.327 Sept 202537
2.5.230 Jul 202537
2.5.126 Jun 202537
2.5.03 Jun 202537
2.4.28 Nov 202436
2.4.16 Nov 202436
2.4.04 Sept 202436
2.3.031 Jul 202436
2.2.1-post118 Jul 202436
2.2.117 Jul 202436
2.2.07 Jul 202438
2.1.011 Mar 202436
2.0.623 Oct 202336
2.0.523 Sept 202336
2.0.419 Sept 202336
2.0.314 May 202334
2.0.222 Mar 202334
2.0.16 Feb 202336

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
3dmol/3dmol.js

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
dkoes/3dmol.js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:40 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d1f1a45a1b0c3baf45ef55755c0e10b81acee0571fcf6fa65dd231c3a6ab56ce