diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 3b4c41ce21..66e69dd636 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -46,7 +46,7 @@ jobs: plotly_api_key: ${{ secrets.PLOTLY_API_KEY }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/DESCRIPTION b/DESCRIPTION index bc1f9f1d19..318fd9d49b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -82,6 +82,7 @@ RoxygenNote: 7.3.2 Encoding: UTF-8 Roxygen: list(markdown = TRUE) Config/Needs/check: + tidyverse/ggplot2, rcmdcheck, devtools, reshape2, diff --git a/NEWS.md b/NEWS.md index 138ad21266..ad7e39f553 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ ## Improvements -* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.4). (#2315, #2368) +* Various updates to `ggplotly()` to better support recent versions of ggplot2. (#2315, #2368, #2442, thanks @teunbrand). ## Bug fixes diff --git a/R/ggplotly.R b/R/ggplotly.R index 93d158813c..973a31ebc1 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -668,7 +668,9 @@ gg2list <- function(p, width = NULL, height = NULL, "\\*\\s+degree[ ]?[\\*]?", "°", gsub("\"", "", tickData[["degree_label"]]) ) - rng[[paste0(xy, ".major")]] <- tickData[[paste0(xy, "_start")]] + # Downstream logic expects these 'break positions' to be on 0-1 scale + # (which is then rescaled back to the data scale) + rng[[paste0(xy, ".major")]] <- scales::rescale(tickData[[paste0(xy, "_start")]]) # If it doesn't already exist (for this panel), # generate graticule (as done in, CoordSf$render_bg) @@ -742,8 +744,8 @@ gg2list <- function(p, width = NULL, height = NULL, # https://github.com/tidyverse/ggplot2/pull/3566#issuecomment-565085809 hasTickText <- !(is.na(ticktext) | is.na(tickvals)) - ticktext <- ticktext[hasTickText] - tickvals <- tickvals[hasTickText] + ticktext <- as.character(unlist(ticktext[hasTickText])) + tickvals <- as.numeric(unlist(tickvals[hasTickText])) axisObj <- list( # TODO: log type? @@ -783,8 +785,11 @@ gg2list <- function(p, width = NULL, height = NULL, # set scaleanchor/scaleratio if these are fixed coordinates # the logic here is similar to what p$coordinates$aspect() does, # but the ratio is scaled to the data range by plotly.js - fixed_coords <- c("CoordSf", "CoordFixed", "CoordMap", "CoordQuickmap") - if (inherits(p$coordinates, fixed_coords)) { + is_fixed <- inherits( + p$coordinates, + c("CoordSf", "CoordFixed", "CoordMap", "CoordQuickmap") + ) + if (is_fixed || isFALSE(p$coordinates$is_free())) { axisObj$scaleanchor <- anchor ratio <- p$coordinates$ratio %||% 1 axisObj$scaleratio <- if (xy == "y") ratio else 1 / ratio @@ -1436,7 +1441,9 @@ gdef2trace <- function(gdef, theme, gglayout) { } vals <- lapply(gglayout[c("xaxis", "yaxis")], function(ax) { - if (identical(ax$tickmode, "auto")) ax$ticktext else ax$tickvals + res <- if (identical(ax$tickmode, "auto")) ax$ticktext else ax$tickvals + # if zero-length, return NULL to avoid subscript oob errors + res %||% NULL }) list( diff --git a/R/layers2traces.R b/R/layers2traces.R index df78b0c62e..1b889dc3f8 100644 --- a/R/layers2traces.R +++ b/R/layers2traces.R @@ -197,6 +197,7 @@ to_basic.GeomCol <- function(data, prestats_data, layout, params, p, ...) { #' @export to_basic.GeomViolin <- function(data, prestats_data, layout, params, p, ...) { n <- nrow(data) + data <- data[order(data[["y"]], decreasing = FALSE), ] revData <- data[order(data[["y"]], decreasing = TRUE), ] idx <- !names(data) %in% c("x", "xmin", "xmax") data <- rbind( diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-labels.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-labels.svg index 142897f141..caa5d42f44 100644 --- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-labels.svg +++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-labels.svg @@ -1 +1 @@ -0123455.0010.0015.0020.00xvalyval +0123452^52^102^152^20xvalyval diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10-labels.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10-labels.svg index 0e42df6c1f..d9bc2b0cce 100644 --- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10-labels.svg +++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10-labels.svg @@ -1 +1 @@ -0123451.002.003.004.005.006.00xvalyval +01234510^110^210^310^410^510^6xvalyval diff --git a/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg b/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg index a03d36e567..d201562295 100644 --- a/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg +++ b/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg @@ -1 +1 @@ -NoYesMaleFemale1st2nd3rdCrew0500100015002000SurvivedSexClassClass1st2nd3rdCrewTitanic survival by class and sexFreq +NoYesMaleFemale1st2nd3rdCrew0500100015002000SurvivedSexClassClass1st2nd3rdCrewTitanic survival by class and sexFreq diff --git a/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg b/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg index 372db14600..f80bf4a8b1 100644 --- a/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg +++ b/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg @@ -1 +1 @@ -NoYesMaleFemale1st2nd3rdCrew0500100015002000SurvivedSexClassTitanic survival by class and sexFreq +NoYesMaleFemale1st2nd3rdCrew0500100015002000SurvivedSexClassTitanic survival by class and sexFreq diff --git a/tests/testthat/_snaps/ggplot-col/col.svg b/tests/testthat/_snaps/ggplot-col/col.svg index a3be5dedfa..515c34c421 100644 --- a/tests/testthat/_snaps/ggplot-col/col.svg +++ b/tests/testthat/_snaps/ggplot-col/col.svg @@ -1 +1 @@ -71.4%20.0%48.3%28.6%80.0%51.7%ElementaryHighMiddle0.000.250.500.751.00includedexcludedincludedtypeprop +71.4%20.0%48.3%28.6%80.0%51.7%ElementaryHighMiddle0.000.250.500.751.00includedexcludedincludedtypeprop diff --git a/tests/testthat/_snaps/ggplot-contour/contour.svg b/tests/testthat/_snaps/ggplot-contour/contour.svg index 5c1aae4739..e4777fc4a4 100644 --- a/tests/testthat/_snaps/ggplot-contour/contour.svg +++ b/tests/testthat/_snaps/ggplot-contour/contour.svg @@ -1 +1 @@ -02550750204060xy +02550750204060xy diff --git a/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg b/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg index 91b992bdd9..43c67fca5a 100644 --- a/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg +++ b/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg @@ -1 +1 @@ --10123-10123246810ptltrsps +-10123-10123246810ptltrsps diff --git a/tests/testthat/_snaps/ggplot-facets/3-panels.svg b/tests/testthat/_snaps/ggplot-facets/3-panels.svg index 698153e481..00587badec 100644 --- a/tests/testthat/_snaps/ggplot-facets/3-panels.svg +++ b/tests/testthat/_snaps/ggplot-facets/3-panels.svg @@ -1 +1 @@ -0.000.250.500.751.000.000.250.500.751.000.000.250.500.751.000.000.250.500.751.00xyabc +0.000.250.500.751.000.000.250.500.751.000.000.250.500.751.000.000.250.500.751.00xyabc diff --git a/tests/testthat/_snaps/ggplot-facets/barley.svg b/tests/testthat/_snaps/ggplot-facets/barley.svg index 8eb848976d..f302ea46d8 100644 --- a/tests/testthat/_snaps/ggplot-facets/barley.svg +++ b/tests/testthat/_snaps/ggplot-facets/barley.svg @@ -1 +1 @@ -SvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38Trebi2030405060SvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38Trebiyear19321931yieldvarietyGrand RapidsDuluthUniversity FarmMorrisCrookstonWaseca +SvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38TrebiSvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38Trebi2030405060SvansotaNo. 462ManchuriaNo. 475VelvetPeatlandGlabronNo. 457Wisconsin No. 38Trebiyear19321931yieldvarietyGrand RapidsDuluthUniversity FarmMorrisCrookstonWaseca diff --git a/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg b/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg index 54fef9c43c..3ffb60481b 100644 --- a/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg +++ b/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg @@ -1 +1 @@ -5100.51.01.52.02.5xy +5100.51.01.52.02.5xy diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg index 26e14cace2..3f11fee71d 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg @@ -1 +1 @@ -23450246wtcount +2345012345wtcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg index 3b37e86f83..64339e615d 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg @@ -1 +1 @@ -Jan 01Jan 15Feb 01Feb 15Mar 010123monthcount +Jan 01Jan 15Feb 01Feb 15Mar 010123monthcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg index fd604d8a1f..d77a828a4b 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg @@ -1 +1 @@ -23450.00.51.01.5wtdensity +23450.00.30.60.91.2wtdensity diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-dodge.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-dodge.svg index 22a9743270..10277ea74f 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-dodge.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-dodge.svg @@ -1 +1 @@ -234501234factor(vs)01wtcount +23450123factor(vs)01wtcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-facets.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-facets.svg index b2bd2e86f8..f2513aa43b 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-facets.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-facets.svg @@ -1 +1 @@ -234502462345factor(vs)01wtcount01 +23450123452345factor(vs)01wtcount01 diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-identity.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-identity.svg index 7d8c449852..f8d3559ab4 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-identity.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor-identity.svg @@ -1 +1 @@ -234501234factor(vs)01wtcount +23450123factor(vs)01wtcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg index 4a98b85937..289e96ad5a 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg @@ -1 +1 @@ -23450246factor(vs)01wtcount +2345012345factor(vs)01wtcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg index de0773ee5a..5f5cc0b318 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg @@ -1 +1 @@ -234502460246countwtcount +2345012345012345countwtcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fixed-fill-color.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fixed-fill-color.svg index 7e13b056ba..c27869c9d6 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-fixed-fill-color.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fixed-fill-color.svg @@ -1 +1 @@ -23450246wtcount +2345012345wtcount diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg index 27a445f168..5032a9d799 100644 --- a/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg +++ b/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg @@ -1 +1 @@ -23450246wtcount +2345012345wtcount diff --git a/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg b/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg index 09547ea0f8..4bf70aa91b 100644 --- a/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg +++ b/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg @@ -1 +1 @@ -40506015.017.520.0speciesAdelieChinstrapGentoo +40506015.017.520.0speciesAdelieChinstrapGentoo diff --git a/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg b/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg index cd77554974..7085010541 100644 --- a/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg +++ b/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg @@ -1 +1 @@ -Jan 02Jan 04Jan 06Jan 08Jan 10-2-1012SeriesMeanQCSeriesASeriesBDateValues +Jan 02Jan 04Jan 06Jan 08Jan 10-2-1012colourMeanQCSeriesASeriesBDateMean diff --git a/tests/testthat/_snaps/ggplot-map/map-facet.svg b/tests/testthat/_snaps/ggplot-map/map-facet.svg index 490a40ad79..5f09eb6169 100644 --- a/tests/testthat/_snaps/ggplot-map/map-facet.svg +++ b/tests/testthat/_snaps/ggplot-map/map-facet.svg @@ -1 +1 @@ -253035404550-120-100-80253035404550-120-100-80100200300valuexyAssaultMurderRapeUrbanPop +253035404550-120-100-80253035404550-120-100-80100200300valueAssaultMurderRapeUrbanPop diff --git a/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg b/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg index afa5dd0510..7766906aef 100644 --- a/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg +++ b/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg @@ -1 +1 @@ --125-100-75-504050607080longlat +-125-100-75-504050607080 diff --git a/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg b/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg index 55c95eb7f8..80ed0adb19 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg @@ -1 +1 @@ -84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N +84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N diff --git a/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg b/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg index 5c77bb8a53..bcf58955aa 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg @@ -1 +1 @@ -100 ° W 80 ° W 60 ° W 40 ° W 20 ° W40 ° N50 ° N60 ° N +100 ° W 80 ° W 60 ° W 40 ° W 20 ° W40 ° N50 ° N60 ° N diff --git a/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg b/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg index c0dd3f4cae..f08c00b5b4 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg @@ -1 +1 @@ -84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N0.050.100.150.20AREA +84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N0.050.100.150.20AREA diff --git a/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg b/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg index 64bc029f0a..ee7e5c3fe0 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg @@ -1 +1 @@ -1234567-0.5-0.4-0.3-0.2-0.1 0.0 +1234567-0.5-0.4-0.3-0.2-0.1 0.0 diff --git a/tests/testthat/_snaps/ggplot-sf/sf-points.svg b/tests/testthat/_snaps/ggplot-sf/sf-points.svg index d67ac10c46..996e36953b 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf-points.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf-points.svg @@ -1 +1 @@ -84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° Nxy +84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N diff --git a/tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg b/tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg index 7a114eb336..0f57f9ef68 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg @@ -1 +1 @@ - + diff --git a/tests/testthat/_snaps/ggplot-sf/sf.svg b/tests/testthat/_snaps/ggplot-sf/sf.svg index 55c95eb7f8..80ed0adb19 100644 --- a/tests/testthat/_snaps/ggplot-sf/sf.svg +++ b/tests/testthat/_snaps/ggplot-sf/sf.svg @@ -1 +1 @@ -84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N +84 ° W82 ° W80 ° W78 ° W76 ° W34.0 ° N34.5 ° N35.0 ° N35.5 ° N36.0 ° N36.5 ° N diff --git a/tests/testthat/_snaps/ggplot-text/text-colour.svg b/tests/testthat/_snaps/ggplot-text/text-colour.svg index d0daca0f9c..963ddf31fc 100644 --- a/tests/testthat/_snaps/ggplot-text/text-colour.svg +++ b/tests/testthat/_snaps/ggplot-text/text-colour.svg @@ -1 +1 @@ -HUNTSVILLEMOBILEBIRMINGHAMMONTGOMERYTUCSONPEORIA01020-505DivisionEast South CentralAaMountainAacoord.1coord.2 +HUNTSVILLEMOBILEBIRMINGHAMMONTGOMERYTUCSONPEORIA01020-505DivisionEast South CentralAaMountainAacoord.1coord.2 diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-lines-labels.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-lines-labels.svg index 6926445f0d..b195101b75 100644 --- a/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-lines-labels.svg +++ b/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-lines-labels.svg @@ -1 +1 @@ -1233.54.04.55.05.56.0groupweight +3.54.04.55.05.56.0groupweight diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg index 6926445f0d..4d59ec12f6 100644 --- a/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg +++ b/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg @@ -1 +1 @@ -1233.54.04.55.05.56.0groupweight +ctrltrt1trt24.004.254.505.006.00groupweight diff --git a/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg b/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg index 6471d3ab3b..baab83207f 100644 --- a/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg +++ b/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg @@ -1 +1 @@ -1020304680.20.40.6densitympgfactor(cyl) +1020304680.20.40.6densitympgfactor(cyl) diff --git a/tests/testthat/_snaps/ggplot-violin/violin.svg b/tests/testthat/_snaps/ggplot-violin/violin.svg index c79f57e606..6dda4ede50 100644 --- a/tests/testthat/_snaps/ggplot-violin/violin.svg +++ b/tests/testthat/_snaps/ggplot-violin/violin.svg @@ -1 +1 @@ -468101520253035factor(cyl)mpg +468101520253035factor(cyl)mpg diff --git a/tests/testthat/_snaps/ggridges/histogram-ridges.svg b/tests/testthat/_snaps/ggridges/histogram-ridges.svg index 89d17fc9bc..ac26c65566 100644 --- a/tests/testthat/_snaps/ggridges/histogram-ridges.svg +++ b/tests/testthat/_snaps/ggridges/histogram-ridges.svg @@ -1 +1 @@ -45678setosaversicolorvirginicaSepal.LengthSpecies +45678setosaversicolorvirginicaSepal.LengthSpecies diff --git a/tests/testthat/_snaps/mean-error-bars/error-rect-alpha.svg b/tests/testthat/_snaps/mean-error-bars/error-rect-alpha.svg index 993e02173b..1ef4b2a3de 100644 --- a/tests/testthat/_snaps/mean-error-bars/error-rect-alpha.svg +++ b/tests/testthat/_snaps/mean-error-bars/error-rect-alpha.svg @@ -1 +1 @@ -024612345grouponetwoxy +0246-2.50.02.55.07.5grouponetwoxy diff --git a/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg b/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg index 5a72f2d81d..14f39817be 100644 --- a/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg +++ b/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg @@ -1 +1 @@ -v1v2v3v4v5012345612345-1.0-0.50.00.51.0 +v1v2v3v4v5-1.0-0.50.00.51.0 diff --git a/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg b/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg index cc5b650a26..7c3e107830 100644 --- a/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg +++ b/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg @@ -1 +1 @@ -0.02.55.07.50.02.55.07.556780.02.55.07.50.00.51.01.52.02.52462.02.53.03.54.04.50.00.10.20.30.42.02.53.03.54.04.5Corr:-0.118246Corr:-0.428***Corr:0.872***0.00.51.01.52.02.5Corr:0.963***Corr:-0.366***Corr:0.818***setosaversicolorvirginicaSepal.LengthSepal.WidthPetal.LengthPetal.WidthSpeciesPetal.WidthPetal.LengthSepal.WidthSepal.Lengthsetosaversicolorvirginicasetosaversicolorvirginicasetosaversicolorvirginicasetosaversicolorvirginica +05101505101556780510150.00.51.01.52.02.52462.02.53.03.54.04.50.00.10.20.30.42.02.53.03.54.04.5Corr:-0.118246Corr:-0.428***Corr:0.872***0.00.51.01.52.02.5Corr:0.963***Corr:-0.366***Corr:0.818***setosaversicolorvirginicaSepal.LengthSepal.WidthPetal.LengthPetal.WidthSpeciesPetal.WidthPetal.LengthSepal.WidthSepal.Lengthsetosaversicolorvirginicasetosaversicolorvirginicasetosaversicolorvirginicasetosaversicolorvirginica diff --git a/tests/testthat/_snaps/plotly-subplot/plotly-subplot-width-height.svg b/tests/testthat/_snaps/plotly-subplot/plotly-subplot-width-height.svg index 627e66e9ae..6d5b52e667 100644 --- a/tests/testthat/_snaps/plotly-subplot/plotly-subplot-width-height.svg +++ b/tests/testthat/_snaps/plotly-subplot/plotly-subplot-width-height.svg @@ -1 +1 @@ -0.02.55.07.5-3-2-1012-2020.02.55.07.510.0xcountcounty +0.02.55.07.510.0-3-2-1012-2020369xcountcounty diff --git a/tests/testthat/test-ggplot-labels.R b/tests/testthat/test-ggplot-labels.R index 4a4a8cfb34..69ca3b4e22 100644 --- a/tests/testthat/test-ggplot-labels.R +++ b/tests/testthat/test-ggplot-labels.R @@ -51,6 +51,6 @@ test_that("empty labels work", { p <- ggplot(palmerpenguins::penguins, aes(bill_length_mm, bill_depth_mm, color = species)) + geom_point() + - labs(x = element_blank(), y = element_blank()) + labs(x = NULL, y = NULL) b <- expect_doppelganger_built(p, "labs-element-blank") }) diff --git a/tests/testthat/test-ggplot-ticks.R b/tests/testthat/test-ggplot-ticks.R index 2038aaeb9a..ed2a0281e2 100644 --- a/tests/testthat/test-ggplot-ticks.R +++ b/tests/testthat/test-ggplot-ticks.R @@ -171,7 +171,7 @@ test_that("Set the X tick mark locations", { test_that("The breaks can be spaced unevenly", { boxes.uneven <- boxes + scale_y_continuous(breaks = c(4, 4.25, 4.5, 5, 6, 8)) - info <- expect_traces(no.breaks, 1, "uneven") + info <- expect_traces(boxes.uneven, 1, "uneven") }) test_that("R line breaks are translated to HTML line breaks", {