| name | molstar-integration | ||||
|---|---|---|---|---|---|
| description | Integrate Mol* (MolStar) with MolViewSpec into Jupyter notebooks, Marimo notebooks, or custom webapps for visualizing molecules (PDB, SDF, MMCIF, and more) or trajectories (XTC), and for customizing layout and appearance using selectors and primitives. | ||||
| license | MIT | ||||
| metadata |
|
Integrate Mol* using MolViewSpec (MVSJ/MVSX) across notebooks and webapps. Use the example code in this repo for end-to-end flows and adapt the builder patterns for selectors and primitives.
- Use the MolViewSpec builder (via the Python
molviewspecpackage) to describe structures (local files or external references) and representations (ball-and-stick, surfaces, coloring, labels). - For notebooks (Jupyter and Marimo), pass the builder to
MolStarWidgettogether with local data (molecules/trajectories) in adatadict. - For web apps, use the example below: build an MVSJ description, package it into an MVSX (zip with
index.mvsj+ bundled files), and load it via Mol*viewer.loadMvsData(bytes, "mvsx").
Always start by reading more about the specific type of integration:
- Jupyter:
.codex/skills/molstar-integration/references/jupyter.md - Marimo:
.codex/skills/molstar-integration/references/marimo.md - Webapp:
.codex/skills/molstar-integration/references/webapp.md
The full AnyWidget wrapper is bundled here for reuse (can be copied directly):
.codex/skills/molstar-integration/assets/molstar_widget/
Complete examples from this repo are bundled as assets:
.codex/skills/molstar-integration/assets/notebooks/.codex/skills/molstar-integration/assets/webapp/
Use selectors and primitives via the MolViewSpec builder. See:
.codex/skills/molstar-integration/references/selectors-primitives.md
Use representation parameters and Mol* color themes:
.codex/skills/molstar-integration/references/representations-coloring.md- Includes postprocessing examples (outline, shadow, SSAO, fog, background).
Reference the official MolViewSpec docs for schema details and capabilities: