Skip to contents

The viz_footer function adds a text below a geoviz map.

Usage

viz_footer(
  map,
  id = NULL,
  text = "Author, source...",
  fill = "#9e9696",
  background_fill = "white",
  background_stroke = "white",
  background_strokeWidth = 1,
  dominantBaseline = "central",
  textAnchor = "middle",
  lineSpacing = 0,
  margin = 1,
  fontSize = 10,
  fontFamily = NULL,
  dx = 0,
  dy = 0,
  ...
)

Arguments

map

A geoviz map created with viz_create.

id

character. Optional. Unique layer id.

text

character. Optional. Footer text to display (default "Author, source...").

fill

character. Optional. Text color (default "#9e9696").

background_fill

character. Optional. Background fill color (default "white").

background_stroke

character. Optional. Background stroke color (default "white").

background_strokeWidth

numeric. Optional. Background stroke width (default 1).

dominantBaseline

character. Optional. Vertical text alignment (default "central", values "hanging","middle","central","bottom").

textAnchor

character. Optional. Horizontal text alignment (default "middle", values "start","middle","end").

lineSpacing

numeric. Optional. Line spacing (default 0).

margin

numeric. Optional. Margin (default 1).

fontSize

numeric. Optional. Font size (default 10).

fontFamily

character. Optional. Font family (default container font).

dx

numeric. Optional. X shift (default 0).

dy

numeric. Optional. Y shift (default 0).

...

Additional SVG attributes applied to text and background elements.

Examples

library(sf)
world <- st_read(
  system.file("gpkg/world.gpkg", package = "geoviz"),
  quiet = TRUE
)

viz_create(projection = "EqualEarth", background = "white") |>
viz_path(datum = world, fill = "#f1f3f5") |>
viz_footer(text = "Source, author, note, etc.", fill = "#38896F") |>
viz_render()