LiveFlow.Components.Handle (LiveFlow v0.2.3)

Copy Markdown View Source

Handle function component for LiveFlow.

Handles are connection points on nodes that allow edges to be created. They render as small circles positioned on the edges of nodes.

Summary

Functions

Renders a handle on a node.

Renders a source handle (output).

Renders a target handle (input).

Functions

handle(assigns)

Renders a handle on a node.

Attributes

  • :handle - The LiveFlow.Handle struct (required)
  • :node_id - ID of the parent node (required)
  • :class - Additional CSS classes

Examples

<.handle handle={handle} node_id="node-1" />

Attributes

  • handle (LiveFlow.Handle) (required)
  • node_id (:string) (required)
  • class (:string) - Defaults to nil.

source(assigns)

Renders a source handle (output).

Attributes

  • id (:string) - Defaults to nil.
  • position (:atom) - Defaults to :right.
  • node_id (:string) (required)
  • connectable (:boolean) - Defaults to true.
  • class (:string) - Defaults to nil.

target(assigns)

Renders a target handle (input).

Attributes

  • id (:string) - Defaults to nil.
  • position (:atom) - Defaults to :left.
  • node_id (:string) (required)
  • connectable (:boolean) - Defaults to true.
  • class (:string) - Defaults to nil.