Viewport command helpers.
Summary
Types
First argument accepted by viewport command helpers.
Functions
Builds a viewport anchor from explicit world-space bounds.
Requests a viewport fit and returns the command result.
Requests a viewport fit for a selection, visible items, bounds, or graph target.
Requests a viewport fit and returns the command result.
Requests a viewport fit around the given item ids.
Builds a viewport anchor that fits the given item ids.
Moves the viewport to a named anchor and returns the command result.
Moves the current participant's viewport to a named anchor.
Broadcasts a named anchor and returns the command result.
Broadcasts a named anchor as the suggested viewport for all participants.
Stores or replaces a named viewport anchor and returns the command result.
Stores or replaces a named viewport anchor through the canvas command path.
Replaces the active viewport sequence and returns the command result.
Replaces the active viewport sequence with the given anchor names.
Removes a named viewport anchor and returns the command result.
Removes a named viewport anchor and prunes it from the active sequence.
Steps to the next anchor and returns the command result.
Steps the current participant to the next anchor in the active sequence.
Steps to the previous anchor and returns the command result.
Steps the current participant to the previous anchor in the active sequence.
Types
@type command_result() :: LivePanels.Canvas.Command.result()
@type socket() :: Phoenix.LiveView.Socket.t()
@type target() :: LivePanels.Canvas.command_target()
First argument accepted by viewport command helpers.
Pass a LiveView socket for a standalone command, or a
LivePanels.Canvas.Transaction context inside LivePanels.Canvas.transaction/2.
Functions
Builds a viewport anchor from explicit world-space bounds.
@spec fit(target(), term()) :: command_result()
Requests a viewport fit and returns the command result.
Requests a viewport fit for a selection, visible items, bounds, or graph target.
@spec fit_items(target(), [String.t()] | MapSet.t()) :: command_result()
Requests a viewport fit and returns the command result.
Requests a viewport fit around the given item ids.
@spec fit_to_items_anchor( map(), String.t() | atom(), [String.t()] | MapSet.t(), keyword() ) :: anchor() | nil
Builds a viewport anchor that fits the given item ids.
@spec goto_anchor(target(), String.t() | atom()) :: command_result()
Moves the viewport to a named anchor and returns the command result.
Moves the current participant's viewport to a named anchor.
@spec present_anchor(target(), String.t() | atom()) :: command_result()
Broadcasts a named anchor and returns the command result.
Broadcasts a named anchor as the suggested viewport for all participants.
@spec put_anchor(target(), anchor()) :: command_result()
Stores or replaces a named viewport anchor and returns the command result.
Stores or replaces a named viewport anchor through the canvas command path.
@spec put_sequence(target(), [String.t() | atom()]) :: command_result()
Replaces the active viewport sequence and returns the command result.
Replaces the active viewport sequence with the given anchor names.
@spec remove_anchor(target(), String.t() | atom()) :: command_result()
Removes a named viewport anchor and returns the command result.
Removes a named viewport anchor and prunes it from the active sequence.
@spec step_next(target()) :: command_result()
Steps to the next anchor and returns the command result.
Steps the current participant to the next anchor in the active sequence.
@spec step_prev(target()) :: command_result()
Steps to the previous anchor and returns the command result.
Steps the current participant to the previous anchor in the active sequence.