Skip to content

Commit 5fcdaa7

Browse files
committed
config() should be applied when _initializing_ plot object to populate R's special defaults
1 parent b4a142b commit 5fcdaa7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/ggplotly.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ggplotly.ggmatrix <- function(p = ggplot2::last_plot(), width = NULL,
8282
if (nchar(p$title %||% "") > 0) {
8383
s <- layout(s, title = p$title)
8484
}
85-
s
85+
config(s)
8686
}
8787

8888
#' @export
@@ -92,7 +92,7 @@ ggplotly.ggplot <- function(p = ggplot2::last_plot(), width = NULL,
9292
l <- gg2list(p, width = width, height = height, tooltip = tooltip,
9393
layerData = layerData, originalData = originalData,
9494
source = source, ...)
95-
structure(as_widget(l), ggplotly = TRUE)
95+
config(as_widget(l))
9696
}
9797

9898
#' Convert a ggplot to a list.

R/plotly.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ plot_ly <- function(data = data.frame(), ..., type = NULL,
146146
),
147147
source = source
148148
)
149-
150-
as_widget(p)
149+
# ensure the collab button is shown (and the save/edit button is hidden) by default
150+
config(as_widget(p))
151151
}
152152

153153

0 commit comments

Comments
 (0)