8 breaking releases
| new 0.10.0 | Apr 7, 2026 |
|---|---|
| 0.9.0 | Mar 9, 2026 |
| 0.8.0 | Feb 28, 2026 |
#90 in Science
120KB
3.5K
SLoC
molvis
A minimal web viewer for molecular trajectory/output text.
- Rust backend reads and parses output text into
energy + coordinatesJSON - JavaScript frontend uses
3Dmol.jsto render molecular structures and switch frames with a slider
Current parser support: ORCA .out only.
Future formats (for example Gaussian / XYZ batches) can be added later.
Install
From crates.io (published package):
cargo install molvis
From local source (not published yet):
cargo install --path .
Installed binary run
molvis /path/to/your.out
molvis -H 0.0.0.0 -p 8080 /path/to/your.out
molvis --xyz /path/to/your.out
molvis -x /path/to/your.out
molvis -x -n _opt /path/to/your.out
-x / --xyz will parse the ORCA .out, take the last geometry frame, and write an XYZ file.
By default it uses the input filename stem:
<input-stem>.xyz
You can append a suffix to the input file stem with -n / --name:
<input-stem><name>.xyz
For example:
molvis -x sample.out
# writes sample.xyz
molvis --xyz sample.out
# writes sample.xyz
molvis -x -n _opt sample.out
# writes sample_opt.xyz
Server config (TOML)
molvis can read host/port defaults from config files:
~/.config/molvis/config.toml/etc/molvis/config.toml
Supported keys:
host = "127.0.0.1"
port = 3000
Priority is:
- CLI flags (
-H,-p) - highest - User config (
~/.config/molvis/config.toml) - System config (
/etc/molvis/config.toml) - Built-in defaults (
127.0.0.1:3000)
Initialize user config template:
molvis --init-config
Develop (run from source)
cargo run -- /path/to/your.out
Open http://127.0.0.1:3000
cargo run -- -H 0.0.0.0 -p 8080 /path/to/your.out
cargo run -- --xyz /path/to/your.out
cargo run -- -x /path/to/your.out
cargo run -- -x -n _opt /path/to/your.out
Frontend JS loading
The frontend loads two browser libraries:
3Dmol-min.jsfor 3D molecular renderingplotly.min.jsfor interactive energy trend chart
Default behavior: local first, CDN fallback.
- If
web/3Dmol-min.js/web/plotly.min.jsexist, local files are used. - If local files are absent, it automatically falls back to CDN.
Optional offline mode: place these files under web/ and they will be used first:
web/3Dmol-min.jsweb/plotly.min.js
You can fetch them with:
scripts/fetch-web-libs.sh
Use --force to re-download:
scripts/fetch-web-libs.sh --force
Note for intranet / no-internet environments
- If external CDN access is blocked, 3D viewer or trend chart may fail to load.
- In that case, provide local files under
web/(recommended), or allowlist the CDN domains in your network policy. - If only one library fails to load, the other feature can still work (for example, 3D works but chart fails, or vice versa).
Dependencies
~10–14MB
~171K SLoC