Skip to content

Commit 43093f2

Browse files
committed
ggplotly shouldn't populate layout.[width/height] by default, closes #1264
1 parent 0f378e7 commit 43093f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

R/ggplotly.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ gg2list <- function(p, width = NULL, height = NULL,
193193
}
194194
# if a device (or RStudio) is already open, use the device size as default size
195195
if (!is.null(grDevices::dev.list()) || is_rstudio()) {
196-
width <- width %||% grDevices::dev.size("px")[1]
197-
height <- height %||% grDevices::dev.size("px")[2]
196+
width <- width %||% default(grDevices::dev.size("px")[1])
197+
height <- height %||% default(grDevices::dev.size("px")[2])
198198
}
199199
# open the device and make sure it closes on exit
200200
dev_fun(file = tempfile(), width = width %||% 640, height = height %||% 480)
@@ -1035,8 +1035,8 @@ gg2list <- function(p, width = NULL, height = NULL,
10351035
# If a trace isn't named, it shouldn't have additional hoverinfo
10361036
traces <- lapply(compact(traces), function(x) { x$name <- x$name %||% ""; x })
10371037

1038-
gglayout$width <- width
1039-
gglayout$height <- height
1038+
gglayout$width <- width %|D|% NULL
1039+
gglayout$height <- height %|D|% NULL
10401040
gglayout$barmode <- gglayout$barmode %||% "relative"
10411041

10421042
l <- list(

0 commit comments

Comments
 (0)