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§
- Align
ToSpec - Object form of document
align_to(template ref + EdgePlan-style opts). - Common
Opts - Universal cascading keys (any node kind).
- DocPaint
- One painted molecule from
render_doc(pass 2). - Edge
Node - Edge node — a reaction / network link between mol ids.
- ForTypes
Patch - Multi-kind patch:
{ "for_types": ["mol","group"], …common opts }. - Label
Lanes - Lane bag:
{ "above": [...], "below": [...], "left": [...], "right": [...] }. - Label
Placement - Placed label:
{ "id": "adh", "pos": "below" }(posoptional → above). - Layout
Opts - Layout for
DepictSpec::ReactionScheme. - MolNode
- Mol node —
MolOptsfields + non-cascading identity / scores / align. - MolOpts
- Mol cascading paint opts — what a mol leaf consumes from the cascade.
- Shade
Spec - Per-atom / per-bond colormap scores (+ legacy window fields on the mol).
- Shade
Style - Cascading shade window / LUT (not per-atom scores).
- Text
Node - Text node — caption / chrome referenced by mols and edges via id.
Enums§
- AlignTo
- Document align target: id string or
{ "ref", "atom_map"?, "min_atoms"? }. - Depict
Spec - Declarative document (
mol,group, orreaction_schemeroot). - Edge
Arrow - Arrow head / shaft style for diagram edges.
- Edge
Node Kind - Discriminator for edge nodes (
"type": "edge"). - Edge
Routing - How edge shafts are drawn between nodes.
- Label
- Unified label: string id, list, placed object, or lane object.
- Label
Item - One entry in a label list: bare id or
{ id, pos? }. - Label
Pos - Side of an edge shaft (or mol caption) for a label placement.
- Layout
Algorithm - Placement algorithm for scheme layout.
- Layout
Direction - Flow axis for scheme layout.
- MolIds
- One or more mol ids (reactants / products).
- MolNode
Kind - Discriminator for mol nodes (
"type": "mol"). - Node
- Document node: mol, edge, or text.
- Node
Type - Document node kinds opts may target (matches wire
"type"discriminants). - Opts
- Cascade bag: singleton patch or list of patches.
- Opts
Patch - One cascade rule. Untagged order: typed → for_types → universal.
- Text
Node Kind - Discriminator for text nodes (
"type": "text"). - Typed
Opts Patch - Discriminated opts patch:
{ "type": "mol"|"group"|"reaction_scheme"|"edge"|"text", …opts }.
Functions§
- apply_
star_ labels - Apply
star_labelsonto*atoms in layout encounter order. - assign_
mol_ ids - Assign stable unique ids (
user idorm_<i>) in document order. - compose_
scheme - Compose a
DepictSpec::ReactionSchemefrom per-molDocPaintrows. - plan_
edge - Pass 1: build an
EdgePlanfor every mol that needs host coord gen. - render_
doc - Pass 2: stitch host
EdgeResultcoords 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.