Expand description
Drawable scene document — engine-neutral primitives shared by Python & JS.
MVP: one molecule → one Viewport inside a Scene. Marks (atom/bond
circles) and shade disks are layers on that viewport. Multi-mol diagrams /
ELK are out of scope for the first shared paint path.
- Language edge supplies coords + chem metadata (RDKit/Indigo/native layout + align stay outside this crate).
- Rust builds a
Sceneof typed primitives (paths, circles, …). - Thin Python / JS serializers emit SVG / data-URI
<img>.
Do not invent new depiction rules here — port proven Python behavior.
Structs§
- AtomIn
- Atom input for a molecule depict call (SVG-space coords from the caller).
- BondIn
- Bond input (indices into
AtomIn::index). - Layer
- Molecule
In - One molecule ready to paint (coords already in SVG /
SCALEspace). - Scene
- Full drawable document before SVG/HTML serialization.
- Viewport
- One molecule viewport in a diagram (after ELK/grid placement).
Enums§
- Layer
Name - Layer name inside a molecule viewport.
- Primitive
- One drawable primitive in SVG space (+Y down).
- Text
Anchor - Horizontal text anchor (SVG
text-anchor).
Functions§
- scale_
path_ d - Multiply every numeric token in an SVG path
d(M/L/Z polygons).