pub struct LayoutOpts {
pub algorithm: Option<LayoutAlgorithm>,
pub direction: Option<LayoutDirection>,
pub edge_routing: Option<EdgeRouting>,
pub node_spacing: Option<f64>,
pub layer_spacing: Option<f64>,
}Expand description
Layout for DepictSpec::ReactionScheme.
Backend-agnostic knobs — hosts map these onto ELK, Dagre, or another engine.
Defaults when omitted: LayoutDirection::Right, EdgeRouting::Polyline,
LayoutAlgorithm::Layered.
Individual EdgeNodes may override Self::edge_routing.
Spacing (px, document space) controls packing tightness:
Self::node_spacing— gap between nodes in the same layer (default ~20)Self::layer_spacing— gap between reactant/product layers (default ~0)
Fields§
§algorithm: Option<LayoutAlgorithm>Placement algorithm (layered / radial / force / stress).
direction: Option<LayoutDirection>Flow axis (right / left / up / down).
edge_routing: Option<EdgeRouting>Shaft style (polyline / orthogonal / splines).
node_spacing: Option<f64>Within-layer node gap (px). Smaller → tighter pack.
layer_spacing: Option<f64>Between-layer gap along the flow axis (px). Smaller → tighter pack.
Implementations§
Source§impl LayoutOpts
impl LayoutOpts
Sourcepub const DEFAULT_NODE_SPACING: f64 = 20.0
pub const DEFAULT_NODE_SPACING: f64 = 20.0
Default within-layer gap for reaction schemes (px).
Sourcepub const DEFAULT_LAYER_SPACING: f64 = 0.0
pub const DEFAULT_LAYER_SPACING: f64 = 0.0
Default between-layer gap for reaction schemes (px).
pub fn algorithm_or_default(&self) -> LayoutAlgorithm
pub fn direction_or_default(&self) -> LayoutDirection
pub fn edge_routing_or_default(&self) -> EdgeRouting
pub fn node_spacing_or_default(&self) -> f64
pub fn layer_spacing_or_default(&self) -> f64
Trait Implementations§
Source§impl Clone for LayoutOpts
impl Clone for LayoutOpts
Source§fn clone(&self) -> LayoutOpts
fn clone(&self) -> LayoutOpts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutOpts
impl Debug for LayoutOpts
Source§impl Default for LayoutOpts
impl Default for LayoutOpts
Source§fn default() -> LayoutOpts
fn default() -> LayoutOpts
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LayoutOpts
impl<'de> Deserialize<'de> for LayoutOpts
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LayoutOpts
impl PartialEq for LayoutOpts
Source§fn eq(&self, other: &LayoutOpts) -> bool
fn eq(&self, other: &LayoutOpts) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LayoutOpts
impl Serialize for LayoutOpts
impl StructuralPartialEq for LayoutOpts
Auto Trait Implementations§
impl Freeze for LayoutOpts
impl RefUnwindSafe for LayoutOpts
impl Send for LayoutOpts
impl Sync for LayoutOpts
impl Unpin for LayoutOpts
impl UnsafeUnpin for LayoutOpts
impl UnwindSafe for LayoutOpts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more