diff --git a/DESCRIPTION b/DESCRIPTION index e822f7de..869e86a8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,7 @@ Imports: tidyselect, uuid, vctrs, - wk + wk (>= 0.9) Suggests: geojsonsf, knitr, diff --git a/NEWS.md b/NEWS.md index 727f3a36..5475e73a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ - Layer data enhancements (#100) - Fix regression in set_layer_visibility (#101) - Rescalers no longer require `center` to be inside input domain (#103) +- All layers now support geometry vectors which {wk} can read (#104) # rdeck 0.5.2 diff --git a/R/deckgl-layers.R b/R/deckgl-layers.R index 29476212..d76ce071 100644 --- a/R/deckgl-layers.R +++ b/R/deckgl-layers.R @@ -280,7 +280,7 @@ add_bitmap_layer <- function( auto_highlight = auto_highlight, highlight_color = accessor(highlight_color, data), image = image, - bounds = bounds, + bounds = if (!is.null(bounds)) wk::wk_bbox(bounds), desaturate = desaturate, transparent_color = transparent_color, tint_color = tint_color, @@ -365,7 +365,7 @@ update_bitmap_layer <- function( auto_highlight = auto_highlight, highlight_color = accessor(highlight_color, data), image = image, - bounds = bounds, + bounds = if (!is.null(bounds)) wk::wk_bbox(bounds), desaturate = desaturate, transparent_color = transparent_color, tint_color = tint_color, @@ -7020,7 +7020,7 @@ add_terrain_layer <- function( elevation_data = elevation_data, texture = texture, mesh_max_error = mesh_max_error, - bounds = bounds, + bounds = if (!is.null(bounds)) wk::wk_bbox(bounds), color = color, elevation_decoder = elevation_decoder, worker_url = worker_url, @@ -7150,7 +7150,7 @@ update_terrain_layer <- function( elevation_data = elevation_data, texture = texture, mesh_max_error = mesh_max_error, - bounds = bounds, + bounds = if (!is.null(bounds)) wk::wk_bbox(bounds), color = color, elevation_decoder = elevation_decoder, worker_url = worker_url, diff --git a/R/doc-deckgl-layers.R b/R/doc-deckgl-layers.R index a95bfded..d5168617 100644 --- a/R/doc-deckgl-layers.R +++ b/R/doc-deckgl-layers.R @@ -482,8 +482,10 @@ NULL #' @inherit layer_props #' @param elevation_data url #' @param mesh_max_error number -#' @param bounds <`bbox`> A [`st_bbox`][sf::st_bbox] object with CRS -#' [EPSG:4326](http://epsg.io/4326). Must be supplied when using non-tiled elevation data. +#' @param bounds <[`rct`][wk::rct]/[`st_bbox`][sf::st_bbox]/[`wk-geometry`]> +#' The bounds of the image to fit x,y coordinates into. +#' Requires CRS [EPSG:4326](http://epsg.io/4326). +#' Must be supplied when using non-tiled elevation data. #' @param color color #' @param elevation_decoder object #' @param worker_url string @@ -561,7 +563,7 @@ NULL #' @param tooltip <[`tooltip`]> Defines the columns (and their order) that will be displayed in #' the layer tooltip, if `pickable == TRUE`. #' Supports [tidy-select](https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html) if a -#' `data` is a `data.frame`. `sfc` columns are always removed. +#' `data` is a `data.frame`. Geometry columns are always removed. #' @param data <`data.frame` | [`sf`][sf::sf] | `string`> The layer's data. Data frames and #' sf objects will contain all columns that are referenced by the layer's accessors. Strings #' will be interpreted as a URL and data will be retrieved dynamically in the browser. @@ -582,11 +584,11 @@ NULL #' highlight all objects in the layer. Per-object highlighting is achieved with a colour scale, #' or a [tidy-eval](https://dplyr.tidyverse.org/articles/programming.html) column of colours. #' @param wrap_longitude <`boolean`> Normalises geometry longitudes. -#' @param get_source_position <[`accessor`]> The source position geometry column, either a -#' `sfc_POINT` or a `sfc_MULTIPOINT` column with CRS [EPSG:4326](http://epsg.io/4326). +#' @param get_source_position <[`accessor`]> The feature source positions. A +#' `` [wk-geometry] column with CRS [EPSG:4326](http://epsg.io/4326). #' Supports [tidy-eval](https://dplyr.tidyverse.org/articles/programming.html). -#' @param get_target_position <[`accessor`]> The target position geometry column, either a -#' `sfc_POINT` or a `sfc_MULTIPOINT` column with CRS [EPSG:4326](http://epsg.io/4326). +#' @param get_target_position <[`accessor`]> The feature target positions. A +#' `` [wk-geometry] column with CRS [EPSG:4326](http://epsg.io/4326). #' Supports [tidy-eval](https://dplyr.tidyverse.org/articles/programming.html). #' @param get_source_color <[`accessor`] | [`scale`] | [`color`]> The colour of the #' _source end_ of the arc. @@ -616,16 +618,16 @@ NULL #' @param width_scale <`number`> The scaling multiplier for the width of each line. #' @param width_min_pixels <`number`> The minimum line width in pixels. #' @param width_max_pixels <`number`> The maximum line width in pixels. -#' @param bounds <`bbox`> A [`st_bbox`][sf::st_bbox] object with CRS -#' [EPSG:4326](http://epsg.io/4326). - +#' @param bounds <[`rct`][wk::rct]/[`st_bbox`][sf::st_bbox]/[`wk-geometry`]> +#' The bounds of the image to fit x,y coordinates into. +#' Requires CRS [EPSG:4326](http://epsg.io/4326). #' @param size_scale <`number`> The size multiplier. #' @param size_units <`"pixels"` | `"common"` | `"meters"`> The units of the size specified by #' `get_size`. #' @param size_min_pixels <`number`> The minimum size in pixels. #' @param size_max_pixels <`number`> The maximum size in pixels. -#' @param get_position <[`accessor`]> The position geometry column, either a `sfc_POINT` or -#' a `sfc_MULTIPOINT` column with CRS [EPSG:4326](http://epsg.io/4326). +#' @param get_position <[`accessor`]> The feature positions. A +#' `` [wk-geometry] column with CRS [EPSG:4326](http://epsg.io/4326). #' Supports [tidy-eval](https://dplyr.tidyverse.org/articles/programming.html). #' @param get_color <[`accessor`] | [`scale`] | [`color`]> The colour of each object. #' Accepts a single colour value, a colour scale, or a @@ -683,15 +685,15 @@ NULL #' joints. #' @param miter_limit <`number`> The maximum extent of a joint in ratio to the stroke width. #' Only applicable if `rounded == FALSE`. -#' @param get_path <[`accessor`]> The path geometry column, either a `sfc_LINESTRING` or -#' a `sfc_MULTILINESTRING` column with CRS [EPSG:4326](http://epsg.io/4326). +#' @param get_path <[`accessor`]> The feature paths. A +#' `` [wk-geometry] column with CRS [EPSG:4326](http://epsg.io/4326). #' Supports [tidy-eval](https://dplyr.tidyverse.org/articles/programming.html). #' @param cap_rounded <`boolean`> If `TRUE`, draw round caps; else draw square caps. #' @param joint_rounded <`boolean`> If `TRUE`, draw round joints; else draw square joints. #' @param line_joint_rounded <`boolean`> #' @param line_miter_limit number -#' @param get_polygon <[`accessor`]> The polygon geometry column, either a `sfc_POLYGON` -#' or a `sfc_MULTIPOLYGON` column with CRS [EPSG:4326](http://epsg.io/4326). +#' @param get_polygon <[`accessor`]> The feature polygons. A +#' `` [wk-geometry] column with CRS [EPSG:4326](http://epsg.io/4326). #' Supports [tidy-eval](https://dplyr.tidyverse.org/articles/programming.html). #' @param point_type <`"circle"`|`"icon"`|`"text"`|combination> #' Determines how to render point and multipoint features. May be one of: diff --git a/R/doc-proptypes.R b/R/doc-proptypes.R index 36211bf1..1b21b8d1 100644 --- a/R/doc-proptypes.R +++ b/R/doc-proptypes.R @@ -178,3 +178,31 @@ NULL #' @name color #' @keywords internal NULL + + +#' Prop Type: WK Geometry +#' +#' @description +#' Geometry vectors are parsed with [wk::wk_handle()]. All geometry formats +#' that \{wk\} supports directly are available to use in {rdeck} layers. You may +#' also use geometry formats which \{wk\} doesn't directly support, provided a +#' _loaded_ package defines a \{wk\} _reader_ (i.e. [wk::wk_handle()] S3 method) +#' for the geometry type. +#' +#' Geometry formats supported by \{wk\} (always supported): +#' - [wk::wkb()] +#' - [wk::wkt()] +#' - [wk::xy()] (`m` dimension is always ignored) +#' - [wk::crc()] +#' - [wk::grd()] +#' - [wk::rct()] +#' - [sf::st_sfc()] +#' +#' Geometry formats supported by other packages (not dependencies of \{rdeck\}): +#' - [s2::s2_geography()] +#' - [geos::geos_geometry()] +#' - Others? +#' +#' @name wk-geometry +#' @keywords internal +NULL diff --git a/R/geometry.R b/R/geometry.R index ef702bb9..c2e60324 100644 --- a/R/geometry.R +++ b/R/geometry.R @@ -43,10 +43,13 @@ is_sf <- function(object) inherits(object, "sf") # is crs = epsg:4326 is_wgs84 <- function(object) { - crs <- sf::st_crs(object) - wgs84 <- sf::st_crs(4326) + obj_proj <- wk::wk_crs_proj_definition(wk::wk_crs(object)) + wgs84_proj <- c( + wk::wk_crs_proj_definition("EPSG:4326"), + wk::wk_crs_proj_definition("OGC:CRS84") + ) - crs == wgs84 || !is.na(crs$input) && crs$input == wgs84$input + !is.na(obj_proj) & obj_proj %in% wgs84_proj } @@ -193,3 +196,14 @@ wk_is_linestring <- function(handleable, ignore_empty = TRUE) { wk_is_polygon <- function(handleable, ignore_empty = TRUE) { wk_is(handleable, wk::wk_geometry_type(c("polygon", "multipolygon")), ignore_empty) } + + +# should this live in the wk package? +wk_bbox.bbox <- function(handleable) { + wk::as_rct(handleable) +} + +# should this live in the wk package? +wk_crs.bbox <- function(handleable) { + wk::wk_crs(wk::as_rct(handleable)) +} diff --git a/R/json.R b/R/json.R index bec7f831..59535915 100644 --- a/R/json.R +++ b/R/json.R @@ -85,8 +85,11 @@ as_json.view_state <- function(object, ...) { ) } -as_json.bbox <- function(object, ...) { - json_stringify(object, digits = 6) +as_json.wk_rct <- function(object, ...) { + json_stringify( + unname(unlist(object)), + digits = 6 + ) } #' @autoglobal diff --git a/R/validation.R b/R/validation.R index e140f9e9..2f5a5fdc 100644 --- a/R/validation.R +++ b/R/validation.R @@ -63,7 +63,7 @@ validate_data.MVTLayer <- function(layer) { } } -validate_geometry_accessor <- function(layer, name, sfc_type) { +validate_geometry_accessor <- function(layer, name, geom_type) { prop <- layer[[name]] if (is_cur_value(prop)) return() @@ -75,49 +75,69 @@ validate_geometry_accessor <- function(layer, name, sfc_type) { data <- layer$data if (inherits(data, "data.frame") && nrow(data) != 0) { - accessor_data <- data[[tidyselect::eval_select(prop$col, data)]] + vec <- data[[tidyselect::eval_select(prop$col, data)]] tidyassert::assert( - inherits(accessor_data, sfc_type) && is_wgs84(accessor_data), + wk_is(vec, geom_type) && is_wgs84(vec), c( "x" = "Column {.col {col}} is invalid for accessor {.arg {name}}", - "x" = "A {.emph WGS84} {.cls {type}} vector is required" + "x" = "A {.emph WGS84} {.cls {type}} geometry vector expected" ), call = rlang::caller_call(), # prettier assertion expression print_expr = substitute( - inherits(data$col, sfc_type) && is_wgs84(data$col), - list(col = prop$col, sfc_type = sfc_type) + wk_is(data$col, geom_type) && is_wgs84(data$col), + list(col = prop$col, geom_type = geom_type) ), name = name, col = prop$col, - type = sfc_type + type = wk::wk_geometry_type_label(geom_type) ) } } # validate get_path validate_get_path.layer <- function(layer) { - validate_geometry_accessor(layer, "get_path", c("sfc_LINESTRING", "sfc_MULTILINESTRING")) + validate_geometry_accessor( + layer, + "get_path", + wk::wk_geometry_type(c("linestring", "multilinestring")) + ) } # validate get_polygon validate_get_polygon.layer <- function(layer) { - validate_geometry_accessor(layer, "get_polygon", c("sfc_POLYGON", "sfc_MULTIPOLYGON")) + validate_geometry_accessor( + layer, + "get_polygon", + wk::wk_geometry_type(c("polygon", "multipolygon")) + ) } # validate get_position validate_get_position.layer <- function(layer) { - validate_geometry_accessor(layer, "get_position", c("sfc_POINT", "sfc_MULTIPOINT")) + validate_geometry_accessor( + layer, + "get_position", + wk::wk_geometry_type(c("point", "multipoint")) + ) } # validate get_source_position validate_get_source_position.layer <- function(layer) { - validate_geometry_accessor(layer, "get_source_position", c("sfc_POINT", "sfc_MULTIPOINT")) + validate_geometry_accessor( + layer, + "get_source_position", + wk::wk_geometry_type(c("point", "multipoint")) + ) } # validate get_target_position validate_get_target_position.layer <- function(layer) { - validate_geometry_accessor(layer, "get_target_position", c("sfc_POINT", "sfc_MULTIPOINT")) + validate_geometry_accessor( + layer, + "get_target_position", + wk::wk_geometry_type(c("point", "multipoint")) + ) } # validate image diff --git a/R/widget.R b/R/widget.R index f540e1c7..71e41b1e 100644 --- a/R/widget.R +++ b/R/widget.R @@ -9,8 +9,10 @@ #' See #' @param theme <`"kepler"` | `"light"`> The widget theme which alters the style of the #' legend and tooltips. -#' @param initial_bounds <[`st_bbox`][sf::st_bbox] | [`sf`][sf::sf] | [`sfc`][sf::sfc]> -#' The initial bounds of the map; overwrites `initial_view_state`. +#' @param initial_bounds <[`rct`][wk::rct]/[`st_bbox`][sf::st_bbox]/[`wk-geometry`]> +#' Sets the initial bounds of the map if not `NULL`. Takes priority over `initial_view_state`. +#' Accepts a bounding box, or a geometry from which a bounding box can be computed. Requires +#' CRS [EPSG:4326](http://epsg.io/4326). #' @param initial_view_state <[`view_state`]> Defines the map position, zoom, bearing and pitch. #' @param controller <`logical`> If `NULL` or `FALSE`, the map is not interactive. #' @param picking_radius <`number`> Extra pixels around the pointer to include while picking; @@ -64,9 +66,12 @@ rdeck <- function(map_style = mapbox_dark(), is_editor_options(editor) | rlang::is_scalar_logical(editor) ) + initial_bounds <- if (!is.null(initial_bounds)) wk::wk_bbox(initial_bounds) + tidyassert::assert(is.null(initial_bounds) || is_wgs84(initial_bounds)) + deckgl <- deck_props( ..., - initial_bounds = if (!is.null(initial_bounds)) map_bounds(initial_bounds), + initial_bounds = initial_bounds, initial_view_state = initial_view_state, controller = controller, picking_radius = picking_radius, @@ -166,19 +171,6 @@ props <- function(rdeck) { rdeck$x$props } -map_bounds <- function(initial_bounds) { - tidyassert::assert_inherits(initial_bounds, c("bbox", "sf", "sfc", "sfg")) - - sfc <- if (inherits(initial_bounds, "bbox")) { - sf::st_as_sfc(initial_bounds) - } else { - sf::st_geometry(initial_bounds) - } - - sfc %>% - sf::st_transform(4326) %>% - sf::st_bbox() -} deck_props <- function(..., initial_bounds = cur_value(), diff --git a/_pkgdown.yml b/_pkgdown.yml index ce636b7b..ef081903 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -36,6 +36,7 @@ reference: - scale - tooltip - color + - wk-geometry - title: Core layers desc: Deck.GL core layers diff --git a/man/arc_layer.Rd b/man/arc_layer.Rd index 49ee2f62..1e17389e 100644 --- a/man/arc_layer.Rd +++ b/man/arc_layer.Rd @@ -115,12 +115,12 @@ highlighted object. If a single colour value is supplied, that colour will be us highlight all objects in the layer. Per-object highlighting is achieved with a colour scale, or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} column of colours.} -\item{get_source_position}{<\code{\link{accessor}}> The source position geometry column, either a -\code{sfc_POINT} or a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_source_position}{<\code{\link{accessor}}> The feature source positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} -\item{get_target_position}{<\code{\link{accessor}}> The target position geometry column, either a -\code{sfc_POINT} or a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_target_position}{<\code{\link{accessor}}> The feature target positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_source_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of the @@ -175,7 +175,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Arc Layer diff --git a/man/bitmap_layer.Rd b/man/bitmap_layer.Rd index 56ccc9b6..7569aacc 100644 --- a/man/bitmap_layer.Rd +++ b/man/bitmap_layer.Rd @@ -104,8 +104,9 @@ or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} col \item{image}{<\code{string} | \code{array}> The image to display. Either a string interpreted as a URL or Data URL, or an image bitmap.} -\item{bounds}{<\code{bbox}> A \code{\link[sf:st_bbox]{st_bbox}} object with CRS -\href{http://epsg.io/4326}{EPSG:4326}.} +\item{bounds}{<\code{\link[wk:rct]{rct}}/\code{\link[sf:st_bbox]{st_bbox}}/\code{\link{wk-geometry}}> +The bounds of the image to fit x,y coordinates into. +Requires CRS \href{http://epsg.io/4326}{EPSG:4326}.} \item{desaturate}{<\code{number}> The desaturation of the bitmap. Between \code{0} and \code{1}, \code{being} the original colour, \code{1} being greyscale.} @@ -130,7 +131,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Bitmap Layer diff --git a/man/column_layer.Rd b/man/column_layer.Rd index 41a91d34..08728a2d 100644 --- a/man/column_layer.Rd +++ b/man/column_layer.Rd @@ -177,8 +177,8 @@ vertical lines for each vertex of the polygon.} \item{stroked}{<\code{boolean}> If \code{TRUE}, draw an outline around each object.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_fill_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The fill colour of each object. @@ -216,7 +216,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Column Layer diff --git a/man/contour_layer.Rd b/man/contour_layer.Rd index 387d0b84..4f84de45 100644 --- a/man/contour_layer.Rd +++ b/man/contour_layer.Rd @@ -105,8 +105,8 @@ or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} col \item{cell_size}{<\code{number}> The size of each cell in metres.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_weight}{<\code{\link{accessor}} | \code{\link{scale}} | \code{number}> The weight of each object. diff --git a/man/cpu_grid_layer.Rd b/man/cpu_grid_layer.Rd index 7c4d234a..db0ce60b 100644 --- a/man/cpu_grid_layer.Rd +++ b/man/cpu_grid_layer.Rd @@ -199,8 +199,8 @@ function used to determine the elevation of a the grid cell.} \item{coverage}{<\code{number}> Radius multiplier, between 0 - 1. The radius of each disk is calculated by \code{coverage * radius}.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{extruded}{<\code{boolean}> If \code{TRUE}, extrude objects along the z-axis; if \code{FALSE}, all diff --git a/man/geojson_layer.Rd b/man/geojson_layer.Rd index 72c7254c..4fc7d565 100644 --- a/man/geojson_layer.Rd +++ b/man/geojson_layer.Rd @@ -437,7 +437,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ GeoJson Layer diff --git a/man/gpu_grid_layer.Rd b/man/gpu_grid_layer.Rd index e25f63e1..96068ab8 100644 --- a/man/gpu_grid_layer.Rd +++ b/man/gpu_grid_layer.Rd @@ -152,8 +152,8 @@ aggregate data values/weights to calculate a bin's elevation value.} \item{coverage}{<\code{number}> Radius multiplier, between 0 - 1. The radius of each disk is calculated by \code{coverage * radius}.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{extruded}{<\code{boolean}> If \code{TRUE}, extrude objects along the z-axis; if \code{FALSE}, all diff --git a/man/great_circle_layer.Rd b/man/great_circle_layer.Rd index bd154d57..49b1b5af 100644 --- a/man/great_circle_layer.Rd +++ b/man/great_circle_layer.Rd @@ -115,12 +115,12 @@ highlighted object. If a single colour value is supplied, that colour will be us highlight all objects in the layer. Per-object highlighting is achieved with a colour scale, or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} column of colours.} -\item{get_source_position}{<\code{\link{accessor}}> The source position geometry column, either a -\code{sfc_POINT} or a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_source_position}{<\code{\link{accessor}}> The feature source positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} -\item{get_target_position}{<\code{\link{accessor}}> The target position geometry column, either a -\code{sfc_POINT} or a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_target_position}{<\code{\link{accessor}}> The feature target positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_source_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of the @@ -175,7 +175,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Great Circle Layer diff --git a/man/grid_cell_layer.Rd b/man/grid_cell_layer.Rd index 86a8c59e..47ce4f1b 100644 --- a/man/grid_cell_layer.Rd +++ b/man/grid_cell_layer.Rd @@ -178,8 +178,8 @@ vertical lines for each vertex of the polygon.} \item{stroked}{<\code{boolean}> If \code{TRUE}, draw an outline around each object.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_fill_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The fill colour of each object. @@ -219,7 +219,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Grid Cell Layer diff --git a/man/grid_layer.Rd b/man/grid_layer.Rd index 0d3f4092..207139bb 100644 --- a/man/grid_layer.Rd +++ b/man/grid_layer.Rd @@ -170,8 +170,8 @@ aggregate data values/weights to calculate a bin's elevation value.} \item{coverage}{<\code{number}> Radius multiplier, between 0 - 1. The radius of each disk is calculated by \code{coverage * radius}.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{extruded}{<\code{boolean}> If \code{TRUE}, extrude objects along the z-axis; if \code{FALSE}, all diff --git a/man/h3_cluster_layer.Rd b/man/h3_cluster_layer.Rd index 8b4a9e07..0045e343 100644 --- a/man/h3_cluster_layer.Rd +++ b/man/h3_cluster_layer.Rd @@ -187,7 +187,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ H3 Cluster Layer diff --git a/man/h3_hexagon_layer.Rd b/man/h3_hexagon_layer.Rd index 7dd5b2da..2ac1a3af 100644 --- a/man/h3_hexagon_layer.Rd +++ b/man/h3_hexagon_layer.Rd @@ -211,7 +211,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ H3 Hexagon Layer diff --git a/man/heatmap_layer.Rd b/man/heatmap_layer.Rd index 9857be8e..efbec149 100644 --- a/man/heatmap_layer.Rd +++ b/man/heatmap_layer.Rd @@ -109,8 +109,8 @@ highlighted object. If a single colour value is supplied, that colour will be us highlight all objects in the layer. Per-object highlighting is achieved with a colour scale, or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} column of colours.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_weight}{<\code{\link{accessor}} | \code{\link{scale}} | \code{number}> The weight of each object. diff --git a/man/hexagon_layer.Rd b/man/hexagon_layer.Rd index 18a19daf..014d96cc 100644 --- a/man/hexagon_layer.Rd +++ b/man/hexagon_layer.Rd @@ -202,8 +202,8 @@ calculated by \code{coverage * radius}.} \item{extruded}{<\code{boolean}> If \code{TRUE}, extrude objects along the z-axis; if \code{FALSE}, all objects will be flat.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{material}{<\code{boolean}>} diff --git a/man/icon_layer.Rd b/man/icon_layer.Rd index 174e1f7e..aa768c1c 100644 --- a/man/icon_layer.Rd +++ b/man/icon_layer.Rd @@ -143,8 +143,8 @@ faces up (z).} A discarded pixel would create a "hole" in the icon that is not considered part of the object.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_icon}{<\code{\link{accessor}}> The name of the icon for each feature. Icon name must be @@ -182,7 +182,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Icon Layer diff --git a/man/line_layer.Rd b/man/line_layer.Rd index fabfd7dc..b6c9c017 100644 --- a/man/line_layer.Rd +++ b/man/line_layer.Rd @@ -107,12 +107,12 @@ highlighted object. If a single colour value is supplied, that colour will be us highlight all objects in the layer. Per-object highlighting is achieved with a colour scale, or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} column of colours.} -\item{get_source_position}{<\code{\link{accessor}}> The source position geometry column, either a -\code{sfc_POINT} or a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_source_position}{<\code{\link{accessor}}> The feature source positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} -\item{get_target_position}{<\code{\link{accessor}}> The target position geometry column, either a -\code{sfc_POINT} or a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_target_position}{<\code{\link{accessor}}> The feature target positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of each object. @@ -147,7 +147,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Line Layer diff --git a/man/mvt_layer.Rd b/man/mvt_layer.Rd index 370f3bcf..bd925bac 100644 --- a/man/mvt_layer.Rd +++ b/man/mvt_layer.Rd @@ -506,7 +506,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ MVT Layer diff --git a/man/path_layer.Rd b/man/path_layer.Rd index 26c671ed..a8da41d8 100644 --- a/man/path_layer.Rd +++ b/man/path_layer.Rd @@ -131,8 +131,8 @@ Only applicable if \code{rounded == FALSE}.} \item{billboard}{<\code{boolean}> If \code{TRUE}, extrude the path in screen space (width always faces) the camera; if \code{FALSE}, the width always faces up (z).} -\item{get_path}{<\code{\link{accessor}}> The path geometry column, either a \code{sfc_LINESTRING} or -a \code{sfc_MULTILINESTRING} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_path}{<\code{\link{accessor}}> The feature paths. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of each object. @@ -159,7 +159,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Path Layer diff --git a/man/point_cloud_layer.Rd b/man/point_cloud_layer.Rd index d492ee30..dacd85d4 100644 --- a/man/point_cloud_layer.Rd +++ b/man/point_cloud_layer.Rd @@ -109,8 +109,8 @@ or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} col \item{point_size}{<\code{number}> The radius of all points in units specified by \code{size_units}.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_normal}{<\code{\link{accessor}} | \code{numeric}> The normal of each object, in \code{c(nx, ny, nz)}. @@ -138,7 +138,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Point Cloud Layer diff --git a/man/polygon_layer.Rd b/man/polygon_layer.Rd index fa2ec56f..9a5d3327 100644 --- a/man/polygon_layer.Rd +++ b/man/polygon_layer.Rd @@ -150,8 +150,8 @@ vertical lines for each vertex of the polygon.} \item{line_miter_limit}{number} -\item{get_polygon}{<\code{\link{accessor}}> The polygon geometry column, either a \code{sfc_POLYGON} -or a \code{sfc_MULTIPOLYGON} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_polygon}{<\code{\link{accessor}}> The feature polygons. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_fill_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The fill colour of each object. @@ -189,7 +189,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Polygon Layer diff --git a/man/quadkey_layer.Rd b/man/quadkey_layer.Rd index 1742eebf..f1aad52e 100644 --- a/man/quadkey_layer.Rd +++ b/man/quadkey_layer.Rd @@ -152,8 +152,8 @@ vertical lines for each vertex of the polygon.} \item{line_miter_limit}{number} -\item{get_polygon}{<\code{\link{accessor}}> The polygon geometry column, either a \code{sfc_POLYGON} -or a \code{sfc_MULTIPOLYGON} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_polygon}{<\code{\link{accessor}}> The feature polygons. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_fill_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The fill colour of each object. @@ -193,7 +193,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Quadkey Layer diff --git a/man/rdeck.Rd b/man/rdeck.Rd index 8d14664c..60364e69 100644 --- a/man/rdeck.Rd +++ b/man/rdeck.Rd @@ -29,8 +29,10 @@ See \url{https://docs.mapbox.com/api/maps/#mapbox-styles}} \item{theme}{<\code{"kepler"} | \code{"light"}> The widget theme which alters the style of the legend and tooltips.} -\item{initial_bounds}{<\code{\link[sf:st_bbox]{st_bbox}} | \code{\link[sf:sf]{sf}} | \code{\link[sf:sfc]{sfc}}> -The initial bounds of the map; overwrites \code{initial_view_state}.} +\item{initial_bounds}{<\code{\link[wk:rct]{rct}}/\code{\link[sf:st_bbox]{st_bbox}}/\code{\link{wk-geometry}}> +Sets the initial bounds of the map if not \code{NULL}. Takes priority over \code{initial_view_state}. +Accepts a bounding box, or a geometry from which a bounding box can be computed. Requires +CRS \href{http://epsg.io/4326}{EPSG:4326}.} \item{initial_view_state}{<\code{\link{view_state}}> Defines the map position, zoom, bearing and pitch.} diff --git a/man/rdeck_proxy.Rd b/man/rdeck_proxy.Rd index 11be2689..44622c82 100644 --- a/man/rdeck_proxy.Rd +++ b/man/rdeck_proxy.Rd @@ -32,8 +32,10 @@ See \url{https://docs.mapbox.com/api/maps/#mapbox-styles}} \item{theme}{<\code{"kepler"} | \code{"light"}> The widget theme which alters the style of the legend and tooltips.} -\item{initial_bounds}{<\code{\link[sf:st_bbox]{st_bbox}} | \code{\link[sf:sf]{sf}} | \code{\link[sf:sfc]{sfc}}> -The initial bounds of the map; overwrites \code{initial_view_state}.} +\item{initial_bounds}{<\code{\link[wk:rct]{rct}}/\code{\link[sf:st_bbox]{st_bbox}}/\code{\link{wk-geometry}}> +Sets the initial bounds of the map if not \code{NULL}. Takes priority over \code{initial_view_state}. +Accepts a bounding box, or a geometry from which a bounding box can be computed. Requires +CRS \href{http://epsg.io/4326}{EPSG:4326}.} \item{initial_view_state}{<\code{\link{view_state}}> Defines the map position, zoom, bearing and pitch.} diff --git a/man/s2_layer.Rd b/man/s2_layer.Rd index 103cb085..bdd05381 100644 --- a/man/s2_layer.Rd +++ b/man/s2_layer.Rd @@ -188,7 +188,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ S2 Layer diff --git a/man/scatterplot_layer.Rd b/man/scatterplot_layer.Rd index 36a09ec7..d157f719 100644 --- a/man/scatterplot_layer.Rd +++ b/man/scatterplot_layer.Rd @@ -151,8 +151,8 @@ if \code{FALSE} circles face up (z).} \item{antialiasing}{<\code{boolean}> If \code{TRUE}, circles are rendered with smoothed edges.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_radius}{<\code{\link{accessor}} | \code{\link{scale}} | \code{number}> The radius of each point, in units @@ -188,7 +188,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Scatterplot Layer diff --git a/man/scenegraph_layer.Rd b/man/scenegraph_layer.Rd index bda312d2..dd81e64d 100644 --- a/man/scenegraph_layer.Rd +++ b/man/scenegraph_layer.Rd @@ -127,8 +127,8 @@ or a \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} col \item{size_max_pixels}{<\code{number}> The maximum size in pixels.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of each object. @@ -158,7 +158,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Scenegraph Layer diff --git a/man/screen_grid_layer.Rd b/man/screen_grid_layer.Rd index 72a32ab0..e3813849 100644 --- a/man/screen_grid_layer.Rd +++ b/man/screen_grid_layer.Rd @@ -116,8 +116,8 @@ of aggregated weights in each bin.} \code{color_domain} is divided into \code{length(color_range)} equal segments, each mapped to one color in \code{color_range}.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_weight}{<\code{\link{accessor}} | \code{\link{scale}} | \code{number}> The weight of each object. diff --git a/man/simple_mesh_layer.Rd b/man/simple_mesh_layer.Rd index 3ab4c67d..3c2a9eac 100644 --- a/man/simple_mesh_layer.Rd +++ b/man/simple_mesh_layer.Rd @@ -125,8 +125,8 @@ vertical lines for each vertex of the polygon.} \item{material}{<\code{boolean}>} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of each object. @@ -156,7 +156,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Simple Mesh Layer diff --git a/man/solid_polygon_layer.Rd b/man/solid_polygon_layer.Rd index 141264b4..72537087 100644 --- a/man/solid_polygon_layer.Rd +++ b/man/solid_polygon_layer.Rd @@ -120,8 +120,8 @@ vertical lines for each vertex of the polygon.} \item{elevation_scale}{<\code{number}> The elevation multiplier.} -\item{get_polygon}{<\code{\link{accessor}}> The polygon geometry column, either a \code{sfc_POLYGON} -or a \code{sfc_MULTIPOLYGON} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_polygon}{<\code{\link{accessor}}> The feature polygons. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_elevation}{<\code{\link{accessor}} | \code{\link{scale}} | \code{number}> The elevation to extrude each @@ -154,7 +154,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Solid Polygon Layer diff --git a/man/terrain_layer.Rd b/man/terrain_layer.Rd index 5ac2ddd3..8792bd29 100644 --- a/man/terrain_layer.Rd +++ b/man/terrain_layer.Rd @@ -165,8 +165,10 @@ supplied no throttling occurs (HTTP/2 only).} \item{mesh_max_error}{number} -\item{bounds}{<\code{bbox}> A \code{\link[sf:st_bbox]{st_bbox}} object with CRS -\href{http://epsg.io/4326}{EPSG:4326}. Must be supplied when using non-tiled elevation data.} +\item{bounds}{<\code{\link[wk:rct]{rct}}/\code{\link[sf:st_bbox]{st_bbox}}/\code{\link{wk-geometry}}> +The bounds of the image to fit x,y coordinates into. +Requires CRS \href{http://epsg.io/4326}{EPSG:4326}. +Must be supplied when using non-tiled elevation data.} \item{color}{color} @@ -195,7 +197,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Terrain Layer diff --git a/man/text_layer.Rd b/man/text_layer.Rd index 5e66ed4e..2db3ed69 100644 --- a/man/text_layer.Rd +++ b/man/text_layer.Rd @@ -198,8 +198,8 @@ the width limit to break the text into multiple lines.} \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval} character column of labels.} -\item{get_position}{<\code{\link{accessor}}> The position geometry column, either a \code{sfc_POINT} or -a \code{sfc_MULTIPOINT} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_position}{<\code{\link{accessor}}> The feature positions. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of each object. @@ -242,7 +242,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Text Layer diff --git a/man/tile_3d_layer.Rd b/man/tile_3d_layer.Rd index 2862547e..68dca0cd 100644 --- a/man/tile_3d_layer.Rd +++ b/man/tile_3d_layer.Rd @@ -123,7 +123,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} } \description{ Tile 3D Layer diff --git a/man/tile_layer.Rd b/man/tile_layer.Rd index 98da5e55..51958056 100644 --- a/man/tile_layer.Rd +++ b/man/tile_layer.Rd @@ -165,7 +165,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} \item{desaturate}{<\code{number}> The desaturation of the bitmap. Between \code{0} and \code{1}, \code{being} the original colour, \code{1} being greyscale.} diff --git a/man/trips_layer.Rd b/man/trips_layer.Rd index 3362e86b..7771b489 100644 --- a/man/trips_layer.Rd +++ b/man/trips_layer.Rd @@ -141,8 +141,8 @@ Only applicable if \code{rounded == FALSE}.} \item{billboard}{<\code{boolean}> If \code{TRUE}, extrude the path in screen space (width always faces) the camera; if \code{FALSE}, the width always faces up (z).} -\item{get_path}{<\code{\link{accessor}}> The path geometry column, either a \code{sfc_LINESTRING} or -a \code{sfc_MULTILINESTRING} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. +\item{get_path}{<\code{\link{accessor}}> The feature paths. A +\verb{} \link{wk-geometry} column with CRS \href{http://epsg.io/4326}{EPSG:4326}. Supports \href{https://dplyr.tidyverse.org/articles/programming.html}{tidy-eval}.} \item{get_color}{<\code{\link{accessor}} | \code{\link{scale}} | \code{\link{color}}> The colour of each object. @@ -180,7 +180,7 @@ dot density on light maps. \item{tooltip}{<\code{\link{tooltip}}> Defines the columns (and their order) that will be displayed in the layer tooltip, if \code{pickable == TRUE}. Supports \href{https://dplyr.tidyverse.org/reference/dplyr_tidy_select.html}{tidy-select} if a -\code{data} is a \code{data.frame}. \code{sfc} columns are always removed.} +\code{data} is a \code{data.frame}. Geometry columns are always removed.} \item{loop_length}{<\code{number}> The number of seconds to complete an animation loop.} diff --git a/man/wk-geometry.Rd b/man/wk-geometry.Rd new file mode 100644 index 00000000..f1672968 --- /dev/null +++ b/man/wk-geometry.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/doc-proptypes.R +\name{wk-geometry} +\alias{wk-geometry} +\title{Prop Type: WK Geometry} +\description{ +Geometry vectors are parsed with \code{\link[wk:wk_handle]{wk::wk_handle()}}. All geometry formats +that \{wk\} supports directly are available to use in {rdeck} layers. You may +also use geometry formats which \{wk\} doesn't directly support, provided a +\emph{loaded} package defines a \{wk\} \emph{reader} (i.e. \code{\link[wk:wk_handle]{wk::wk_handle()}} S3 method) +for the geometry type. + +Geometry formats supported by \{wk\} (always supported): +\itemize{ +\item \code{\link[wk:wkb]{wk::wkb()}} +\item \code{\link[wk:wkt]{wk::wkt()}} +\item \code{\link[wk:xy]{wk::xy()}} (\code{m} dimension is always ignored) +\item \code{\link[wk:crc]{wk::crc()}} +\item \code{\link[wk:grd]{wk::grd()}} +\item \code{\link[wk:rct]{wk::rct()}} +\item \code{\link[sf:sfc]{sf::st_sfc()}} +} + +Geometry formats supported by other packages (not dependencies of \{rdeck\}): +\itemize{ +\item \code{\link[s2:as_s2_geography]{s2::s2_geography()}} +\item \code{\link[geos:as_geos_geometry]{geos::geos_geometry()}} +\item Others? +} +} +\keyword{internal} diff --git a/scripts/generate-layers.js b/scripts/generate-layers.js index 548cdd08..b16aaecb 100644 --- a/scripts/generate-layers.js +++ b/scripts/generate-layers.js @@ -88,6 +88,7 @@ function transformProps({ props }) { .map((p) => { if (p.type === "accessor") return `${p.name} = accessor(${p.name}, data)`; if (p.name === "tooltip") return `${p.name} = tooltip(${p.name}, data)`; + if (p.name === "bounds") return `${p.name} = if (!is.null(bounds)) wk::wk_bbox(bounds)`; // default return `${p.name} = ${p.name}`;