From fd812f526f10fcb5d977bbbdbbaf47c887e2651e Mon Sep 17 00:00:00 2001 From: cpsievert Date: Tue, 2 Feb 2016 07:27:48 -0600 Subject: [PATCH 1/2] Attach base_url in as.widget() so it works in multiple contexts --- R/plotly.R | 3 +-- R/print.R | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/plotly.R b/R/plotly.R index abaa70cc74..ad108cf17d 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -97,8 +97,7 @@ plot_ly <- function(data = data.frame(), ..., type = "scatter", layout = NULL, url = NULL, width = width, - height = height, - base_url = get_domain() + height = height ) if (evaluate) p <- plotly_build(p) diff --git a/R/print.R b/R/print.R index ff4c507d63..5de936aefe 100644 --- a/R/print.R +++ b/R/print.R @@ -38,6 +38,7 @@ as.widget <- function(x, ...) { list(b = 40, l = 60, t = 25, r = 10), p$layout$margin %||% list() ) + p$base_url <- get_domain() # customize the JSON serializer (for htmlwidgets) attr(p, 'TOJSON_FUNC') <- to_JSON htmlwidgets::createWidget( From b5a00b01ae89676fb29fc3c2506b4751c96e1d48 Mon Sep 17 00:00:00 2001 From: cpsievert Date: Tue, 2 Feb 2016 07:28:47 -0600 Subject: [PATCH 2/2] bump version, update news --- DESCRIPTION | 2 +- NEWS | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f7d6c995c7..927a0895a9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: plotly Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library -Version: 2.4.0 +Version: 2.4.1 Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"), email = "cpsievert1@gmail.com"), person("Chris", "Parmer", role = c("aut", "cph"), diff --git a/NEWS b/NEWS index d49d877438..e4f561ce81 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +2.4.1 -- 2 Feb 2015 + +Attach base_url in as.widget() so it works in multiple contexts + 2.4.0 -- 1 Feb 2015 * Pass plot configuration using ... to avoid conflicts in defaults/documentation