Skip to content

Commit ae20cba

Browse files
committed
Merge pull request #506 from ropensci/fix/autosize
relayout on resize only when layout.autosize is true. fixes #403
2 parents f9c671f + 4871358 commit ae20cba

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-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.js'
3-
Version: 3.4.1
3+
Version: 3.4.2
44
Authors@R: c(person("Carson", "Sievert", role = c("aut", "cre"),
55
email = "cpsievert1@gmail.com"),
66
person("Chris", "Parmer", role = c("aut", "cph"),

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
3.4.2 -- 14 Mar 2016
2+
3+
BUGFIX:
4+
5+
Automatic resizing will now occur only when layout.autosize is true (the default). See #403.
6+
7+
18
3.4.1 -- 13 Mar 2016
29

310
BUGFIX:

inst/htmlwidgets/plotly.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ HTMLWidgets.widget({
88
},
99

1010
resize: function(el, width, height, instance) {
11-
Plotly.relayout(el.id, {width: width, height: height});
11+
if (instance.autosize) {
12+
Plotly.relayout(el.id, {width: width, height: height});
13+
}
1214
},
1315

1416
renderValue: function(el, x, instance) {
@@ -27,6 +29,7 @@ HTMLWidgets.widget({
2729
if (!instance.plotly) {
2830
Plotly.plot(graphDiv, x.data, x.layout, x.config);
2931
instance.plotly = true;
32+
instance.autosize = x.layout.autosize;
3033
} else {
3134
Plotly.newPlot(graphDiv, x.data, x.layout);
3235
}

0 commit comments

Comments
 (0)