Registers a new S7 generic + method from any ggplot2 geom function,
making it available in the plotit pipeline. The new mark behaves
identically to built-in marks: it supports mapping, data,
position, auto-dodge, and rasterization.
Arguments
- name
Mark name as a string (e.g.
"mark_spoke"). Should start with"mark_".- geom_fun
A ggplot2 geom function (e.g.
ggplot2::geom_spoke).
Stability
Extension surface (contract tier: extensible). The signature is stable as
documented; registration behaviour (how the new mark is exposed to the
pipeline) may be iterated in future releases without a deprecation
cycle. Marks registered via make_mark() that are not listed in
._MARK_CHROME keep axis = "keep" by default (zero behavioural
difference vs. hand-rolled layers).
Examples
make_mark("mark_spoke", ggplot2::geom_spoke)
df <- data.frame(
x = 1:5, y = 1:5,
angle = seq(0, 2 * pi, length.out = 5),
radius = rep(0.3, 5)
)
# Now usable in the pipeline:
df |>
plotit(encode(x = x, y = y, angle = angle, radius = radius)) |>
mark_spoke()