Skip to content

Commit 4e8aac0

Browse files
committed
have plotly_json() pick up last plot if none provided
1 parent 64abe0d commit 4e8aac0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/dev.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#' plotly_json(plot_ly())
1313
#' plotly_json(plot_ly(), FALSE)
1414

15-
plotly_json <- function(p = plot_ly(), jsonedit = interactive(), ...) {
15+
plotly_json <- function(p = last_plot(), jsonedit = interactive(), ...) {
1616
plotlyJSON <- to_JSON(plotly_build(p)$x, pretty = TRUE)
1717
if (jsonedit) {
1818
if (system.file(package = "listviewer") == "") {

0 commit comments

Comments
 (0)