Repository navigation
Project Format
A FormChem drawing is a .fchem file: a zip package with MIME type application/x-formchem. The full contract (every field, the style sheet, the ops and transactions, validation and coalescing) is docs/FORMAT.md. This page is the short tour.
| Entry | What it is |
|---|---|
mimetype |
application/x-formchem, the first entry, stored uncompressed |
document.json |
The document: pages, structures, text and their styles, UTF-8 |
media/[id].[ext] |
Pictures placed in the document |
thumbs/page-[n].png |
Optional page previews, 512 px on the longer side |
The engine writes the package to a temporary file in the same folder and renames it into place, so a failed save never leaves half a file. Readers ignore entries they do not know. When the code disagrees with FORMAT.md, the code is the bug, and a format change updates FORMAT.md, the window model (frontend/src/engine/model.ts) and the engine model (backend/app/services/model.py) together.
- Units are points (1/72 inch); x runs right, y runs down; angles are degrees counter-clockwise as the person sees the page.
-
stylenames a preset (journal-1996by default: bond length 14.4 pt, line width 0.6 pt, bold width 2.0 pt, Arimo labels at 10 pt) and any fields set on top of it. New drawings take the preset and the numbers from Preferences > Drawing. -
pagesis a list; each page has a size, margins and anorderof object ids. -
objectsis a map by id. A fragment (kind: "fragment") holdsatomsandbondsmaps; text objects carry runs of styled text. - Ids are short random strings, stable for life and never reused in a document. Agents, extensions and the renderer address everything by id.
The engine's chemistry (canonical SMILES, InChI and InChIKey, formula, masses, elemental analysis, implicit hydrogens, valence errors, warnings) is a derived cache. It is rebuilt when a drawing opens and broadcast after every change, keyed by fragment id and document revision, and never saved. Undo history is kept per open drawing by the engine and is not saved either.
Every change is a transaction: a list of set, ins, del and move ops on JSON paths into document.json, applied all or nothing, with the inverse ops kept for undo. One gesture, one command or one agent call is one transaction and one undo step. See Architecture for how a transaction travels from the window to the engine and back.
Molfile, SDF, RXN, SMILES and CXSMILES, InChI, CML and CDXML files open as new, unsaved drawings laid out at the drawing's bond length. Exporting to them arrives in 0.7.0.
FormChem
- Home
- Manual
- Getting Started
- Drawing
- Grid and Page
- Annotations
- Reactions
- Templates
- Printing and pages
- Keyboard Shortcuts
- Stereo and Queries
- Analysis
- Names
- Spectra and NMR
- 3D
- Databases
- Lab Notebook
- Biopolymers
- Live Structures
- Accessibility
- Formats and Export
- Clipboard
- Command Line
- Agents
- Agent Activity
- Terminal
- Extensions
- Project Format
- Architecture
- Desktop
- Troubleshooting
- Development
- Releasing
Documents