Skip to main content

Module doc

Module doc 

Source
Expand description

Declarative document — plan (pass 1) + paint (pass 2) + scheme compose.

Wire types live in [spec] (opts cascade + DepictSpec collocated). Hosts call plan_edge → process the EdgePlan with RDKit → render_doc with the EdgeResult → compose_scheme for reaction schemes. No RDKit in this module.

Structs§

AlignToSpec
Object form of document align_to (template ref + EdgePlan-style opts).
CommonOpts
Universal cascading keys (any node kind).
DocPaint
One painted molecule from render_doc (pass 2).
EdgeNode
Edge node — a reaction / network link between mol ids.
ForTypesPatch
Multi-kind patch: { "for_types": ["mol","group"], …common opts }.
LabelLanes
Lane bag: { "above": [...], "below": [...], "left": [...], "right": [...] }.
LabelPlacement
Placed label: { "id": "adh", "pos": "below" } (pos optional → above).
LayoutOpts
Layout for DepictSpec::ReactionScheme.
MolNode
Mol node — MolOpts fields + non-cascading identity / scores / align.
MolOpts
Mol cascading paint opts — what a mol leaf consumes from the cascade.
ShadeSpec
Per-atom / per-bond colormap scores (+ legacy window fields on the mol).
ShadeStyle
Cascading shade window / LUT (not per-atom scores).
TextNode
Text node — caption / chrome referenced by mols and edges via id.

Enums§

AlignTo
Document align target: id string or { "ref", "atom_map"?, "min_atoms"? }.
DepictSpec
Declarative document (mol, group, or reaction_scheme root).
EdgeArrow
Arrow head / shaft style for diagram edges.
EdgeNodeKind
Discriminator for edge nodes ("type": "edge").
EdgeRouting
How edge shafts are drawn between nodes.
Label
Unified label: string id, list, placed object, or lane object.
LabelItem
One entry in a label list: bare id or { id, pos? }.
LabelPos
Side of an edge shaft (or mol caption) for a label placement.
LayoutAlgorithm
Placement algorithm for scheme layout.
LayoutDirection
Flow axis for scheme layout.
MolIds
One or more mol ids (reactants / products).
MolNodeKind
Discriminator for mol nodes ("type": "mol").
Node
Document node: mol, edge, or text.
NodeType
Document node kinds opts may target (matches wire "type" discriminants).
Opts
Cascade bag: singleton patch or list of patches.
OptsPatch
One cascade rule. Untagged order: typed → for_types → universal.
TextNodeKind
Discriminator for text nodes ("type": "text").
TypedOptsPatch
Discriminated opts patch: { "type": "mol"|"group"|"reaction_scheme"|"edge"|"text", …opts }.

Functions§

apply_star_labels
Apply star_labels onto * atoms in layout encounter order.
assign_mol_ids
Assign stable unique ids (user id or m_<i>) in document order.
compose_scheme
Compose a DepictSpec::ReactionScheme from per-mol DocPaint rows.
plan_edge
Pass 1: build an EdgePlan for every mol that needs host coord gen.
render_doc
Pass 2: stitch host EdgeResult coords onto the document and paint.
resolve_mol_opts
Apply a chain of opts bags (ancestor → … → leaf) for a mol.
validate_edges
Ensure edge endpoints and label refs resolve to the right node kinds.