Skip to content

Commit e047312

Browse files
committed
Revert "restrict exists to plotly environment"
This reverts commit 20b7ad7.
1 parent c465722 commit e047312

File tree

2 files changed

+5
-54
lines changed

2 files changed

+5
-54
lines changed

R/ggplotly.R

+5-4
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ gg2list <- function(p) {
625625

626626
# Legend.
627627
layout$margin$r <- 10
628-
if (exists("increase_margin_r", where = as.environment("package:plotly"))) {
628+
if (exists("increase_margin_r")) {
629629
layout$margin$r <- 60
630630
}
631631
layout$legend <- list(bordercolor = "transparent",
@@ -666,10 +666,11 @@ gg2list <- function(p) {
666666
legend.title <- colnames(p$data)[i]
667667
}
668668
legend.title <- paste0("<b>", legend.title, "</b>")
669+
669670
# Create legend title element as an annotation
670-
if (exists("annotations", where = as.environment("package:plotly"))) {
671-
nann <- nann + 1
672-
} else{
671+
if (exists("annotations")) {
672+
nann <- nann + 1
673+
} else {
673674
annotations <- list()
674675
nann <- 1
675676
}

tests/testthat/test-ggplot-environment.R

-50
This file was deleted.

0 commit comments

Comments
 (0)