Skip to content

Commit fd812f5

Browse files
committed
Attach base_url in as.widget() so it works in multiple contexts
1 parent ae17cef commit fd812f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/plotly.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ plot_ly <- function(data = data.frame(), ..., type = "scatter",
9797
layout = NULL,
9898
url = NULL,
9999
width = width,
100-
height = height,
101-
base_url = get_domain()
100+
height = height
102101
)
103102

104103
if (evaluate) p <- plotly_build(p)

R/print.R

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ as.widget <- function(x, ...) {
3838
list(b = 40, l = 60, t = 25, r = 10),
3939
p$layout$margin %||% list()
4040
)
41+
p$base_url <- get_domain()
4142
# customize the JSON serializer (for htmlwidgets)
4243
attr(p, 'TOJSON_FUNC') <- to_JSON
4344
htmlwidgets::createWidget(

0 commit comments

Comments
 (0)