Skip to contents

Templates use placeholders like {col} or {col:.1f}. Values are gathered during widget compilation for fast rendering in the browser.

Usage

tmpl(template, ..., html = FALSE)

Arguments

template

A single template string.

...

Optional named expressions to bind placeholders (e.g. mag = ~mag). If omitted, placeholders are resolved by column name.

html

Logical; if TRUE, the template is treated as HTML.

Value

A template specification object.

Examples

d <- data.frame(
  lon   = runif(1000, -60, 60),
  lat   = runif(1000, -60, 60),
  value = runif(1000, 1, 10)
)
maplamina() |>
  add_circles(d, tooltip = tmpl("Value: {value:.1f}"))