Skip to main content

xpict_core/
lib.rs

1//! Shared depiction core for **xpict**.
2//!
3//! Python under `python/xpict/` is still the working engine. This crate holds
4//! algorithms we are ready to share with PyO3 and WASM — start small, move
5//! modules as they stabilize. See the crate `README.md` for the migration
6//! rule.
7
8#![forbid(unsafe_code)]
9
10pub mod align;
11pub mod arrows;
12pub mod bonds;
13pub mod colormap;
14pub mod cxsmiles;
15pub mod depict;
16pub mod doc;
17pub mod edge;
18pub mod elements;
19#[cfg(feature = "elk")]
20pub mod elk;
21pub mod font;
22pub mod geom;
23#[cfg(feature = "font")]
24pub mod labels;
25#[cfg(feature = "font")]
26pub mod markup;
27pub mod metrics;
28pub mod plotdot;
29pub mod rings;
30pub mod scene;
31
32pub use align::{kabsch_2d, rigid_align_coords, RigidTransform};
33pub use arrows::{
34    axis_aligned, clip_box_edge, edge_anchors, edge_primitives as arrow_edge_primitives,
35    filleted_path_d, shaft_path_d, should_fillet, simplify_route, EdgePaintIn, EdgePrim,
36    ANCHOR_GAP, KINK_PX, TURN_RADIUS,
37};
38pub use bonds::{
39    bond_paths, bond_strokes, centered_displacements, depict_order, join_centered_multibonds,
40    line_intersect, multi_bond_offset, BondStrokes, DrawnBond, StrokePath,
41};
42pub use colormap::{colormap_rgb, sample_colormap, XENOSITE};
43pub use cxsmiles::{apply_cx_by_index, cx_atom_labels, cx_source, smiles_base};
44pub use depict::depict_molecule;
45pub use doc::{
46    apply_star_labels, assign_mol_ids, compose_scheme, plan_edge, render_doc,
47    resolve_mol_opts, validate_edges, AlignTo, AlignToSpec, CommonOpts, DepictSpec, DocPaint,
48    EdgeArrow, EdgeNode, EdgeNodeKind, EdgeRouting, ForTypesPatch, Label, LabelItem, LabelLanes,
49    LabelPlacement, LabelPos, LayoutAlgorithm, LayoutDirection, LayoutOpts, MolIds, MolNode,
50    MolNodeKind, MolOpts,
51    Node, NodeType, Opts, OptsPatch, ShadeSpec, ShadeStyle, TextNode, TextNodeKind, TypedOptsPatch,
52};
53pub use edge::{
54    AlignOpts, CoordGenMoleculeResult, CoordMethod, EdgePlan, EdgeResult, EdgeTask,
55    EdgeTaskResult, MolTemplate, MIN_MCS_ATOMS as EDGE_MIN_MCS_ATOMS,
56};
57pub use elements::{atomic_number, element_symbol, SYMBOLS};
58#[cfg(feature = "elk")]
59pub use elk::{
60    layout_json as elk_layout_json, scheme_layout_options, DiagramKind as ElkDiagramKind,
61};
62pub use geom::{capsule_halo_path_d, disk_halo_path_d, polygon_to_svg_d};
63#[cfg(feature = "font")]
64pub use labels::{
65    compose_label, label_side, place_backbone, place_label, shorten_bond, split_label, AtomIn,
66    BondIn, BondOut, LabelParts, LabelSide, PlacedLabel,
67};
68#[cfg(feature = "font")]
69pub use markup::parse_label_markup;
70pub use metrics::{BOND_PX, OFFSET_FRAC, OFFSET_PX, SCALE, SHADE_FRAC, STROKE_PX};
71pub use plotdot::{PlotDot, ShadeDisk};
72pub use rings::{apply_ring_interiors, bond_interior_normals, find_sssr, Ring};
73pub use scene::{Layer, LayerName, MoleculeIn, Primitive, Scene, TextAnchor, Viewport};
74// MoleculeIn atoms/bonds are scene::AtomIn / scene::BondIn (JSON ABI).
75// labels::AtomIn / BondIn remain the place_backbone wire types.