File tree 2 files changed +11
-8
lines changed
Filter options
2 files changed +11
-8
lines changed
Original file line number Diff line number Diff line change @@ -2275,7 +2275,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
2275
2275
* hovermode and dragmode don't need any redrawing, since they just
2276
2276
* affect reaction to user input. everything else, assume full replot.
2277
2277
* height, width, autosize get dealt with below. Except for the case of
2278
- * of subplots - scenes - which require scene.handleDragmode to be called.
2278
+ * of subplots - scenes - which require scene.updateFx to be called.
2279
2279
*/
2280
2280
else if ( [ 'hovermode' , 'dragmode' ] . indexOf ( ai ) !== - 1 ) domodebar = true ;
2281
2281
else if ( [ 'hovermode' , 'dragmode' , 'height' ,
@@ -2343,7 +2343,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
2343
2343
subplotIds = Plots . getSubplotIds ( fullLayout , 'gl3d' ) ;
2344
2344
for ( i = 0 ; i < subplotIds . length ; i ++ ) {
2345
2345
scene = fullLayout [ subplotIds [ i ] ] . _scene ;
2346
- scene . handleDragmode ( fullLayout . dragmode ) ;
2346
+ scene . updateFx ( fullLayout . dragmode , fullLayout . hovermode ) ;
2347
2347
}
2348
2348
2349
2349
subplotIds = Plots . getSubplotIds ( fullLayout , 'gl2d' ) ;
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ proto.plot = function(sceneData, fullLayout, layout) {
300
300
this . spikeOptions . merge ( fullSceneLayout ) ;
301
301
302
302
// Update camera mode
303
- this . handleDragmode ( fullLayout . dragmode ) ;
303
+ this . updateFx ( fullSceneLayout . dragmode , fullSceneLayout . hovermode ) ;
304
304
305
305
//Update scene
306
306
this . glplot . update ( { } ) ;
@@ -586,16 +586,16 @@ proto.saveCamera = function saveCamera(layout) {
586
586
return hasChanged ;
587
587
} ;
588
588
589
- proto . handleDragmode = function ( dragmode ) {
590
-
589
+ proto . updateFx = function ( dragmode , hovermode ) {
591
590
var camera = this . camera ;
592
- if ( camera ) {
591
+
592
+ if ( camera ) {
593
593
// rotate and orbital are synonymous
594
- if ( dragmode === 'orbit' ) {
594
+ if ( dragmode === 'orbit' ) {
595
595
camera . mode = 'orbit' ;
596
596
camera . keyBindingMode = 'rotate' ;
597
597
598
- } else if ( dragmode === 'turntable' ) {
598
+ } else if ( dragmode === 'turntable' ) {
599
599
camera . up = [ 0 , 0 , 1 ] ;
600
600
camera . mode = 'turntable' ;
601
601
camera . keyBindingMode = 'rotate' ;
@@ -606,6 +606,9 @@ proto.handleDragmode = function(dragmode) {
606
606
camera . keyBindingMode = dragmode ;
607
607
}
608
608
}
609
+
610
+ // to put dragmode and hovermode on the same grounds from relayout
611
+ this . fullSceneLayout . hovermode = hovermode ;
609
612
} ;
610
613
611
614
proto . toImage = function ( format ) {
You can’t perform that action at this time.
0 commit comments