The offset filter applies an offset in the x and y directions to an existing element. The offset is handled by setting values for dx and dy.

filter_offset(dx = NULL, dy = NULL, what = "source")

Arguments

dx, dy

The offset of the element position compared to its initial position.

what

What exactly should be offset? By default, it is the "source" image.

Examples

# Add a circle element to an # SVG drawing and offset it # by 10px to the right SVG(width = 150, height = 150) %>% svg_filter( id = "offset_right", filters = list( filter_offset(dx = 50, dy = 0) ) ) %>% svg_circle( x = 30, y = 30, diameter = 40, attrs = svg_attrs_pres( fill = "red", filter = "offset_right" ) )
#> <svg width="150" height="150"> #> <defs> #> <filter id="offset_right" width="150" height="150"> #> <feOffset in="SourceGraphic" dx="50" dy="0"/> #> </filter> #> </defs> #> <circle cx="30" cy="30" r="20" fill="red" filter="url(#offset_right)"/> #> </svg>