Skip to main content

Introduction

megane is a high-performance molecular viewer that works wherever you do — Jupyter notebooks, React web apps, the command line, and VSCode.

What can megane do?

  • Render 1M+ atoms at 60 fps in the browser using billboard impostor rendering
  • Load 15 file formats: PDB, GRO, XYZ, MOL, SDF, MOL2, CIF, mmCIF, LAMMPS data, AMBER topology, XTC, DCD, ASE .traj, LAMMPS dump, AMBER NetCDF
  • Stream XTC trajectories from the megane serve CLI over WebSocket — scrub multi-GB files without loading every frame into memory (browser/Jupyter without the CLI load full trajectories)
  • Build visual pipelines with a drag-and-drop node editor, or write them as Python/TypeScript code
  • Integrate with Plotly, MDX/Next.js, ipywidgets, and any framework via the framework-agnostic renderer
  • Light, dark, and auto themes — cycle through Light / Dark / Auto (follows OS preference) via the Theme button in the Pipeline panel; persisted across sessions

Choose your environment

EnvironmentInstallStart here
Jupyter / Pythonpip install meganeJupyter Guide
Web / Reactnpm install megane-viewerWeb Guide
CLI (Docker)docker build -t megane .CLI Guide
VSCodeInstall the megane extensionPipeline Editor

For a side-by-side comparison of which formats and UI features each environment supports — including known gaps — see Platform Support.

Supported file formats

FormatExtension
Protein Data Bank.pdb
GROMACS structure.gro
XYZ.xyz
MDL Molfile (V2000).mol
MDL SDfile (parsed via the V2000 Molfile reader).sdf
Tripos MOL2.mol2
Crystallographic Information File.cif
Macromolecular CIF (mmCIF/PDBx).mmcif
LAMMPS data.data, .lammps
AMBER topology.prmtop
GROMACS trajectory.xtc
CHARMM/NAMD DCD trajectory.dcd
ASE trajectory.traj
LAMMPS dump.lammpstrj, .dump
AMBER NetCDF trajectory.nc

Per-host coverage (which formats each platform's UI can open vs. parser-only access) is enumerated in Platform Support.

Architecture at a glance

megane is a Rust core compiled to both WebAssembly (browser) and a Python extension (PyO3), with a TypeScript/React frontend built on Three.js.

┌────────────┐     ┌────────────────────┐     ┌──────────────────┐
│ Rust core │────▶│ WASM (browser) │────▶│ React / Three.js│
│ megane-core│ └────────────────────┘ └──────────────────┘
│ │ ┌────────────────────┐ ┌──────────────────┐
│ │────▶│ PyO3 (Python) │────▶│ Jupyter widget │
└────────────┘ └────────────────────┘ └──────────────────┘

All environments share the same parser and pipeline execution engine — a pipeline defined in Python produces identical output to the same pipeline in the browser.

Next steps