# `LivePanels.Item.Connector`
[🔗](https://github.com/livepanels/livepanels/blob/v0.1.0/lib/livepanels/item/connector.ex#L1)

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.

# `anchor`

```elixir
@type anchor() :: :center | {:port, String.t()}
```

# `bend`

```elixir
@type bend() :: %{x: number(), y: number()}
```

# `connection_endpoint`

```elixir
@type connection_endpoint() :: %{item_id: String.t(), port: String.t()}
```

# `emphasis`

```elixir
@type emphasis() :: :muted | :normal | :active
```

# `endpoint`

```elixir
@type endpoint() :: %{item_id: String.t(), anchor: anchor()}
```

# `semantic`

```elixir
@type semantic() :: :connection | :relationship
```

# `t`

```elixir
@type t() :: LivePanels.Item.t()
```

# `bends`

```elixir
@spec bends(LivePanels.Item.t()) :: [bend()]
```

Returns the connector's routed bend points.

# `connection`

```elixir
@spec connection(keyword() | map()) :: LivePanels.Item.t()
```

Builds a port-to-port connection connector item.

# `connection?`

```elixir
@spec connection?(LivePanels.Item.t()) :: boolean()
```

Returns true when a connector represents a port connection.

# `directed?`

```elixir
@spec directed?(LivePanels.Item.t() | map()) :: boolean()
```

Returns true when a connector should render directionally.

# `emphasis`

```elixir
@spec emphasis(LivePanels.Item.t()) :: emphasis()
```

Returns the connector emphasis.

# `endpoint`

```elixir
@spec endpoint(String.t(), String.t() | atom()) :: connection_endpoint()
```

Builds a connection endpoint map from an item id and port name.

# `from`

```elixir
@spec from(LivePanels.Item.t()) :: endpoint() | nil
```

Returns the connector's source endpoint.

# `from_item_id`

```elixir
@spec from_item_id(term()) :: String.t() | nil
```

Returns the source item id touched by a connector.

# `involves_item?`

```elixir
@spec involves_item?(LivePanels.Item.t(), String.t()) :: boolean()
```

Returns true when a connector touches an item id.

# `item_ids`

```elixir
@spec item_ids(LivePanels.Item.t()) :: [String.t()]
```

Returns item ids touched by a connector.

# `label`

```elixir
@spec label(LivePanels.Item.t()) :: String.t() | nil
```

Returns the connector label.

# `marker`

```elixir
@spec marker(LivePanels.Item.t(), :start | :end) :: atom() | String.t() | nil
```

Returns the marker style for one connector endpoint.

# `new`

```elixir
@spec new(semantic(), endpoint(), endpoint(), keyword() | map()) ::
  LivePanels.Item.t()
```

Builds a connector item or raises when the connector state is invalid.

# `port_name`

```elixir
@spec port_name(anchor()) :: String.t() | nil
```

Returns the port name from a connector anchor.

# `presentation`

```elixir
@spec presentation(LivePanels.Item.t()) :: map()
```

Returns the connector presentation projection.

# `put_bends`

```elixir
@spec put_bends(LivePanels.Item.t(), [bend()]) :: {:ok, LivePanels.Item.t()} | :error
```

Updates a connector's routed bend points.

# `put_presentation`

```elixir
@spec put_presentation(LivePanels.Item.t(), keyword() | map()) ::
  {:ok, LivePanels.Item.t()} | :error
```

Returns a connector with presentation fields updated.

# `reconnect`

```elixir
@spec reconnect(LivePanels.Item.t(), map()) :: LivePanels.Item.t()
```

Returns a connector with updated endpoint resolution.

# `relationship`

```elixir
@spec relationship(String.t(), String.t(), keyword() | map()) :: LivePanels.Item.t()
```

Builds an item-to-item relationship connector item.

# `relationship?`

```elixir
@spec relationship?(LivePanels.Item.t()) :: boolean()
```

Returns true when a connector represents an item relationship.

# `replace_item_connectors`

```elixir
@spec replace_item_connectors([LivePanels.Item.t()], String.t(), [LivePanels.Item.t()]) ::
  [
    LivePanels.Item.t()
  ]
```

Replaces every connector touching one item id.

# `role`

```elixir
@spec role(LivePanels.Item.t()) :: atom() | String.t() | nil
```

Returns the connector role.

# `route_options`

```elixir
@spec route_options(LivePanels.Item.t() | map()) :: keyword()
```

Returns connector routing options stored on the item.

# `semantic`

```elixir
@spec semantic(LivePanels.Item.t()) :: semantic() | nil
```

Returns the connector semantic.

# `to`

```elixir
@spec to(LivePanels.Item.t()) :: endpoint() | nil
```

Returns the connector's target endpoint.

# `to_item_id`

```elixir
@spec to_item_id(term()) :: String.t() | nil
```

Returns the target item id touched by a connector.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
