3Dmol.js is a WebGL-powered JavaScript library for interactive molecular visualization in browsers. Current stable version is 2.5.4, released with improvements to aromatic bond visualization. Releases occur approximately every 2-4 months with incremental feature additions and bug fixes. Key differentiators include support for multiple molecular formats (PDB, SDF, MOL2, XYZ, CIF, MMTF, etc.), parallelized surface computation, rich styling (cartoon, stick, sphere, surface), and both hosted/embeddable viewer modes. It is licensed under BSD and widely cited in bioinformatics. Unlike alternatives (e.g., NGL Viewer, JSmol), 3Dmol.js offers seamless integration with JavaScript apps and a simpler API for quick molecular rendering.
npm install 3dmolNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a 3Dmol.js viewer, loads a PDB structure, applies cartoon style, adds a surface, and draws a cylinder.
Upgrade to >=2.4.1 or set antialias: false
Upgrade to >=2.5.3
Use import $3Dmol from '3dmol' instead of require
Adjust maxpixels or antialias settings; see documentation
Use callback in addSurface or call render after promise resolves
Use import $3Dmol from '3dmol' then $3Dmol.createViewer
Upgrade to >=2.4.1 or use a single viewer instance
Ensure file is served over HTTP/HTTPS and correct path is provided
Run npm install 3dmol or include script tag from CDN