@@ -1203,14 +1203,6 @@ var FigureView = widgets.DOMWidgetView.extend({
1203
1203
var traceIndexes = this . model . _normalize_trace_indexes (
1204
1204
msgData . restyle_traces ) ;
1205
1205
1206
- if ( msgData . source_view_id === this . viewID ) {
1207
- // Operation originated from this view, don't re-apply it
1208
- console . log ( "Skipping restyle for view " + this . viewID ) ;
1209
- return
1210
- } else {
1211
- console . log ( "Applying restyle for view " + this . viewID )
1212
- }
1213
-
1214
1206
restyleData [ "_doNotReportToPy" ] = true ;
1215
1207
Plotly . restyle ( this . el , restyleData , traceIndexes ) ;
1216
1208
@@ -1235,16 +1227,9 @@ var FigureView = widgets.DOMWidgetView.extend({
1235
1227
var msgData = this . model . get ( "_py2js_relayout" ) ;
1236
1228
if ( msgData !== null ) {
1237
1229
1238
- if ( msgData . source_view_id === this . viewID ) {
1239
- // Operation originated from this view, don't re-apply it
1240
- console . log ( "Skipping relayout for view " + this . viewID ) ;
1241
- } else {
1242
- console . log ( "Applying relayout for view " + this . viewID ) ;
1243
-
1244
- var relayoutData = msgData . relayout_data ;
1230
+ var relayoutData = msgData . relayout_data ;
1245
1231
relayoutData [ "_doNotReportToPy" ] = true ;
1246
1232
Plotly . relayout ( this . el , msgData . relayout_data ) ;
1247
- }
1248
1233
1249
1234
// ### Send layout delta ###
1250
1235
var layout_edit_id = msgData . layout_edit_id ;
@@ -1267,15 +1252,8 @@ var FigureView = widgets.DOMWidgetView.extend({
1267
1252
var traceIndexes = this . model . _normalize_trace_indexes (
1268
1253
msgData . style_traces ) ;
1269
1254
1270
- if ( msgData . source_view_id === this . viewID ) {
1271
- // Operation originated from this view, don't re-apply it
1272
- console . log ( "Skipping update for view " + this . viewID ) ;
1273
- } else {
1274
- console . log ( "Applying update for view " + this . viewID )
1275
-
1276
- style [ "_doNotReportToPy" ] = true ;
1255
+ style [ "_doNotReportToPy" ] = true ;
1277
1256
Plotly . update ( this . el , style , layout , traceIndexes ) ;
1278
- }
1279
1257
1280
1258
// ### Send trace deltas ###
1281
1259
// We create an array of deltas corresponding to the updated
@@ -1314,38 +1292,22 @@ var FigureView = widgets.DOMWidgetView.extend({
1314
1292
traces : traceIndexes
1315
1293
} ;
1316
1294
1317
- if ( msgData . source_view_id === this . viewID ) {
1318
- // Operation originated from this view, don't re-apply it
1319
- console . log ( "Skipping animate for view " + this . viewID ) ;
1320
-
1321
- // ### Send trace deltas ###
1322
- // We create an array of deltas corresponding to the
1323
- // animated traces.
1324
- this . _sendTraceDeltas ( msgData . trace_edit_id ) ;
1325
-
1326
- // ### Send layout delta ###
1327
- var layout_edit_id = msgData . layout_edit_id ;
1328
- this . _sendLayoutDelta ( layout_edit_id ) ;
1329
-
1330
- } else {
1331
- console . log ( "Applying animate for view " + this . viewID )
1295
+ animationData [ "_doNotReportToPy" ] = true ;
1296
+ var that = this ;
1332
1297
1333
- animationData [ "_doNotReportToPy" ] = true ;
1334
- var that = this ;
1298
+ Plotly . animate ( this . el , animationData , animationOpts ) . then (
1299
+ function ( ) {
1335
1300
1336
- Plotly . animate ( this . el , animationData , animationOpts ) . then (
1337
- function ( ) {
1301
+ // ### Send trace deltas ###
1302
+ // We create an array of deltas corresponding to the
1303
+ // animated traces.
1304
+ that . _sendTraceDeltas ( msgData . trace_edit_id ) ;
1338
1305
1339
- // ### Send trace deltas ###
1340
- // We create an array of deltas corresponding to the
1341
- // animated traces.
1342
- that . _sendTraceDeltas ( msgData . trace_edit_id ) ;
1306
+ // ### Send layout delta ###
1307
+ var layout_edit_id = msgData . layout_edit_id ;
1308
+ that . _sendLayoutDelta ( layout_edit_id ) ;
1309
+ } ) ;
1343
1310
1344
- // ### Send layout delta ###
1345
- var layout_edit_id = msgData . layout_edit_id ;
1346
- that . _sendLayoutDelta ( layout_edit_id ) ;
1347
- } ) ;
1348
- }
1349
1311
}
1350
1312
} ,
1351
1313
0 commit comments