We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2368c0c commit b3af2b8Copy full SHA for b3af2b8
inst/htmlwidgets/plotly.js
@@ -155,6 +155,11 @@ HTMLWidgets.widget({
155
x.config.modeBarButtonsToRemove.push("sendDataToCloud");
156
}
157
158
+ // if the object was passed in from another window, plotly will falsely think it isn't a "plain object"
159
+ // to get around this, we do a deep clone of the object
160
+ if (inIframe() && !isPlainObject(x))
161
+ x = $.extend(true, {}, x)
162
+
163
// if no plot exists yet, create one with a particular configuration
164
if (!instance.plotly) {
165
@@ -832,6 +837,10 @@ function isPlainObject(obj) {
832
837
);
833
838
834
839
840
+function inIframe() {
841
+ return window && window.self !== window.top;
842
+}
843
835
844
function subsetArrayAttrs(obj, indices) {
836
845
var newObj = {};
846
Object.keys(obj).forEach(function(k) {
0 commit comments