| Title: | High-Performance 'WebGL' Mapping Widgets for R |
|---|---|
| Description: | Creates interactive maps using 'MapLibre GL' and 'deck.gl' via 'htmlwidgets'. Provides GPU-accelerated layers for points, lines and polygons, plus linked user interface components such as filters, views and summary cards for exploratory analysis and production dashboards. |
| Authors: | Jack Humble [aut, cre] |
| Maintainer: | Jack Humble <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-22 10:14:48 UTC |
| Source: | https://github.com/jhumbl/maplamina |
Adds a GPU-rendered circle layer (points). Use formulas (e.g. ~mag * 2) to
map columns to aesthetics.
add_circles( map, data = NULL, lon = NULL, lat = NULL, color = "darkblue", opacity = 1, width = 1, fill_color = "dodgerblue", fill_opacity = 0.8, radius = 6, stroke = TRUE, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, radius_units = c("pixels", "meters", "common"), radius_min_pixels = NULL, radius_max_pixels = NULL, width_units = c("pixels", "meters", "common"), width_min_pixels = NULL, width_max_pixels = NULL )add_circles( map, data = NULL, lon = NULL, lat = NULL, color = "darkblue", opacity = 1, width = 1, fill_color = "dodgerblue", fill_opacity = 0.8, radius = 6, stroke = TRUE, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, radius_units = c("pixels", "meters", "common"), radius_min_pixels = NULL, radius_max_pixels = NULL, width_units = c("pixels", "meters", "common"), width_min_pixels = NULL, width_max_pixels = NULL )
map |
A maplamina widget created by |
data |
Data for this layer. If |
lon, lat
|
Longitude/latitude aesthetics (formula or scalar). Required for non- |
color, opacity, width
|
Stroke color/opacity/width. |
fill_color, fill_opacity
|
Fill color/opacity. |
radius |
Circle radius (numeric or formula). |
stroke |
Logical; draw circle stroke. |
tooltip, popup
|
Optional |
id, group
|
Optional layer id and group name. |
pickable |
Logical; whether features can be picked (tooltip/popup). |
radius_units |
Units for |
radius_min_pixels, radius_max_pixels
|
Optional clamp in pixels when using meter/common units. |
width_units |
Units for stroke |
width_min_pixels, width_max_pixels
|
Optional clamp in pixels when using meter/common units. |
The modified map widget.
d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d, radius = ~value, fill_color = "dodgerblue")d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d, radius = ~value, fill_color = "dodgerblue")
Registers one or more filters for a layer. When multiple layers share the same bind,
controls merge across layers by (bind, label, type).
add_filters(map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL)add_filters(map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL)
map |
A maplamina widget created by |
... |
One or more |
id |
Optional id used as a shorthand bind id when |
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). |
The modified map widget.
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, default = c(4, 6)), bind = "filters" )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, default = c(4, 6)), bind = "filters" )
Add MapLibre fullscreen control
add_fullscreen(map, position = "topright", ...)add_fullscreen(map, position = "topright", ...)
map |
A maplamina widget created by |
position |
Control position: |
... |
Named options passed through to the underlying MapLibre control. |
The modified map widget.
maplamina() |> add_fullscreen()maplamina() |> add_fullscreen()
Add MapLibre geolocate control
add_geolocate(map, position = "topright", track_user_location = FALSE, ...)add_geolocate(map, position = "topright", track_user_location = FALSE, ...)
map |
A maplamina widget created by |
position |
Control position: |
track_user_location |
Logical; keep tracking after initial locate. |
... |
Named options passed through to the underlying MapLibre control. |
The modified map widget.
maplamina() |> add_geolocate()maplamina() |> add_geolocate()
Adds a point icon layer. Icons are referenced by id (resolved in the frontend icon set).
add_icons( map, data = NULL, lon = NULL, lat = NULL, icon = "marker", size = 18, color = "#3388ff", opacity = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, size_units = c("pixels", "meters", "common"), size_min_pixels = NULL, size_max_pixels = 64, icon_anchor = NULL, mask = TRUE, occlude = FALSE )add_icons( map, data = NULL, lon = NULL, lat = NULL, icon = "marker", size = 18, color = "#3388ff", opacity = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, size_units = c("pixels", "meters", "common"), size_min_pixels = NULL, size_max_pixels = 64, icon_anchor = NULL, mask = TRUE, occlude = FALSE )
map |
A maplamina widget created by |
data |
Data for this layer. If |
lon, lat
|
Longitude/latitude aesthetics (formula or scalar). Required for non- |
icon |
Icon id string (e.g. |
size, color, opacity
|
Icon size and color/opacity (can be formulas). |
tooltip, popup
|
Optional |
id, group
|
Optional layer id and group name. |
pickable |
Logical; whether features can be picked (tooltip/popup). |
size_units |
Units for |
size_min_pixels, size_max_pixels
|
Optional clamp in pixels when using meter/common units. |
icon_anchor |
Optional anchor (frontend-specific). |
mask |
Logical; whether to mask the icon. |
occlude |
Logical; whether icons occlude each other. |
The modified map widget.
d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_icons(d, icon = "star", size = 20)d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_icons(d, icon = "star", size = 20)
Adds a categorical or continuous legend. Legends can be conditionally displayed
based on layer/view, and can be mounted via the panel by bind.
add_legend( map, title = NULL, type = c("categorical", "continuous"), position = c("bottomleft", "bottomright", "topleft", "topright"), values = NULL, colors = NULL, shapes = "square", sizes = NULL, range = NULL, labels = NULL, breaks = NULL, gradient = NULL, shape = "square", size = 12, layer = NULL, view = NULL, bind = NULL, id = NULL )add_legend( map, title = NULL, type = c("categorical", "continuous"), position = c("bottomleft", "bottomright", "topleft", "topright"), values = NULL, colors = NULL, shapes = "square", sizes = NULL, range = NULL, labels = NULL, breaks = NULL, gradient = NULL, shape = "square", size = 12, layer = NULL, view = NULL, bind = NULL, id = NULL )
map |
A maplamina widget created by |
title |
Optional legend title. |
type |
Legend type: |
position |
Legend position hint: |
values, colors
|
Categorical legend labels and colors (same length). |
shapes, sizes
|
Optional categorical shapes/sizes (length 1 or length(values)). |
range, labels, breaks
|
Continuous legend range/labels/breaks. |
gradient |
Vector of 2+ colors for the continuous legend. |
shape, size
|
Continuous legend swatch/shape and size. |
layer, view
|
Optional conditional display rule. |
bind |
Bind group id for mounting in the panel (defaults to legend id). |
id |
Optional component id (otherwise generated). |
The modified map widget.
maplamina() |> add_legend( title = "Magnitude", type = "continuous", range = c(3, 7), gradient = c("lightyellow", "red") )maplamina() |> add_legend( title = "Magnitude", type = "continuous", range = c(3, 7), gradient = c("lightyellow", "red") )
Adds a GPU-rendered line/path layer.
add_lines( map, data = NULL, color = "#3388ff", opacity = 1, width = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, width_units = c("pixels", "meters", "common"), width_min_pixels = NULL, width_max_pixels = NULL )add_lines( map, data = NULL, color = "#3388ff", opacity = 1, width = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, width_units = c("pixels", "meters", "common"), width_min_pixels = NULL, width_max_pixels = NULL )
map |
A maplamina widget created by |
data |
Data for this layer. Typically an |
color, opacity, width
|
Line color/opacity/width. |
tooltip, popup
|
Optional |
id, group
|
Optional layer id and group name. |
pickable |
Logical; whether features can be picked (tooltip/popup). |
width_units |
Units for |
width_min_pixels, width_max_pixels
|
Optional clamp in pixels when using meter/common units. |
The modified map widget.
if (requireNamespace("sf", quietly = TRUE)) { ln <- sf::st_sfc( sf::st_linestring(matrix(c(-122.4, 37.8, -122.5, 37.85), ncol = 2, byrow = TRUE)), crs = 4326 ) ln <- sf::st_sf(id = 1, geometry = ln) maplamina(ln) |> add_lines(color = "black", width = 3) }if (requireNamespace("sf", quietly = TRUE)) { ln <- sf::st_sfc( sf::st_linestring(matrix(c(-122.4, 37.8, -122.5, 37.85), ncol = 2, byrow = TRUE)), crs = 4326 ) ln <- sf::st_sf(id = 1, geometry = ln) maplamina(ln) |> add_lines(color = "black", width = 3) }
Convenience wrapper around add_icons() using the default marker icons.
add_markers( map, data = NULL, lon = NULL, lat = NULL, size = 18, color = "dodgerblue", opacity = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, size_units = c("pixels", "meters", "common"), size_min_pixels = NULL, size_max_pixels = NULL )add_markers( map, data = NULL, lon = NULL, lat = NULL, size = 18, color = "dodgerblue", opacity = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, size_units = c("pixels", "meters", "common"), size_min_pixels = NULL, size_max_pixels = NULL )
map |
A maplamina widget created by |
data |
Data for this layer. If |
lon, lat
|
Longitude/latitude aesthetics (formula or scalar). Required for non- |
size, color, opacity
|
Marker size and color/opacity (can be formulas). |
tooltip, popup
|
Optional |
id, group
|
Optional layer id and group name. |
pickable |
Logical; whether features can be picked (tooltip/popup). |
size_units |
Units for |
size_min_pixels, size_max_pixels
|
Optional clamp in pixels when using meter/common units. |
The modified map widget.
d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_markers(d, size = ~value * 3)d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_markers(d, size = ~value * 3)
The panel mounts previously-declared controls by bind id (see section() and sections()).
add_panel( map, title = NULL, description = NULL, icon = NULL, dividers = TRUE, position = NULL, sections = NULL )add_panel( map, title = NULL, description = NULL, icon = NULL, dividers = TRUE, position = NULL, sections = NULL )
map |
A maplamina widget created by |
title |
Panel title. |
description |
Optional panel description. |
icon |
Optional URL for a small icon shown beside the title. |
dividers |
Logical; whether to render divider lines between sections. |
position |
Optional corner position for the panel container: |
sections |
Panel layout, created with |
The modified map widget.
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_panel(sections = sections(section("filters")))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_panel(sections = sections(section("filters")))
Adds a polygon layer (fill + optional stroke). For data-driven fills, use a
color scale spec such as color_quantile() or color_factor().
add_polygons( map, data = NULL, color = "darkblue", opacity = 1, width = 1, fill_color = "dodgerblue", fill_opacity = 0.6, stroke = TRUE, elevation = NULL, elevation_scale = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, width_units = c("pixels", "meters", "common"), width_min_pixels = NULL, width_max_pixels = NULL )add_polygons( map, data = NULL, color = "darkblue", opacity = 1, width = 1, fill_color = "dodgerblue", fill_opacity = 0.6, stroke = TRUE, elevation = NULL, elevation_scale = 1, tooltip = NULL, popup = NULL, id = NULL, group = NULL, pickable = TRUE, width_units = c("pixels", "meters", "common"), width_min_pixels = NULL, width_max_pixels = NULL )
map |
A maplamina widget created by |
data |
Data for this layer. Typically an |
color, opacity, width
|
Stroke color/opacity/width. |
fill_color, fill_opacity
|
Fill color/opacity. |
stroke |
Logical; draw polygon stroke. |
elevation, elevation_scale
|
Optional extrusion height (numeric or formula) and scale. |
tooltip, popup
|
Optional |
id, group
|
Optional layer id and group name. |
pickable |
Logical; whether features can be picked (tooltip/popup). |
width_units |
Units for stroke |
width_min_pixels, width_max_pixels
|
Optional clamp in pixels when using meter/common units. |
The modified map widget.
if (requireNamespace("sf", quietly = TRUE)) { nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) maplamina(nc) |> add_polygons(fill_color = color_quantile(~BIR74), stroke = FALSE) }if (requireNamespace("sf", quietly = TRUE)) { nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) maplamina(nc) |> add_polygons(fill_color = color_quantile(~BIR74), stroke = FALSE) }
Add MapLibre scale bar
add_scalebar( map, position = "bottomleft", unit = c("metric", "imperial", "nautical"), max_width = 100, ... )add_scalebar( map, position = "bottomleft", unit = c("metric", "imperial", "nautical"), max_width = 100, ... )
map |
A maplamina widget created by |
position |
Control position: |
unit |
Units for the scale bar. |
max_width |
Maximum scale bar width (pixels). |
... |
Named options passed through to the underlying MapLibre control. |
The modified map widget.
maplamina() |> add_scalebar(unit = "metric")maplamina() |> add_scalebar(unit = "metric")
Registers one or more summary rows that update with filtering. When multiple
layers share the same bind, a single summaries card can be created.
add_summaries( map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL )add_summaries( map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL )
map |
A maplamina widget created by |
... |
One or more |
id |
Optional id used as a shorthand bind id when |
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). |
The modified map widget.
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")))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")))
Registers a per-layer views component. When multiple layers share the same bind,
a single selector control is created.
add_views( map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL, duration = 750, easing = c("smoothstep", "linear", "easein", "easeout", "easeinout", "easeInOutCubic") )add_views( map, ..., id = NULL, bind = NULL, position = NULL, layer_id = NULL, duration = 750, easing = c("smoothstep", "linear", "easein", "easeout", "easeinout", "easeInOutCubic") )
map |
A maplamina widget created by |
... |
One or more |
id |
Optional component id (also used as the default bind id). |
bind |
Bind group id for shared UI control. If omitted, defaults to |
position |
Optional UI position hint (applied to the control group). |
layer_id |
Target layer id (defaults to the most recently added layer). |
duration |
Animation duration (ms) for switching views. |
easing |
Easing function name for switching views. |
The modified map widget.
d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d, radius = 5) |> add_views( view("magnitude", radius = ~value * 3), view("faint", fill_opacity = 0.2) )d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d, radius = 5) |> add_views( view("magnitude", radius = ~value * 3), view("faint", fill_opacity = 0.2) )
A named list of MapLibre-compatible style URLs for common open-source
basemaps. Pass any entry directly to the style argument of
maplamina.
base_tilesbase_tiles
A named list of character strings (URLs).
Light basemap with labels. Good default for thematic maps.
Light basemap without labels. Clean background for dense data.
Dark basemap with labels. Good for glowing point layers.
Dark basemap without labels.
Colored basemap with labels. More geographic detail than Positron.
Colored basemap without labels.
OSM Liberty style hosted by OpenFreeMap. No API key required.
OSM Bright style hosted by OpenFreeMap. No API key required.
Positron style hosted by OpenFreeMap. No API key required.
MapLibre demo tiles. Lightweight, no API key, useful for testing.
# Polygons example (sf ships the nc shapefile) if (requireNamespace("sf", quietly = TRUE)) { nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) maplamina(nc) |> add_polygons(fill_color = color_quantile(~BIR74), stroke = FALSE) maplamina(nc, style = base_tiles$carto_dark_matter) |> add_polygons(fill_color = color_quantile(~BIR74, "Inferno"), stroke = FALSE) }# Polygons example (sf ships the nc shapefile) if (requireNamespace("sf", quietly = TRUE)) { nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) maplamina(nc) |> add_polygons(fill_color = color_quantile(~BIR74), stroke = FALSE) maplamina(nc, style = base_tiles$carto_dark_matter) |> add_polygons(fill_color = color_quantile(~BIR74, "Inferno"), stroke = FALSE) }
Binned (equal-interval or manual breaks) color scale specification
color_bin( expr, palette = NULL, bins = 5, domain = NULL, na_color = "#00000000", reverse = FALSE, clamp = TRUE )color_bin( expr, palette = NULL, bins = 5, domain = NULL, na_color = "#00000000", reverse = FALSE, clamp = TRUE )
expr |
A formula selecting a numeric column (e.g. |
palette |
|
bins |
Number of bins, or a numeric vector of breakpoints. |
domain |
Optional numeric range |
na_color |
Color used for missing values. |
reverse |
Logical; reverse the palette. |
clamp |
Logical; if |
A color scale specification object.
Categorical color scale specification
color_factor( expr, palette = NULL, domain = NULL, na_color = "#00000000", reverse = FALSE )color_factor( expr, palette = NULL, domain = NULL, na_color = "#00000000", reverse = FALSE )
expr |
A formula selecting a categorical column (e.g. |
palette |
|
domain |
Optional character vector of levels (controls ordering and which levels are shown). |
na_color |
Color used for missing values. |
reverse |
Logical; reverse the palette. |
A color scale specification object.
Creates a numeric color scale spec that is resolved during widget compilation.
Use in color/fill_color aesthetics (e.g. fill_color = color_numeric(~x)).
color_numeric( expr, palette = NULL, domain = NULL, steps = 256L, na_color = "#00000000", reverse = FALSE, clamp = TRUE )color_numeric( expr, palette = NULL, domain = NULL, steps = 256L, na_color = "#00000000", reverse = FALSE, clamp = TRUE )
expr |
A formula selecting a numeric column (e.g. |
palette |
|
domain |
Optional numeric range |
steps |
Number of palette steps for interpolation. |
na_color |
Color used for missing values. |
reverse |
Logical; reverse the palette. |
clamp |
Logical; if |
A color scale specification object.
if (requireNamespace("sf", quietly = TRUE)) { nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) maplamina(nc) |> add_polygons(fill_color = color_numeric(~BIR74)) }if (requireNamespace("sf", quietly = TRUE)) { nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) maplamina(nc) |> add_polygons(fill_color = color_numeric(~BIR74)) }
Quantile color scale specification
color_quantile( expr, palette = NULL, n = 5, domain = NULL, na_color = "#00000000", reverse = FALSE, clamp = TRUE )color_quantile( expr, palette = NULL, n = 5, domain = NULL, na_color = "#00000000", reverse = FALSE, clamp = TRUE )
expr |
A formula selecting a numeric column (e.g. |
palette |
|
n |
Number of quantile bins. |
domain |
Optional numeric range |
na_color |
Color used for missing values. |
reverse |
Logical; reverse the palette. |
clamp |
Logical; if |
A color scale specification object.
Creates a numeric range filter specification to be registered with add_filters().
filter_range( col, label = NULL, default = NULL, min = NULL, max = NULL, step = NULL, live = TRUE, id = NULL )filter_range( col, label = NULL, default = NULL, min = NULL, max = NULL, step = NULL, live = TRUE, id = NULL )
col |
A formula selecting a numeric column (e.g. |
label |
Optional label for the UI control (defaults to the column name). |
default |
Optional default range |
min, max
|
Optional explicit min/max (otherwise computed from data). |
step |
Optional step size for the UI slider. |
live |
Logical; update the map continuously while dragging. |
id |
Optional filter id (otherwise generated). |
A filter specification object.
f <- filter_range(~mpg, default = c(15, 30)) ff <- filter_range(~mpg, default = c(15, 30)) f
Creates a categorical filter specification to be registered with add_filters().
filter_select( col, label = NULL, multi = TRUE, dropdown = NULL, searchable = TRUE, default = NULL, max_levels = NULL, id = NULL )filter_select( col, label = NULL, multi = TRUE, dropdown = NULL, searchable = TRUE, default = NULL, max_levels = NULL, id = NULL )
col |
A formula selecting a column (e.g. |
label |
Optional label for the UI control (defaults to the column name). |
multi |
Logical; allow multiple selections. |
dropdown |
Optional UI hint (frontend-specific). |
searchable |
Logical; allow searching within options. |
default |
Optional default selection(s). |
max_levels |
Optional maximum number of levels to show (frontend may truncate). |
id |
Optional filter id (otherwise generated). |
A filter specification object.
f <- filter_select(~Species, default = c("setosa", "versicolor")) ff <- filter_select(~Species, default = c("setosa", "versicolor")) f
Creates an interactive MapLibre + deck.gl map widget. You can add layers and
UI components (views/filters/summaries/panel) with the add_*() functions.
maplamina( data = NULL, style = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json", projection = c("mercator", "globe"), dragRotate = FALSE, fit_bounds = TRUE, show_layer_controls = TRUE, width = NULL, height = NULL, elementId = NULL )maplamina( data = NULL, style = "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json", projection = c("mercator", "globe"), dragRotate = FALSE, fit_bounds = TRUE, show_layer_controls = TRUE, width = NULL, height = NULL, elementId = NULL )
data |
Optional default dataset used by subsequent |
style |
MapLibre style URL (or a named style from |
projection |
Map projection; one of |
dragRotate |
Logical; whether drag-rotate is enabled (also affects compass). |
fit_bounds |
Logical; whether the map initially fits the bounds of all layers. |
show_layer_controls |
Logical; show built-in per-layer visibility controls. |
width, height
|
Widget width/height (CSS units or numeric pixels). If |
elementId |
Optional HTML element id. |
An htmlwidget maplamina widget.
# Minimal widget maplamina() # With a Circle layer d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d)# Minimal widget maplamina() # With a Circle layer d <- data.frame( lon = runif(1000, -60, 60), lat = runif(1000, -60, 60), value = runif(1000, 1, 10) ) maplamina() |> add_circles(d)
Panel sections refer to bind ids created by components such as add_views(),
add_filters(), and add_summaries().
section(id)section(id)
id |
Bind id (e.g. the |
A panel section object.
section("filters")section("filters")
Create a list of panel sections
sections(...)sections(...)
... |
One or more |
A panel sections container.
sections(section("views"), section("filters"))sections(section("views"), section("filters"))
Counts the number of filtered rows.
summary_count( col = NULL, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )summary_count( col = NULL, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )
col |
Optional formula like |
label |
Display label for the summary row. |
digits |
Optional number of digits for formatting (applied in JS). |
prefix, suffix
|
Optional prefix/suffix strings (applied in JS). |
id |
Optional summary id. |
A summary specification object.
Summary: max value
summary_max( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )summary_max( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )
col |
A formula like |
label |
Display label for the summary row. |
digits |
Optional number of digits for formatting (applied in JS). |
prefix, suffix
|
Optional prefix/suffix strings (applied in JS). |
id |
Optional summary id. |
A summary specification object.
Summary: mean value
summary_mean( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )summary_mean( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )
col |
A formula like |
label |
Display label for the summary row. |
digits |
Optional number of digits for formatting (applied in JS). |
prefix, suffix
|
Optional prefix/suffix strings (applied in JS). |
id |
Optional summary id. |
A summary specification object.
Summary: min value
summary_min( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )summary_min( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )
col |
A formula like |
label |
Display label for the summary row. |
digits |
Optional number of digits for formatting (applied in JS). |
prefix, suffix
|
Optional prefix/suffix strings (applied in JS). |
id |
Optional summary id. |
A summary specification object.
Summary: sum of values
summary_sum( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )summary_sum( col, label = NULL, digits = NULL, prefix = NULL, suffix = NULL, id = NULL )
col |
A formula like |
label |
Display label for the summary row. |
digits |
Optional number of digits for formatting (applied in JS). |
prefix, suffix
|
Optional prefix/suffix strings (applied in JS). |
id |
Optional summary id. |
A summary specification object.
Templates use placeholders like {col} or {col:.1f}. Values are gathered
during widget compilation for fast rendering in the browser.
tmpl(template, ..., html = FALSE)tmpl(template, ..., html = FALSE)
template |
A single template string. |
... |
Optional named expressions to bind placeholders (e.g. |
html |
Logical; if |
A template specification object.
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}"))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}"))
transition() has been removed. Configure animated view switching via
add_views() using duration and easing.
transition(...)transition(...)
... |
Ignored. |
This function always errors with Defunct.
A view is a named set of overrides (e.g. radius/opacity) that can be switched
via a shared views selector created by add_views().
view(name, ...)view(name, ...)
name |
View name shown in the UI. |
... |
Named overrides for layer aesthetics (e.g. |
A view specification object.
v <- view("magnitude", radius = ~mag * 3) vv <- view("magnitude", radius = ~mag * 3) v