Skip to content

Commit

Permalink
update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 29, 2024
1 parent 2862513 commit 049a6e0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
20 changes: 10 additions & 10 deletions tests/testthat/_snaps/vdiffr_geoms_coords/geom-point2-works.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 13 additions & 17 deletions tests/testthat/test-vdiffr_geoms_coords.R
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
test_that("geom and coord functions work correctly", {
skip_if_not_installed("poorman")
suppressPackageStartupMessages(library(poorman))

skip_if_not_installed("ggplot2")
# coord_radar() ------------------

data <- iris %>%
group_by(Species) %>%
summarise(across(everything(), mean)) %>%
datawizard::reshape_longer(c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"))
data <- aggregate(iris[1:4], list(Species = iris$Species), mean)
data <- datawizard::reshape_longer(data, c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"))

set.seed(123)
vdiffr::expect_doppelganger(
title = "coord_radar() works",
fig = ggplot(
fig = ggplot2::ggplot(
data,
aes(
ggplot2::aes(
x = name,
y = value,
color = Species,
group = Species
)
) +
geom_polygon(fill = NA, linewidth = 2) +
ggplot2::geom_polygon(fill = NA, linewidth = 2) +
coord_radar(start = -pi / 4)
)

# geom_point2() ----------------------

normal <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) +
geom_point(size = 8, alpha = 0.3) +
normal <- ggplot2::ggplot(iris, ggplot2::aes(x = Petal.Width, y = Sepal.Length)) +
ggplot2::geom_point(size = 8, alpha = 0.3) +
theme_modern()
new <- ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) +
new <- ggplot2::ggplot(iris, ggplot2::aes(x = Petal.Width, y = Sepal.Length)) +
geom_point2(size = 8, alpha = 0.3) +
theme_modern()

Expand All @@ -45,7 +41,7 @@ test_that("geom and coord functions work correctly", {
set.seed(123)
vdiffr::expect_doppelganger(
title = "`geom_poolpoint()` works - 1",
fig = ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) +
fig = ggplot2::ggplot(iris, ggplot2::aes(x = Petal.Width, y = Sepal.Length, color = Species)) +
geom_poolpoint(label = rownames(iris)) +
scale_color_flat_d() +
theme_modern()
Expand All @@ -54,7 +50,7 @@ test_that("geom and coord functions work correctly", {
set.seed(123)
vdiffr::expect_doppelganger(
title = "`geom_poolpoint()` works - 2",
fig = ggplot(iris, aes(x = Petal.Width, y = Sepal.Length, color = Species)) +
fig = ggplot2::ggplot(iris, ggplot2::aes(x = Petal.Width, y = Sepal.Length, color = Species)) +
geom_pooljitter(label = rownames(iris)) +
scale_color_flat_d() +
theme_modern()
Expand All @@ -65,7 +61,7 @@ test_that("geom and coord functions work correctly", {
set.seed(123)
vdiffr::expect_doppelganger(
title = "geom_violindot() works",
fig = ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
fig = ggplot2::ggplot(iris, ggplot2::aes(x = Species, y = Sepal.Length, fill = Species)) +
geom_violindot() +
theme_modern()
)
Expand All @@ -75,7 +71,7 @@ test_that("geom and coord functions work correctly", {
set.seed(123)
vdiffr::expect_doppelganger(
title = "geom_violinhalf() works",
fig = ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
fig = ggplot2::ggplot(iris, ggplot2::aes(x = Species, y = Sepal.Length, fill = Species)) +
geom_violinhalf() +
theme_modern() +
scale_fill_material_d()
Expand Down

0 comments on commit 049a6e0

Please sign in to comment.