filter_dilate {omsvg}R Documentation

Filter: add a dilation effect to an element

Description

The filter_dilate() filter applies a dilation effect to a source graphic by a given radius value. The higher the radius, the greater the dilation potential.

Usage

filter_dilate(radius = 1)

Arguments

radius

The extent to which the source graphic will be dilated. If a vector of two values are provided, the first value represents the x-radius and the second one the y-radius. If one value is provided, then that value is used for both x and y.

Value

An svg object.

Examples

if (interactive()) {

# Add a text element to an
# SVG drawing and erode it with
# the `filter_dilate()` filter
SVG(width = 200, height = 100) %>%
  svg_filter(
    id = "dilate",
    filters = list(
      filter_dilate(radius = c(0, 1))
    )
  ) %>%
  svg_text(
    x = 10, y = 40,
    text = "Dilation",
    attrs = svg_attrs_pres(
      font_size = "3em",
      filter = "dilate"
    )
  )
}


[Package omsvg version 0.1.0 Index]