diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml
index 275487bf57..fb06e614a1 100644
--- a/.github/workflows/R-CMD-check.yaml
+++ b/.github/workflows/R-CMD-check.yaml
@@ -29,8 +29,7 @@ jobs:
# vdiffr & shinytest only runs on mac r-release since the results aren't cross-platform
- {os: macOS-latest, r: 'release', visual_tests: true, node: "14.x", shinytest: true}
- {os: windows-latest, r: 'release'}
- - {os: windows-latest, r: '4.1'}
- - {os: windows-latest, r: '3.6'}
+ # - {os: windows-latest, r: 'oldrel-1'} # pak is having issues
- {os: ubuntu-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
@@ -62,26 +61,10 @@ jobs:
cache-version: 3
needs: check
- - name: Set up Python 3.8
- uses: actions/setup-python@v2
- with:
- python-version: 3.8
-
- name: Install kaleido
if: matrix.config.visual_tests == true
run: |
- sudo chown -R $UID $CONDA # https://github.com/nextstrain/conda/issues/5
- Rscript -e "reticulate::install_miniconda()"
- Rscript -e "reticulate::conda_install('r-reticulate', 'python-kaleido')"
- Rscript -e "reticulate::conda_install('r-reticulate', 'plotly', channel = 'plotly')"
- Rscript -e "reticulate::use_miniconda('r-reticulate')"
-
- - name: Install shinytest deps
- if: matrix.config.shinytest == true
- run: |
- Rscript -e 'shinytest::installDependencies()'
- R CMD install .
- shell: bash
+ Rscript -e 'library(reticulate); use_python(install_python()); py_install(c("kaleido", "plotly"))'
# Run test() before R CMD check since, for some reason, rcmdcheck::rcmdcheck() skips vdiffr tests
- name: Run Tests
diff --git a/DESCRIPTION b/DESCRIPTION
index 4bda21a633..f7c6718462 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -57,7 +57,7 @@ Suggests:
testthat,
knitr,
shiny (>= 1.1.0),
- shinytest (>= 1.3.0),
+ shinytest2,
curl,
rmarkdown,
Cairo,
diff --git a/NEWS.md b/NEWS.md
index 60173c95fd..fed423fe24 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,6 +4,10 @@
* `ggplotly()` now supports the `{ggridges}` package. (#2314)
+## Improvements
+
+* `ggplotly()` now works better with the development version of ggplot2 (> v3.4.4). (#2315)
+
## Bug fixes
* Closed #2337: Creating a new `event_data()` handler no longer causes a spurious reactive update of existing `event_data()`s. (#2339)
diff --git a/R/ggplotly.R b/R/ggplotly.R
index 98bf487a96..1c2073f9b6 100644
--- a/R/ggplotly.R
+++ b/R/ggplotly.R
@@ -463,12 +463,8 @@ gg2list <- function(p, width = NULL, height = NULL,
assign(var, built_env[[var]], envir = envir)
}
- # initiate plotly.js layout with some plot-wide theming stuff
- theme <- ggfun("plot_theme")(plot)
- elements <- names(which(sapply(theme, inherits, "element")))
- for (i in elements) {
- theme[[i]] <- ggplot2::calc_element(i, theme)
- }
+ theme <- calculated_theme_elements(plot)
+
# Translate plot wide theme elements to plotly.js layout
pm <- unitConvert(theme$plot.margin, "pixels")
gglayout <- list(
@@ -1154,6 +1150,23 @@ gg2list <- function(p, width = NULL, height = NULL,
# Due to the non-standard use of assign() in g2list() (above)
utils::globalVariables(c("groupDomains", "layers", "prestats_data", "scales", "sets"))
+# 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)
+ elements <- names(theme)
+ } else {
+ theme <- ggfun("plot_theme")(plot)
+ elements <- names(which(sapply(theme, inherits, "element")))
+ }
+
+ for (i in elements) {
+ theme[[i]] <- ggplot2::calc_element(i, theme)
+ }
+
+ theme
+}
+
#-----------------------------------------------------------------------------
# ggplotly 'utility' functions
@@ -1384,7 +1397,8 @@ rect2shape <- function(rekt = ggplot2::element_rect()) {
linetype = lty2dash(rekt$linetype)
),
yref = "paper",
- xref = "paper"
+ xref = "paper",
+ layer = "below"
)
}
@@ -1408,6 +1422,7 @@ gdef2trace <- function(gdef, theme, gglayout) {
# N.B. ggplot2 >v3.4.2 (specifically #4879) renamed bar to decor and also
# started returning normalized values for the key field
decor <- gdef$decor %||% gdef$bar
+ decor$value <- decor$value %||% decor$max
rng <- range(decor$value)
decor$value <- scales::rescale(decor$value, from = rng)
if (!"decor" %in% names(gdef)) {
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.png b/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.png
deleted file mode 100644
index 755f0cb579..0000000000
Binary files a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.png and /dev/null differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.png b/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.png
deleted file mode 100644
index 4c6e328694..0000000000
Binary files a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.png and /dev/null differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.png b/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.png
deleted file mode 100644
index 838f3bc87c..0000000000
Binary files a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.png and /dev/null differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.png b/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.png
deleted file mode 100644
index 755f0cb579..0000000000
Binary files a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.png and /dev/null differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest.R b/inst/examples/shiny/event_data/tests/shinytest/mytest.R
deleted file mode 100644
index 68c6a9b270..0000000000
--- a/inst/examples/shiny/event_data/tests/shinytest/mytest.R
+++ /dev/null
@@ -1,30 +0,0 @@
-library(shinytest)
-app <- ShinyDriver$new("../../", shinyOptions = list(display.mode = "normal"))
-app$snapshotInit("mytest")
-
-app$snapshot()
-app$setInputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_click-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_hover-A` = character(0), allowInputNoBinding_ = TRUE)
-Sys.sleep(1)
-app$snapshot()
-app$setInputs(`plotly_brushing-A` = "{\"x\":[25.726819184123485,25.98332414553473],\"y\":[1.3174499999999998,5.61955]}", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_selecting-A` = "[]", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_brushing-A` = "{\"x\":[24.64379823594267,25.98332414553473],\"y\":[3.2093373493975905,3.5073743975903615]}", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_brushing-A` = "{\"x\":[24.045286659316428,25.98332414553473],\"y\":[3.040881626506024,3.5073743975903615]}", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_selecting-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_brushing-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_selected-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_brushed-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_hover-A` = character(0), allowInputNoBinding_ = TRUE)
-app$snapshot()
-app$setInputs(`plotly_selected-A` = character(0), allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_brushed-A` = character(0), allowInputNoBinding_ = TRUE)
-#app$setInputs(`plotly_selected-A` = character(0), allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_selecting-A` = character(0), allowInputNoBinding_ = TRUE)
-#app$setInputs(`plotly_brushed-A` = character(0), allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_brushing-A` = character(0), allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_click-A` = character(0), allowInputNoBinding_ = TRUE)
-app$setInputs(`plotly_deselect-A` = "\"plot\"", allowInputNoBinding_ = TRUE)
-app$snapshot()
diff --git a/inst/examples/shiny/event_data/tests/testthat.R b/inst/examples/shiny/event_data/tests/testthat.R
new file mode 100644
index 0000000000..7d25b5b9e4
--- /dev/null
+++ b/inst/examples/shiny/event_data/tests/testthat.R
@@ -0,0 +1 @@
+shinytest2::test_app()
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json
similarity index 97%
rename from inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.json
rename to inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json
index aafb5d9688..e4e32e11f5 100644
--- a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/001.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json
@@ -1,6 +1,21 @@
{
"input": {
- "plotType": "ggplotly"
+ ".clientValue-default-plotlyCrosstalkOpts": {
+ "on": "plotly_click",
+ "persistent": false,
+ "dynamic": false,
+ "selectize": false,
+ "opacityDim": 0.2,
+ "selected": {
+ "opacity": 1
+ },
+ "debounce": 0,
+ "color": [
+
+ ]
+ },
+ "plotType": "ggplotly",
+ "plotly_afterplot-A": "\"plot\""
},
"output": {
"brushed": "[1] \"Brush extents appear here (double-click to clear)\"",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001_.png
new file mode 100644
index 0000000000..f844a551f9
Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001_.png differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json
similarity index 99%
rename from inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.json
rename to inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json
index b089eae1e3..15430c47e8 100644
--- a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/002.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json
@@ -14,11 +14,11 @@
]
},
+ "plotType": "ggplotly",
"plotly_afterplot-A": "\"plot\"",
"plotly_click-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]",
"plotly_hover-A": null,
- "plotly_relayout-A": "{\"width\":962,\"height\":400}",
- "plotType": "ggplotly"
+ "plotly_relayout-A": "{\"width\":962,\"height\":400}"
},
"output": {
"brushed": "[1] \"Brush extents appear here (double-click to clear)\"",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002_.png
new file mode 100644
index 0000000000..b96cc7b25e
Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002_.png differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json
similarity index 99%
rename from inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.json
rename to inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json
index 264b18e0a8..91f5634177 100644
--- a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/003.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json
@@ -14,6 +14,7 @@
]
},
+ "plotType": "ggplotly",
"plotly_afterplot-A": "\"plot\"",
"plotly_brushed-A": "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}",
"plotly_brushing-A": "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}",
@@ -21,8 +22,7 @@
"plotly_hover-A": null,
"plotly_relayout-A": "{\"width\":962,\"height\":400}",
"plotly_selected-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]",
- "plotly_selecting-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]",
- "plotType": "ggplotly"
+ "plotly_selecting-A": "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]"
},
"output": {
"brushed": "$x\n[1] 23.95979 25.98332\n\n$y\n[1] 3.002007 3.507374",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003_.png
new file mode 100644
index 0000000000..6c51c45735
Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003_.png differ
diff --git a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json
similarity index 99%
rename from inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.json
rename to inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json
index 5552f3edd5..a5fc81e2ee 100644
--- a/inst/examples/shiny/event_data/tests/shinytest/mytest-expected/004.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json
@@ -14,6 +14,7 @@
]
},
+ "plotType": "ggplotly",
"plotly_afterplot-A": "\"plot\"",
"plotly_brushed-A": null,
"plotly_brushing-A": null,
@@ -22,8 +23,7 @@
"plotly_hover-A": null,
"plotly_relayout-A": "{\"width\":962,\"height\":400}",
"plotly_selected-A": null,
- "plotly_selecting-A": null,
- "plotType": "ggplotly"
+ "plotly_selecting-A": null
},
"output": {
"brushed": "[1] \"Brush extents appear here (double-click to clear)\"",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004_.png b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004_.png
new file mode 100644
index 0000000000..e424b18f25
Binary files /dev/null and b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004_.png differ
diff --git a/inst/examples/shiny/event_data/tests/testthat/setup-shinytest2.R b/inst/examples/shiny/event_data/tests/testthat/setup-shinytest2.R
new file mode 100644
index 0000000000..be65b4f035
--- /dev/null
+++ b/inst/examples/shiny/event_data/tests/testthat/setup-shinytest2.R
@@ -0,0 +1,2 @@
+# Load application support files into testing environment
+shinytest2::load_app_env()
diff --git a/inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R b/inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R
new file mode 100644
index 0000000000..ead36064f6
--- /dev/null
+++ b/inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R
@@ -0,0 +1,34 @@
+library(shinytest2)
+app <- AppDriver$new(
+ "../../", view = interactive(),
+ options = list(display.mode = "normal")
+)
+
+test_that("Plotly input values in Shiny", {
+ app$expect_values()
+ app$set_inputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_click-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_hover-A` = character(0), allow_no_input_binding_ = TRUE)
+ Sys.sleep(1)
+ app$expect_values()
+ app$set_inputs(`plotly_brushing-A` = "{\"x\":[25.726819184123485,25.98332414553473],\"y\":[1.3174499999999998,5.61955]}", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_selecting-A` = "[]", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_brushing-A` = "{\"x\":[24.64379823594267,25.98332414553473],\"y\":[3.2093373493975905,3.5073743975903615]}", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_brushing-A` = "{\"x\":[24.045286659316428,25.98332414553473],\"y\":[3.040881626506024,3.5073743975903615]}", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_selecting-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_brushing-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_selected-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_brushed-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_hover-A` = character(0), allow_no_input_binding_ = TRUE)
+ app$expect_values()
+ app$set_inputs(`plotly_selected-A` = character(0), allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_brushed-A` = character(0), allow_no_input_binding_ = TRUE)
+ #app$set_inputs(`plotly_selected-A` = character(0), allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_selecting-A` = character(0), allow_no_input_binding_ = TRUE)
+ #app$set_inputs(`plotly_brushed-A` = character(0), allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_brushing-A` = character(0), allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_click-A` = character(0), allow_no_input_binding_ = TRUE)
+ app$set_inputs(`plotly_deselect-A` = "\"plot\"", allow_no_input_binding_ = TRUE)
+ app$expect_values()
+})
diff --git a/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg b/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg
new file mode 100644
index 0000000000..91b992bdd9
--- /dev/null
+++ b/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg
@@ -0,0 +1 @@
+
diff --git a/tests/testthat/_snaps/ggplot-density/density-color.svg b/tests/testthat/_snaps/ggplot-density/density-color.svg
index 7024b64224..37b2aac673 100644
--- a/tests/testthat/_snaps/ggplot-density/density-color.svg
+++ b/tests/testthat/_snaps/ggplot-density/density-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-density/density-fill.svg b/tests/testthat/_snaps/ggplot-density/density-fill.svg
index 5cc84ba105..10048115c7 100644
--- a/tests/testthat/_snaps/ggplot-density/density-fill.svg
+++ b/tests/testthat/_snaps/ggplot-density/density-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-density/density-histogram.svg b/tests/testthat/_snaps/ggplot-density/density-histogram.svg
index f35c2fd108..b04eb749f6 100644
--- a/tests/testthat/_snaps/ggplot-density/density-histogram.svg
+++ b/tests/testthat/_snaps/ggplot-density/density-histogram.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-density/density-simple.svg b/tests/testthat/_snaps/ggplot-density/density-simple.svg
index 6a05645c6c..caa094e4ad 100644
--- a/tests/testthat/_snaps/ggplot-density/density-simple.svg
+++ b/tests/testthat/_snaps/ggplot-density/density-simple.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-density/density-traces-order.svg b/tests/testthat/_snaps/ggplot-density/density-traces-order.svg
index e1befb3cd7..cffbfa414f 100644
--- a/tests/testthat/_snaps/ggplot-density/density-traces-order.svg
+++ b/tests/testthat/_snaps/ggplot-density/density-traces-order.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/3-panels.svg b/tests/testthat/_snaps/ggplot-facets/3-panels.svg
index a634bfe4e2..00587badec 100644
--- a/tests/testthat/_snaps/ggplot-facets/3-panels.svg
+++ b/tests/testthat/_snaps/ggplot-facets/3-panels.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/barley.svg b/tests/testthat/_snaps/ggplot-facets/barley.svg
index b1acebfdff..f302ea46d8 100644
--- a/tests/testthat/_snaps/ggplot-facets/barley.svg
+++ b/tests/testthat/_snaps/ggplot-facets/barley.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-mult.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-mult.svg
index bcf00858fd..8c5362adbd 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-mult.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-mult.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-x.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-x.svg
index 09a466f4d0..141052b850 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-x.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-x.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y-2.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y-2.svg
index 314a630781..066d9187bd 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y-2.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y-2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y.svg
index c61edec570..0c2231fcd6 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free-y.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free.svg
index 5f6f8fc2c8..a7198e04b8 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap-free.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap-free.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg
index 23c50b6c1a..bcd437959d 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg
index b58fa571d8..a7ce21f158 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg
index 51ac85d8e5..c65ecdb426 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg
@@ -1 +1 @@
-
+
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 ca74cd6861..e1d79a991a 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 @@
-
+
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 d4082381ce..39ffb737cb 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 @@
-
+
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 19de855334..311ffb0339 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 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg
index b7dca71a96..f128d6a4e5 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill-factor.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg
index 9a6b65a8e9..2cf48289ae 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-fill.svg
@@ -1 +1 @@
-
+
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 9f9f80adec..b82629240f 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 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg
index af63a897ee..5b4bdf614e 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/legend-many-legend-items.svg b/tests/testthat/_snaps/ggplot-legend/legend-many-legend-items.svg
index 68d634ed8a..63fe204462 100644
--- a/tests/testthat/_snaps/ggplot-legend/legend-many-legend-items.svg
+++ b/tests/testthat/_snaps/ggplot-legend/legend-many-legend-items.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-map/map-facet.svg b/tests/testthat/_snaps/ggplot-map/map-facet.svg
index 010be0473b..490a40ad79 100644
--- a/tests/testthat/_snaps/ggplot-map/map-facet.svg
+++ b/tests/testthat/_snaps/ggplot-map/map-facet.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-point/all-shapes.svg b/tests/testthat/_snaps/ggplot-point/all-shapes.svg
index 5d4609088a..8e927f22f4 100644
--- a/tests/testthat/_snaps/ggplot-point/all-shapes.svg
+++ b/tests/testthat/_snaps/ggplot-point/all-shapes.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg b/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg
index 4102cc0b67..b4603aa673 100644
--- a/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg
+++ b/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg b/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg
index b695954579..32baf6c533 100644
--- a/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg
+++ b/tests/testthat/_snaps/ggplot-sf/sf-axis-ticks.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg b/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg
index 644ffacdb0..b3ed88da78 100644
--- a/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg
+++ b/tests/testthat/_snaps/ggplot-sf/sf-fill-text.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg b/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg
index 65338ebc5d..b710b5adf5 100644
--- a/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg
+++ b/tests/testthat/_snaps/ggplot-sf/sf-geom-collection.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-points.svg b/tests/testthat/_snaps/ggplot-sf/sf-points.svg
index e62d92ead3..6cf62007c5 100644
--- a/tests/testthat/_snaps/ggplot-sf/sf-points.svg
+++ b/tests/testthat/_snaps/ggplot-sf/sf-points.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg b/tests/testthat/_snaps/ggplot-sf/sf-theme-map.svg
index defe049fe3..48b2fba4c2 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 4102cc0b67..b4603aa673 100644
--- a/tests/testthat/_snaps/ggplot-sf/sf.svg
+++ b/tests/testthat/_snaps/ggplot-sf/sf.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-smooth/smooth-facet.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-facet.svg
index 007e99bd59..42407153f1 100644
--- a/tests/testthat/_snaps/ggplot-smooth/smooth-facet.svg
+++ b/tests/testthat/_snaps/ggplot-smooth/smooth-facet.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-theme/theme-panel-border-2.svg b/tests/testthat/_snaps/ggplot-theme/theme-panel-border-2.svg
index e3829aa2e9..468c3ffe77 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-panel-border-2.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-panel-border-2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-violin/violin-aes.svg b/tests/testthat/_snaps/ggplot-violin/violin-aes.svg
index c51fb9bdca..9e19480d10 100644
--- a/tests/testthat/_snaps/ggplot-violin/violin-aes.svg
+++ b/tests/testthat/_snaps/ggplot-violin/violin-aes.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-violin/violin.svg b/tests/testthat/_snaps/ggplot-violin/violin.svg
index 1a8ec9197d..c79f57e606 100644
--- a/tests/testthat/_snaps/ggplot-violin/violin.svg
+++ b/tests/testthat/_snaps/ggplot-violin/violin.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/cutting-tails.svg b/tests/testthat/_snaps/ggridges/cutting-tails.svg
index d3cec4781b..4c2e9ec36c 100644
--- a/tests/testthat/_snaps/ggridges/cutting-tails.svg
+++ b/tests/testthat/_snaps/ggridges/cutting-tails.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/density-ridgeline.svg b/tests/testthat/_snaps/ggridges/density-ridgeline.svg
index 157a558b91..7d5012aabf 100644
--- a/tests/testthat/_snaps/ggridges/density-ridgeline.svg
+++ b/tests/testthat/_snaps/ggridges/density-ridgeline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/density-ridgeline2.svg b/tests/testthat/_snaps/ggridges/density-ridgeline2.svg
index 101d8a7af9..7648b6d017 100644
--- a/tests/testthat/_snaps/ggridges/density-ridgeline2.svg
+++ b/tests/testthat/_snaps/ggridges/density-ridgeline2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/histogram-ridges.svg b/tests/testthat/_snaps/ggridges/histogram-ridges.svg
index 9f23a883ca..6b73b75dc3 100644
--- a/tests/testthat/_snaps/ggridges/histogram-ridges.svg
+++ b/tests/testthat/_snaps/ggridges/histogram-ridges.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/jittering-points.svg b/tests/testthat/_snaps/ggridges/jittering-points.svg
index f54c7ab31a..7579dbb5dd 100644
--- a/tests/testthat/_snaps/ggridges/jittering-points.svg
+++ b/tests/testthat/_snaps/ggridges/jittering-points.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/manual-densities-stat-identity.svg b/tests/testthat/_snaps/ggridges/manual-densities-stat-identity.svg
index 6478859f2c..287d171f60 100644
--- a/tests/testthat/_snaps/ggridges/manual-densities-stat-identity.svg
+++ b/tests/testthat/_snaps/ggridges/manual-densities-stat-identity.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/numeric-grouping.svg b/tests/testthat/_snaps/ggridges/numeric-grouping.svg
index dda54b9513..c995d8607e 100644
--- a/tests/testthat/_snaps/ggridges/numeric-grouping.svg
+++ b/tests/testthat/_snaps/ggridges/numeric-grouping.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/overlapping-facet-touching.svg b/tests/testthat/_snaps/ggridges/overlapping-facet-touching.svg
index 44404fbe21..636bf14e81 100644
--- a/tests/testthat/_snaps/ggridges/overlapping-facet-touching.svg
+++ b/tests/testthat/_snaps/ggridges/overlapping-facet-touching.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/overlapping-lot.svg b/tests/testthat/_snaps/ggridges/overlapping-lot.svg
index 09d33ec376..8474194f3f 100644
--- a/tests/testthat/_snaps/ggridges/overlapping-lot.svg
+++ b/tests/testthat/_snaps/ggridges/overlapping-lot.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/overlapping-none.svg b/tests/testthat/_snaps/ggridges/overlapping-none.svg
index 0fa74c66dc..3a19ed95bc 100644
--- a/tests/testthat/_snaps/ggridges/overlapping-none.svg
+++ b/tests/testthat/_snaps/ggridges/overlapping-none.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/overlapping-touching.svg b/tests/testthat/_snaps/ggridges/overlapping-touching.svg
index dcd1b8272b..465ae2f348 100644
--- a/tests/testthat/_snaps/ggridges/overlapping-touching.svg
+++ b/tests/testthat/_snaps/ggridges/overlapping-touching.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/quantile-colouring-tails-only.svg b/tests/testthat/_snaps/ggridges/quantile-colouring-tails-only.svg
index ab723e641c..2f5ec62269 100644
--- a/tests/testthat/_snaps/ggridges/quantile-colouring-tails-only.svg
+++ b/tests/testthat/_snaps/ggridges/quantile-colouring-tails-only.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/quantile-colouring.svg b/tests/testthat/_snaps/ggridges/quantile-colouring.svg
index 34995647f1..98d3c65a6d 100644
--- a/tests/testthat/_snaps/ggridges/quantile-colouring.svg
+++ b/tests/testthat/_snaps/ggridges/quantile-colouring.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/quantile-cut-points.svg b/tests/testthat/_snaps/ggridges/quantile-cut-points.svg
index f0b6ad9038..155980eae8 100644
--- a/tests/testthat/_snaps/ggridges/quantile-cut-points.svg
+++ b/tests/testthat/_snaps/ggridges/quantile-cut-points.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/quantile-lines-1.svg b/tests/testthat/_snaps/ggridges/quantile-lines-1.svg
index 8fc3a3de27..a3eb51cf34 100644
--- a/tests/testthat/_snaps/ggridges/quantile-lines-1.svg
+++ b/tests/testthat/_snaps/ggridges/quantile-lines-1.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/quantile-lines-multi.svg b/tests/testthat/_snaps/ggridges/quantile-lines-multi.svg
index b35ea39f16..b3c2996a82 100644
--- a/tests/testthat/_snaps/ggridges/quantile-lines-multi.svg
+++ b/tests/testthat/_snaps/ggridges/quantile-lines-multi.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/raincloud-effect.svg b/tests/testthat/_snaps/ggridges/raincloud-effect.svg
index 3cad788ca5..f31c3c3b89 100644
--- a/tests/testthat/_snaps/ggridges/raincloud-effect.svg
+++ b/tests/testthat/_snaps/ggridges/raincloud-effect.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/raincloud-vertical-line-points.svg b/tests/testthat/_snaps/ggridges/raincloud-vertical-line-points.svg
index 167e863b1c..735b868783 100644
--- a/tests/testthat/_snaps/ggridges/raincloud-vertical-line-points.svg
+++ b/tests/testthat/_snaps/ggridges/raincloud-vertical-line-points.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/stat-density.svg b/tests/testthat/_snaps/ggridges/stat-density.svg
index 8542cf6651..ae4c3f0f97 100644
--- a/tests/testthat/_snaps/ggridges/stat-density.svg
+++ b/tests/testthat/_snaps/ggridges/stat-density.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/styling-points.svg b/tests/testthat/_snaps/ggridges/styling-points.svg
index 3afb3a94b4..7f5ab6e9fe 100644
--- a/tests/testthat/_snaps/ggridges/styling-points.svg
+++ b/tests/testthat/_snaps/ggridges/styling-points.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/styling-points2.svg b/tests/testthat/_snaps/ggridges/styling-points2.svg
index 762718104a..ed541a2a1e 100644
--- a/tests/testthat/_snaps/ggridges/styling-points2.svg
+++ b/tests/testthat/_snaps/ggridges/styling-points2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/varying-fill-colours.svg b/tests/testthat/_snaps/ggridges/varying-fill-colours.svg
index ce8b5ceb6f..697afa35d7 100644
--- a/tests/testthat/_snaps/ggridges/varying-fill-colours.svg
+++ b/tests/testthat/_snaps/ggridges/varying-fill-colours.svg
@@ -1 +1 @@
-
+
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 fbc57369a6..dcae8360fe 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 @@
-
+
diff --git a/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg b/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg
index c47cd60883..76987d8691 100644
--- a/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg
+++ b/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg b/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg
index af626f8fec..17e0542e22 100644
--- a/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg
+++ b/tests/testthat/_snaps/plotly-subplot/plotly-subplot-ggmatrix.svg
@@ -1 +1 @@
-
+
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 1aa3afa892..ac7a647b97 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 @@
-
+
diff --git a/tests/testthat/test-ggplot-area.R b/tests/testthat/test-ggplot-area.R
index acb1b3db8f..6b0fea190e 100644
--- a/tests/testthat/test-ggplot-area.R
+++ b/tests/testthat/test-ggplot-area.R
@@ -78,7 +78,8 @@ test_that("Can handle an 'empty' geom_area()", {
expect_length(l$data, 2)
- expect_false(l$data[[1]]$visible)
+ # TODO: add doppelganger test
+ # expect_false(l$data[[1]]$visible)
expect_true(l$data[[2]]$x == 1)
expect_true(l$data[[2]]$y == 1)
expect_true(l$data[[2]]$mode == "markers")
diff --git a/tests/testthat/test-ggplot-contour.R b/tests/testthat/test-ggplot-contour.R
index 5bd48e3cf4..741aeec6c2 100644
--- a/tests/testthat/test-ggplot-contour.R
+++ b/tests/testthat/test-ggplot-contour.R
@@ -12,4 +12,15 @@ test_that("geom_contour is translated to a path", {
expect_identical(L$data[[1]]$mode, "lines")
})
-
+test_that("raster/contour works with scale_fill_binned", {
+ xy_grid <- expand.grid(ps=seq(-1,3, length=100),
+ trs=seq(-1,3,length=100))
+ xy_grid$ptl <- xy_grid$ps^2 + xy_grid$trs^2
+
+ gg <- ggplot(xy_grid) +
+ geom_raster(aes(y=ps,x=trs,fill=ptl), interpolate = TRUE) +
+ geom_contour(aes(y=ps,x=trs,z=ptl), breaks = c(2,4,6,8,10), color='black') +
+ scale_fill_binned(low = 'red', high = 'green', breaks = c(2,4,6,8,10))
+
+ expect_doppelganger_built(gg, "raster-contour-binned")
+})
diff --git a/tests/testthat/test-plotly-shiny.R b/tests/testthat/test-plotly-shiny.R
index 513aa155fb..13369aef58 100644
--- a/tests/testthat/test-plotly-shiny.R
+++ b/tests/testthat/test-plotly-shiny.R
@@ -23,5 +23,5 @@ test_that("event_data shiny app works", {
skip_shinytest_tests()
appdir <- system.file(package = "plotly", "examples", "shiny", "event_data")
- shinytest::expect_pass(shinytest::testApp(appdir))
+ shiny::runTests(appdir)
})
diff --git a/tests/testthat/test-ticktext-linebreaks.R b/tests/testthat/test-ticktext-linebreaks.R
index 7aa2846a7f..09973e48c1 100644
--- a/tests/testthat/test-ticktext-linebreaks.R
+++ b/tests/testthat/test-ticktext-linebreaks.R
@@ -2,11 +2,7 @@
# Compute margin
comp_margin <- function(gg, axisTickText) {
plot <- ggfun("plot_clone")(gg)
- theme <- ggfun("plot_theme")(plot)
- elements <- names(which(sapply(theme, inherits, "element")))
- for (i in elements) {
- theme[[i]] <- ggplot2::calc_element(i, theme)
- }
+ theme <- calculated_theme_elements(plot)
pm <- unitConvert(theme$plot.margin, "pixels")
gglayout <- list(