The rules of the edges of a canvas, the same in the browser and on the server.
<.canvas id="flow" graph={@graph} rules={[cycles: false]}>While a person draws an edge, the browser shows the handles it may end on, and no others; when the edge comes to the server, the canvas checks the same rules again, so that a browser that does not follow them still makes no edge they forbid.
loops- an edge from a node to itself (falseunless set).duplicates- a second edge between the same two handles, in the same direction (falseunless set).cycles- an edge that closes a cycle, as a workflow must not have (trueunless set).
A handle of one type connects to a handle that accepts it (see
Hakushi.Components.handle/1). That rule is the browser's: the server
does not know the handles, which are in the HEEx of each node. Check
what an edge means for your app in on_change (see Hakushi.Change).
Summary
Functions
Checks an edge against the rules, in a graph that does not have it yet.
Makes rules of a keyword list, or gives rules back.
Types
Functions
@spec check(t(), Hakushi.Graph.t(), Hakushi.Edge.t()) :: :ok | {:error, reason()}
Checks an edge against the rules, in a graph that does not have it yet.
Makes rules of a keyword list, or gives rules back.