Live Examples
Every panel below runs the Orbitron WASM viewer in your browser. Left-drag to rotate, right-drag to pan, scroll or use − / + to zoom, and choose Reset to return to the framed pose. WebGPU is used when available, with a WebGL2 fallback.
Each viewer has its own iframe. The WASM runtime is a page-level singleton, so placing several <orbitron-viewer> elements directly in one document causes them to compete for the same render state. An iframe gives each scene its own JavaScript and WASM context while the browser still caches the shared assets.
Buckminsterfullerene (C₆₀), ball-and-stick
MgAl₂O₄ spinel, periodic unit cell
Water antisymmetric stretch, generated from displacement vectors
Copper complex, geometry-optimisation trajectory
Ferrocene LUMO, positive and negative isosurface lobes
Ubiquitin (1UBQ), secondary-structure cartoon
Protein-DNA complex (1JGG), two protein chains bound to a 10-base-pair duplex
GROMACS XTC frame 3, paired with GRO topology and exported as a portable snapshot
EMD-3001, experimental MRC2014 density at its header-derived contour
The last three examples come from the same attributed fixtures used by the biology, GROMACS, and density-map regression gates. The protein-DNA bundle retains the deposited chain and residue identity. The GROMACS card is a single portable frame because binary XTC still needs its topology during multiframe access. The map bundle retains the normalized voxel grid, placement, source digest, and contour without embedding the original MRC file.
Reproduce the biology, MD, and density examples
The repository includes one small runner that writes inspectable JSON/CSV, PNG, GRO, and .orbpack outputs:
CARGO_BUILD_JOBS=12 conda run --no-capture-output -n orbitron-dev \
cargo build --release -p orbitron-cli
examples/biology-and-md/run.sh allRun structure, trajectory, or density instead of all for one case. The default output goes to ~/scratch/orbitron-biology-and-md-examples. See examples/biology-and-md/README.md for the exact fixture provenance and output contract.
Make your own
import orbitron
orb = orbitron.Orbitron()
scene = orb.load("your_structure.cif")
orbitron.export_html(
scene,
"viewer.html",
lighting="Studio",
appearance="presentation",
)That output is one portable HTML file. A bundle keeps more than a Scene can: normal modes, trajectory frames, volumetric grids, and a recorded view. Pass the bundle path directly when those sections matter:
orbitron.export_html("run.orbpack", "run.html")For pages with several viewers, use one iframe per scene as this gallery does. The web-embedding guide covers the hosted bundle layout, URL controls, and direct custom-element API. The Python guide covers Jupyter display and scripting.