diff --git a/NEWS.md b/NEWS.md
index 086635fafd..71d932d6b1 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -26,6 +26,13 @@ See the [plotly.js releases page](https://github.com/plotly/plotly.js/releases)
## Bug fixes
* `plotly_build()` now works with `ggmatrix` objects (e.g., from `GGally::ggpairs()`). (#2447)
+* Closed #2415: `ggplotly()` now shows variables named 'group' in tooltips when mapped to aesthetics like `colour`.
+* Closed #2455, #2460: `ggplotly()` no longer creates empty shapes when `panel.border` is `element_blank()` (ggplot2 4.0.0 compatibility).
+* Closed #2466: `ggplotly()` no longer errors when `scale_*_manual()` has unused aesthetics (e.g., `aesthetics = c("colour", "fill")` when only colour is used).
+* Closed #2305: `ggplotly()` now respects `geom_boxplot(outlier.shape = NA)` to hide outlier points.
+* Closed #2467: `ggplotly()` now correctly shows legends and splits traces when scales have multiple aesthetics.
+* Closed #2407, #2187: `ggplotly()` now translates `legend.position` theme element to plotly layout (supports "bottom", "top", "left", and numeric positions).
+* Closed #2281: `ggplotly()` no longer drops legends when `geom_blank()` is present in the plot.
# plotly 4.11.0
diff --git a/R/ggplotly.R b/R/ggplotly.R
index 973a31ebc1..a37804dd9e 100644
--- a/R/ggplotly.R
+++ b/R/ggplotly.R
@@ -411,9 +411,9 @@ gg2list <- function(p, width = NULL, height = NULL,
# of each non-positional scale for display in tooltips
for (sc in npscales$scales) {
data <- lapply(data, function(d) {
- # scale may not be relevant for every layer data
- if (any(names(d) %in% sc$aesthetics)) {
- d[paste0(sc$aesthetics, "_plotlyDomain")] <- d[sc$aesthetics]
+ present_aes <- intersect(sc$aesthetics, names(d))
+ if (length(present_aes) > 0) {
+ d[paste0(present_aes, "_plotlyDomain")] <- d[present_aes]
}
d
})
@@ -572,13 +572,15 @@ gg2list <- function(p, width = NULL, height = NULL,
tr$hoverinfo <- tr$hoverinfo %||%"text"
tr
})
- # show only one legend entry per legendgroup
+ # show only one legend entry per legendgroup (skip invisible traces for dedup)
grps <- sapply(traces, "[[", "legendgroup")
+ is_visible <- sapply(traces, function(tr) !isFALSE(tr$visible))
+ grps_for_dedup <- ifelse(is_visible, grps, paste0(grps, "_invisible_", seq_along(grps)))
traces <- Map(function(x, y) {
if (!is.null(x[["frame"]])) return(x)
x$showlegend <- isTRUE(x$showlegend) && y
x
- }, traces, !duplicated(grps))
+ }, traces, !duplicated(grps_for_dedup))
# ------------------------------------------------------------------------
# axis/facet/margin conversion
@@ -978,12 +980,45 @@ gg2list <- function(p, width = NULL, height = NULL,
bgcolor = toRGB(theme$legend.background$fill),
bordercolor = toRGB(theme$legend.background$colour),
borderwidth = unitConvert(
- theme$legend.background[[linewidth_or_size(theme$legend.background)]],
+ theme$legend.background[[linewidth_or_size(theme$legend.background)]],
"pixels", "width"
),
font = text2font(theme$legend.text)
)
-
+
+ # Translate legend.position to plotly layout
+ legend_pos <- theme$legend.position %||% theme[["legend.position"]]
+ if (!is.null(legend_pos) && !identical(legend_pos, "none")) {
+ if (is.character(legend_pos)) {
+ gglayout$legend <- switch(legend_pos,
+ "bottom" = modifyList(gglayout$legend, list(
+ orientation = "h", x = 0.5, y = -0.15, xanchor = "center", yanchor = "top"
+ )),
+ "top" = modifyList(gglayout$legend, list(
+ orientation = "h", x = 0.5, y = 1.02, xanchor = "center", yanchor = "bottom"
+ )),
+ "left" = modifyList(gglayout$legend, list(
+ x = -0.15, y = 0.5, xanchor = "right", yanchor = "middle"
+ )),
+ "inside" = {
+ inside_pos <- theme$legend.position.inside %||% theme[["legend.position.inside"]]
+ if (is.numeric(inside_pos) && length(inside_pos) == 2) {
+ modifyList(gglayout$legend, list(
+ x = inside_pos[1], y = inside_pos[2], xanchor = "left", yanchor = "bottom"
+ ))
+ } else {
+ gglayout$legend
+ }
+ },
+ gglayout$legend
+ )
+ } else if (is.numeric(legend_pos) && length(legend_pos) == 2) {
+ gglayout$legend <- modifyList(gglayout$legend, list(
+ x = legend_pos[1], y = legend_pos[2], xanchor = "left", yanchor = "bottom"
+ ))
+ }
+ }
+
# if theme(legend.position = "none") is used, don't show a legend _or_ guide
if (npscales$n() == 0 || identical(theme$legend.position, "none")) {
gglayout$showlegend <- FALSE
@@ -1389,7 +1424,12 @@ make_strip_rect <- function(xdom, ydom, theme, side = "top") {
# theme(panel.border) -> plotly.js rect shape
make_panel_border <- function(xdom, ydom, theme) {
- rekt <- rect2shape(theme[["panel.border"]])
+ # Use calc_element to get fully resolved element with inherited values
+ border <- ggplot2::calc_element("panel.border", theme)
+ if (is.null(border) || is_blank(border)) {
+ return(list())
+ }
+ rekt <- rect2shape(border)
rekt$x0 <- xdom[1]
rekt$x1 <- xdom[2]
rekt$y0 <- ydom[1]
diff --git a/R/layers2traces.R b/R/layers2traces.R
index 1b889dc3f8..181ef72909 100644
--- a/R/layers2traces.R
+++ b/R/layers2traces.R
@@ -56,8 +56,8 @@ layers2traces <- function(data, prestats_data, layout, p) {
if (!aesName %in% names(x)) next
# TODO: should we be getting the name from scale_*(name) first?
varName <- y[[i]]
- # "automatically" generated group aes is not informative
- if (identical("group", unique(varName, aesName))) next
+ # Skip auto-generated group aesthetic, but keep explicit group mappings
+ if (identical(aesName, "group") && identical(varName, "group")) next
# add a line break if hovertext already exists
if ("hovertext" %in% names(x)) x$hovertext <- paste0(x$hovertext, br())
# text aestheic should be taken verbatim (for custom tooltips)
@@ -75,12 +75,13 @@ layers2traces <- function(data, prestats_data, layout, p) {
x
}, data, hoverTextAes)
- # draw legends only for discrete scales
+ # draw legends only for discrete scales (skip scales with guide = "none")
discreteScales <- list()
for (sc in p$scales$non_position_scales()$scales) {
- if (sc$is_discrete()) {
- nm <- paste(sc$aesthetics, collapse = "_")
- discreteScales[[nm]] <- sc
+ if (sc$is_discrete() && !identical(sc$guide, "none")) {
+ for (aes_name in sc$aesthetics) {
+ discreteScales[[aes_name]] <- sc
+ }
}
}
# Convert "high-level" geoms to their "low-level" counterpart
@@ -706,7 +707,7 @@ geom2trace <- function(data, params, p) {
#' @export
geom2trace.GeomBlank <- function(data, params, p) {
- list(visible = FALSE)
+ list(visible = FALSE, showlegend = FALSE)
}
#' @export
@@ -870,6 +871,8 @@ geom2trace.GeomBoxplot <- function(data, params, p) {
# marker styling must inherit from GeomPoint$default_aes
# https://github.com/hadley/ggplot2/blob/ab42c2ca81458b0cf78e3ba47ed5db21f4d0fc30/NEWS#L73-L7
point_defaults <- GeomPoint$use_defaults(NULL)
+ hide_outliers <- isFALSE(params$outliers) || isTRUE(is.na(params$outlier_gp$shape))
+
compact(list(
x = data[["x"]],
y = data[["y"]],
@@ -883,6 +886,7 @@ geom2trace.GeomBoxplot <- function(data, params, p) {
aes2plotly(data, params, "fill"),
aes2plotly(data, params, "alpha")
),
+ boxpoints = if (hide_outliers) FALSE,
# markers/points
marker = list(
opacity = point_defaults$alpha,
@@ -1157,7 +1161,8 @@ linewidth_or_size.Geom <- function(x) {
#' @export
linewidth_or_size.element <- function(x) {
- if ("linewidth" %in% names(x)) "linewidth" else "size"
+ # S7 objects (ggplot2 >= 4.0) don't have traditional names(), check for slot
+ if (!is.null(x$linewidth) || "linewidth" %in% names(x)) "linewidth" else "size"
}
#' @export
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json
index 1ad6c91575..3d39284fe3 100644
--- a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/001.json
@@ -239,7 +239,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -252,7 +252,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "y",
"title": {
@@ -301,7 +301,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -314,7 +314,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "x",
"title": {
@@ -328,30 +328,13 @@
"hoverformat": ".2f"
},
"shapes": [
- {
- "type": "rect",
- "fillcolor": null,
- "line": {
- "color": null,
- "width": 0,
- "linetype": [
- ]
- },
- "yref": "paper",
- "xref": "paper",
- "layer": "below",
- "x0": 0,
- "x1": 1,
- "y0": 0,
- "y1": 1
- }
],
"showlegend": false,
"legend": {
"bgcolor": "rgba(255,255,255,1)",
"bordercolor": "transparent",
- "borderwidth": 0,
+ "borderwidth": 1.8897637795275593,
"font": {
"color": "rgba(0,0,0,1)",
"family": "",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json
index f926bc78c1..7e500aac33 100644
--- a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/002.json
@@ -18,7 +18,7 @@
"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}"
+ "plotly_relayout-A": "{\"width\":947,\"height\":400}"
},
"output": {
"brushed": "[1] \"Brush extents appear here (double-click to clear)\"",
@@ -242,7 +242,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -255,7 +255,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "y",
"title": {
@@ -304,7 +304,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -317,7 +317,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "x",
"title": {
@@ -331,30 +331,13 @@
"hoverformat": ".2f"
},
"shapes": [
- {
- "type": "rect",
- "fillcolor": null,
- "line": {
- "color": null,
- "width": 0,
- "linetype": [
- ]
- },
- "yref": "paper",
- "xref": "paper",
- "layer": "below",
- "x0": 0,
- "x1": 1,
- "y0": 0,
- "y1": 1
- }
],
"showlegend": false,
"legend": {
"bgcolor": "rgba(255,255,255,1)",
"bordercolor": "transparent",
- "borderwidth": 0,
+ "borderwidth": 1.8897637795275593,
"font": {
"color": "rgba(0,0,0,1)",
"family": "",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json
index e9f68d08c2..ff9132d055 100644
--- a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/003.json
@@ -20,7 +20,7 @@
"plotly_brushing-A": "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}",
"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}",
+ "plotly_relayout-A": "{\"width\":947,\"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\"}]"
},
@@ -246,7 +246,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -259,7 +259,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "y",
"title": {
@@ -308,7 +308,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -321,7 +321,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "x",
"title": {
@@ -335,30 +335,13 @@
"hoverformat": ".2f"
},
"shapes": [
- {
- "type": "rect",
- "fillcolor": null,
- "line": {
- "color": null,
- "width": 0,
- "linetype": [
- ]
- },
- "yref": "paper",
- "xref": "paper",
- "layer": "below",
- "x0": 0,
- "x1": 1,
- "y0": 0,
- "y1": 1
- }
],
"showlegend": false,
"legend": {
"bgcolor": "rgba(255,255,255,1)",
"bordercolor": "transparent",
- "borderwidth": 0,
+ "borderwidth": 1.8897637795275593,
"font": {
"color": "rgba(0,0,0,1)",
"family": "",
diff --git a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json
index 2b4bc6f5c8..96a563dbb1 100644
--- a/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json
+++ b/inst/examples/shiny/event_data/tests/testthat/_snaps/shinytest2/004.json
@@ -21,7 +21,7 @@
"plotly_click-A": null,
"plotly_deselect-A": "\"plot\"",
"plotly_hover-A": null,
- "plotly_relayout-A": "{\"width\":962,\"height\":400}",
+ "plotly_relayout-A": "{\"width\":947,\"height\":400}",
"plotly_selected-A": null,
"plotly_selecting-A": null
},
@@ -247,7 +247,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -260,7 +260,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "y",
"title": {
@@ -309,7 +309,7 @@
"ticks": "outside",
"tickcolor": "rgba(51,51,51,1)",
"ticklen": 3.6529680365296811,
- "tickwidth": 0,
+ "tickwidth": 0.66417600664176002,
"showticklabels": true,
"tickfont": {
"color": "rgba(77,77,77,1)",
@@ -322,7 +322,7 @@
"linewidth": 0,
"showgrid": true,
"gridcolor": "rgba(255,255,255,1)",
- "gridwidth": 0,
+ "gridwidth": 0.66417600664176002,
"zeroline": false,
"anchor": "x",
"title": {
@@ -336,30 +336,13 @@
"hoverformat": ".2f"
},
"shapes": [
- {
- "type": "rect",
- "fillcolor": null,
- "line": {
- "color": null,
- "width": 0,
- "linetype": [
- ]
- },
- "yref": "paper",
- "xref": "paper",
- "layer": "below",
- "x0": 0,
- "x1": 1,
- "y0": 0,
- "y1": 1
- }
],
"showlegend": false,
"legend": {
"bgcolor": "rgba(255,255,255,1)",
"bordercolor": "transparent",
- "borderwidth": 0,
+ "borderwidth": 1.8897637795275593,
"font": {
"color": "rgba(0,0,0,1)",
"family": "",
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor-major.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor-major.svg
index a101d1160d..31b4b91f11 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor-major.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor-major.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor.svg
index 86bb073e55..0f01c3d360 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-minor.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-x.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-x.svg
index a066656087..6ce0ec5f08 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-x.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-x.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-y.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-y.svg
index f37ee2e2a5..eaaf69f23b 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-y.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-blank-y.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-coord-ylim.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-coord-ylim.svg
index e68a7cecbb..3c77da1ede 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-coord-ylim.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-coord-ylim.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-custom-formatter.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-custom-formatter.svg
index 9bada9ef53..ccc92f6df8 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-custom-formatter.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-custom-formatter.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-flevels.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-flevels.svg
index d7e693bf9d..2adfcd9579 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-flevels.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-flevels.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-fonts.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-fonts.svg
index 1882834967..2d4278e04e 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-fonts.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-fonts.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-label-funs.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-label-funs.svg
index 0cbdc2ac10..685a1f1bf0 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-label-funs.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-label-funs.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-linear-axes.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-linear-axes.svg
index 4d690dbb0d..270774a282 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-linear-axes.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-linear-axes.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-coord.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-coord.svg
index c5b3aed832..a682e4d5a5 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-coord.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-coord.svg
@@ -1 +1 @@
-
+
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 f90bfda233..ba086f859f 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 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-scale.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-scale.svg
index e4824f44cb..17ccb79a7f 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-scale.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-log2-scale.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-no-x-title.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-no-x-title.svg
index 3ccde61f03..b67265e4ef 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-no-x-title.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-no-x-title.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-hide.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-hide.svg
index b7daaed970..42d7380dc8 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-hide.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-hide.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-name.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-name.svg
index 00611de2f5..b5379cce19 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-name.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-name.svg
@@ -1 +1 @@
-
+
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 887896d2af..97b17145b0 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 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10.svg
index d39c3a35de..50c8e04d60 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-scale-y-log10.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-ylim-hide.svg b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-ylim-hide.svg
index b7daaed970..42d7380dc8 100644
--- a/tests/testthat/_snaps/cookbook-axes/cookbook-axes-ylim-hide.svg
+++ b/tests/testthat/_snaps/cookbook-axes/cookbook-axes-ylim-hide.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-err4.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-err4.svg
index e2302135fb..00dd0565fc 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-err4.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-err4.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-error.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-error.svg
index 1dc8185811..b080e8e05b 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-error.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color-error.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color.svg
index 6f17146f7c..62a07ac7cf 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-dodge-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-diff.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-diff.svg
index 6e9db2ac57..be851f4b77 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-diff.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-diff.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-narrow.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-narrow.svg
index 33b394fc81..f3b775786b 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-narrow.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-narrow.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-wide.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-wide.svg
index 6e9db2ac57..be851f4b77 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-wide.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-bar-error-wide.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-bar.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-bar.svg
index e5c7ab1926..a01a103e60 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-bar.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-bar.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-horizontal-line.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-horizontal-line.svg
index 0b1955a570..7c9982effe 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-horizontal-line.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-basic-horizontal-line.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-dashed-red-line.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-dashed-red-line.svg
index b6bf220a47..f16412e536 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-dashed-red-line.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-dashed-red-line.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-basic.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-basic.svg
index 9741892726..624691c376 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-basic.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-basic.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline-vline.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline-vline.svg
index 5ed1c004f6..1ec4e0a686 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline-vline.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline-vline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline.svg
index e3f13cd02b..bef90d3636 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet-hline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet.svg
index de6a32ea85..c8b2bf0f2a 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-facet.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline-vline.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline-vline.svg
index ce4c4400e1..1f00ec02c2 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline-vline.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline-vline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline.svg b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline.svg
index e8a933e41c..776e5ae5ea 100644
--- a/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline.svg
+++ b/tests/testthat/_snaps/cookbook-lines/cookbook-axes-scatter-hline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/color.svg b/tests/testthat/_snaps/cookbook-scatterplots/color.svg
index 4bbfd50829..4542f85c21 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/color.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/full-range.svg b/tests/testthat/_snaps/cookbook-scatterplots/full-range.svg
index fa6aee11f8..183c648df3 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/full-range.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/full-range.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/geom-jitter.svg b/tests/testthat/_snaps/cookbook-scatterplots/geom-jitter.svg
index 08c4cac223..2899b809f3 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/geom-jitter.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/geom-jitter.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/hollow.svg b/tests/testthat/_snaps/cookbook-scatterplots/hollow.svg
index c3dda960c5..ce513ae2c1 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/hollow.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/hollow.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/jitter.svg b/tests/testthat/_snaps/cookbook-scatterplots/jitter.svg
index 08c4cac223..2899b809f3 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/jitter.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/jitter.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/loess.svg b/tests/testthat/_snaps/cookbook-scatterplots/loess.svg
index cc7d446776..c46029d439 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/loess.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/loess.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/overlap.svg b/tests/testthat/_snaps/cookbook-scatterplots/overlap.svg
index 702e6ebd52..fc0f01009a 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/overlap.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/overlap.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/scale-color-hue.svg b/tests/testthat/_snaps/cookbook-scatterplots/scale-color-hue.svg
index 794061e96d..786a8ea302 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/scale-color-hue.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/scale-color-hue.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/shape-manual.svg b/tests/testthat/_snaps/cookbook-scatterplots/shape-manual.svg
index ff8115fa16..9d733d7fe1 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/shape-manual.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/shape-manual.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/shape.svg b/tests/testthat/_snaps/cookbook-scatterplots/shape.svg
index edc54d24a7..036a9f16c6 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/shape.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/shape.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm-se-false.svg b/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm-se-false.svg
index 2e40d6e55d..c21991ee98 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm-se-false.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm-se-false.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm.svg b/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm.svg
index 05871f8bf3..1fd6c4edc2 100644
--- a/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm.svg
+++ b/tests/testthat/_snaps/cookbook-scatterplots/smooth-lm.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/geom-errorbar-flipped-aes/errobar-flipped-aes.svg b/tests/testthat/_snaps/geom-errorbar-flipped-aes/errobar-flipped-aes.svg
index 0a3c10272e..c0e6a0da4a 100644
--- a/tests/testthat/_snaps/geom-errorbar-flipped-aes/errobar-flipped-aes.svg
+++ b/tests/testthat/_snaps/geom-errorbar-flipped-aes/errobar-flipped-aes.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/geom-errorbar-issue-1751/errobar-no-aes-y.svg b/tests/testthat/_snaps/geom-errorbar-issue-1751/errobar-no-aes-y.svg
index 292285897c..a8b7de6ce5 100644
--- a/tests/testthat/_snaps/geom-errorbar-issue-1751/errobar-no-aes-y.svg
+++ b/tests/testthat/_snaps/geom-errorbar-issue-1751/errobar-no-aes-y.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg b/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg
index 4d361e74de..c6ae43a562 100644
--- a/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg
+++ b/tests/testthat/_snaps/ggalluvial/stratum-alluvium-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg b/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg
index 5373864dff..936c39a12f 100644
--- a/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg
+++ b/tests/testthat/_snaps/ggalluvial/stratum-alluvium.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-abline/cookbook-axes-multiple-abline.svg b/tests/testthat/_snaps/ggplot-abline/cookbook-axes-multiple-abline.svg
index 9ee86c7b41..e04d9d2036 100644
--- a/tests/testthat/_snaps/ggplot-abline/cookbook-axes-multiple-abline.svg
+++ b/tests/testthat/_snaps/ggplot-abline/cookbook-axes-multiple-abline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-abline/cookbook-axes-single-abline.svg b/tests/testthat/_snaps/ggplot-abline/cookbook-axes-single-abline.svg
index 60dbaa3a33..f88952c450 100644
--- a/tests/testthat/_snaps/ggplot-abline/cookbook-axes-single-abline.svg
+++ b/tests/testthat/_snaps/ggplot-abline/cookbook-axes-single-abline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-area/area-area-fillcolor.svg b/tests/testthat/_snaps/ggplot-area/area-area-fillcolor.svg
index 8160dcf346..4de48b038d 100644
--- a/tests/testthat/_snaps/ggplot-area/area-area-fillcolor.svg
+++ b/tests/testthat/_snaps/ggplot-area/area-area-fillcolor.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-area/area-simple.svg b/tests/testthat/_snaps/ggplot-area/area-simple.svg
index 89af7b902f..483c295520 100644
--- a/tests/testthat/_snaps/ggplot-area/area-simple.svg
+++ b/tests/testthat/_snaps/ggplot-area/area-simple.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-area/area-traces-order.svg b/tests/testthat/_snaps/ggplot-area/area-traces-order.svg
index fff3b035ab..ae58abc623 100644
--- a/tests/testthat/_snaps/ggplot-area/area-traces-order.svg
+++ b/tests/testthat/_snaps/ggplot-area/area-traces-order.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-aes-colour-guides-fill-false.svg b/tests/testthat/_snaps/ggplot-bar/bar-aes-colour-guides-fill-false.svg
index 1a1656ef74..e751bd731a 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-aes-colour-guides-fill-false.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-aes-colour-guides-fill-false.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-aes-fill-guides-color-none.svg b/tests/testthat/_snaps/ggplot-bar/bar-aes-fill-guides-color-none.svg
index 0ae4078c30..d870c4c727 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-aes-fill-guides-color-none.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-aes-fill-guides-color-none.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-black-outline.svg b/tests/testthat/_snaps/ggplot-bar/bar-black-outline.svg
index 0ae4078c30..d870c4c727 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-black-outline.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-black-outline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-category-names.svg b/tests/testthat/_snaps/ggplot-bar/bar-category-names.svg
index a93d6da437..4c4e01c711 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-category-names.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-category-names.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-color.svg b/tests/testthat/_snaps/ggplot-bar/bar-color.svg
index a3e65f9fc8..2ef326f650 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-color.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-coord-flip.svg b/tests/testthat/_snaps/ggplot-bar/bar-coord-flip.svg
index 6bb07e13dd..de9c4ed64c 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-coord-flip.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-coord-flip.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-dates.svg b/tests/testthat/_snaps/ggplot-bar/bar-dates.svg
index 055d232f0a..e1874a31d4 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-dates.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-dates.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-dodge.svg b/tests/testthat/_snaps/ggplot-bar/bar-dodge.svg
index 565421be6f..7c91e24ec9 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-dodge.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-dodge.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-identity.svg b/tests/testthat/_snaps/ggplot-bar/bar-identity.svg
index f75af064e0..384c4a83c8 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-identity.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-identity.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-nocolor.svg b/tests/testthat/_snaps/ggplot-bar/bar-nocolor.svg
index 80a0f70555..0701eaa45f 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-nocolor.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-nocolor.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-position-fill.svg b/tests/testthat/_snaps/ggplot-bar/bar-position-fill.svg
index 4b89d79b54..55d242ef4b 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-position-fill.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-position-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-position-stack.svg b/tests/testthat/_snaps/ggplot-bar/bar-position-stack.svg
index 44e9e33df8..2845b553f0 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-position-stack.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-position-stack.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-bar/bar-stack.svg b/tests/testthat/_snaps/ggplot-bar/bar-stack.svg
index b7474e31ef..ebc4bb5bc7 100644
--- a/tests/testthat/_snaps/ggplot-bar/bar-stack.svg
+++ b/tests/testthat/_snaps/ggplot-bar/bar-stack.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-boxplot/boxplot-datetime.svg b/tests/testthat/_snaps/ggplot-boxplot/boxplot-datetime.svg
index b30bd53ae3..99bf3e514b 100644
--- a/tests/testthat/_snaps/ggplot-boxplot/boxplot-datetime.svg
+++ b/tests/testthat/_snaps/ggplot-boxplot/boxplot-datetime.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-boxplot/boxplot-fillcolor.svg b/tests/testthat/_snaps/ggplot-boxplot/boxplot-fillcolor.svg
index 2765fb176d..ecc3080c75 100644
--- a/tests/testthat/_snaps/ggplot-boxplot/boxplot-fillcolor.svg
+++ b/tests/testthat/_snaps/ggplot-boxplot/boxplot-fillcolor.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-boxplot/boxplot-legends-for-fill.svg b/tests/testthat/_snaps/ggplot-boxplot/boxplot-legends-for-fill.svg
index dda3c05dca..806cf3d231 100644
--- a/tests/testthat/_snaps/ggplot-boxplot/boxplot-legends-for-fill.svg
+++ b/tests/testthat/_snaps/ggplot-boxplot/boxplot-legends-for-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-boxplot/boxplot.svg b/tests/testthat/_snaps/ggplot-boxplot/boxplot.svg
index 0a5e327f7d..1c61bbaa7c 100644
--- a/tests/testthat/_snaps/ggplot-boxplot/boxplot.svg
+++ b/tests/testthat/_snaps/ggplot-boxplot/boxplot.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-col/col.svg b/tests/testthat/_snaps/ggplot-col/col.svg
index 3ec40841d2..8411a51d08 100644
--- a/tests/testthat/_snaps/ggplot-col/col.svg
+++ b/tests/testthat/_snaps/ggplot-col/col.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-contour/contour.svg b/tests/testthat/_snaps/ggplot-contour/contour.svg
index 47086596a9..7ca30c35ae 100644
--- a/tests/testthat/_snaps/ggplot-contour/contour.svg
+++ b/tests/testthat/_snaps/ggplot-contour/contour.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg b/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg
index 580d78f08e..5d2b4c2238 100644
--- a/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg
+++ b/tests/testthat/_snaps/ggplot-contour/raster-contour-binned.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-date/date-class-date.svg b/tests/testthat/_snaps/ggplot-date/date-class-date.svg
index 8ebd20f59e..3753401405 100644
--- a/tests/testthat/_snaps/ggplot-date/date-class-date.svg
+++ b/tests/testthat/_snaps/ggplot-date/date-class-date.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-date/date-irregular-time-series.svg b/tests/testthat/_snaps/ggplot-date/date-irregular-time-series.svg
index c36d00b032..402f214223 100644
--- a/tests/testthat/_snaps/ggplot-date/date-irregular-time-series.svg
+++ b/tests/testthat/_snaps/ggplot-date/date-irregular-time-series.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-date/date-strings.svg b/tests/testthat/_snaps/ggplot-date/date-strings.svg
index 4f4fecaf17..b68c2194ab 100644
--- a/tests/testthat/_snaps/ggplot-date/date-strings.svg
+++ b/tests/testthat/_snaps/ggplot-date/date-strings.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-density/density-color.svg b/tests/testthat/_snaps/ggplot-density/density-color.svg
index 0f5ad23cae..2a2c1e6290 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 1094073aca..8f1467266d 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 cb689d7924..8a85aeacf7 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 f4cea066d5..15f5eec9e9 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 98ca79b7e5..0e648018dc 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-density2d/density2d.svg b/tests/testthat/_snaps/ggplot-density2d/density2d.svg
index f2fa02a93f..e4f603956b 100644
--- a/tests/testthat/_snaps/ggplot-density2d/density2d.svg
+++ b/tests/testthat/_snaps/ggplot-density2d/density2d.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-errorbar-horizontal/errorbar-horizontal.svg b/tests/testthat/_snaps/ggplot-errorbar-horizontal/errorbar-horizontal.svg
index 9f88cdfab5..288d79f2d1 100644
--- a/tests/testthat/_snaps/ggplot-errorbar-horizontal/errorbar-horizontal.svg
+++ b/tests/testthat/_snaps/ggplot-errorbar-horizontal/errorbar-horizontal.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-errorbar/errorbar-unique-groups.svg b/tests/testthat/_snaps/ggplot-errorbar/errorbar-unique-groups.svg
index 4a8f1a1fc8..e55c4e672a 100644
--- a/tests/testthat/_snaps/ggplot-errorbar/errorbar-unique-groups.svg
+++ b/tests/testthat/_snaps/ggplot-errorbar/errorbar-unique-groups.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-errorbar/errorbar.svg b/tests/testthat/_snaps/ggplot-errorbar/errorbar.svg
index d530cfe4d3..865680f43f 100644
--- a/tests/testthat/_snaps/ggplot-errorbar/errorbar.svg
+++ b/tests/testthat/_snaps/ggplot-errorbar/errorbar.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/3-panels.svg b/tests/testthat/_snaps/ggplot-facets/3-panels.svg
index 09b6db3468..8a1fbdcb88 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 e381a09743..cd32ca9c62 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-grid-free-x.svg b/tests/testthat/_snaps/ggplot-facets/facet-grid-free-x.svg
index 36b62aa901..02a70182be 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-grid-free-x.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-grid-free-x.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-grid-free-y.svg b/tests/testthat/_snaps/ggplot-facets/facet-grid-free-y.svg
index cde8d9507b..807b5e805c 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-grid-free-y.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-grid-free-y.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-grid-free.svg b/tests/testthat/_snaps/ggplot-facets/facet-grid-free.svg
index 91585dbb69..e8e2faaa67 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-grid-free.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-grid-free.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-grid-labeller.svg b/tests/testthat/_snaps/ggplot-facets/facet-grid-labeller.svg
index 83a3d217d0..b8cb58240c 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-grid-labeller.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-grid-labeller.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 50481ff749..0e95571585 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 9dc2300fe9..b30e634d9d 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 7c232c6140..663ca2d4db 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 e19577ae39..f1b417d86c 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 0de10fef70..0b9ed4968b 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-facets/facet-wrap-labeller.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap-labeller.svg
index 51847ed161..fabba5963a 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap-labeller.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap-labeller.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-facets/facet-wrap.svg b/tests/testthat/_snaps/ggplot-facets/facet-wrap.svg
index 00487b8afc..b1aba34476 100644
--- a/tests/testthat/_snaps/ggplot-facets/facet-wrap.svg
+++ b/tests/testthat/_snaps/ggplot-facets/facet-wrap.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-function/geomfunction.svg b/tests/testthat/_snaps/ggplot-function/geomfunction.svg
index 8709acff47..cbe95e6b87 100644
--- a/tests/testthat/_snaps/ggplot-function/geomfunction.svg
+++ b/tests/testthat/_snaps/ggplot-function/geomfunction.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-function/stat-function.svg b/tests/testthat/_snaps/ggplot-function/stat-function.svg
index bba0270fc1..d9f4332c88 100644
--- a/tests/testthat/_snaps/ggplot-function/stat-function.svg
+++ b/tests/testthat/_snaps/ggplot-function/stat-function.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-heatmap/heatmap-discrete.svg b/tests/testthat/_snaps/ggplot-heatmap/heatmap-discrete.svg
index 9a4e759bd3..af04ebfaf4 100644
--- a/tests/testthat/_snaps/ggplot-heatmap/heatmap-discrete.svg
+++ b/tests/testthat/_snaps/ggplot-heatmap/heatmap-discrete.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-heatmap/heatmap-midpoint.svg b/tests/testthat/_snaps/ggplot-heatmap/heatmap-midpoint.svg
index f5436c421c..b4601e9169 100644
--- a/tests/testthat/_snaps/ggplot-heatmap/heatmap-midpoint.svg
+++ b/tests/testthat/_snaps/ggplot-heatmap/heatmap-midpoint.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-heatmap/heatmap.svg b/tests/testthat/_snaps/ggplot-heatmap/heatmap.svg
index 0ca7bf93f6..c3d48f69a4 100644
--- a/tests/testthat/_snaps/ggplot-heatmap/heatmap.svg
+++ b/tests/testthat/_snaps/ggplot-heatmap/heatmap.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg b/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg
index 59a2d34b17..b7c82f55ee 100644
--- a/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg
+++ b/tests/testthat/_snaps/ggplot-heatmap/tile-no-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-hex/hex-basic.svg b/tests/testthat/_snaps/ggplot-hex/hex-basic.svg
index e9f2112c61..dd5ca99e20 100644
--- a/tests/testthat/_snaps/ggplot-hex/hex-basic.svg
+++ b/tests/testthat/_snaps/ggplot-hex/hex-basic.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-hex/hex-bins.svg b/tests/testthat/_snaps/ggplot-hex/hex-bins.svg
index efc8573776..ed7fc19288 100644
--- a/tests/testthat/_snaps/ggplot-hex/hex-bins.svg
+++ b/tests/testthat/_snaps/ggplot-hex/hex-bins.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-hex/hex-binwidth.svg b/tests/testthat/_snaps/ggplot-hex/hex-binwidth.svg
index 1e3dc06b31..26431bc603 100644
--- a/tests/testthat/_snaps/ggplot-hex/hex-binwidth.svg
+++ b/tests/testthat/_snaps/ggplot-hex/hex-binwidth.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-counts.svg
index 9b334ee38d..7055d966ec 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-date-bins.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-date-bins.svg
index 8bb51ff15e..277efe2145 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-date-bins.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-date-bins.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-dates.svg
index 1980345982..10813ee7d6 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-binwidth.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-density-binwidth.svg
index f12bc523f8..62e5ffa3c3 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-density-binwidth.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-density-binwidth.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-density.svg
index c6d455f617..9e9fd27d19 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 45d0c3ac1d..3537f762dd 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 4ea40fbedf..cbcc887535 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 7d418f0672..f9beb752e6 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 3e68da3804..0cf73b358b 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 1302eee0a7..a136a5461a 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 bdbff1c26a..48e7b0804b 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-posixt-bins.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-posixt-bins.svg
index 8bb51ff15e..277efe2145 100644
--- a/tests/testthat/_snaps/ggplot-histogram/histogram-posixt-bins.svg
+++ b/tests/testthat/_snaps/ggplot-histogram/histogram-posixt-bins.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg b/tests/testthat/_snaps/ggplot-histogram/histogram-vline.svg
index 24655e26a8..f63de55e3d 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-hline/hline-factor.svg b/tests/testthat/_snaps/ggplot-hline/hline-factor.svg
index 0b1955a570..7c9982effe 100644
--- a/tests/testthat/_snaps/ggplot-hline/hline-factor.svg
+++ b/tests/testthat/_snaps/ggplot-hline/hline-factor.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-hline/hline-multiple.svg b/tests/testthat/_snaps/ggplot-hline/hline-multiple.svg
index 216997380d..e5043340ba 100644
--- a/tests/testthat/_snaps/ggplot-hline/hline-multiple.svg
+++ b/tests/testthat/_snaps/ggplot-hline/hline-multiple.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-hline/hline.svg b/tests/testthat/_snaps/ggplot-hline/hline.svg
index 6524268763..2c185c5ae9 100644
--- a/tests/testthat/_snaps/ggplot-hline/hline.svg
+++ b/tests/testthat/_snaps/ggplot-hline/hline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-hline/split-hline-vline-abline.svg b/tests/testthat/_snaps/ggplot-hline/split-hline-vline-abline.svg
index b82fab37a1..e33f827c43 100644
--- a/tests/testthat/_snaps/ggplot-hline/split-hline-vline-abline.svg
+++ b/tests/testthat/_snaps/ggplot-hline/split-hline-vline-abline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-jitter/jitter-basic.svg b/tests/testthat/_snaps/ggplot-jitter/jitter-basic.svg
index 23c1798316..31f0d0f824 100644
--- a/tests/testthat/_snaps/ggplot-jitter/jitter-basic.svg
+++ b/tests/testthat/_snaps/ggplot-jitter/jitter-basic.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-labels/factor-labels.svg b/tests/testthat/_snaps/ggplot-labels/factor-labels.svg
index 024f1c52a7..ed4e6407b1 100644
--- a/tests/testthat/_snaps/ggplot-labels/factor-labels.svg
+++ b/tests/testthat/_snaps/ggplot-labels/factor-labels.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-labels/labels-angles.svg b/tests/testthat/_snaps/ggplot-labels/labels-angles.svg
index 0fbd285591..4c678e4723 100644
--- a/tests/testthat/_snaps/ggplot-labels/labels-angles.svg
+++ b/tests/testthat/_snaps/ggplot-labels/labels-angles.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-labels/labels-ggtitle.svg b/tests/testthat/_snaps/ggplot-labels/labels-ggtitle.svg
index 31096ee68d..449e7d48bf 100644
--- a/tests/testthat/_snaps/ggplot-labels/labels-ggtitle.svg
+++ b/tests/testthat/_snaps/ggplot-labels/labels-ggtitle.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-labels/labels-scale-x-continuous-name.svg b/tests/testthat/_snaps/ggplot-labels/labels-scale-x-continuous-name.svg
index 7abd86d62f..235fc96965 100644
--- a/tests/testthat/_snaps/ggplot-labels/labels-scale-x-continuous-name.svg
+++ b/tests/testthat/_snaps/ggplot-labels/labels-scale-x-continuous-name.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-labels/labels-ylab.svg b/tests/testthat/_snaps/ggplot-labels/labels-ylab.svg
index c56fc48a7d..a260149115 100644
--- a/tests/testthat/_snaps/ggplot-labels/labels-ylab.svg
+++ b/tests/testthat/_snaps/ggplot-labels/labels-ylab.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg b/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg
index 0f28e2b07a..a53de8522b 100644
--- a/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg
+++ b/tests/testthat/_snaps/ggplot-labels/labs-element-blank.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg b/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg
index c9fea70072..a6431ccff8 100644
--- a/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg
+++ b/tests/testthat/_snaps/ggplot-legend/guide-aes-none.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/legend-hide-legend.svg b/tests/testthat/_snaps/ggplot-legend/legend-hide-legend.svg
index e3f1e128ba..d0c40393ed 100644
--- a/tests/testthat/_snaps/ggplot-legend/legend-hide-legend.svg
+++ b/tests/testthat/_snaps/ggplot-legend/legend-hide-legend.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/legend-hide.svg b/tests/testthat/_snaps/ggplot-legend/legend-hide.svg
index 88c041570e..ab49d039e3 100644
--- a/tests/testthat/_snaps/ggplot-legend/legend-hide.svg
+++ b/tests/testthat/_snaps/ggplot-legend/legend-hide.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 412e5e9a70..950a7664c2 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-legend/legend-one-entry.svg b/tests/testthat/_snaps/ggplot-legend/legend-one-entry.svg
index ca23482179..1fba05eb96 100644
--- a/tests/testthat/_snaps/ggplot-legend/legend-one-entry.svg
+++ b/tests/testthat/_snaps/ggplot-legend/legend-one-entry.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/legend-varying-aes-guide.svg b/tests/testthat/_snaps/ggplot-legend/legend-varying-aes-guide.svg
index f9a6aa8e5b..c0920c3541 100644
--- a/tests/testthat/_snaps/ggplot-legend/legend-varying-aes-guide.svg
+++ b/tests/testthat/_snaps/ggplot-legend/legend-varying-aes-guide.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/legend-very-long-legend-items.svg b/tests/testthat/_snaps/ggplot-legend/legend-very-long-legend-items.svg
index 1d3c009246..271b23ee46 100644
--- a/tests/testthat/_snaps/ggplot-legend/legend-very-long-legend-items.svg
+++ b/tests/testthat/_snaps/ggplot-legend/legend-very-long-legend-items.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/respect-guides.svg b/tests/testthat/_snaps/ggplot-legend/respect-guides.svg
index 7d581ec51f..8de28f2ab4 100644
--- a/tests/testthat/_snaps/ggplot-legend/respect-guides.svg
+++ b/tests/testthat/_snaps/ggplot-legend/respect-guides.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-legend/scatter-legend.svg b/tests/testthat/_snaps/ggplot-legend/scatter-legend.svg
index 0ca901f7d3..2b21497f20 100644
--- a/tests/testthat/_snaps/ggplot-legend/scatter-legend.svg
+++ b/tests/testthat/_snaps/ggplot-legend/scatter-legend.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-lines/line-milliseconds.svg b/tests/testthat/_snaps/ggplot-lines/line-milliseconds.svg
index 583ea7cc6b..de816dfdfd 100644
--- a/tests/testthat/_snaps/ggplot-lines/line-milliseconds.svg
+++ b/tests/testthat/_snaps/ggplot-lines/line-milliseconds.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-lines/linetype-colors.svg b/tests/testthat/_snaps/ggplot-lines/linetype-colors.svg
index ca2886acd8..a6fa1eff43 100644
--- a/tests/testthat/_snaps/ggplot-lines/linetype-colors.svg
+++ b/tests/testthat/_snaps/ggplot-lines/linetype-colors.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-lines/linetype-types.svg b/tests/testthat/_snaps/ggplot-lines/linetype-types.svg
index da9da6022d..498b424502 100644
--- a/tests/testthat/_snaps/ggplot-lines/linetype-types.svg
+++ b/tests/testthat/_snaps/ggplot-lines/linetype-types.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-map/map-facet.svg b/tests/testthat/_snaps/ggplot-map/map-facet.svg
index b882328a6a..5c65c1de0f 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-path/path-colored-groups-stay-together.svg b/tests/testthat/_snaps/ggplot-path/path-colored-groups-stay-together.svg
index f7db9c2f5a..f35e3ff6cf 100644
--- a/tests/testthat/_snaps/ggplot-path/path-colored-groups-stay-together.svg
+++ b/tests/testthat/_snaps/ggplot-path/path-colored-groups-stay-together.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-path/path-colors.svg b/tests/testthat/_snaps/ggplot-path/path-colors.svg
index 687e7d1e91..a63508505a 100644
--- a/tests/testthat/_snaps/ggplot-path/path-colors.svg
+++ b/tests/testthat/_snaps/ggplot-path/path-colors.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-path/path-colors2.svg b/tests/testthat/_snaps/ggplot-path/path-colors2.svg
index ed58f0bf38..33880b2392 100644
--- a/tests/testthat/_snaps/ggplot-path/path-colors2.svg
+++ b/tests/testthat/_snaps/ggplot-path/path-colors2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-path/path-line-symbols.svg b/tests/testthat/_snaps/ggplot-path/path-line-symbols.svg
index 13cd9fdaa2..f9be562d5e 100644
--- a/tests/testthat/_snaps/ggplot-path/path-line-symbols.svg
+++ b/tests/testthat/_snaps/ggplot-path/path-line-symbols.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-path/path-lines-diff-from-paths.svg b/tests/testthat/_snaps/ggplot-path/path-lines-diff-from-paths.svg
index de8924b03b..ec85b01c6b 100644
--- a/tests/testthat/_snaps/ggplot-path/path-lines-diff-from-paths.svg
+++ b/tests/testthat/_snaps/ggplot-path/path-lines-diff-from-paths.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-point/all-shapes.svg b/tests/testthat/_snaps/ggplot-point/all-shapes.svg
index b2d160f56b..900d6890a1 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-point/open-shapes.svg b/tests/testthat/_snaps/ggplot-point/open-shapes.svg
index 057f058ca8..59bf83389e 100644
--- a/tests/testthat/_snaps/ggplot-point/open-shapes.svg
+++ b/tests/testthat/_snaps/ggplot-point/open-shapes.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-point/point-flip.svg b/tests/testthat/_snaps/ggplot-point/point-flip.svg
index e647a0631e..25ff4475ce 100644
--- a/tests/testthat/_snaps/ggplot-point/point-flip.svg
+++ b/tests/testthat/_snaps/ggplot-point/point-flip.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-point/point-size-alpha.svg b/tests/testthat/_snaps/ggplot-point/point-size-alpha.svg
index 3d18e14f40..4894b5014f 100644
--- a/tests/testthat/_snaps/ggplot-point/point-size-alpha.svg
+++ b/tests/testthat/_snaps/ggplot-point/point-size-alpha.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-point/point-size-alpha2.svg b/tests/testthat/_snaps/ggplot-point/point-size-alpha2.svg
index 3d182154b9..7d4854cd71 100644
--- a/tests/testthat/_snaps/ggplot-point/point-size-alpha2.svg
+++ b/tests/testthat/_snaps/ggplot-point/point-size-alpha2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-aes-color.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-aes-color.svg
index 45ef65ec40..4c8b659ee0 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-aes-color.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-aes-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-aes-fill.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-aes-fill.svg
index b6d0ebed72..996b22fa7f 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-aes-fill.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-aes-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-black.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-black.svg
index 17df596ffb..24af6a9dda 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-black.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-black.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-color-aes-fill.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-color-aes-fill.svg
index 242041bb17..4fc53e0291 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-color-aes-fill.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-color-aes-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-linetype.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-linetype.svg
index 3bb952748d..2e6b27497e 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-linetype.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-linetype.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-size.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-size.svg
index bdd5692218..2cc6a54578 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-size.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-color-fill-aes-size.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-star-fill-color.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-star-fill-color.svg
index 94d80d36fa..4887d563f3 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-star-fill-color.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-star-fill-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-star-group-color.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-star-group-color.svg
index 55c1c16df8..515bb1bfcf 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-star-group-color.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-star-group-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygon-star-group.svg b/tests/testthat/_snaps/ggplot-polygons/polygon-star-group.svg
index d7ef8f8995..0baff6b976 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygon-star-group.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygon-star-group.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg b/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg
index 9092b3fff5..5ebbf4ee24 100644
--- a/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg
+++ b/tests/testthat/_snaps/ggplot-polygons/polygons-canada-borders.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-rect/rect-black.svg b/tests/testthat/_snaps/ggplot-rect/rect-black.svg
index 6f2bb7cbba..c5c4278495 100644
--- a/tests/testthat/_snaps/ggplot-rect/rect-black.svg
+++ b/tests/testthat/_snaps/ggplot-rect/rect-black.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-rect/rect-black4.svg b/tests/testthat/_snaps/ggplot-rect/rect-black4.svg
index ff6e03978d..9440158075 100644
--- a/tests/testthat/_snaps/ggplot-rect/rect-black4.svg
+++ b/tests/testthat/_snaps/ggplot-rect/rect-black4.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-rect/rect-color.svg b/tests/testthat/_snaps/ggplot-rect/rect-color.svg
index 0637a71c77..37723ca8a5 100644
--- a/tests/testthat/_snaps/ggplot-rect/rect-color.svg
+++ b/tests/testthat/_snaps/ggplot-rect/rect-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-rect/rect-fill-color.svg b/tests/testthat/_snaps/ggplot-rect/rect-fill-color.svg
index cfa53d7b4c..dbeceeb904 100644
--- a/tests/testthat/_snaps/ggplot-rect/rect-fill-color.svg
+++ b/tests/testthat/_snaps/ggplot-rect/rect-fill-color.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-rect/rect-fill-hex-alpha.svg b/tests/testthat/_snaps/ggplot-rect/rect-fill-hex-alpha.svg
index 361eaae375..05a47daf9d 100644
--- a/tests/testthat/_snaps/ggplot-rect/rect-fill-hex-alpha.svg
+++ b/tests/testthat/_snaps/ggplot-rect/rect-fill-hex-alpha.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-rect/rect-fill.svg b/tests/testthat/_snaps/ggplot-rect/rect-fill.svg
index e6d89c35ea..8231b3a1ca 100644
--- a/tests/testthat/_snaps/ggplot-rect/rect-fill.svg
+++ b/tests/testthat/_snaps/ggplot-rect/rect-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ribbon/ribbon-alpha.svg b/tests/testthat/_snaps/ggplot-ribbon/ribbon-alpha.svg
index 4489454ac1..f9793001ae 100644
--- a/tests/testthat/_snaps/ggplot-ribbon/ribbon-alpha.svg
+++ b/tests/testthat/_snaps/ggplot-ribbon/ribbon-alpha.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ribbon/ribbon-colour.svg b/tests/testthat/_snaps/ggplot-ribbon/ribbon-colour.svg
index c7e2d06bac..525dd05a9f 100644
--- a/tests/testthat/_snaps/ggplot-ribbon/ribbon-colour.svg
+++ b/tests/testthat/_snaps/ggplot-ribbon/ribbon-colour.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ribbon/ribbon-fill.svg b/tests/testthat/_snaps/ggplot-ribbon/ribbon-fill.svg
index ae0455e51e..88357920a5 100644
--- a/tests/testthat/_snaps/ggplot-ribbon/ribbon-fill.svg
+++ b/tests/testthat/_snaps/ggplot-ribbon/ribbon-fill.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ribbon/ribbon-group.svg b/tests/testthat/_snaps/ggplot-ribbon/ribbon-group.svg
index 8c765840e9..6e81c21796 100644
--- a/tests/testthat/_snaps/ggplot-ribbon/ribbon-group.svg
+++ b/tests/testthat/_snaps/ggplot-ribbon/ribbon-group.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-segment/segment-multiple-non-numeric.svg b/tests/testthat/_snaps/ggplot-segment/segment-multiple-non-numeric.svg
index 4ce79186eb..2c795dc373 100644
--- a/tests/testthat/_snaps/ggplot-segment/segment-multiple-non-numeric.svg
+++ b/tests/testthat/_snaps/ggplot-segment/segment-multiple-non-numeric.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-segment/segment.svg b/tests/testthat/_snaps/ggplot-segment/segment.svg
index 290b7b3b32..0ef1f07aa6 100644
--- a/tests/testthat/_snaps/ggplot-segment/segment.svg
+++ b/tests/testthat/_snaps/ggplot-segment/segment.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg b/tests/testthat/_snaps/ggplot-sf/sf-aspect.svg
index faa3ae8cbf..167ae03f78 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 fd55356dab..27be7cf090 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 bd5af427f0..0c857ead53 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 f1f00e98c5..a87407bb72 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 e7e38dba0f..11589487f7 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.svg b/tests/testthat/_snaps/ggplot-sf/sf.svg
index faa3ae8cbf..167ae03f78 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-size/size-global-scaling.svg b/tests/testthat/_snaps/ggplot-size/size-global-scaling.svg
index dfe2446ba1..98c56dd7f3 100644
--- a/tests/testthat/_snaps/ggplot-size/size-global-scaling.svg
+++ b/tests/testthat/_snaps/ggplot-size/size-global-scaling.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-size/size-is-a-vector.svg b/tests/testthat/_snaps/ggplot-size/size-is-a-vector.svg
index fd03bfd113..4c002822c8 100644
--- a/tests/testthat/_snaps/ggplot-size/size-is-a-vector.svg
+++ b/tests/testthat/_snaps/ggplot-size/size-is-a-vector.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-smooth/smooth-basic.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-basic.svg
index 44a3885a75..bdf4762bbf 100644
--- a/tests/testthat/_snaps/ggplot-smooth/smooth-basic.svg
+++ b/tests/testthat/_snaps/ggplot-smooth/smooth-basic.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-smooth/smooth-colour.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-colour.svg
index f4e756f2fd..313713f0de 100644
--- a/tests/testthat/_snaps/ggplot-smooth/smooth-colour.svg
+++ b/tests/testthat/_snaps/ggplot-smooth/smooth-colour.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-smooth/smooth-facet.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-facet.svg
index e79f872772..8b9bd8af23 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-smooth/smooth-fill2.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-fill2.svg
index eff0152619..5945650847 100644
--- a/tests/testthat/_snaps/ggplot-smooth/smooth-fill2.svg
+++ b/tests/testthat/_snaps/ggplot-smooth/smooth-fill2.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-smooth/smooth-group.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-group.svg
index 1136e92a57..c45e01718f 100644
--- a/tests/testthat/_snaps/ggplot-smooth/smooth-group.svg
+++ b/tests/testthat/_snaps/ggplot-smooth/smooth-group.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-smooth/smooth-se-false.svg b/tests/testthat/_snaps/ggplot-smooth/smooth-se-false.svg
index 35eb4f06e1..a45ff10a21 100644
--- a/tests/testthat/_snaps/ggplot-smooth/smooth-se-false.svg
+++ b/tests/testthat/_snaps/ggplot-smooth/smooth-se-false.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-step/step-ecdf-multiple.svg b/tests/testthat/_snaps/ggplot-step/step-ecdf-multiple.svg
index b849d2e983..f5be69294a 100644
--- a/tests/testthat/_snaps/ggplot-step/step-ecdf-multiple.svg
+++ b/tests/testthat/_snaps/ggplot-step/step-ecdf-multiple.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-step/step-ecdf.svg b/tests/testthat/_snaps/ggplot-step/step-ecdf.svg
index f9b84e1c8f..4ccac5ea37 100644
--- a/tests/testthat/_snaps/ggplot-step/step-ecdf.svg
+++ b/tests/testthat/_snaps/ggplot-step/step-ecdf.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-step/step-gg-hv.svg b/tests/testthat/_snaps/ggplot-step/step-gg-hv.svg
index 1dc4c90100..e5ae8aab19 100644
--- a/tests/testthat/_snaps/ggplot-step/step-gg-hv.svg
+++ b/tests/testthat/_snaps/ggplot-step/step-gg-hv.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-step/step-gg-hvh.svg b/tests/testthat/_snaps/ggplot-step/step-gg-hvh.svg
index 33f830c206..380f448fbb 100644
--- a/tests/testthat/_snaps/ggplot-step/step-gg-hvh.svg
+++ b/tests/testthat/_snaps/ggplot-step/step-gg-hvh.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-step/step-gg-vh.svg b/tests/testthat/_snaps/ggplot-step/step-gg-vh.svg
index dd11fbcab9..0ad3faa7e9 100644
--- a/tests/testthat/_snaps/ggplot-step/step-gg-vh.svg
+++ b/tests/testthat/_snaps/ggplot-step/step-gg-vh.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-step/step-gg-vhv.svg b/tests/testthat/_snaps/ggplot-step/step-gg-vhv.svg
index 44493a5b23..1069de0dc9 100644
--- a/tests/testthat/_snaps/ggplot-step/step-gg-vhv.svg
+++ b/tests/testthat/_snaps/ggplot-step/step-gg-vhv.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-summary/stat-summary.svg b/tests/testthat/_snaps/ggplot-summary/stat-summary.svg
index 3734737f5e..59e9c7cf6c 100644
--- a/tests/testthat/_snaps/ggplot-summary/stat-summary.svg
+++ b/tests/testthat/_snaps/ggplot-summary/stat-summary.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-text/text-colour.svg b/tests/testthat/_snaps/ggplot-text/text-colour.svg
index ceca677a50..0632ba5bb0 100644
--- a/tests/testthat/_snaps/ggplot-text/text-colour.svg
+++ b/tests/testthat/_snaps/ggplot-text/text-colour.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-text/text.svg b/tests/testthat/_snaps/ggplot-text/text.svg
index da7f524e10..04ef8057ca 100644
--- a/tests/testthat/_snaps/ggplot-text/text.svg
+++ b/tests/testthat/_snaps/ggplot-text/text.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-theme/theme-background.svg b/tests/testthat/_snaps/ggplot-theme/theme-background.svg
index 574fb1ab96..627d295657 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-background.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-background.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-theme/theme-marker-default.svg b/tests/testthat/_snaps/ggplot-theme/theme-marker-default.svg
index 8120ead62a..cb7d459437 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-marker-default.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-marker-default.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-theme/theme-panel-border-1.svg b/tests/testthat/_snaps/ggplot-theme/theme-panel-border-1.svg
index 835bc4940d..5e4f7031f1 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-panel-border-1.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-panel-border-1.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 05f2aceb78..3608ecc537 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-theme/theme-ticks-and-grids.svg b/tests/testthat/_snaps/ggplot-theme/theme-ticks-and-grids.svg
index bac9a647cb..92a8dbf889 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-ticks-and-grids.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-ticks-and-grids.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-theme/theme-ticks-default.svg b/tests/testthat/_snaps/ggplot-theme/theme-ticks-default.svg
index 835bc4940d..5e4f7031f1 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-ticks-default.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-ticks-default.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-theme/theme-zeroline-default.svg b/tests/testthat/_snaps/ggplot-theme/theme-zeroline-default.svg
index 835bc4940d..5e4f7031f1 100644
--- a/tests/testthat/_snaps/ggplot-theme/theme-zeroline-default.svg
+++ b/tests/testthat/_snaps/ggplot-theme/theme-zeroline-default.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/continuous-x-missing.svg b/tests/testthat/_snaps/ggplot-ticks/continuous-x-missing.svg
index e7699649bc..849a964feb 100644
--- a/tests/testthat/_snaps/ggplot-ticks/continuous-x-missing.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/continuous-x-missing.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-facet-grid.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-facet-grid.svg
index 359835b4b2..aa9eb132c5 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-facet-grid.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-facet-grid.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-scales-free.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-scales-free.svg
index 0eb029b5a2..d130fb3d81 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-scales-free.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-scales-free.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-space-free.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-space-free.svg
index 0eb029b5a2..d130fb3d81 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-space-free.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes-space-free.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes.svg
index 86bb073e55..0f01c3d360 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-boxes.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-boxes.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-less.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-less.svg
index f2e21ffbd3..6900d7f715 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-less.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-less.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-more.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-more.svg
index 052b54e17e..be4a6aec33 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-more.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-more.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-nochange.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-nochange.svg
index 052b54e17e..be4a6aec33 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-nochange.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-breaks-nochange.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-evenly-spaced-ticks.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-evenly-spaced-ticks.svg
index 95595145d2..6fa5ea5a4e 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-evenly-spaced-ticks.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-evenly-spaced-ticks.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid-free.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid-free.svg
index 915134426d..74389cd195 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid-free.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid-free.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid.svg
index bb1439462f..6b6a5b5a9e 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-flip-grid.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-flip.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-flip.svg
index 7773483cc0..cbaac2cab2 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-flip.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-flip.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-labels.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-labels.svg
index 0f75a8dc6b..90abb0fdbd 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-labels.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-hide-ticks-labels.svg
@@ -1 +1 @@
-
+
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 1ebd2e95b6..3094fb85d9 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 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-limits-gap.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-limits-gap.svg
index 4a1387a668..1fc54eacea 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-limits-gap.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-limits-gap.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-limits-hide.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-limits-hide.svg
index 0f9390c79d..aa0dd9acb6 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-limits-hide.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-limits-hide.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-line-breaks.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-line-breaks.svg
index 6b4fd56bfe..b540b79ce8 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-line-breaks.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-line-breaks.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-scale-labels.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-scale-labels.svg
index 30f8a837cf..1d523673b0 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-scale-labels.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-scale-labels.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg
index bcb9aa6440..0b02c133e6 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-uneven.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-ycontinuous-ranges.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-ycontinuous-ranges.svg
index c6c2394cc8..eba96572bd 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-ycontinuous-ranges.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-ycontinuous-ranges.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-ranges.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-ranges.svg
index c6c2394cc8..eba96572bd 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-ranges.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-ranges.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-reversed-ranges.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-reversed-ranges.svg
index 6e6f10d3fe..36dfbd8ffc 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-reversed-ranges.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-ylim-reversed-ranges.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-limits-ranges.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-limits-ranges.svg
index 5c9204bfe2..21e9e3b6e2 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-limits-ranges.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-limits-ranges.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-ranges.svg b/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-ranges.svg
index fc6ee4aa3c..8d4678d69d 100644
--- a/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-ranges.svg
+++ b/tests/testthat/_snaps/ggplot-ticks/ticks-yreverse-ranges.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-tooltip/group-lines-hovertext.svg b/tests/testthat/_snaps/ggplot-tooltip/group-lines-hovertext.svg
index 37849921c0..de233c2900 100644
--- a/tests/testthat/_snaps/ggplot-tooltip/group-lines-hovertext.svg
+++ b/tests/testthat/_snaps/ggplot-tooltip/group-lines-hovertext.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg b/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg
index eaa5892ef0..fcb288df7c 100644
--- a/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg
+++ b/tests/testthat/_snaps/ggplot-tooltip/heatmap-discrete-tooltip.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-tooltip/hovertext-display.svg b/tests/testthat/_snaps/ggplot-tooltip/hovertext-display.svg
index 37849921c0..de233c2900 100644
--- a/tests/testthat/_snaps/ggplot-tooltip/hovertext-display.svg
+++ b/tests/testthat/_snaps/ggplot-tooltip/hovertext-display.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-tooltip/tooltip-date.svg b/tests/testthat/_snaps/ggplot-tooltip/tooltip-date.svg
index e7d9d0073f..4435c46b53 100644
--- a/tests/testthat/_snaps/ggplot-tooltip/tooltip-date.svg
+++ b/tests/testthat/_snaps/ggplot-tooltip/tooltip-date.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-tooltip/tooltip-datetime.svg b/tests/testthat/_snaps/ggplot-tooltip/tooltip-datetime.svg
index 9635ef3dd5..e6b555b333 100644
--- a/tests/testthat/_snaps/ggplot-tooltip/tooltip-datetime.svg
+++ b/tests/testthat/_snaps/ggplot-tooltip/tooltip-datetime.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-violin/violin-aes.svg b/tests/testthat/_snaps/ggplot-violin/violin-aes.svg
index 8dcbf661b4..f81b0ea1fb 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 df755131e0..3833b0fba0 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/ggplot-vline/vline-multiple.svg b/tests/testthat/_snaps/ggplot-vline/vline-multiple.svg
index e7a9e532ce..0283a86513 100644
--- a/tests/testthat/_snaps/ggplot-vline/vline-multiple.svg
+++ b/tests/testthat/_snaps/ggplot-vline/vline-multiple.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-vline/vline.svg b/tests/testthat/_snaps/ggplot-vline/vline.svg
index 11665516e6..397f07d019 100644
--- a/tests/testthat/_snaps/ggplot-vline/vline.svg
+++ b/tests/testthat/_snaps/ggplot-vline/vline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggplot-ylim/ylim-one-trace.svg b/tests/testthat/_snaps/ggplot-ylim/ylim-one-trace.svg
index df97194e9a..8d035dc9d7 100644
--- a/tests/testthat/_snaps/ggplot-ylim/ylim-one-trace.svg
+++ b/tests/testthat/_snaps/ggplot-ylim/ylim-one-trace.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/basic-ridgeline.svg b/tests/testthat/_snaps/ggridges/basic-ridgeline.svg
index 0f77494cac..ec292bcb35 100644
--- a/tests/testthat/_snaps/ggridges/basic-ridgeline.svg
+++ b/tests/testthat/_snaps/ggridges/basic-ridgeline.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/cutting-tails.svg b/tests/testthat/_snaps/ggridges/cutting-tails.svg
index 9126c02532..e414ed10c4 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 9d336bc53a..1a2db24a10 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 141756c0ed..2159230e26 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 f154afb649..befd815c7d 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 7b7ebe6f9d..cee17135e0 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 35885e928e..6ac48eb1d9 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/multiple-ridgelines.svg b/tests/testthat/_snaps/ggridges/multiple-ridgelines.svg
index 4e61f425af..e4a2e81dbd 100644
--- a/tests/testthat/_snaps/ggridges/multiple-ridgelines.svg
+++ b/tests/testthat/_snaps/ggridges/multiple-ridgelines.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/negative-height-cut.svg b/tests/testthat/_snaps/ggridges/negative-height-cut.svg
index b18549cdbb..ecea41e9d4 100644
--- a/tests/testthat/_snaps/ggridges/negative-height-cut.svg
+++ b/tests/testthat/_snaps/ggridges/negative-height-cut.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/negative-height-retained.svg b/tests/testthat/_snaps/ggridges/negative-height-retained.svg
index f4bea16da7..60e729d397 100644
--- a/tests/testthat/_snaps/ggridges/negative-height-retained.svg
+++ b/tests/testthat/_snaps/ggridges/negative-height-retained.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/numeric-grouping.svg b/tests/testthat/_snaps/ggridges/numeric-grouping.svg
index 673ad1628c..f2de920c7f 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 54a26d7ede..a3e93b73a4 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 8d0562a06b..2aecac7310 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 aed29008cc..e957213098 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 15f91764f7..67d05d979d 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 1242776c5a..1b1ee24041 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 76410aa145..20f9d7421a 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 b73eebe3cf..71616c0742 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 0a623ca927..bcad555df1 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 783f5f0a7d..9d0644b5fc 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 2879a68a67..07d07c9359 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 7f223979f0..01087cd668 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 4eb7470c44..05e2113682 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/stat-identity.svg b/tests/testthat/_snaps/ggridges/stat-identity.svg
index d76b6456c6..5f28e50cf6 100644
--- a/tests/testthat/_snaps/ggridges/stat-identity.svg
+++ b/tests/testthat/_snaps/ggridges/stat-identity.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ggridges/styling-points.svg b/tests/testthat/_snaps/ggridges/styling-points.svg
index 0ddcb228af..6675f9b361 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 7a6268547c..1569f1f23d 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 30ecccd097..e7aa1896f8 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 3a6d45697c..8e98458501 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/mean-error-bars/error-simple-line-point-crazy.svg b/tests/testthat/_snaps/mean-error-bars/error-simple-line-point-crazy.svg
index 923abc9ce5..ddd882b856 100644
--- a/tests/testthat/_snaps/mean-error-bars/error-simple-line-point-crazy.svg
+++ b/tests/testthat/_snaps/mean-error-bars/error-simple-line-point-crazy.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/mean-error-bars/error-simple-line-point.svg b/tests/testthat/_snaps/mean-error-bars/error-simple-line-point.svg
index e092a3499d..0529a7613c 100644
--- a/tests/testthat/_snaps/mean-error-bars/error-simple-line-point.svg
+++ b/tests/testthat/_snaps/mean-error-bars/error-simple-line-point.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/mean-error-bars/error-simple-line.svg b/tests/testthat/_snaps/mean-error-bars/error-simple-line.svg
index 81265d73d1..3227b86ab9 100644
--- a/tests/testthat/_snaps/mean-error-bars/error-simple-line.svg
+++ b/tests/testthat/_snaps/mean-error-bars/error-simple-line.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/mean-error-bars/error-simple.svg b/tests/testthat/_snaps/mean-error-bars/error-simple.svg
index bb1990f703..729a46b0ec 100644
--- a/tests/testthat/_snaps/mean-error-bars/error-simple.svg
+++ b/tests/testthat/_snaps/mean-error-bars/error-simple.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg b/tests/testthat/_snaps/plotly-subplot/ggally-ggcorr.svg
index adf7f2cc46..e94f7168eb 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 b65affb2c4..d96e1232c3 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 0e2fe8621f..1740c18d8e 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/_snaps/ticktext-linebreaks/ticktext-linebreaks-no-linebreaks.svg b/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-no-linebreaks.svg
index 42e2952593..e7745e7d86 100644
--- a/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-no-linebreaks.svg
+++ b/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-no-linebreaks.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-one-cat.svg b/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-one-cat.svg
index 88c1a9bbfd..f4df489526 100644
--- a/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-one-cat.svg
+++ b/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks-one-cat.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks.svg b/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks.svg
index c996497512..44585d0049 100644
--- a/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks.svg
+++ b/tests/testthat/_snaps/ticktext-linebreaks/ticktext-linebreaks.svg
@@ -1 +1 @@
-
+
diff --git a/tests/testthat/test-ggplot-blank.R b/tests/testthat/test-ggplot-blank.R
index c192368e05..7fcd71ef92 100644
--- a/tests/testthat/test-ggplot-blank.R
+++ b/tests/testthat/test-ggplot-blank.R
@@ -3,13 +3,31 @@ test_that("geom_blank", {
skip_if_not_installed("ggplot2", "3.4.0")
qp <- expect_warning(qplot(), "deprecated")
l <- ggplotly(qp)$x
-
+
expect_length(l$data, 1)
expect_false(l$data[[1]]$visible)
-
+
l <- ggplotly(ggplot())$x
-
+
expect_length(l$data, 1)
expect_false(l$data[[1]]$visible)
-
+
+})
+
+test_that("geom_blank does not drop legend (#2281)", {
+ # When geom_blank() is combined with other geoms, legend should still appear
+ p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, col = Species)) +
+ geom_blank() +
+ geom_point()
+
+ L <- plotly_build(ggplotly(p))$x
+
+ # geom_point should create 3 visible traces with legend
+ visible_traces <- Filter(function(d) !isFALSE(d$visible) && d$type == "scatter", L$data)
+ expect_equal(length(visible_traces), 3)
+ expect_true(any(sapply(visible_traces, function(d) isTRUE(d$showlegend))))
+
+ # Trace names should be species names
+ trace_names <- sapply(visible_traces, function(d) d$name)
+ expect_true(all(c("setosa", "versicolor", "virginica") %in% trace_names))
})
diff --git a/tests/testthat/test-ggplot-boxplot.R b/tests/testthat/test-ggplot-boxplot.R
index 43d4fccf17..52766e8499 100644
--- a/tests/testthat/test-ggplot-boxplot.R
+++ b/tests/testthat/test-ggplot-boxplot.R
@@ -83,3 +83,29 @@ test_that("correct # of unique fillcolors", {
fills <- sapply(L$data, "[[", "fillcolor")
expect_equivalent(length(unique(fills)), length(unique(dat$col)))
})
+
+test_that("outlier.shape = NA hides outlier points (#2305)", {
+ # With outlier.shape = NA, plotly should not show outlier points
+ p <- ggplot(iris, aes(Species, Sepal.Length)) + geom_boxplot(outlier.shape = NA)
+ L <- plotly_build(ggplotly(p))$x
+ expect_equal(L$data[[1]]$type, "box")
+ # boxpoints should be FALSE or "false" to hide outliers
+ expect_true(isFALSE(L$data[[1]]$boxpoints) || identical(L$data[[1]]$boxpoints, "false"))
+
+ # With default (no outlier.shape specified), outliers should show
+ p_default <- ggplot(iris, aes(Species, Sepal.Length)) + geom_boxplot()
+ L_default <- plotly_build(ggplotly(p_default))$x
+ # Default should either be NULL (plotly default shows outliers) or "outliers"/"suspectedoutliers"
+ expect_true(
+ is.null(L_default$data[[1]]$boxpoints) ||
+ L_default$data[[1]]$boxpoints %in% c("outliers", "suspectedoutliers", TRUE)
+ )
+})
+
+test_that("outliers = FALSE hides outlier points", {
+ # ggplot2 also supports outliers = FALSE parameter
+ p <- ggplot(iris, aes(Species, Sepal.Length)) + geom_boxplot(outliers = FALSE)
+ L <- plotly_build(ggplotly(p))$x
+ expect_equal(L$data[[1]]$type, "box")
+ expect_true(isFALSE(L$data[[1]]$boxpoints) || identical(L$data[[1]]$boxpoints, "false"))
+})
diff --git a/tests/testthat/test-ggplot-color.R b/tests/testthat/test-ggplot-color.R
index 012b888977..d76d2ed0ac 100644
--- a/tests/testthat/test-ggplot-color.R
+++ b/tests/testthat/test-ggplot-color.R
@@ -1,6 +1,6 @@
df = data.frame(width = 1:3, height = 1:3, col = letters[1:3])
test_that("ggplotly automatically converts `color` aes to `colour`", {
- p <- qplot(width, height,
+ p <- qplot(width, height,
data = df, color = col)
# color variable is not shown
color <- plotly_build(ggplotly(p, tooltip = c("color")))
@@ -8,3 +8,34 @@ test_that("ggplotly automatically converts `color` aes to `colour`", {
expect_identical(color$x$data, plotly_build(ggplotly(p, tooltip = c("colour")))$x$data)
})
+test_that("scale_*_manual with unused aesthetics does not error (#2466)", {
+ # scale has aesthetics = c('colour', 'fill') but plot only uses 'colour'
+ p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species)) +
+ geom_point() +
+ scale_colour_manual(
+ values = c("setosa" = "red", "versicolor" = "blue", "virginica" = "green"),
+ aesthetics = c("colour", "fill")
+ )
+ # Should not error with "undefined columns selected"
+ expect_error(plotly_build(ggplotly(p)), NA)
+})
+
+test_that("multi-aesthetic scales show legend and split traces correctly (#2467)", {
+ # When scale has aesthetics = c('colour', 'fill') and both are used,
+ # traces should be split by the variable and legend should appear
+ p <- ggplot(iris, aes(Sepal.Length, Sepal.Width, colour = Species, fill = Species)) +
+ geom_point(shape = 21) +
+ scale_colour_manual(
+ values = c("setosa" = "red", "versicolor" = "blue", "virginica" = "green"),
+ aesthetics = c("colour", "fill")
+ )
+ L <- plotly_build(ggplotly(p))$x
+ # Should have 3 traces (one per Species level)
+ expect_equal(length(L$data), 3)
+ # Should show legend
+ expect_true(any(sapply(L$data, function(d) isTRUE(d$showlegend))))
+ # Trace names should be the species names
+ trace_names <- sapply(L$data, function(d) d$name)
+ expect_true(all(c("setosa", "versicolor", "virginica") %in% trace_names))
+})
+
diff --git a/tests/testthat/test-ggplot-theme.R b/tests/testthat/test-ggplot-theme.R
index 6d0ba15669..8c089ca504 100644
--- a/tests/testthat/test-ggplot-theme.R
+++ b/tests/testthat/test-ggplot-theme.R
@@ -65,12 +65,70 @@ test_that("marker default shape is a circle", {
test_that("plot panel border is translated correctly", {
ggpenguin <- penguin.base + theme_grey() # has no panel.border
info <- expect_doppelganger_built(ggpenguin, "theme-panel-border-1")
-
+
red <- ggplot(palmerpenguins::penguins) +
theme_grey() +
geom_point(aes(bill_length_mm, bill_depth_mm)) +
theme(panel.border = element_rect(colour = "red", fill = NA))
-
+
info <- expect_doppelganger_built(red, "theme-panel-border-2")
expect_true(info$layout$shapes[[1]]$line$color == toRGB("red"))
})
+
+test_that("element_blank panel.border does not create empty shapes (#2455, #2460)", {
+ # theme_grey() has element_blank() panel.border - should NOT create a shape
+ p_grey <- ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_grey()
+ L_grey <- plotly_build(ggplotly(p_grey))$x
+ # No panel border shapes should be created for element_blank
+ grey_shapes <- Filter(function(s) identical(s$xref, "paper") && identical(s$yref, "paper"), L_grey$layout$shapes)
+ expect_equal(length(grey_shapes), 0)
+
+ # theme_bw() has visible panel.border - SHOULD create a shape
+ p_bw <- ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_bw()
+ L_bw <- plotly_build(ggplotly(p_bw))$x
+ bw_shapes <- Filter(function(s) identical(s$xref, "paper") && identical(s$yref, "paper"), L_bw$layout$shapes)
+ expect_true(length(bw_shapes) > 0)
+ expect_false(is.na(bw_shapes[[1]]$line$color))
+})
+
+test_that("legend.position is translated correctly (#2407, #2187)", {
+ # Test legend.position = "bottom"
+ p_bottom <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
+ geom_point() +
+ theme(legend.position = "bottom")
+ L_bottom <- plotly_build(ggplotly(p_bottom))$x
+ expect_equal(L_bottom$layout$legend$orientation, "h")
+ expect_equal(L_bottom$layout$legend$xanchor, "center")
+ expect_equal(L_bottom$layout$legend$y, -0.15)
+
+ # Test legend.position = "top"
+ p_top <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
+ geom_point() +
+ theme(legend.position = "top")
+ L_top <- plotly_build(ggplotly(p_top))$x
+ expect_equal(L_top$layout$legend$orientation, "h")
+ expect_equal(L_top$layout$legend$y, 1.02)
+
+ # Test legend.position = "left"
+ p_left <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
+ geom_point() +
+ theme(legend.position = "left")
+ L_left <- plotly_build(ggplotly(p_left))$x
+ expect_equal(L_left$layout$legend$xanchor, "right")
+ expect_equal(L_left$layout$legend$x, -0.15)
+
+ # Test legend.position = "none"
+ p_none <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
+ geom_point() +
+ theme(legend.position = "none")
+ L_none <- plotly_build(ggplotly(p_none))$x
+ expect_false(L_none$layout$showlegend)
+
+ # Test numeric legend.position
+ p_custom <- ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
+ geom_point() +
+ theme(legend.position = c(0.8, 0.2))
+ L_custom <- plotly_build(ggplotly(p_custom))$x
+ expect_equal(L_custom$layout$legend$x, 0.8)
+ expect_equal(L_custom$layout$legend$y, 0.2)
+})
diff --git a/tests/testthat/test-ggplot-tooltip.R b/tests/testthat/test-ggplot-tooltip.R
index 621ac1e261..ba2a8c7838 100644
--- a/tests/testthat/test-ggplot-tooltip.R
+++ b/tests/testthat/test-ggplot-tooltip.R
@@ -119,3 +119,19 @@ test_that("Hoverinfo is only displayed if no tooltip variables are present", {
expect_true(all(grepl("^label", L$data[[2]]$text)))
})
+test_that("variable named 'group' is shown in tooltip when mapped to aesthetic (#2415)", {
+ # When a user has a column named "group" and maps it to colour,
+ # it should appear in the tooltip
+ df <- data.frame(
+ x = 1:6,
+ y = 1:6,
+ group = rep(c("A", "B"), each = 3)
+ )
+ p <- ggplot(df, aes(x, y, colour = group)) + geom_point()
+ L <- plotly_build(ggplotly(p))$x
+ # Check that "group: A" or "group: B" appears in the tooltip text
+ txt <- unlist(lapply(L$data, function(d) d$text))
+ expect_true(any(grepl("group: A", txt)))
+ expect_true(any(grepl("group: B", txt)))
+})
+