Edge geometry: handle coordinates (fixed or floating) and the path of an
edge between two nodes. Shared by LiveFlow.Components.Edge and
LiveFlow.Export.
Nodes must carry absolute positions (see LiveFlow.State.absolute_nodes/1).
Summary
Functions
Built-in types are their own path type; custom types default to bezier.
Computes the path of an edge. Returns %{path, label_x, label_y, source, target}
where source/target are %{x, y, position}, or nil without nodes.
Nearest point on the node border facing the other node's center.
Coordinates and side of an edge endpoint on node.
Center of a side of the node box.
Point on a side of the node box; offset goes from 0.0 (top/left) to
1.0 (bottom/right), nil meaning the center.
Functions
Built-in types are their own path type; custom types default to bezier.
@spec edge_path(LiveFlow.Edge.t(), LiveFlow.Node.t() | nil, LiveFlow.Node.t() | nil) :: map() | nil
Computes the path of an edge. Returns %{path, label_x, label_y, source, target}
where source/target are %{x, y, position}, or nil without nodes.
Nearest point on the node border facing the other node's center.
@spec handle_point( LiveFlow.Node.t(), LiveFlow.Node.t(), String.t() | nil, :source | :target, boolean() ) :: {%{x: number(), y: number()}, atom()}
Coordinates and side of an edge endpoint on node.
Center of a side of the node box.
Point on a side of the node box; offset goes from 0.0 (top/left) to
1.0 (bottom/right), nil meaning the center.