Learn R Programming

ggsketch (version 2.0.0)

leader_path: Route a leader line from a box edge to a target

Description

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)

Value

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

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.

See Also

Other sketch-core: arrowhead(), curve_fill(), engrave_fill(), engrave_ladder(), hachure_fill(), hachure_fill_multi(), repel_layout(), rough_arc(), rough_bezier(), rough_ellipse(), roughen_polyline(), sketch_arrowheads(), sketch_fill(), sketch_fill_multi(), spray_scatter(), stroke_profile(), stroke_ribbon(), treemap_layout(), wash_bleed(), watercolor_wash(), watercolor_wash_multi()

Examples

Run this code
leader_path(0, 0, 1, 1, style = "elbow")

Run the code above in your browser using DataLab