LiveFlow.Paths.Smoothstep (LiveFlow v0.3.2)

Copy Markdown View Source

Smoothstep path calculation for edges.

Creates orthogonal paths with rounded corners. This is a port of getSmoothStepPath from xyflow, including the step_position option and the collinear-point cleanup that keeps every bend rounded.

The JavaScript client mirrors this algorithm in assets/js/live_flow/utils/paths.js so edges keep their shape while nodes are dragged or resized.

Options

  • :border_radius - Corner radius (default: 5)
  • :offset - Distance the path travels out of a handle before turning (default: 20)
  • :step_position - Where the bend happens between source (0.0) and target (1.0) (default: 0.5)
  • :center_x / :center_y - Force the bend through a specific coordinate

Summary

Functions

Calculates a smoothstep path between two points with explicit positions.

Functions

path(source_x, source_y, source_position, target_x, target_y, target_position, opts \\ [])

@spec path(number(), number(), atom(), number(), number(), atom(), keyword()) :: map()

Calculates a smoothstep path between two points with explicit positions.