Skip to content

Commit c755a44

Browse files
committed
expect_traces isn't exclusive to ggplot
1 parent 12c5adc commit c755a44

19 files changed

+21
-57
lines changed

R/crosstalk.R

Lines changed: 0 additions & 41 deletions
This file was deleted.

R/helpers.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ hide_legend <- function(p) {
5454
p$x$layout$annotations[[i]] <- NULL
5555
}
5656
}
57+
if (length(p$x$layout$annotations) == 0) {
58+
p$x$layout$annotations <- NULL
59+
}
5760
p$x$layout$showlegend <- FALSE
5861
p
5962
}

man/hide_guides.Rd

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-cookbook-axes.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
context("cookbook axes")
22

33
expect_traces <- function(gg, n.traces, name) {
4-
stopifnot(is.ggplot(gg))
54
stopifnot(is.numeric(n.traces))
65
L <- save_outputs(gg, paste0("cookbook-axes-", name))
76
all.traces <- L$data

tests/testthat/test-cookbook-lines.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
context("cookbook lines")
22

33
expect_traces <- function(gg, n.traces, name) {
4-
stopifnot(is.ggplot(gg))
54
stopifnot(is.numeric(n.traces))
65
L <- save_outputs(gg, paste0("cookbook-axes-", name))
76
all.traces <- L$data

tests/testthat/test-ggplot-abline.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ context("Abline")
33
# 'Abline' refers to the line coefficients, as in y = a b * x
44

55
expect_traces <- function(gg, n.traces, name) {
6-
stopifnot(is.ggplot(gg))
76
stopifnot(is.numeric(n.traces))
87
L <- save_outputs(gg, paste0("cookbook-axes-", name))
98
all.traces <- L$data

tests/testthat/test-ggplot-area.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ context("Area")
33
# Test that the order of traces is correct
44
# Expect traces function
55
expect_traces <- function(gg, n_traces, name) {
6-
stopifnot(is.ggplot(gg))
76
stopifnot(is.numeric(n_traces))
87
save_outputs(gg, paste0("area-", name))
98
L <- gg2list(gg)

tests/testthat/test-ggplot-bar.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
context("bar")
22

33
expect_traces <- function(gg, n.traces, name) {
4-
stopifnot(is.ggplot(gg))
54
stopifnot(is.numeric(n.traces))
65
L <- save_outputs(gg, paste0("bar-", name))
76
all.traces <- L$data

tests/testthat/test-ggplot-boxplot.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
context("Boxplot")
22

33
expect_traces <- function(gg, n.traces, name) {
4-
stopifnot(is.ggplot(gg))
54
stopifnot(is.numeric(n.traces))
65
save_outputs(gg, paste0("boxplot-", name))
76
L <- gg2list(gg)

tests/testthat/test-ggplot-histogram.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
context("Histogram")
22

33
expect_traces <- function(gg, n.traces, name) {
4-
stopifnot(is.ggplot(gg))
54
stopifnot(is.numeric(n.traces))
65
L <- save_outputs(gg, paste0("histogram-", name))
76
all.traces <- L$data

0 commit comments

Comments
 (0)