# `Ascii.Diagram.Layout`
[🔗](https://github.com/houllette/ascii_art/blob/main/lib/ascii/diagram/layout.ex#L1)

Compiled cell geometry for a diagram, reusable for drawing and hit testing.

Node, boundary, fragment, note and activation bounds use zero-based
`x`, `y`, `width`, `height`.
Edges retain their ordered orthogonal `points` and stable IDs. Bounds and
routes are independent of theme and character set. `frame/2` does no parsing
or layout work.

# `t`

```elixir
@type t() :: %Ascii.Diagram.Layout{
  activations: map(),
  boundaries: map(),
  cols: pos_integer(),
  commands: [tuple()],
  description: String.t(),
  edges: [map()],
  fragments: map(),
  nodes: map(),
  notes: map(),
  rows: pos_integer()
}
```

# `frame`

```elixir
@spec frame(layout :: t(), opts :: keyword()) ::
  {:ok, Ascii.Frame.t()} | Ascii.Diagram.error()
```

Draws retained geometry. `charset: :ascii | :unicode`, `theme:` maps visual roles to inks.

# `hit_at`

```elixir
@spec hit_at(layout :: t(), x :: integer(), y :: integer()) ::
  {atom(), String.t()} | nil
```

The node, note, activation, edge, fragment or boundary at a cell, as `{kind, id}`, or `nil`.

---

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