@@ -267,7 +267,7 @@ function handleCartesian(gd, ev) {
267
267
modeBarButtons . zoom3d = {
268
268
name : 'zoom3d' ,
269
269
title : 'Zoom' ,
270
- attr : 'dragmode' ,
270
+ attr : 'scene. dragmode' ,
271
271
val : 'zoom' ,
272
272
icon : Icons . zoombox ,
273
273
click : handleDrag3d
@@ -276,7 +276,7 @@ modeBarButtons.zoom3d = {
276
276
modeBarButtons . pan3d = {
277
277
name : 'pan3d' ,
278
278
title : 'Pan' ,
279
- attr : 'dragmode' ,
279
+ attr : 'scene. dragmode' ,
280
280
val : 'pan' ,
281
281
icon : Icons . pan ,
282
282
click : handleDrag3d
@@ -285,7 +285,7 @@ modeBarButtons.pan3d = {
285
285
modeBarButtons . orbitRotation = {
286
286
name : 'orbitRotation' ,
287
287
title : 'orbital rotation' ,
288
- attr : 'dragmode' ,
288
+ attr : 'scene. dragmode' ,
289
289
val : 'orbit' ,
290
290
icon : Icons [ '3d_rotate' ] ,
291
291
click : handleDrag3d
@@ -294,7 +294,7 @@ modeBarButtons.orbitRotation = {
294
294
modeBarButtons . tableRotation = {
295
295
name : 'tableRotation' ,
296
296
title : 'turntable rotation' ,
297
- attr : 'dragmode' ,
297
+ attr : 'scene. dragmode' ,
298
298
val : 'turntable' ,
299
299
icon : Icons [ 'z-axis' ] ,
300
300
click : handleDrag3d
@@ -304,14 +304,16 @@ function handleDrag3d(gd, ev) {
304
304
var button = ev . currentTarget ,
305
305
attr = button . getAttribute ( 'data-attr' ) ,
306
306
val = button . getAttribute ( 'data-val' ) || true ,
307
+ fullLayout = gd . _fullLayout ,
308
+ sceneIds = Plotly . Plots . getSubplotIds ( fullLayout , 'gl3d' ) ,
307
309
layoutUpdate = { } ;
308
310
309
- layoutUpdate [ attr ] = val ;
311
+ var parts = attr . split ( '.' ) ;
312
+
313
+ for ( var i = 0 ; i < sceneIds . length ; i ++ ) {
314
+ layoutUpdate [ sceneIds [ i ] + '.' + parts [ 1 ] ] = val ;
315
+ }
310
316
311
- /*
312
- * Dragmode will go through the relayout -> doplot -> scene.plot()
313
- * routine where the dragmode will be set in scene.plot()
314
- */
315
317
Plotly . relayout ( gd , layoutUpdate ) ;
316
318
}
317
319
0 commit comments