Skip to content

Commit d7a340c

Browse files
committed
Merge pull request #334 from ropensci/fix/base-url
Fix #333
2 parents 9a5714e + a8759b7 commit d7a340c

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: plotly
22
Title: Create Interactive Web Graphics via Plotly's JavaScript Graphing Library
3-
Version: 2.0.8
3+
Version: 2.0.9
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "[email protected]"),
66
person("Chris", "Parmer", role = c("aut", "cph"),

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.0.9 -- 10 Dec 2015
2+
3+
Fix #333
4+
15
2.0.8 -- 10 Dec 2015
26

37
Fix a bug with geom_segment (see #321 & #228)

R/plotly.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ plot_ly <- function(data = data.frame(), ..., type = "scatter",
9797
layout = NULL,
9898
url = NULL,
9999
width = width,
100-
height = height
100+
height = height,
101+
base_url = get_domain()
101102
)
102103

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

inst/htmlwidgets/plotly.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ HTMLWidgets.widget({
1111
},
1212

1313
renderValue: function(el, x, instance) {
14+
// make sure plots don't get created outside the network
15+
window.PLOTLYENV = window.PLOTLYENV || {};
16+
window.PLOTLYENV.BASE_URL = x.base_url;
17+
1418
// if no plot exists yet, create one with a particular configuration
1519
if (!instance.plotly) {
1620
Plotly.plot(el.id, x.data, x.layout, x.config);

0 commit comments

Comments
 (0)