Skip to contents

Registers one or more summary rows that update with filtering. When multiple layers share the same bind, a single summaries card can be created.

Usage

add_summaries(
  map,
  ...,
  id = NULL,
  bind = NULL,
  position = NULL,
  layer_id = NULL
)

Arguments

map

A maplamina widget created by maplamina().

...

One or more summary_*() objects (or a single list of them).

id

Optional id used as a shorthand bind id when bind is omitted.

bind

Bind group id for shared UI control.

position

Optional UI position hint (applied to the control group).

layer_id

Target layer id (defaults to the most recently added layer).

Value

The modified map widget.

Examples

d <- data.frame(
  lon   = runif(1000, -60, 60),
  lat   = runif(1000, -60, 60),
  value = runif(1000, 1, 10)
)
maplamina() |>
  add_circles(d) |>
  add_filters(filter_range(~value), bind = "filters") |>
  add_summaries(summary_mean(~value, label = "Avg value"), bind = "summaries") |>
  add_panel(sections = sections(section("filters"), section("summaries")))