{"id":49549430,"url":"https://github.com/mx-e/quick-mol-viewer","last_synced_at":"2026-05-02T21:30:35.717Z","repository":{"id":352852889,"uuid":"1216909784","full_name":"mx-e/quick-mol-viewer","owner":"mx-e","description":"Static molecule viewer — render molecules, trajectories, and collections from URL-encoded data. No backend, no build step.","archived":false,"fork":false,"pushed_at":"2026-04-21T11:11:40.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-21T13:12:24.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mx-e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-21T10:59:16.000Z","updated_at":"2026-04-21T11:11:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mx-e/quick-mol-viewer","commit_stats":null,"previous_names":["mx-e/quick-mol-viewer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mx-e/quick-mol-viewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mx-e%2Fquick-mol-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mx-e%2Fquick-mol-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mx-e%2Fquick-mol-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mx-e%2Fquick-mol-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mx-e","download_url":"https://codeload.github.com/mx-e/quick-mol-viewer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mx-e%2Fquick-mol-viewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32550737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-02T21:30:35.084Z","updated_at":"2026-05-02T21:30:35.711Z","avatar_url":"https://github.com/mx-e.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quick-mol-viewer\n\nA single-page, static molecule viewer. All state lives in the URL — no backend, no uploads, no build step. Paste a link, render a molecule.\n\n**Live:** https://mx-e.github.io/quick-mol-viewer/\n\n## Try it\n\nClick any of these (they render in the hosted viewer):\n\n- **Water** (static snapshot, 86 chars): [Link](https://mx-e.github.io/quick-mol-viewer/#d=cgEAAwABAMHKQT8IAQEAAAAAAAD_fxVjAAABgBVjAAA)\n\n- **Benzene rotation** (60-frame trajectory, delta+gzip): [Link](https://mx-e.github.io/quick-mol-viewer/#d=Zx-LCAAAAAAAAv9llk9IVGsYxr-Z809nzkipRLiQiFsraxVlN7l2kdI0SQqhRXdxiQqquUSim7QraRvD8DIVVESLWgRSGGaNhYRgadEqX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pQhKIpAtJIJIuJIFIupAEIulCEoikC0kgki4kgUi6kAQi6UISiKQLSSCSLiSBSLqQBCLpQhKIpAtJIJIuJIFIupAEIulCEoikC0kgki4kgUi6kAQi6UISiKQLSSCSLiSBSLqQBCLpQhKIpAtJIJIuJIFIupAE8j9Er2R69hAAAA)\n\n- **Collection** (6 heterogeneous mols — water, ammonia, methane, CO₂, methanol, benzene): [Link](https://mx-e.github.io/quick-mol-viewer/#d=Zx-LCAAAAAAAAv9jZGJgYGOoFpFzYGbgYGRkAAMr9Tg5BoZjN0AkCwM7I0x8mwEDw7N3S5__1ASR7NeevWNlYGOESy9TAMGo-1H3QSQMR91nZmDj4IAokbUBkY8Pg0g2oDBCs5QXiLzy5qWkvB6IfHjxyhvV0wwMyQmL9RgYeBjYwIARDDg8QGrdVPTtGBh23QaRP7aDRHbdvngQJA4i_9eDRJwcnuYxMOzbDyIZG0Ai-_ZLTwSJg0gAlDGs0v0AAAA)\n\nIn the collection, press `G` (or click ▦) to toggle the 3×3 grid view.\n\n## What it does\n\nThree content modes, all served from one HTML file:\n\n- **Single snapshot** — one molecule, one frame.\n- **Trajectory** — one molecule, many frames. Play/pause, scrub, variable speed (0.25×–4×, base 10 fps).\n- **Collection** — multiple independent molecules (different atom counts OK). Navigate one-at-a-time or view a 3×3 grid.\n\n## Usage\n\nTwo ways to load a molecule:\n\n1. **URL fragment** — `https://mx-e.github.io/quick-mol-viewer/#d=\u003cbase64url-payload\u003e`\n2. **Paste field** — click `paste` (top-right) or press `P`, paste either the full URL, the `#d=…` fragment, or just the base64url payload.\n\nCopy-paste artifacts (line wraps, shell `\\`-continuations, smart quotes, `%XX` escapes, zero-width chars) are stripped automatically before decoding.\n\n## Encoding\n\nThe reference Python encoder is in this repo (`mol_url.py`, requires `numpy`):\n\n```python\nfrom mol_url import encode, encode_collection\n\n# Snapshot: positions shape (N, 3)\nurl = encode(positions, atomic_numbers)\n\n# Trajectory: positions shape (F, N, 3). Delta-encoded by default.\nurl = encode(trajectory, atomic_numbers)\n\n# Collection: iterable of (positions, atomic_numbers) pairs.\nurl = encode_collection([(pos1, Zs1), (pos2, Zs2), ...])\n\n# Get just the opaque payload code (for the paste field), no URL:\ncode = encode(positions, atomic_numbers, base_url=\"\")\n```\n\nRun the module directly to self-test and print example URLs:\n\n```bash\npython mol_url.py\n```\n\n## Wire format\n\nBase64url-decode the fragment value to get a byte array. First byte is a prefix: `0x67` (`g`) → rest is gzip-compressed; `0x72` (`r`) → rest is raw. After optional ungzip, read a 10-byte little-endian header:\n\n| offset | type    | name    | notes |\n|--------|---------|---------|-------|\n| 0      | uint8   | version | `1` |\n| 1      | uint8   | flags   | bit 0 = delta-encoded frames; bit 1 = collection mode |\n| 2      | uint16  | N       | global atom count (0 in collection mode) |\n| 4      | uint16  | F       | frame count, or molecule count if collection mode |\n| 6      | float32 | scale   | Ångström scaling factor |\n\nÅngström values are recovered as `xyz_A = int16_value * (scale / 32767)`.\n\n**Snapshot / trajectory body** (after the header):\n- `uint8 × N` atomic numbers (H=1, C=6, N=7, O=8, F=9, Si=14, P=15, S=16, Cl=17, Br=35, I=53)\n- `int16 × F × N × 3` coordinates, frame-major `[f][a][xyz]`\n\nFor delta-encoded trajectories (flag bit 0), frame 0 is absolute int16 and subsequent frames are int16 deltas from the previous frame. Decoders must cumulative-sum in int32 (to avoid int16 wrap) before applying the scale.\n\n**Collection body** (flag bit 1 set; header `N` is 0, `F` is the number of molecules). Starting at offset 10, read `F` blocks back-to-back:\n- `uint16` N_i (atoms in this molecule)\n- `uint8 × N_i` atomic numbers\n- `int16 × N_i × 3` coordinates\n\nThe `flags \u0026 1` delta bit is not valid in collection mode.\n\nThe reference JS decoder (`decodeMolPayload` in `index.html`) handles all of this in ~60 lines.\n\n## Keyboard\n\n| key             | action |\n|-----------------|--------|\n| `Space`         | play/pause trajectory |\n| `←` / `→`       | step frame (trajectory) / molecule (collection, single) / page of 9 (collection, grid) |\n| `G`             | toggle grid view (collection) |\n| `P`             | open paste dialog |\n| `Esc`           | close paste dialog |\n| `⌘/Ctrl+Enter`  | submit paste |\n\n## Credits\n\nRendering by [3Dmol.js](https://3dmol.csb.pitt.edu/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmx-e%2Fquick-mol-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmx-e%2Fquick-mol-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmx-e%2Fquick-mol-viewer/lists"}