File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,18 @@ HTMLWidgets.widget({
148
148
}
149
149
}
150
150
151
+ // remove "sendDataToCloud", unless user has specified they want it
152
+ x . config = x . config || { } ;
153
+ if ( ! x . config . cloud ) {
154
+ x . config . modeBarButtonsToRemove = x . config . modeBarButtonsToRemove || [ ] ;
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 have to create a deep copy of the object
160
+ if ( inIframe ( ) && ! isPlainObject ( x ) )
161
+ x = JSON . parse ( JSON . stringify ( x ) )
162
+
151
163
// if no plot exists yet, create one with a particular configuration
152
164
if ( ! instance . plotly ) {
153
165
@@ -868,6 +880,10 @@ function isPlainObject(obj) {
868
880
) ;
869
881
}
870
882
883
+ function inIframe ( ) {
884
+ return window && window . self !== window . top ;
885
+ }
886
+
871
887
function subsetArrayAttrs ( obj , indices ) {
872
888
var newObj = { } ;
873
889
Object . keys ( obj ) . forEach ( function ( k ) {
You can’t perform that action at this time.
0 commit comments