Skip to main content

Module scene

Module scene 

Source
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.

  1. Language edge supplies coords + chem metadata (RDKit/Indigo/native layout + align stay outside this crate).
  2. Rust builds a Scene of typed primitives (paths, circles, …).
  3. 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
MoleculeIn
One molecule ready to paint (coords already in SVG / SCALE space).
Scene
Full drawable document before SVG/HTML serialization.
Viewport
One molecule viewport in a diagram (after ELK/grid placement).

Enums§

LayerName
Layer name inside a molecule viewport.
Primitive
One drawable primitive in SVG space (+Y down).
TextAnchor
Horizontal text anchor (SVG text-anchor).

Functions§

scale_path_d
Multiply every numeric token in an SVG path d (M/L/Z polygons).