diff --git a/DESCRIPTION b/DESCRIPTION index f997d8bb1f..e0baff8b7e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: plotly Title: Create Interactive Web Graphics via 'plotly.js' -Version: 3.4.1 +Version: 3.4.2 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 3c6256deb5..53264f9bac 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +3.4.2 -- 14 Mar 2016 + +BUGFIX: + +Automatic resizing will now occur only when layout.autosize is true (the default). See #403. + + 3.4.1 -- 13 Mar 2016 BUGFIX: diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index f974afeaf9..8dbf13fd8b 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -8,7 +8,9 @@ HTMLWidgets.widget({ }, resize: function(el, width, height, instance) { - Plotly.relayout(el.id, {width: width, height: height}); + if (instance.autosize) { + Plotly.relayout(el.id, {width: width, height: height}); + } }, renderValue: function(el, x, instance) { @@ -27,6 +29,7 @@ HTMLWidgets.widget({ if (!instance.plotly) { Plotly.plot(graphDiv, x.data, x.layout, x.config); instance.plotly = true; + instance.autosize = x.layout.autosize; } else { Plotly.newPlot(graphDiv, x.data, x.layout); }