Skip to contents

The un-roughened path a callout / annotation leader takes from its start (sx, sy) (a box edge) to the target (xe, ye): a "straight" line, an "elbow" (horizontal then vertical, flowchart style) or a "curved" quadratic-Bezier bow. Also reports the end tangent so the arrowhead can orient to it. Pure geometry; the grob roughens the result.

Usage

leader_path(sx, sy, xe, ye, style = "straight", curvature = 0.3)

Arguments

sx, sy

Leader start (inch space).

xe, ye

Target point (inch space).

style

One of "straight", "elbow", "curved".

curvature

Bow size for "curved" (signed). Default 0.3.

Value

A list with x, y (the path vertices) and angle (end tangent, in radians).

Examples

leader_path(0, 0, 1, 1, style = "elbow")
#> $x
#> [1] 0 1 1
#> 
#> $y
#> [1] 0 0 1
#> 
#> $angle
#> [1] 1.570796
#>