d_fslash() is a wrapper around MZ() to create
a forward slash path convenience wrapper.
d_bslash() is a wrapper around MZ() to create
a backward slash path convenience wrapper.
They are vectorized in their y_top, x_right, y_bottom, x_left,
and w arguments.
Usage
d_fslash(
y_top,
x_right,
y_bottom,
x_left,
w,
...,
origin_at_bottom = getOption("dee.origin_at_bottom", FALSE),
height = getOption("dee.height", NULL),
nib = c("horizontal", "diagonal", "square", "vertical"),
left = nib,
right = nib
)
d_bslash(
y_top,
x_right,
y_bottom,
x_left,
w,
...,
origin_at_bottom = getOption("dee.origin_at_bottom", FALSE),
height = getOption("dee.height", NULL),
nib = c("horizontal", "diagonal", "square", "vertical"),
left = nib,
right = nib
)Arguments
- y_top, x_right, y_bottom, x_left
The most extreme x and y values of the slash shape.
- w
The (stroke) width of the slash "line".
- ...
Passed to
MZ().- origin_at_bottom, height
If
origin_at_bottomisTRUEtheny(and anyy1andy2) coordinates is transformed byheight - yfor absolute coordinates and-yfor relative coordinates.- nib, left, right
The shape of the "nib" tracing the line. This only affects the left and right ends.
Value
A dee() object.
See also
width_slash_left(), width_slash_right(), height_slash_left(), height_slash_right()
d_arc1(), d_arc2(), d_arc3(), and d_arc4() for curved (quarter-elliptical arc) lines.
Examples
d_h <- d_fslash(2, 8, 8, 2, 1)
if (requireNamespace("omsvg", quietly = TRUE) &&
requireNamespace("nanosvgr", quietly = TRUE)) {
plot(d_h, height = 10, width = 10,
fill = "red", stroke = "black", stroke_width = 4)
}
d_s <- d_bslash(2, 8, 8, 2, 1, nib = "square")
if (requireNamespace("omsvg", quietly = TRUE) &&
requireNamespace("nanosvgr", quietly = TRUE)) {
plot(d_s, height = 10, width = 10,
fill = "red", stroke = "black", stroke_width = 4)
}
d_v <- d_fslash(2, 8, 8, 2, 1, nib = "vertical")
if (requireNamespace("omsvg", quietly = TRUE) &&
requireNamespace("nanosvgr", quietly = TRUE)) {
plot(d_v, height = 10, width = 10,
fill = "red", stroke = "black", stroke_width = 4)
}
d_d <- d_bslash(2, 8, 8, 2, 1, nib = "diagonal")
if (requireNamespace("omsvg", quietly = TRUE) &&
requireNamespace("nanosvgr", quietly = TRUE)) {
plot(d_d, height = 10, width = 10,
fill = "red", stroke = "black", stroke_width = 4)
}