LivePanels.Canvas.Layout.Options (livepanels v0.1.0)

Copy Markdown View Source

Normalized option helpers for canvas layout strategies.

Layout strategy modules receive these normalized options when implementing LivePanels.Canvas.Layout.Strategy.

Summary

Types

t()

@type t() :: %{optional(atom()) => term()}

Functions

align_extent_to_grid(value, opts)

@spec align_extent_to_grid(integer(), t() | keyword()) :: integer()

align_to_grid(value, axis, opts)

@spec align_to_grid(integer(), :x | :y, t() | keyword()) :: integer()

axis_origin(atom, opts)

@spec axis_origin(:x | :y, t() | keyword()) :: integer()

first_grid_at_or_after(minimum, axis, opts)

@spec first_grid_at_or_after(integer(), :x | :y, t() | keyword()) :: integer()

get(opts, atom)

@spec get(t() | keyword(), atom()) :: integer()

normalize(opts)

@spec normalize(keyword() | map()) :: map()