Skip to content

Commit

Permalink
update all ggplot 'size' pars -> 'linewidth'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jan 19, 2024
1 parent 3d73b83 commit 9bbf8ef
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: osmplotr
Title: Bespoke Images of 'OpenStreetMap' Data
Version: 0.3.4.005
Version: 0.3.4.006
Authors@R:
c(person(given = "Mark",
family = "Padgham",
Expand Down
8 changes: 4 additions & 4 deletions R/add-colourbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ add_colourbar <- function (map, barwidth = 0.02, barlength = 0.7, zlims, cols,

# ---------- LAYER#1: semi-transparent underlay
cbu <- colourbar_underlay (cbxy, vertical, expand)
aes <- ggplot2::aes (x = x, y = y, size = 0)
aes <- ggplot2::aes (x = x, y = y, linewidth = 0)
pcol <- rgb (1, 1, 1, alpha)
# geom_path has rounded corners, geom_poly does not, and size = 5 *should*
# ensure it covers the inside of most bars
# geom_path has rounded corners, geom_poly does not, and linewidth = 5
# *should* ensure it covers the inside of most bars
map <- map + ggplot2::geom_path (
data = cbu$rdat, mapping = aes,
inherit.aes = FALSE,
colour = pcol, size = 5
colour = pcol, linewidth = 5
)

# ---------- LAYER#2: colourbar
Expand Down
10 changes: 5 additions & 5 deletions R/add-osm-groups.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#' @param boundary (negative, 0, positive) values define whether the boundary of
#' groups should (exclude, bisect, include) objects which straddle the precise
#' boundary. (Has no effect if \code{bg} is given).
#' @param size Size argument passed to \code{ggplot2} (polygon, path, point)
#' functions: determines width of lines for (polygon, line), and sizes of
#' @param size Linewidth argument passed to \code{ggplot2} (polygon, path,
#' point) functions: determines width of lines for (polygon, line), and sizes of
#' points. Respective defaults are (0, 0.5, 0.5).
#' @param shape Shape of points or lines (the latter passed as \code{linetype});
#' see \code{\link[ggplot2]{shape}}.
Expand Down Expand Up @@ -820,7 +820,7 @@ map_plus_spPolydf_grps <- function (map, xy, aes, cols, size) { # nolint
data = xy,
mapping = aes,
fill = cols [xy$col],
size = size
linewidth = size
)
}

Expand All @@ -845,7 +845,7 @@ map_plus_spLinedf_grps <- function (map, xyflat, aes, cols, size, shape) { # nol
data = xyflat,
mapping = aes,
colour = cols [xyflat$col],
size = size,
linewidth = size,
linetype = shape
)
}
Expand Down Expand Up @@ -891,7 +891,7 @@ map_plus_hulls <- function (map, border_width = 1, groups, xyflat, cols) {
mapping = aes,
colour = cols [bdry$id],
fill = "transparent",
size = border_width
linewidth = border_width
)

return (map)
Expand Down
10 changes: 5 additions & 5 deletions R/add-osm-objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#' @param col Colour of lines or points; fill colour of polygons.
#' @param border Border colour of polygons.
#' @param hcol (Multipolygons only) Vector of fill colours for holes
#' @param size Size argument passed to \code{ggplot2} (polygon, path, point)
#' functions: determines width of lines for (polygon, line), and sizes of
#' @param size Linewidth argument passed to \code{ggplot2} (polygon, path,
#' point) functions: determines width of lines for (polygon, line), and sizes of
#' points. Respective defaults are (0, 0.5, 0.5).
#' @param shape Shape of points or lines (the latter passed as \code{linetype});
#' see \code{\link[ggplot2]{shape}}.
Expand Down Expand Up @@ -109,7 +109,7 @@ add_osm_objects <- function (map, obj, col = "gray40", border = NA, hcol,
ggplot2::geom_polygon (
ggplot2::aes (group = id),
data = xy1,
size = size,
linewidth = size,
fill = col,
colour = border
)
Expand Down Expand Up @@ -143,7 +143,7 @@ add_osm_objects <- function (map, obj, col = "gray40", border = NA, hcol,
ggplot2::geom_polygon (
ggplot2::aes (group = id),
data = xy,
size = size,
linewidth = size,
fill = col,
colour = border
)
Expand All @@ -156,7 +156,7 @@ add_osm_objects <- function (map, obj, col = "gray40", border = NA, hcol,
data = xy,
ggplot2::aes (x = lon, y = lat),
colour = col,
size = size,
linewidth = size,
linetype = shape
)
} else if (grepl ("point", obj_type)) {
Expand Down
2 changes: 1 addition & 1 deletion R/osm-basemap.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ osm_basemap <- function (bbox, structures, bg = "gray20") {
set_map_theme <- function (bg) {

theme <- ggplot2::theme_minimal ()
theme$panel.background <- ggplot2::element_rect (fill = bg, size = 0) # nolint
theme$panel.background <- ggplot2::element_rect (fill = bg, linewidth = 0) # nolint
theme$line <- ggplot2::element_blank ()
theme$axis.text <- ggplot2::element_blank () # nolint
theme$axis.title <- ggplot2::element_blank () # nolint
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci/osmplotr",
"issueTracker": "https://github.com/ropensci/osmplotr/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.3.4.005",
"version": "0.3.4.006",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down

0 comments on commit 9bbf8ef

Please sign in to comment.