From 1dfb182044607398b11066125ab742cb3925b0c7 Mon Sep 17 00:00:00 2001 From: SymbolixAU Date: Wed, 15 Aug 2018 08:38:16 +1000 Subject: [PATCH] patches for #29 and #27 --- .Rbuildignore | 1 + DESCRIPTION | 2 +- R/map_layer_arc.R | 2 +- R/map_layer_geojson.R | 2 +- R/map_layer_grid.R | 2 +- R/map_layer_line.R | 2 +- R/map_layer_path.R | 2 +- R/map_layer_pointcloud.R | 2 +- R/map_layer_polygon.R | 2 +- R/map_layer_scatterplot.R | 2 +- R/map_layer_screengrid.R | 2 +- R/map_layer_text.R | 2 +- R/map_styles.R | 2 +- R/mapdeck_package.R | 2 +- cran-comments.md | 3 ++- inst/htmlwidgets/mapdeck.js | 4 ++-- man/add_arc.Rd | 2 +- man/add_geojson.Rd | 2 +- man/add_grid.Rd | 2 +- man/add_line.Rd | 2 +- man/add_path.Rd | 2 +- man/add_pointcloud.Rd | 2 +- man/add_polygon.Rd | 2 +- man/add_scatterplot.Rd | 2 +- man/add_screengrid.Rd | 2 +- man/add_text.Rd | 2 +- man/mapdeck_style.Rd | 2 +- man/pipe.Rd | 2 +- 28 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index a232b4a9..e112af4d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,4 @@ ^\.travis\.yml$ ^codecov\.yml$ ^cran-comments\.md$ +^javascript$ diff --git a/DESCRIPTION b/DESCRIPTION index 8ec41a6c..0fc90945 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: mapdeck Type: Package Title: Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl' -Version: 0.1.1 +Version: 0.1.0 Date: 2018-08-11 Authors@R: c( person("David", "Cooley", ,"dcooley@symbolix.com.au", role = c("aut", "cre")) diff --git a/R/map_layer_arc.R b/R/map_layer_arc.R index 74d201ae..229edfd0 100644 --- a/R/map_layer_arc.R +++ b/R/map_layer_arc.R @@ -36,7 +36,7 @@ mapdeckArcDependency <- function() { #' @param palette a function which generates hex colours #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_layer_geojson.R b/R/map_layer_geojson.R index b23b2b7b..e55abd85 100644 --- a/R/map_layer_geojson.R +++ b/R/map_layer_geojson.R @@ -42,7 +42,7 @@ mapdeckGeojsonDependency <- function() { #' #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_layer_grid.R b/R/map_layer_grid.R index 078bf173..f1a0d448 100644 --- a/R/map_layer_grid.R +++ b/R/map_layer_grid.R @@ -25,7 +25,7 @@ mapdeckGridDependency <- function() { #' @param elevation_scale cell elevation multiplier #' #' @examples -#' \dontrun{ +#' \donttest{ #' ## You need a valid access token from Mapbox #' key <- 'abc' #' diff --git a/R/map_layer_line.R b/R/map_layer_line.R index b1ae1c22..59615cc6 100644 --- a/R/map_layer_line.R +++ b/R/map_layer_line.R @@ -21,7 +21,7 @@ mapdeckLineDependency <- function() { #' @param stroke_colour variable or hex colour to use as the ending stroke colour #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_layer_path.R b/R/map_layer_path.R index 739ba5b8..558defa9 100644 --- a/R/map_layer_path.R +++ b/R/map_layer_path.R @@ -22,7 +22,7 @@ mapdeckPathDependency <- function() { #' between 1 and 255 to be applied to all the shapes #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_layer_pointcloud.R b/R/map_layer_pointcloud.R index 4cd4e54d..25c756d8 100644 --- a/R/map_layer_pointcloud.R +++ b/R/map_layer_pointcloud.R @@ -23,7 +23,7 @@ mapdeckPointcloudDependency <- function() { #' @param light_settings list of light setting parameters. See \link{light_settings} #' #' @examples -#' \dontrun{ +#' \donttest{ #' ## You need a valid access token from Mapbox #' key <- 'abc' #' diff --git a/R/map_layer_polygon.R b/R/map_layer_polygon.R index 294760e2..7c321259 100644 --- a/R/map_layer_polygon.R +++ b/R/map_layer_polygon.R @@ -28,7 +28,7 @@ mapdeckPolygonDependency <- function() { #' @param tooltip variable of \code{data} containing text or HTML to render as a tooltip #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_layer_scatterplot.R b/R/map_layer_scatterplot.R index 68f50c34..8ea170a3 100644 --- a/R/map_layer_scatterplot.R +++ b/R/map_layer_scatterplot.R @@ -22,7 +22,7 @@ mapdeckScatterplotDependency <- function() { #' #' @examples #' -#'\dontrun{ +#' \donttest{ #' ## You need a valid access token from Mapbox #' key <- 'abc' #' diff --git a/R/map_layer_screengrid.R b/R/map_layer_screengrid.R index 3393ded6..da66c949 100644 --- a/R/map_layer_screengrid.R +++ b/R/map_layer_screengrid.R @@ -24,7 +24,7 @@ mapdeckScreengridDependency <- function() { #' @param cell_size size of grid squares in pixels #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_layer_text.R b/R/map_layer_text.R index 5fef802f..0e142b22 100644 --- a/R/map_layer_text.R +++ b/R/map_layer_text.R @@ -27,7 +27,7 @@ mapdeckTextDependency <- function() { #' #' @examples #' -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/map_styles.R b/R/map_styles.R index 9b100476..74c072b5 100644 --- a/R/map_styles.R +++ b/R/map_styles.R @@ -5,7 +5,7 @@ #' @param style one of streets, outdoors, light, dark, satellite, satellite-streets #' #' @examples -#' \dontrun{ +#' \donttest{ #' #' ## You need a valid access token from Mapbox #' key <- 'abc' diff --git a/R/mapdeck_package.R b/R/mapdeck_package.R index bac231b8..4aec1c7f 100644 --- a/R/mapdeck_package.R +++ b/R/mapdeck_package.R @@ -9,7 +9,7 @@ #' @export #' @param lhs,rhs A google map and a layer to add to it #' @examples -#' \dontrun{ +#' \donttest{ #' #' key <- "your_api_key" #' mapdeck_map(key = key) %>% diff --git a/cran-comments.md b/cran-comments.md index a806801d..e1a3d442 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,8 @@ ## Comments +* Updated all examples from `\dontrun` to `\donttest` * Updated description with details about Mapbox GL and Deck gl -* All examples are `dontrun` because they all require internet connection +* All examples are `donttest` because they all require internet connection ## Test environments diff --git a/inst/htmlwidgets/mapdeck.js b/inst/htmlwidgets/mapdeck.js index d21ef807..6caafcdb 100644 --- a/inst/htmlwidgets/mapdeck.js +++ b/inst/htmlwidgets/mapdeck.js @@ -10,8 +10,8 @@ HTMLWidgets.widget({ renderValue: function(x) { - window.params = []; - window.params.push({ 'map_id' : el.id }); + //window.params = []; + //window.params.push({ 'map_id' : el.id }); window[el.id + 'layers'] = []; // keep track of layers for overlaying multiple // needs to be an array because .props takes an array of layers diff --git a/man/add_arc.Rd b/man/add_arc.Rd index 6ffa2ada..5fcfc310 100644 --- a/man/add_arc.Rd +++ b/man/add_arc.Rd @@ -55,7 +55,7 @@ Therefore, if the origin is a MULTIPOINT of two points, and the destination is a single POINT, the code will error as there will be an uneven number of rows } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_geojson.Rd b/man/add_geojson.Rd index 13fdf7c4..3fae942f 100644 --- a/man/add_geojson.Rd +++ b/man/add_geojson.Rd @@ -48,7 +48,7 @@ Otherwise the values supplied to the arguments will be applied to all the featur } } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_grid.Rd b/man/add_grid.Rd index ee211187..8ca53691 100644 --- a/man/add_grid.Rd +++ b/man/add_grid.Rd @@ -40,7 +40,7 @@ It takes the constant size all each cell, projects points into cells. The color and height of the cell is scaled by number of points it contains. } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_line.Rd b/man/add_line.Rd index 10693453..0400ecb2 100644 --- a/man/add_line.Rd +++ b/man/add_line.Rd @@ -49,7 +49,7 @@ Therefore, if the origin is a MULTIPOINT of two points, and the destination is a single POINT, the code will error as there will be an uneven number of rows } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_path.Rd b/man/add_path.Rd index 335d5cea..860a7f7e 100644 --- a/man/add_path.Rd +++ b/man/add_path.Rd @@ -38,7 +38,7 @@ The Path Layer takes in lists of coordinate points and renders them as extruded lines with mitering. } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_pointcloud.Rd b/man/add_pointcloud.Rd index b04ea19f..20c9d0c2 100644 --- a/man/add_pointcloud.Rd +++ b/man/add_pointcloud.Rd @@ -47,7 +47,7 @@ The Pointcloud Layer takes in coordinate points and renders them as circles with a certain radius. } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_polygon.Rd b/man/add_polygon.Rd index f58235f8..34334fdc 100644 --- a/man/add_polygon.Rd +++ b/man/add_polygon.Rd @@ -45,7 +45,7 @@ should be used for the latitude / longitude coordinates.} The Polygon Layer renders filled and/or stroked polygons. } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_scatterplot.Rd b/man/add_scatterplot.Rd index d517546e..387614a8 100644 --- a/man/add_scatterplot.Rd +++ b/man/add_scatterplot.Rd @@ -42,7 +42,7 @@ with a certain radius. } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_screengrid.Rd b/man/add_screengrid.Rd index 2a5280b6..2344a279 100644 --- a/man/add_screengrid.Rd +++ b/man/add_screengrid.Rd @@ -38,7 +38,7 @@ The Screen Grid Layer takes in an array of latitude and longitude coordinated po aggregates them into histogram bins and renders as a grid } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/add_text.Rd b/man/add_text.Rd index 48714d78..364c6eb0 100644 --- a/man/add_text.Rd +++ b/man/add_text.Rd @@ -54,7 +54,7 @@ with a certain radius. } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/mapdeck_style.Rd b/man/mapdeck_style.Rd index c9fde31c..342c1aff 100644 --- a/man/mapdeck_style.Rd +++ b/man/mapdeck_style.Rd @@ -14,7 +14,7 @@ mapdeck_style(style = c("dark", "light", "outdoors", "streets", "satellite", Various styles available to all Mapbox accounts using a valid access token } \examples{ -\dontrun{ +\donttest{ ## You need a valid access token from Mapbox key <- 'abc' diff --git a/man/pipe.Rd b/man/pipe.Rd index 13bf0f97..ab1cbd45 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -11,7 +11,7 @@ Uses the pipe operator (\code{\%>\%}) to chain statements. Useful for adding layers to a \code{google_map} } \examples{ -\dontrun{ +\donttest{ key <- "your_api_key" mapdeck_map(key = key) \%>\%