Skip to content

3.0.0

Latest

Choose a tag to compare

@dkoes dkoes released this 22 Nov 21:06
· 1 commit to master since this release

Breaking changes

  • UI API changes. The optional viewer controls have been rewritten in TypeScript, with changes to the StateManager and UI interfaces. Applications using the old UI internals, form-based APIs, or custom UI markup will need updating. In particular, StateManager.addSurface(property, callback) is replaced by the Promise-based addSurface(type, style, selection, name?, calculationSelection?). Legacy form/icon helpers and UI label helpers have been removed; use the viewer’s label APIs or StateManager.setResidueLabels(). Construct controls with new $3Dmol.StateManager(viewer, options) and load matching core and 3Dmol.ui bundles. Existing data-ui="true" embeds remain supported. UI API, embedding examples

  • Viewers now automatically destroy themselves when removed from the document. Removing a previously attached viewer container triggers permanent cleanup of its graphics resources, controls, timers, and listeners. Cleanup is deferred so synchronous and microtask reparenting remain safe. Applications that detach viewers for later reuse should create them with $3Dmol.createViewer(element, {autoDestroy: false}) and call viewer.destroy() when finished. A destroyed viewer cannot be reused; viewer.isDestroyed() reports its status. Viewer lifecycle

  • py3Dmol now requires Python 3. Python 2 is no longer supported.

Additional compatibility notes

  • Download failures now reject Promises. The Promise form of $3Dmol.download() now rejects when loading fails instead of resolving with an empty model. Handle failures with .catch() or try/catch around awaited downloads. The callback form continues to invoke its callback after failed load attempts. Download API
  • Updated development requirements: Node.js 24 and npm 10 or newer are required for building and testing the project. Development guide
  • Self-hosted classroom deployments need coordinated updates. Deploy the updated session server and viewer assets together, then reload existing clients. The server now uses threaded Gunicorn instead of Eventlet and requires Python 3.10 or newer. Server upgrade instructions

Viewer controls and sharing

  • Rebuilt editing interface for models, selections, representations, residue labels, molecular surfaces, and view settings. Managed selection layers preserve underlying styles and restore them when layers are disabled or removed.
  • Interactive trajectory controls with playback, frame stepping and scrubbing, speed and loop settings, and movable/collapsible controls. Editing and trajectory controls can be enabled independently through edit/trajectory options or data-ui-edit/data-ui-trajectory attributes.
  • Volumetric-map controls and distance measurements. Load and adjust volumetric maps through the editor, and measure distances by clicking pairs of atoms.
  • Expanded scene sharing. Shared viewer URLs preserve the edited scene, including selections, representations, labels, surfaces, volumes, measurements, camera and clipping settings, and trajectory playback settings. Browser Back and Forward restore saved scenes.

See the viewer guide and embedding guide.

Rendering and animation

  • Per-atom sphere opacity. Sphere imposters can now display different atom opacities within the same model, with depth-sorted translucent rendering. #858
  • Faster coordinate-only trajectory updates. setFrame(frame, {fast: true}) and animate({fast: true}) can reuse existing geometry for compatible sphere, stick, and line representations. This opt-in path assumes consistent atom order, topology, and styling, and falls back to rebuilding when replay cannot be applied. #859
  • Sharper labels. Labels use higher-resolution textures by default without changing their displayed size. LabelSpec.resolution controls texture detail and defaults to 2. Label improvements
  • Lower rendering overhead. Interactive redraws are coalesced, framebuffer textures and temporary storage are reused, and redundant geometry work and allocations have been reduced. Rendering improvements

Classrooms and py3Dmol

  • Expanded classroom synchronization shares models, styles, labels, surfaces, volumetric maps, measurements, and trajectory settings. Students receive the current scene and can rotate, zoom, and answer atom-selection questions while following the instructor.
  • Classrooms in embedded viewers, including optional hidden instructor activation and automatic student joining.
  • Improved session cleanup: classrooms end when the instructor disconnects and expire after 48 hours without activity.
  • Optional py3Dmol controls through edit=True, trajectory=True, and learning=True or a learning configuration dictionary. Controls load automatically and work in notebooks and exported HTML. These options support individual viewers and (1, 1) grids; multi-cell grids require separate views for controls.

See the classroom guide and py3Dmol examples.

Fixes and reliability

  • Fixed accumulating picking shapes when animation frames are rebuilt, preventing continued growth of retained hit-test geometry. #861
  • Prevented stale asynchronous frame requests and animation callbacks from overwriting newer state.
  • Improved GPU-resource disposal, shared-context opacity, shader-failure handling, and postprocessing recovery.
  • Corrected surface-type handling, element-radius lookup, asynchronous coloring, style updates, removal, and cancellation.
  • Corrected volumetric parsing, grid-to-world coordinates, sampling distances, selection masks, and transfer-function validation. Normalization now produces the documented zero mean and unit variance.
  • Fixed custom linear gradient interpolation, camera positioning and animated translation, line picking, hover callbacks, arrow directions, and empty-selection handling.
  • Fixed BCIF downloading and fallback behavior, GRO box values, and CIF secondary-structure options.

Core fixes · Resource and rendering follow-up

Documentation and development

Expanded API documentation, migration guidance, and executable examples; refreshed the documentation site; added generated Markdown and llms.txt discovery. Builds now expose package and Git revision information through $3Dmol.buildInfo. Regression coverage has been expanded across rendering, lifecycle management, controls, classroom synchronization, and Python examples. Documentation updates, build metadata

Thanks to our contributors

  • @jaysoma for per-atom sphere opacity and fast trajectory coordinate updates #858, #859.
  • @dajiaohuang for fixing accumulated picking shapes during animation #861.
  • @MolinDiscovery for the detailed reproduction that identified the animation picking-shape memory issue #860.
  • This is also the first release with significant code assist from Codex.

Full changelog: Changes since 2.5.5