pub struct MoleculeIn {
pub id: Option<String>,
pub atoms: Vec<AtomIn>,
pub bonds: Vec<BondIn>,
pub color: Option<String>,
pub atom_shade: Option<Vec<f64>>,
pub bond_shade: Option<Vec<f64>>,
pub shade_vmin: Option<f64>,
pub shade_vmax: Option<f64>,
pub mark_atoms: Vec<i32>,
pub mark_bonds: Vec<(i32, i32)>,
pub scale: f64,
pub weight: f64,
}Expand description
One molecule ready to paint (coords already in SVG / SCALE space).
MVP extras: optional per-atom / per-bond shade scores and mark indices.
Fields§
§id: Option<String>§atoms: Vec<AtomIn>§bonds: Vec<BondIn>§color: Option<String>Ink color for backbone bonds and atom labels (CSS). Default #111.
atom_shade: Option<Vec<f64>>Per-atom shade scores (same order as Self::atoms); omit if unshaded.
bond_shade: Option<Vec<f64>>Per-bond shade scores (same order as Self::bonds).
shade_vmin: Option<f64>Shade colormap window low (default 0). Not inferred from data.
shade_vmax: Option<f64>Shade colormap window high (default 1). Not inferred from data.
mark_atoms: Vec<i32>Atom indices to circle (publication marks).
mark_bonds: Vec<(i32, i32)>Bond endpoint index pairs to circle/stroke-mark.
scale: f64Uniform diagram scale (font, stroke, pad, geometry). 1.0 = house size.
weight: f64Ink weight for backbone stroke and label glyph thicken. 1.0 = house;
may go down to ~2/3 (Regular stem); typical thicken up to ~2.
Implementations§
Source§impl MoleculeIn
impl MoleculeIn
Sourcepub fn diagram_scale(&self) -> f64
pub fn diagram_scale(&self) -> f64
Effective diagram scale; non-positive values fall back to 1.0.
Sourcepub fn diagram_weight(&self) -> f64
pub fn diagram_weight(&self) -> f64
Absolute ink multiplier for this mol (user weight × house base).
§Panics
Panics if Self::weight is invalid (see crate::metrics::diagram_weight).
Trait Implementations§
Source§impl Clone for MoleculeIn
impl Clone for MoleculeIn
Source§fn clone(&self) -> MoleculeIn
fn clone(&self) -> MoleculeIn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MoleculeIn
impl Debug for MoleculeIn
Source§impl<'de> Deserialize<'de> for MoleculeIn
impl<'de> Deserialize<'de> for MoleculeIn
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MoleculeIn
impl PartialEq for MoleculeIn
Source§fn eq(&self, other: &MoleculeIn) -> bool
fn eq(&self, other: &MoleculeIn) -> bool
self and other values to be equal, and is used by ==.