Skip to main content

Module arrow

Module arrow 

Source
Expand description

Arrowheads for segment/curve/path/line, modelled on R grid’s arrow().

Arrow only describes where and how a head should be drawn; the geometry is computed in pixel space from an already-projected polyline by [heads], and drawn by [draw_heads]. Geoms call these two functions — see geom::segment/geom::curve/geom::path/geom::line (B1-3).

Structs§

Arrow
Describes an arrowhead to draw at the end(s) of a line-like geom, following R grid’s arrow(). position and length_per_linewidth are ggplot-rs extensions, not part of grid’s API.

Enums§

ArrowEnds
Which end(s) of a path get an arrowhead.
ArrowType
Arrowhead shape.

Functions§

arrow
Build an Arrow with the default settings (open, 30° half-angle, 18px wings, a head at the end): arrow(), or arrow().closed().angle(20.0) for a filled, narrower head.
rect_edge_point
Where a straight line from a rectangle’s center toward toward leaves the rectangle — i.e. the point on the rect’s boundary a segment/curve endpoint should sit at so an arrow() drawn on it lands on the box’s edge instead of overlapping into the box (too short) or stopping short in open space (too far).