Skip to content

fix: address various check/test/CI issues #2441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 5, 2025
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}
# - {os: ubuntu-latest, r: 'oldrel-4'} # dependency issues with oldrel-4

env:
VISUAL_TESTS: ${{ matrix.config.visual_tests }}
Expand Down Expand Up @@ -63,10 +63,16 @@ jobs:
cache-version: 3
needs: check

- name: Set up Python (for reticulate)
if: matrix.config.visual_tests == true
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install kaleido
if: matrix.config.visual_tests == true
run: |
Rscript -e 'library(reticulate); use_python(install_python()); py_install(c("kaleido", "plotly"))'
Rscript -e 'library(reticulate); use_python(Sys.which("python")); py_install(c("kaleido", "plotly"))'

# Run test() before R CMD check since, for some reason, rcmdcheck::rcmdcheck() skips vdiffr tests
- name: Run Tests
Expand Down
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ Suggests:
rsvg,
ggridges
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Config/Needs/check:
tidyverse/ggplot2,
rcmdcheck,
devtools,
reshape2,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ S3method(print,api_grid_local)
S3method(print,api_plot)
S3method(print,kaleidoScope)
S3method(print,plotly_data)
S3method(process,api_image)
S3method(process,api_plot)
S3method(process,default)
S3method(to_basic,GeomAbline)
S3method(to_basic,GeomAlluvium)
S3method(to_basic,GeomAnnotationMap)
Expand Down
2 changes: 0 additions & 2 deletions R/animate.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ animation_opts_defaults <- function() {
}


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


#' @inheritParams animation_slider
#' @param label a character string used for the animation button's label
#' @export
#' @rdname animation
Expand Down
3 changes: 0 additions & 3 deletions R/api_exports.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@
#'
#' }
#'


#' @rdname api
#' @export
api_create <- function(x = last_plot(), filename = NULL,
fileopt = c("overwrite", "new"),
Expand Down
5 changes: 3 additions & 2 deletions R/ggplotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,9 @@ utils::globalVariables(c("groupDomains", "layers", "prestats_data", "scales", "s

# Get the "complete" set of theme elements and their calculated values
calculated_theme_elements <- function(plot) {
if (is.function(asNamespace("ggplot2")$complete_theme)) {
theme <- ggplot2::complete_theme(plot$theme)
complete_theme <- ggfun("complete_theme")
if (is.function(complete_theme)) {
theme <- complete_theme(plot$theme)
elements <- names(theme)
} else {
theme <- ggfun("plot_theme")(plot)
Expand Down
1 change: 0 additions & 1 deletion R/orca.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ orca <- function(p, file = "plot.png", format = tools::file_ext(file),

#' Orca image export server
#'
#' @inheritParams orca
#' @param port Sets the server's port number.
#' @param keep_alive Turn on keep alive mode where orca will (try to) relaunch server if process unexpectedly exits.
#' @param window_max_number Sets maximum number of browser windows the server can keep open at a given time.
Expand Down
3 changes: 3 additions & 0 deletions R/process.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ process <- function(resp) {
UseMethod("process")
}

#' @export
process.default <- function(resp) {
json_content(relay_error(resp))
}

#' @export
process.api_plot <- function(resp) {
json_content(relay_error(resp))
}

#' @export
process.api_image <- function(resp) {
relay_error(resp)
type <- resp[["headers"]][["content-type"]]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ggplot2 API won’t ever support (e.g., surface,
plot_ly(z = ~volcano, type = "surface")
```

![<https://plot.ly/~brnvg/1134>](https://plot.ly/~brnvg/1134.png)
![<https://plotly.com/~brnvg/1134>](https://plotly.com/~brnvg/1134.png)

## Learn more

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-col/col.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-facets/3-panels.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-facets/barley.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-ribbon/ribbon-alpha.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-ribbon/ribbon-colour.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-ribbon/ribbon-group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf-aspect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf-points.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-sf/sf.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggplot-text/text-colour.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/ggridges/histogram-ridges.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/mean-error-bars/error-rect-alpha.svg

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions tests/testthat/test-plotly.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ test_that("Character strings correctly mapped to a positional axis", {
letters <- LETTERS[as.numeric(sort(as.character(1:26)))]
p <- plot_ly(x = letters, y = seq_along(letters)) %>%
add_bars(color = rep(c("a1", "a2"), length.out = 26))
l <- expect_warning(expect_traces(p, 2, "character-axis"),
regexp = "minimal value for n is 3")
l <- expect_traces(p, 2, "character-axis")
expect_equivalent(l$layout$xaxis$type, "category")
expect_equivalent(l$layout$xaxis$categoryorder, "array")
expect_equivalent(l$layout$xaxis$categoryarray, LETTERS)
Expand Down