Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -29,15 +30,14 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -47,3 +47,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
11 changes: 5 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -22,13 +23,11 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -41,7 +40,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
clean: false
branch: gh-pages
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

Expand All @@ -17,11 +16,9 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -35,14 +32,16 @@ jobs:
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -55,7 +54,7 @@ jobs:

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tmap
Title: Thematic Maps
Version: 4.4-1
Version: 4.4-1.9000
Authors@R: c(
person("Martijn", "Tennekes", , "mtennekes@gmail.com", role = c("aut", "cre")),
person("Jakub", "Nowosad", , "nowosad.jakub@gmail.com", role = "ctb"),
Expand Down
38 changes: 21 additions & 17 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
# tmap (development version)

- fixed partial matching.

# tmap 4.4-1

- Documentation-only release: more informative and de-duplicated man-page titles, and terminology harmonized across the documentation for consistency with upcoming publications.

# tmap 4.4

- [!] added tm_circles (circles with fixed unit-based radii)
- [!] added blend argument to all layers
- [!] added hitbox to tm_lines and tm_symbols for view mode (so hovering and clicking also works well for small objects)
- [!] added `tm_circles()` (circles with fixed unit-based radii)
- [!] added `blend` argument to all layers
- [!] added `hitbox` to `tm_lines()` and `tm_symbols()` for view mode (so hovering and clicking also works well for small objects)
- added `tmap_mode_pool()` to restrict which modes are cycled by `ttm()` and `rtm()`, e.g. `library(tmap.mapgl); tmap_mode_pool(c("plot", "maplibre"))`
- shiny dispatch methods added (to allow integration for other modes)
- added support for terra's PackedSpatX objects
- added support for stars_proxy when changed after evaluation
- tm_crs() can take bbox and tmaptools::bb arguments
- added height to tmap_arrange (for interactive modes)
- added support for `stars_proxy` when changed after evaluation
- `tm_crs()` can take `bbox` and `tmaptools::bb` arguments
- added height to `tmap_arrange()` (for interactive modes)
- fixed date/time formatting of facet labels
- bug fixes (most importantly regarding >=1000 polygons in view mode)


# tmap 4.3

- [!] support for PMTiles via new and experimental package tmap.sources
- [!] tm_text: halo, shadow and background rectangles implemented in plot and view mode
- [!] tm_scalebar: improved measurement (using ellipsoidal distance rather than Eucledian distances in projected crs)
- [!] `tm_text()`: halo, shadow and background rectangles implemented in plot and view mode
- [!] `tm_scalebar()`: improved measurement (using ellipsoidal distance rather than Eucledian distances in projected crs)
- crs handling improved: local crs accepted
- tmap_save can also save in other modes (e.g. from tmap.mapgl)
- `tmap_save()` can also save in other modes (e.g. from tmap.mapgl)
- fixed many view-mode/shiny related bugs

# tmap 4.2

- [!] improved legend (labeling #1174 and continuous-style intervals #1175)
- [!] added tm_insets: inset maps, ggplot2 plots etc. excepted
- [!] added tm_minimap for plot mode
- [!] added `tm_insets()`: inset maps, ggplot2 plots etc. excepted
- [!] added `tm_minimap()` for plot mode
- improved animations (#1160)
- tmap_overview added, which provides an overview of all map elements (layers and components)
- tm_layout arguments limited to the useful ones
- tm_components (was tm_comp_group) improved: now also applicable to map component functions
- bbox added to tm_crs. Special value is "FULL" which refers to the whole earth
- `tmap_overview()` added, which provides an overview of all map elements (layers and components)
- `tm_layout()` arguments limited to the useful ones
- `tm_components()` (was tm_comp_group) improved: now also applicable to map component functions
- `bbox` added to `tm_crs()`. Special value is "FULL" which refers to the whole earth

# tmap 4.1

This fixes a few regressions in the tmap v4 release and adds improvements.

- [!] basemaps in plot mode much sharper, added `tmap_providers()` (#1041, #1042)
- [!] tm_comp_group() added to specify grouped components (incl legends)
- [!] added tm_animate() (main use case: cartograms)
- [!] `tm_comp_group()` added to specify grouped components (incl legends)
- [!] added `tm_animate()` (main use case: cartograms)
- for the background and frame we introduce: `bg`/`bg.color` and `frame`/`frame.color`
- `tm_remove_layer()` works again in Shiny (#1044)
- `tm_logo()` works again in view mode (#1038).
Expand Down
12 changes: 6 additions & 6 deletions R/tm_component_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ tm_credits = function(text, size, color, padding, fontface, fontfamily, alpha, s
#' Map component that adds a compass
#'
#' @param north north
#' @param type compass type, one of: \code{"arrow"}, \code{"4star"}, \code{"8star"}, \code{"radar"}, \code{"rose"}. The default is controlled by \code{\link{tm_layout}} (which uses \code{"arrow"} for the default style)
#' @param text.size text.size
#' @param type compass type, one of: `"arrow"`, `"4star"`, `"8star"`, `"radar"`, `"rose"`. The default is controlled by [tm_layout()] (which uses `"arrow"` for the default style)
#' @param text.size Text size
#' @param size size
#' @param show.labels show.labels
#' @param show.labels Show labels
#' @param cardinal.directions cardinal.directions
#' @param text.color text.color
#' @param text.color Text color
#' @param color.dark color.dark
#' @param color.light color.light
#' @param lwd lwd
Expand Down Expand Up @@ -228,10 +228,10 @@ tm_mouse_coordinates <- function(stack,
#'
#' Map component that adds a [minimap][leaflet::addMiniMap()] in view mode.
#'
#' @param server name of the provider or an URL (see \code{\link{tm_tiles}}).
#' @param server name of the provider or an URL (see [tm_tiles()]).
#' By default, it shows the same map as the basemap, and moreover, it will automatically change when the user switches basemaps.
#' Note the latter does not happen when `server` is specified.
#' @param toggle should the minimap have a button to minimise it? By default \code{TRUE}.
#' @param toggle should the minimap have a button to minimise it? By default `TRUE`.
#' @inheritParams tm_title
#' @inheritParams tm_inset
#' @inheritDotParams leaflet::addMiniMap
Expand Down
4 changes: 2 additions & 2 deletions R/tm_layers_symbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#' \enumerate{
#' \item{A numeric value that specifies the plotting character of the symbol. See parameter \code{pch} of \code{\link[graphics:points]{points}} and the last example to create a plot with all options. Note that this is not supported for the \code{"view" mode.}}
#' \item{A \code{\link[grid:grid.grob]{grob}} object, which can be a ggplot2 plot object created with \code{\link[ggplot2:ggplotGrob]{ggplotGrob}}. To specify multiple shapes, a list of grob objects is required. Tip: for proportional symbols, such as donuts or pies, see the extension package `r .doc_see_vig("ext_glyphs")`.}
#' \item{An icon specification, which can be created with \code{\link{tmap_icons}}.}
#' \item{An icon specification, which can be created with [tmap_icons()]}.
#' }
#' To specify multiple shapes (needed for the \code{shapes} argument), a vector or list of these shape specification is required. The shape specification options can also be mixed. For the \code{shapes} argument, it is possible to use a named vector or list, where the names correspond to the value of the variable specified by the \code{shape} argument.
#' To specify multiple shapes (needed for the `shapes` argument), a vector or list of these shape specification is required. The shape specification options can also be mixed. For the \code{shapes} argument, it is possible to use a named vector or list, where the names correspond to the value of the variable specified by the \code{shape} argument.
#' For small multiples, a list of these shape specification(s) should be provided.
#'
#' @param fill,fill.scale,fill.legend,fill.chart,fill.free `r .doc_vv("fill")` `r .doc_unit("fill")`
Expand Down
4 changes: 2 additions & 2 deletions R/tmapGridComp.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gridCell = function(rows, cols, e) {

process_comp_box = function(comp, sc, o) {
comp = within(comp, {
if ("frame.color" %in% comp$called) {
if ("frame.color" %in% comp$called_via_comp_group) {
frame = TRUE
frame.lwd = frame.lwd * sc
} else {
Expand Down Expand Up @@ -286,7 +286,7 @@ tmapGetCompGroupArgs = function(comp) {
if (any(frms) && (any(!frms))) grp$frame = any_legend_chart_inset
}
if (!("bg" %in%grp_called)) grp$bg = any_legend_chart_inset
grp$called = comp[[1]]$called
grp$called = comp[[1]]$called_via_comp_group
grp
}

Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ knitr::knit_hooks$set(output = function(x, options) {

<!-- badges: start -->
[![R-CMD-check](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/r-tmap/tmap/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-tmap/tmap?branch=master)
[![Codecov test coverage](https://codecov.io/gh/r-tmap/tmap/graph/badge.svg)](https://app.codecov.io/gh/r-tmap/tmap)
[![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap)
[![CRAN checks](https://badges.cranchecks.info/worst/tmap.svg)](https://cran.r-project.org/web/checks/check_results_tmap.html)
[![Downloads](https://cranlogs.r-pkg.org/badges/tmap?color=brightgreen)](https://www.r-pkg.org:443/pkg/tmap)
Expand Down Expand Up @@ -80,7 +80,7 @@ tmap depend on other R packages, which will automatically be installed along. Ho

Instructions for the libraries GEOS, GDAL and PROJ (required by **sf**): see the installation instructions of **terra** which requires the same libraries: [MacOS](https://rspatial.github.io/terra/index.html?q=installation#macos) and [Linux](https://rspatial.github.io/terra/index.html?q=installation#linux)

Instructions for the libraries Abseil and OpenSS (required by **s2**): see the [installation instructions](https://r-spatial.github.io/s2/#installation).
Instructions for the libraries Abseil and OpenSSL (required by **s2**): see the [installation instructions](https://r-spatial.github.io/s2/#installation).

## Getting started

Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[![R-CMD-check](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-tmap/tmap/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/r-tmap/tmap/branch/master/graph/badge.svg)](https://app.codecov.io/gh/r-tmap/tmap?branch=master)
coverage](https://codecov.io/gh/r-tmap/tmap/graph/badge.svg)](https://app.codecov.io/gh/r-tmap/tmap)
[![CRAN](https://www.r-pkg.org/badges/version/tmap)](https://cran.r-project.org/package=tmap)
[![CRAN
checks](https://badges.cranchecks.info/worst/tmap.svg)](https://cran.r-project.org/web/checks/check_results_tmap.html)
Expand Down Expand Up @@ -77,7 +77,7 @@ tm_shape(World) +
tm_polygons(fill = "HPI")
```

<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-4-1.png" alt="" width="100%" />

This map can be enhanced in several ways. For instance:

Expand All @@ -91,14 +91,12 @@ tm_shape(World, crs = "+proj=robin") +
)
```

<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-5-1.png" alt="" width="100%" />

<!--
## Online tmap course

3-6 June, organized jointly by
[PRStats](https://www.prstats.org/course/visual-exploration-analysis-and-presentation-of-spatial-data-using-the-tmap-package-tmap01/)
and
[Instats](https://instats.org/seminar/spatial-data-analysis-and-visualization)
&#10;10-14 November 2025, organized jointly by [PRStats](https://www.prstats.org/course/spatial-data-visualisation-and-mapping-using-tmap-tmap02/) and [Instats](https://instats.org/seminar/spatial-data-analysis-and-visualization-1)
-->

## Additional Resources for Learning **tmap**

Expand All @@ -111,9 +109,9 @@ following resources:
- **Official Vignettes:** A collection of vignettes at
[r-tmap.github.io](https://r-tmap.github.io/tmap/articles/) covers
both basic and advanced topics with examples.
- **Work-in-Progress Book:** *Elegant and Informative Maps with tmap* is
an upcoming book available at
[tmap.geocompx.org](https://tmap.geocompx.org/).
- **Work-in-Progress Book:** *Spatial Data Visualization with tmap: A
Practical Guide to Thematic Mapping in R* is an upcoming book
available at [tmap.geocompx.org](https://tmap.geocompx.org/).

These resources provide a solid foundation for working with **tmap** in
R.
8 changes: 4 additions & 4 deletions man/tm_compass.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_minimap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tm_symbols.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading