Skip to main content

Module metrics

Module metrics 

Source
Expand description

Depiction proportions (xenopict / RDKit house style).

Keep in sync with python/xpict/draw/metrics.py.

Constants§

BOND_PX
Bond length in drawing / CSS-px units (alias of SCALE).
CHAIN_END_GAP_FRAC
CHAIN_END_GAP_PX
END_GAP_FRAC
END_GAP_PX
FONT_FRAC
Atom-label em as a fraction of bond length.
FONT_PX
FONT_STEM_EM
Liberation Sans Regular vertical stem width in em.
FONT_STEM_EM_BOLD
Liberation Sans Bold vertical stem width in em (measured on H).
HALO_FRAC
HALO_GAP_PX
Halo outline grow (half the label-gap air) + soft white fill.
HALO_OPACITY
HALO_STROKE
HASH_PER_BOND
LABEL_GAP_FRAC
LABEL_GAP_PX
MARK_FRAC
MARK_HALO_COLOR
xenopict mark halo <use stroke="#555">.
MARK_HALO_OPACITY
MARK_HALO_STROKE_FRAC
xenopict mark halo (<use>): stroke-width: scale * 0.2, opacity 0.45.
MARK_HALO_STROKE_PX
MARK_OPACITY
MARK_STROKE_FRAC
xenopict mark layer: stroke-width: scale * 0.1, opacity 0.7.
MARK_STROKE_PX
OFFSET_FRAC
RDKit multipleBondOffset.
OFFSET_PX
PAD_FRAC
PAD_PX
SCALE
xenopict Xenopict.scale / xenosite depiction "scale": 20.
SCRIPT_SCALE
RDKit DrawText::SUBS_SCALE / SUPER_SCALE for H-counts and charges.
SHADE_FRAC
STAR_FRAC
Dummy / R-group * height as a multiple of Liberation cap-height.
STROKE_FRAC
Bond stroke as a fraction of bond length — tracks the label stem so ink weight matches letter stems when FONT_FRAC changes.
STROKE_PX
WEDGE_HALF_PX
WEDGE_WIDTH_FRAC
Full wedge width at the fat end, as a fraction of bond length.
WEIGHT_AT_ONE
Absolute ink multiplier at user-facing weight = 1 (house look).
WEIGHT_MIN
Lowest user-facing weight (maps to absolute ink 1 = Regular stem).

Functions§

diagram_weight
Map user-facing mol weight → absolute ink multiplier (≥ 1).
halo_gap_for_weight
Outer halo buffer for mol weight: HALO_GAP_PX × √ink.
halo_stroke_for_weight
Halo stroke for mol weight: HALO_STROKE × √ink (sublinear vs ink).
halo_stroke_from_stroke
Halo stroke width tracks active bond ink (2×, same ratio as HALO_FRAC).
hash_count
Dash count scaling with drawn bond length (hashed wedges).
label_weight_grow_px
Outward glyph buffer (px) so absolute ink stems grow past Regular.
label_weight_standoff_px
Extra bond↔label standoff (px) when absolute ink exceeds Regular.
stroke_frac_from_stem
Bond stroke fraction from a stem width in em (rounded like STROKE_FRAC).
stroke_px_for_weight
Bond stroke in drawing px for user-facing mol weight.
stroke_px_from_stem
Bond stroke in drawing px keyed to a label stem.