Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 4, 2024
1 parent fce954c commit df20065
Show file tree
Hide file tree
Showing 10 changed files with 813 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: see
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
Version: 0.8.5.3
Version: 0.8.5.4
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
9 changes: 7 additions & 2 deletions R/plot.check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ plot.see_check_dag <- function(x,
ggplot2::ggtitle("Required model")

if (which == "all") {
# fix legends
plot2 <- plot2 + ggplot2::theme(legend.position = "none")
# fix legends - remove the legend that has fewer items, so all items
# in the legend are shown for the integrated plot
if (insight::n_unique(p1$data$type) > insight::n_unique(p2$data$type)) {
plot2 <- plot2 + ggplot2::theme(legend.position = "none")
} else {
plot1 <- plot1 + ggplot2::theme(legend.position = "none")
}
# plot
plots(plot1, plot2, n_rows = 1)
} else if (which == "current") {
Expand Down
121 changes: 121 additions & 0 deletions tests/testthat/_snaps/plot.check_dag/plot-check-dag-all-adjusted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 121 additions & 0 deletions tests/testthat/_snaps/plot.check_dag/plot-check-dag-all.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit df20065

Please sign in to comment.