Edge change event types for LiveFlow.
Edge changes describe mutations to edges that are sent from the JS hook to the LiveView.
Change Types
:add- Edge was added (connection made):remove- Edge was removed:select- Edge selection changed:replace- Edge was replaced
Examples
# Edge added from connection
%{"type" => "add", "edge" => %{"id" => "e1", "source" => "a", "target" => "b"}}
# Edge selection
%{"type" => "select", "id" => "e1", "selected" => true}
Summary
Functions
Creates an add edge change.
Applies a single change to the state.
Applies a list of changes to the state.
Creates a remove edge change.
Creates a selection change.
Types
@type add_change() :: %{type: :add, edge: map()}
@type remove_change() :: %{type: :remove, id: String.t()}
@type replace_change() :: %{type: :replace, edge: map()}
@type t() :: add_change() | remove_change() | selection_change() | replace_change()
Functions
Creates an add edge change.
@spec apply_change(LiveFlow.State.t(), map()) :: LiveFlow.State.t()
Applies a single change to the state.
@spec apply_changes(LiveFlow.State.t(), [map()]) :: LiveFlow.State.t()
Applies a list of changes to the state.
Creates a remove edge change.
Creates a selection change.