svg_attrs_pres {omsvg} | R Documentation |
Define SVG presentation attributes for an element
Description
The svg_attrs_pres()
helper function can be used to more easily generate a
valid presentation attribute list for the attrs
argument that is present
in every SVG element function (e.g., svg_rect()
, svg_text()
, etc.). All
of the presentation attributes formally included here as options can be
animated.
Usage
svg_attrs_pres(
stroke = NULL,
stroke_width = NULL,
stroke_opacity = NULL,
fill = NULL,
fill_opacity = NULL,
font_family = NULL,
font_size = NULL,
font_weight = NULL,
font_style = NULL,
text_decoration = NULL,
transform = NULL,
filter = NULL,
mask = NULL,
clip_path = NULL,
clip_rule = NULL,
stroke_dasharray = NULL,
stroke_dashoffset = NULL,
stroke_linecap = NULL,
stroke_linejoin = NULL,
stroke_miterlimit = NULL,
fill_rule = NULL,
color = NULL,
opacity = NULL,
color_interpolation = NULL,
color_interpolation_filters = NULL,
lighting_color = NULL,
flood_color = NULL,
flood_opacity = NULL,
stop_color = NULL,
stop_opacity = NULL,
font_variant = NULL,
font_stretch = NULL,
font_size_adjust = NULL,
text_anchor = NULL,
letter_spacing = NULL,
word_spacing = NULL,
dominant_baseline = NULL,
alignment_baseline = NULL,
baseline_shift = NULL,
direction = NULL,
writing_mode = NULL,
overflow = NULL,
marker_start = NULL,
marker_mid = NULL,
marker_end = NULL,
pointer_events = NULL,
cursor = NULL,
vector_effect = NULL,
shape_rendering = NULL,
color_rendering = NULL,
text_rendering = NULL,
image_rendering = NULL,
display = NULL,
visibility = NULL
)
Arguments
stroke |
The color used to paint the outline of the shape. |
stroke_width |
The width of the stroke to be applied to the shape. Can
be expressed in |
stroke_opacity |
The opacity of the stroke of a shape. We can use a real
number from |
fill |
The color used to fill the inside of the element. |
fill_opacity |
The opacity of the color or the content the current
object is filled with. We can use a real number from |
font_family |
Which font family will be used to render the text of the element? |
font_size |
The size of the font. |
font_weight |
The weight or boldness of the font. Possible values are
|
font_style |
Whether a font should be styled with a |
text_decoration |
Add decorative lines on text. Options are
|
transform |
A list of transform definitions that are applied to an element and the element's children. |
filter |
The filter effects defined by a |
mask |
The mask defined by a |
clip_path |
The clipping path defined by a |
clip_rule |
A rule for determining what side of a path is inside of a
shape in order to know how |
stroke_dasharray |
The pattern of dashes and gaps used to paint the outline of the shape. |
stroke_dashoffset |
Defines an offset on the rendering of the associated dash array. |
stroke_linecap |
The shape to be used at the end of open subpaths when
they are stroked. We can use the options |
stroke_linejoin |
The shape to be used at the corners of paths when they
are stroked ( |
stroke_miterlimit |
The limit on the ratio of the miter length to the
|
fill_rule |
A rule for determining what side of a path is inside of a
shape. Options are |
color |
Potentially provides an indirect value (as the |
opacity |
Specifies the transparency of an object or a group of objects.
We can use a real number from |
color_interpolation |
The color space for gradient interpolations, color
animations, and alpha compositing. Allowed values are: |
color_interpolation_filters |
The color space for imaging operations
performed via filter effects. Allowed values are: |
lighting_color |
The color of the light source for filter primitives
elements |
flood_color , flood_opacity |
The color and opacity level to use to flood
the current filter primitive subregion defined through the |
stop_color , stop_opacity |
Sets the color and opacity at a gradient stop. |
font_variant |
Determines whether a font should be used with some of their variation such as small caps or ligatures. |
font_stretch |
Allows for a selection of a normal, condensed, or expanded face from a font. |
font_size_adjust |
Specifies that the font size should be chosen based on the height of lowercase letters rather than the height of capital letters. |
text_anchor |
The vertical alignment a string of text. We can use the
values |
letter_spacing , word_spacing |
The spacing between text characters and between words. |
dominant_baseline |
The baseline used to align the box’s text and
inline-level contents. The options for this are: |
alignment_baseline |
Determines how an object is to be aligned along the
font baseline with respect to its parent. Allowed values are: |
baseline_shift |
An option for repositioning of the dominant-baseline
relative to the dominant-baseline of the parent text content element. Valid
options are: |
direction |
The base writing direction of text. Can be either |
writing_mode |
The initial inline-progression-direction for a |
overflow |
The overflow behavior for the content of a block-level
element when it overflows the element's box. Options are: |
marker_start , marker_mid , marker_end |
The arrowhead or polymarker that
will be drawn at the first node, the final node, or, the in-between nodes.
This applies to a |
pointer_events |
Defines whether or when an element may be the target of
a mouse event. Options are: |
cursor |
The mouse cursor displayed when the mouse pointer is over an element. |
vector_effect |
The vector effect to use when drawing an object. Options
are: |
shape_rendering , color_rendering , text_rendering , image_rendering |
A
quality setting parameter for shapes, color interpolation and compositing,
text, and image processing. All of the rendering attributes can use the
|
display |
Allows for control of the rendering of graphical or container
elements. A value of |
visibility |
The visibility attribute lets us control the visibility of
graphical elements. With a value of |
Value
A named list of presentational SVG properties. This object can be
used as a value for the attrs
argument, which is present in every SVG
element function (e.g,. svg_rect()
).