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

Canvas-domain spatial geometry utilities for LivePanels.

Provides dimension constants, coercion helpers, and normalization functions
used throughout the runtime. Applications can reference the constants
when building custom add controls or validating item-frame dimensions before
calling `LivePanels.Canvas.Item.add/3`.

## Constants

The boundary values exposed here are the same ones the JS runtime enforces
client-side. Keeping them in sync via these functions avoids hardcoded magic
numbers in application code:

    iex> LivePanels.Canvas.Geometry.min_item_frame_width()
    360
## Coercion

Runtime boundary modules use the coercion helpers here when processing JS
events, which send geometry values as strings.

# `canvas_min_height`

```elixir
@spec canvas_min_height() :: pos_integer()
```

Returns the baseline canvas height used before viewport measurement.

# `canvas_min_width`

```elixir
@spec canvas_min_width() :: pos_integer()
```

Returns the baseline canvas width used before viewport measurement.

# `default_ad_hoc_item_height`

```elixir
@spec default_ad_hoc_item_height() :: pos_integer()
```

Returns the default height for ad-hoc item frames.

# `default_ad_hoc_item_width`

```elixir
@spec default_ad_hoc_item_width() :: pos_integer()
```

Returns the default width for ad-hoc item frames.

# `default_item_frame_height`

```elixir
@spec default_item_frame_height() :: pos_integer()
```

Returns the default height for content-backed item frames.

# `default_item_frame_width`

```elixir
@spec default_item_frame_width() :: pos_integer()
```

Returns the default width for content-backed item frames.

# `edge_threshold`

```elixir
@spec edge_threshold() :: pos_integer()
```

Returns the edge threshold used by connector and autoscroll interactions.

# `interaction_sync_ms`

```elixir
@spec interaction_sync_ms(:local | :shared | term()) :: pos_integer()
```

Returns the browser-to-server interaction throttle in milliseconds.

The bundled JS runtime uses this value to coalesce drag and resize updates
before they hit the server. Shared canvases use a lower default network
cadence while the browser continues moving the active item locally at
pointer-event speed. Shared canvases may also apply
`:interaction_broadcast_sync_ms` for server-to-participant fanout.

# `max_autopan_step`

```elixir
@spec max_autopan_step() :: pos_integer()
```

Returns the maximum autopan step per interaction tick.

# `max_frame_height`

```elixir
@spec max_frame_height(LivePanels.Item.t() | map()) :: pos_integer()
```

Returns the effective max frame height for an item.

Mirrors `max_frame_width/1` against the `:max_h` resize constraint and
`max_item_frame_height/0` global cap.

# `max_frame_width`

```elixir
@spec max_frame_width(LivePanels.Item.t() | map()) :: pos_integer()
```

Returns the effective max frame width for an item.

An item without `:resize` capability is pinned at its current width.
A resizable item with a `:max_w` constraint clamps to that constraint; with
no constraint, the global `max_item_frame_width/0` cap applies.

# `max_item_frame_height`

```elixir
@spec max_item_frame_height() :: pos_integer()
```

Returns the upper bound for item frame height.

# `max_item_frame_width`

```elixir
@spec max_item_frame_width() :: pos_integer()
```

Returns the upper bound for item frame width.

# `min_frame_height`

```elixir
@spec min_frame_height(LivePanels.Item.t() | map()) :: pos_integer()
```

Returns the effective min frame height for an item.

Mirrors `min_frame_width/1` against the `:min_h` resize constraint and the
global `min_item_frame_height/0` fallback.

# `min_frame_width`

```elixir
@spec min_frame_width(LivePanels.Item.t() | map()) :: pos_integer()
```

Returns the effective min frame width for an item.

A resizable item with a `:min_w` constraint clamps to that item-specific
constraint. With no item constraint, the global `min_item_frame_width/0`
fallback applies.

# `min_item_frame_height`

```elixir
@spec min_item_frame_height() :: pos_integer()
```

Returns the lower bound for item frame height.

# `min_item_frame_width`

```elixir
@spec min_item_frame_width() :: pos_integer()
```

Returns the lower bound for item frame width.

# `nudge_debounce_ms`

```elixir
@spec nudge_debounce_ms() :: pos_integer()
```

Returns the debounce window for keyboard nudging in milliseconds.

# `snap_grid`

```elixir
@spec snap_grid() :: pos_integer()
```

Returns the grid interval used by canvas nudging and snapping.

# `viewport_snap_threshold`

```elixir
@spec viewport_snap_threshold() :: pos_integer()
```

Returns the viewport anchoring snap threshold.

---

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