# `LivePanels.Canvas.Read`
[🔗](https://github.com/livepanels/livepanels/blob/v0.1.0/lib/livepanels/canvas/read.ex#L1)

Read-side accessors for application code that needs the current canvas projection.

Prefer the narrow query that answers the question directly. Use `state/1`
when passing the canonical state into lower-level helpers such as graph
bounds, graph navigation, drawing queries, or custom projections.

# `socket`

```elixir
@type socket() :: Phoenix.LiveView.Socket.t()
```

# `actor`

```elixir
@spec actor(socket()) :: LivePanels.Canvas.actor()
```

Returns the current actor identity map.

# `clipboard`

```elixir
@spec clipboard(socket()) :: LivePanels.Canvas.Clipboard.t() | nil
```

Returns the current actor's `%Clipboard{}` or `nil` when empty.

# `command_trace`

```elixir
@spec command_trace(socket()) :: [map()]
```

Returns the recent browser command envelopes received by the runtime, reduced
to display-oriented field deltas.

# `content_status`

```elixir
@spec content_status(socket(), String.t()) :: map() | nil
```

Returns the content availability status for one item, or `nil` when none is recorded.

# `content_statuses`

```elixir
@spec content_statuses(socket()) :: map()
```

Returns item content availability statuses keyed by item id.

# `history`

```elixir
@spec history(socket()) :: LivePanels.Canvas.History.t()
```

Returns the current actor's history projection for layout mutations.

# `item`

```elixir
@spec item(socket(), String.t()) :: LivePanels.Item.t() | nil
```

Returns one item by id, or `nil` if it does not exist on the canvas.

# `items`

```elixir
@spec items(socket()) :: [LivePanels.Item.t()]
```

Returns all canvas items as a list.

# `last_command`

```elixir
@spec last_command(socket()) :: map() | nil
```

Returns metadata for the most recent runtime command handled by this socket.

Rejected commands include `:reason` and `:message` entries even when the
canvas model itself was not changed.

# `participants`

```elixir
@spec participants(socket()) :: [map()]
```

Returns the participants currently joined to the canvas.

# `selection`

```elixir
@spec selection(socket()) :: LivePanels.Canvas.Selection.t()
```

Returns the current actor's `%Selection{}`.

# `selection_for`

```elixir
@spec selection_for(socket(), String.t()) :: LivePanels.Canvas.Selection.t()
```

Returns the `%Selection{}` for the given `client_id`.

# `state`

```elixir
@spec state(socket()) :: LivePanels.Canvas.State.t()
```

Returns the canonical canvas `State` struct.

# `viewport`

```elixir
@spec viewport(socket()) :: map() | nil
```

Returns the current actor's viewport, or `nil` if not yet reported.

# `viewport_anchors`

```elixir
@spec viewport_anchors(socket()) :: map()
```

Returns viewport anchors keyed by anchor name.

# `viewport_profile`

```elixir
@spec viewport_profile(socket()) :: String.t()
```

Returns the current actor's viewport profile name.

# `viewport_sequence`

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

Returns the active viewport sequence as anchor names.

# `z_order`

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

Returns the canvas z-order from front to back.

---

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