Description Usage Arguments Value Examples
With the filter_drop_shadow()
drop shadow appears beneath the input image
or shape and its offset is controlled by dx
and dy
. The blurring of the
drop shadow is set by the stdev
value.
1 | filter_drop_shadow(dx = 0.2, dy = 0.2, stdev = 1, color = "black", opacity = 1)
|
dx, dy |
The offset of the drop shadow compared to the position of the input image or shape. |
stdev |
The number of standard deviations for the blur effect. |
color |
The color of the drop shadow. |
opacity |
The opacity of the drop shadow. We can use a real number from
|
An svg
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | if (interactive()) {
# Apply a drop shadow filter on a
# text element (orange in color,
# and semi-opaque)
SVG(width = 250, height = 100) %>%
svg_filter(
id = "shadow",
filters = list(
filter_drop_shadow(
dx = 1, dy = 2,
color = "orange",
opacity = 0.5
)
)
) %>%
svg_text(
x = 10, y = 40,
text = "Shadowed",
attrs = svg_attrs_pres(
font_size = "2em",
fill = "#555555",
font_weight = "bolder",
filter = "shadow"
)
)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.