pub struct Edge {Show 18 fields
pub id: Id,
pub source: Id,
pub target: Id,
pub source_handle: Option<Id>,
pub target_handle: Option<Id>,
pub source_seat: Option<PortSeat>,
pub target_seat: Option<PortSeat>,
pub label: Option<String>,
pub label_position: f64,
pub weight: u8,
pub kind: EdgeKind,
pub animated: bool,
pub selected: bool,
pub selectable: bool,
pub marker_start: MarkerKind,
pub marker_end: MarkerKind,
pub class: Option<String>,
pub style: Option<String>,
}Expand description
An edge connecting two nodes.
Fields§
§id: Id§source: Id§target: Id§source_handle: Option<Id>Optional id of a specific source crate::Handle on the source node.
target_handle: Option<Id>Optional id of a specific target crate::Handle on the target node.
source_seat: Option<PortSeat>Under AnchorMode::Seats: the seat this end is pinned to. None
leaves the end to the solver, which is where every connection starts.
target_seat: Option<PortSeat>See Edge::source_seat.
label: Option<String>§label_position: f64Where the label sits along the edge, as a fraction of the curve (clamped to the drawable range). Seat-anchored edges honour it; the default is the midpoint.
weight: u8Stroke emphasis, 1–3. Seat-anchored arrowheads scale with it, so a
heavier edge carries a proportionate head. Styling the stroke itself
stays in style/CSS.
kind: EdgeKind§animated: boolAnimated edges render a marching-dashes effect.
selected: bool§selectable: bool§marker_start: MarkerKind§marker_end: MarkerKind§class: Option<String>Extra CSS classes for the edge group.
style: Option<String>Extra inline CSS for the visible edge path (e.g. stroke: #f43f5e).
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(source: impl Into<Id>, target: impl Into<Id>) -> Self
pub fn new(source: impl Into<Id>, target: impl Into<Id>) -> Self
Create an edge from source to target with an autogenerated id.
pub fn id(self, id: impl Into<Id>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Sourcepub fn label_position(self, position: f64) -> Self
pub fn label_position(self, position: f64) -> Self
Place the label at position (0..=1) along the curve.
Sourcepub fn weight(self, weight: u8) -> Self
pub fn weight(self, weight: u8) -> Self
Stroke emphasis, 1–3; seat-anchored arrowheads scale with it.
pub fn kind(self, kind: EdgeKind) -> Self
pub fn animated(self, animated: bool) -> Self
pub fn marker_start(self, marker: MarkerKind) -> Self
pub fn marker_end(self, marker: MarkerKind) -> Self
Sourcepub fn source_seat(self, seat: PortSeat) -> Self
pub fn source_seat(self, seat: PortSeat) -> Self
Pin this edge’s source end to a seat (used under AnchorMode::Seats).
Sourcepub fn target_seat(self, seat: PortSeat) -> Self
pub fn target_seat(self, seat: PortSeat) -> Self
Pin this edge’s target end to a seat (used under AnchorMode::Seats).