README.md

July 17, 2026 · View on GitHub

MolVis logo  MolVis

Interactive 3D molecular visualization for the web, VSCode, and Jupyter

CI npm License

Documentation  ·  Quick start  ·  Ecosystem

MolVis renders molecules, simulation boxes, and trajectories straight in the browser, with one engine shared across a web viewer, a VSCode editor, and a Jupyter widget. It reads the common chemistry formats (PDB, XYZ, LAMMPS, Zarr), plays back dynamics frame-by-frame, and lets you select, edit, measure, and annotate structures interactively.

Under active development. Public APIs may change between minor releases.

Vision

Molecular visualization tools have long made you choose: a powerful desktop application that is hard to install and impossible to share, or a lightweight web viewer that cannot keep up once your work gets serious. MolVis exists to erase that trade-off — a single rendering engine that runs anywhere a browser does, with no compromise on what you can see or do.

We want looking at a structure to be frictionless. Drag a file onto a page, open it in your editor next to its input deck, or display it inline in a notebook cell — the viewport, the modes, and the shortcuts are identical everywhere, so the muscle memory you build transfers across every context you work in.

And we want visualization to be more than a picture. MolVis treats editing, measurement, pipeline transforms, and analysis as first-class, fully reversible operations on live molecular data — so the viewer becomes a place where you actually do the work, not just admire the result.

Capabilities

SubsystemCapability
@molcrafts/molvis-coreEngine library — Babylon.js rendering, commands, modes, pipeline, RPC bridge
Rendering & artistTen global molecular representations, adaptive 2-D outlines, surface/cloud shaders, MolVis themes, labels
Interaction modesView, Select, Edit, Manipulate, Measure — switchable without losing context
Command systemEvery operation is a reversible do()/undo() command with full history
Modifier pipelineComposable, reorderable transforms — slice, expression-select, color, wrap PBC, hide
AnalysisRDF, clustering, MSD, ring detection, topology analysis
I/ORead/write PDB, XYZ, LAMMPS data & dump, Zarr trajectories
OverlaysArrows, text labels, vector fields, atom markers anchored to the scene
pageReact 19 web app — the single frontend bundle that drives every host
molvis (npm)VSCode extension — custom editor for .pdb/.xyz/.data/.dump/.lammpstrj
molcrafts-molvis (PyPI)Python package — drives the page bundle over a local WebSocket, with bidirectional events

Install

npm install @molcrafts/molvis-core

Requires Node.js 22+. The Python package (pip install molcrafts-molvis) needs Python 3.10+; the VSCode extension installs from the Marketplace.

Quick start

import { mountMolvis } from "@molcrafts/molvis-core";
import { readFrames } from "@molcrafts/molvis-core/io";

const container = document.getElementById("viewer");
if (!container) throw new Error("viewer container not found");

const app = mountMolvis(container);
await app.start();

const pdbText = await (await fetch("/structure.pdb")).text();
const [frame] = readFrames(pdbText, "structure.pdb");
app.renderFrame(frame);

See the documentation for the web viewer, the VSCode extension, the Python API, and how to extend the engine.

Documentation

  • Tutorial — learn frames, camera, representations, selection, pipeline, trajectories, and export
  • Interfaces — Web/TypeScript, Python/Jupyter, and VS Code guides
  • Development — embed MolVis and write custom modifiers and commands
  • API Reference — TypeScript library and Python package

MolCrafts ecosystem

ProjectRole
molpyPython toolkit — the shared molecular data model & workflow layer
molrsRust core — molecular data structures & compute kernels (native + WASM)
molpackPackmol-grade molecular packing (Rust + Python)
molvis — this repoWebGL molecular visualization & editing
molexpWorkflow & experiment-management platform
molnexMolecular machine-learning framework
molqUnified job queue — local / SLURM / PBS / LSF
molcfgLayered configuration library
mollogStructured logging, stdlib-compatible
molhubMolecular dataset hub
molmcpMCP server for the ecosystem
molrecAtomistic record specification

Contributing

Contributions are welcome — see CONTRIBUTING.md or the development guide.

License

BSD-3-Clause — see LICENSE.


Crafted with 💚 by MolCrafts