Skip to contents

The viz_blur function creates an SVG blur filter and adds it to the map definitions. It returns a reference usable in SVG styling (e.g. url(#id)).

Usage

viz_blur(map, id = NULL, stdDeviation = 1.5, ...)

Arguments

map

A geovizr map object created using viz_create().

id

character. Optional. Unique filter id.

stdDeviation

numeric. Optional. Standard deviation controlling blur intensity (default 1.5). Higher values produce a stronger blur effect.

...

Additional parameters

Value

A modified `geoviz` map object with a new effect added. Rendering is performed using viz_render()

Examples

library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
world <- st_read(
  system.file("gpkg/world.gpkg", package = "geovizr"),
  quiet = TRUE
)
aus <- world[world$ISO3 == "AUS", ]

viz_create(margin = 5, width = 650) |>
  viz_blur(id = "my_blur_effect", stdDeviation = 2) |>
  viz_path(datum = aus, fill = "#38896F", filter = "url(#my_blur_effect)") |>
  viz_render()