# `Hakushi.Edge`
[🔗](https://github.com/hattoriai/hakushi/blob/v0.1.0/lib/hakushi/edge.ex#L1)

An edge of a canvas: a line from a handle of one node to a handle of
another.

    %Hakushi.Edge{id: "e1", source: "orders", source_handle: "user_id", target: "users", target_handle: "id"}

  * `id` - a string, unique in the canvas.
  * `source`, `target` - the ids of its nodes.
  * `source_handle`, `target_handle` - the ids of the handles in those
    nodes (`Hakushi.Components.handle/1`); `nil` for the node's first
    handle of that kind, or its side when it has none.
  * `path` - how it is drawn: `"bezier"` (the default), `"smooth"` (steps
    with round corners), `"step"` or `"straight"`.
  * `label` - a text on its middle, or `nil`.
  * `marker` - the end of the line at the target: `"arrow"` (the
    default), `"dot"` or `"none"`.
  * `animated` - a line that flows from the source to the target.
  * `data` - anything of the app's; it stays on the server.

# `id`

```elixir
@type id() :: String.t()
```

# `t`

```elixir
@type t() :: %Hakushi.Edge{
  animated: boolean(),
  data: term(),
  id: id(),
  label: String.t() | nil,
  marker: String.t(),
  path: String.t(),
  source: Hakushi.Node.id(),
  source_handle: String.t() | nil,
  target: Hakushi.Node.id(),
  target_handle: String.t() | nil
}
```

# `default_id`

```elixir
@spec default_id(String.t(), String.t() | nil, String.t(), String.t() | nil) ::
  String.t()
```

The id of an edge made of its ends, as `new/1` gives an edge with none:
the same ends make the same id.

# `new`

```elixir
@spec new(t() | map() | keyword()) :: t()
```

Makes an edge of a map or a keyword list: the struct's keys as atoms or
strings. An edge with no id gets one made of its ends.

# `paths`

```elixir
@spec paths() :: [String.t()]
```

The kinds of `path`.

---

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