Connector capability helpers.
A connector is a LivePanels.Item with type: "connector". This module
validates connector capability state, builds connector items, and provides
accessors over those items. A connector is a core wire primitive; graph and
drawing extensions consume it without owning it.
Summary
Functions
Returns the connector's routed bend points.
Builds a port-to-port connection connector item.
Returns true when a connector represents a port connection.
Returns true when a connector should render directionally.
Returns the connector emphasis.
Builds a connection endpoint map from an item id and port name.
Returns the connector's source endpoint.
Returns the source item id touched by a connector.
Returns true when a connector touches an item id.
Returns item ids touched by a connector.
Returns the connector label.
Returns the marker style for one connector endpoint.
Builds a connector item or raises when the connector state is invalid.
Returns the port name from a connector anchor.
Returns the connector presentation projection.
Updates a connector's routed bend points.
Returns a connector with presentation fields updated.
Returns a connector with updated endpoint resolution.
Builds an item-to-item relationship connector item.
Returns true when a connector represents an item relationship.
Replaces every connector touching one item id.
Returns the connector role.
Returns connector routing options stored on the item.
Returns the connector semantic.
Returns the connector's target endpoint.
Returns the target item id touched by a connector.
Types
@type anchor() :: :center | {:port, String.t()}
@type emphasis() :: :muted | :normal | :active
@type semantic() :: :connection | :relationship
@type t() :: LivePanels.Item.t()
Functions
@spec bends(LivePanels.Item.t()) :: [bend()]
Returns the connector's routed bend points.
@spec connection(keyword() | map()) :: LivePanels.Item.t()
Builds a port-to-port connection connector item.
@spec connection?(LivePanels.Item.t()) :: boolean()
Returns true when a connector represents a port connection.
@spec directed?(LivePanels.Item.t() | map()) :: boolean()
Returns true when a connector should render directionally.
@spec emphasis(LivePanels.Item.t()) :: emphasis()
Returns the connector emphasis.
@spec endpoint(String.t(), String.t() | atom()) :: connection_endpoint()
Builds a connection endpoint map from an item id and port name.
@spec from(LivePanels.Item.t()) :: endpoint() | nil
Returns the connector's source endpoint.
Returns the source item id touched by a connector.
@spec involves_item?(LivePanels.Item.t(), String.t()) :: boolean()
Returns true when a connector touches an item id.
@spec item_ids(LivePanels.Item.t()) :: [String.t()]
Returns item ids touched by a connector.
@spec label(LivePanels.Item.t()) :: String.t() | nil
Returns the connector label.
@spec marker(LivePanels.Item.t(), :start | :end) :: atom() | String.t() | nil
Returns the marker style for one connector endpoint.
Builds a connector item or raises when the connector state is invalid.
Returns the port name from a connector anchor.
@spec presentation(LivePanels.Item.t()) :: map()
Returns the connector presentation projection.
@spec put_bends(LivePanels.Item.t(), [bend()]) :: {:ok, LivePanels.Item.t()} | :error
Updates a connector's routed bend points.
@spec put_presentation(LivePanels.Item.t(), keyword() | map()) :: {:ok, LivePanels.Item.t()} | :error
Returns a connector with presentation fields updated.
@spec reconnect(LivePanels.Item.t(), map()) :: LivePanels.Item.t()
Returns a connector with updated endpoint resolution.
@spec relationship(String.t(), String.t(), keyword() | map()) :: LivePanels.Item.t()
Builds an item-to-item relationship connector item.
@spec relationship?(LivePanels.Item.t()) :: boolean()
Returns true when a connector represents an item relationship.
@spec replace_item_connectors([LivePanels.Item.t()], String.t(), [LivePanels.Item.t()]) :: [ LivePanels.Item.t() ]
Replaces every connector touching one item id.
@spec role(LivePanels.Item.t()) :: atom() | String.t() | nil
Returns the connector role.
@spec route_options(LivePanels.Item.t() | map()) :: keyword()
Returns connector routing options stored on the item.
@spec semantic(LivePanels.Item.t()) :: semantic() | nil
Returns the connector semantic.
@spec to(LivePanels.Item.t()) :: endpoint() | nil
Returns the connector's target endpoint.
Returns the target item id touched by a connector.