svg_ellipse {omsvg} | R Documentation |
Addition of an ellipse
element
Description
The svg_ellipse()
function adds an ellipse to an svg
object. The position
of the ellipse is given by x
and y
, and they refer to the center point of
the point of the ellipse. The width
and the height
, both in units of
px
, provide the horizontal and vertical extents of the ellipse.
Usage
svg_ellipse(
svg,
x,
y,
width,
height,
stroke = NULL,
stroke_width = NULL,
fill = NULL,
opacity = NULL,
attrs = list(),
anims = list(),
filters = list(),
id = NULL
)
Arguments
svg |
The |
x , y |
The |
width , height |
The |
stroke |
The color of the stroke applied to the element (i.e., the outline). |
stroke_width |
The width of the stroke in units of pixels. |
fill |
The fill color of the element. |
opacity |
The opacity of the element. Must be a value in the
range of |
attrs |
A presentation attribute list. The helper function
|
anims |
An animation directive list for the element. This should be
structured using the |
filters |
A filter directive list for the element. This is easily
created by using a list of |
id |
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. |
Value
An svg
object.
Examples
if (interactive()) {
# Create an SVG with a single
# ellipse element
svg <-
SVG(width = 60, height = 60) %>%
svg_ellipse(
x = 30, y = 30,
width = 50, height = 30,
fill = "purple"
)
}