Skip to content

Commit 3b5f6e6

Browse files
authored
fix: address various check/test/CI issues (#2441)
* Follow up to #1999: update test expectation to not expect warning * Temporarily test against CRAN ggplot2 * Avoid :: on old ggplot2 function * Disable oldrel-4; roxygen stuff * Update URL * Try to fix kaliedo install * Fix more roxygen issues * Pass data to use_defaults() method (this way GeomSf default aes logic will actually work as expected) * Approve new snapshots * Revert "Pass data to use_defaults() method (this way GeomSf default aes logic will actually work as expected)" This reverts commit 01e73fb.
1 parent 57fe5c0 commit 3b5f6e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+53
-48
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- {os: ubuntu-latest, r: 'oldrel-1'}
3636
- {os: ubuntu-latest, r: 'oldrel-2'}
3737
- {os: ubuntu-latest, r: 'oldrel-3'}
38-
- {os: ubuntu-latest, r: 'oldrel-4'}
38+
# - {os: ubuntu-latest, r: 'oldrel-4'} # dependency issues with oldrel-4
3939

4040
env:
4141
VISUAL_TESTS: ${{ matrix.config.visual_tests }}
@@ -63,10 +63,16 @@ jobs:
6363
cache-version: 3
6464
needs: check
6565

66+
- name: Set up Python (for reticulate)
67+
if: matrix.config.visual_tests == true
68+
uses: actions/setup-python@v4
69+
with:
70+
python-version: '3.11'
71+
6672
- name: Install kaleido
6773
if: matrix.config.visual_tests == true
6874
run: |
69-
Rscript -e 'library(reticulate); use_python(install_python()); py_install(c("kaleido", "plotly"))'
75+
Rscript -e 'library(reticulate); use_python(Sys.which("python")); py_install(c("kaleido", "plotly"))'
7076
7177
# Run test() before R CMD check since, for some reason, rcmdcheck::rcmdcheck() skips vdiffr tests
7278
- name: Run Tests

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ Suggests:
7878
rsvg,
7979
ggridges
8080
LazyData: true
81-
RoxygenNote: 7.3.1
81+
RoxygenNote: 7.3.2
8282
Encoding: UTF-8
8383
Roxygen: list(markdown = TRUE)
8484
Config/Needs/check:
85-
tidyverse/ggplot2,
8685
rcmdcheck,
8786
devtools,
8887
reshape2,

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ S3method(print,api_grid_local)
4040
S3method(print,api_plot)
4141
S3method(print,kaleidoScope)
4242
S3method(print,plotly_data)
43+
S3method(process,api_image)
44+
S3method(process,api_plot)
45+
S3method(process,default)
4346
S3method(to_basic,GeomAbline)
4447
S3method(to_basic,GeomAlluvium)
4548
S3method(to_basic,GeomAnnotationMap)

R/animate.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ animation_opts_defaults <- function() {
122122
}
123123

124124

125-
#' @inheritParams animation_opts
126125
#' @param hide remove the animation slider?
127126
#' @param ... for `animation_slider`, attributes are passed to a special
128127
#' layout.sliders object tied to the animation frames.
@@ -149,7 +148,6 @@ animation_slider <- function(p, hide = FALSE, ...) {
149148
}
150149

151150

152-
#' @inheritParams animation_slider
153151
#' @param label a character string used for the animation button's label
154152
#' @export
155153
#' @rdname animation

R/api_exports.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@
108108
#'
109109
#' }
110110
#'
111-
112-
113-
#' @rdname api
114111
#' @export
115112
api_create <- function(x = last_plot(), filename = NULL,
116113
fileopt = c("overwrite", "new"),

R/ggplotly.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,9 @@ utils::globalVariables(c("groupDomains", "layers", "prestats_data", "scales", "s
11571157

11581158
# Get the "complete" set of theme elements and their calculated values
11591159
calculated_theme_elements <- function(plot) {
1160-
if (is.function(asNamespace("ggplot2")$complete_theme)) {
1161-
theme <- ggplot2::complete_theme(plot$theme)
1160+
complete_theme <- ggfun("complete_theme")
1161+
if (is.function(complete_theme)) {
1162+
theme <- complete_theme(plot$theme)
11621163
elements <- names(theme)
11631164
} else {
11641165
theme <- ggfun("plot_theme")(plot)

R/orca.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file),
9797

9898
#' Orca image export server
9999
#'
100-
#' @inheritParams orca
101100
#' @param port Sets the server's port number.
102101
#' @param keep_alive Turn on keep alive mode where orca will (try to) relaunch server if process unexpectedly exits.
103102
#' @param window_max_number Sets maximum number of browser windows the server can keep open at a given time.

R/process.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ process <- function(resp) {
66
UseMethod("process")
77
}
88

9+
#' @export
910
process.default <- function(resp) {
1011
json_content(relay_error(resp))
1112
}
1213

14+
#' @export
1315
process.api_plot <- function(resp) {
1416
json_content(relay_error(resp))
1517
}
1618

19+
#' @export
1720
process.api_image <- function(resp) {
1821
relay_error(resp)
1922
type <- resp[["headers"]][["content-type"]]

README.md

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-col/col.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-facets/3-panels.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-facets/barley.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-density.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-dodge.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-facets.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-identity.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-fixed-fill-color.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-ribbon/ribbon-alpha.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-ribbon/ribbon-colour.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-ribbon/ribbon-group.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf-aspect.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf-points.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-sf/sf.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggplot-text/text-colour.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/ggridges/histogram-ridges.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/mean-error-bars/error-rect-alpha.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/_snaps/plotly-subplot/plotly-subplot-width-height.svg

Lines changed: 1 addition & 1 deletion

tests/testthat/test-plotly.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ test_that("Character strings correctly mapped to a positional axis", {
142142
letters <- LETTERS[as.numeric(sort(as.character(1:26)))]
143143
p <- plot_ly(x = letters, y = seq_along(letters)) %>%
144144
add_bars(color = rep(c("a1", "a2"), length.out = 26))
145-
l <- expect_warning(expect_traces(p, 2, "character-axis"),
146-
regexp = "minimal value for n is 3")
145+
l <- expect_traces(p, 2, "character-axis")
147146
expect_equivalent(l$layout$xaxis$type, "category")
148147
expect_equivalent(l$layout$xaxis$categoryorder, "array")
149148
expect_equivalent(l$layout$xaxis$categoryarray, LETTERS)

0 commit comments

Comments
 (0)