Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Flip geom_curve() direction in some circumstances #6332

Merged
merged 7 commits into from
Mar 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add visual tests
teunbrand committed Feb 14, 2025
commit c37f789b969eb1d248977634fbaa6b85d2f97568
61 changes: 61 additions & 0 deletions tests/testthat/_snaps/geom-curve/flipped-geom-curve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions tests/testthat/_snaps/geom-curve/standard-geom-curve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tests/testthat/test-geom-curve.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
test_that("geom_curve flipping works", {

df <- data.frame(x = c(1, 2), xend = c(2, 3), y = 1, yend = c(2, 1.5))

p <- ggplot(df, aes(x, y, xend = xend, yend = yend)) +
geom_curve(arrow = arrow())

expect_doppelganger("standard geom_curve", p)
expect_doppelganger("flipped geom_curve", p + scale_y_reverse())

})