text
elementThe svg_text()
function adds text to an svg
object. As with many of the
functions that create shape elements (such as svg_rect()
), the starting
position is defined by x
and y
values. All point positions are in units
of px
.
svg_text(
svg,
x,
y,
text,
fill = NULL,
opacity = NULL,
path = NULL,
attrs = list(),
anims = list(),
filters = list(),
id = NULL
)
The svg
object that is created using the SVG()
function.
The x
and y
positions of the upper left of the text to be
drawn. The x
and y
values are relative to upper left of the SVG drawing
area itself.
A character vector that contains the text to be rendered.
The color of the text.
The opacity of the element. Must be a value in the
range of 0
to 1
.
A single-length character vector that holds the formatted path string.
A presentation attribute list. The helper function
svg_attrs_pres()
can help us easily generate this named list object. For the
most part, the list's names are the presentation attribute names and the
corresponding values are the matching attribute values.
An animation directive list for the element. This should be
structured using the anims()
function.
A filter directive list for the element. This is easily
created by using a list of filter_*()
functions (e.g.,
list(filter_gaussian_blur(2), filter_drop_shadow(2, 2))
).
An optional ID value to give to the built tag. This is useful for modifying this element in a later function call or for interacting with CSS.
An svg
object.