Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9354fb3

Browse filesBrowse files
committed
rename scene.proto.handleDragmode --> scene.proto.updateFx
- to be consistent with scene2d - note that updateFx is called w/o passing through scene.proto.plot for Plotly.relayout when 'layout.dragmode' and/or 'layout.hovermode' are updated
1 parent 524ce13 commit 9354fb3
Copy full SHA for 9354fb3

File tree

2 files changed

+11
-8
lines changed
Filter options

2 files changed

+11
-8
lines changed

‎src/plot_api/plot_api.js

Copy file name to clipboardExpand all lines: src/plot_api/plot_api.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
22752275
* hovermode and dragmode don't need any redrawing, since they just
22762276
* affect reaction to user input. everything else, assume full replot.
22772277
* 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.
22792279
*/
22802280
else if(['hovermode', 'dragmode'].indexOf(ai) !== -1) domodebar = true;
22812281
else if(['hovermode','dragmode','height',
@@ -2343,7 +2343,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
23432343
subplotIds = Plots.getSubplotIds(fullLayout, 'gl3d');
23442344
for(i = 0; i < subplotIds.length; i++) {
23452345
scene = fullLayout[subplotIds[i]]._scene;
2346-
scene.handleDragmode(fullLayout.dragmode);
2346+
scene.updateFx(fullLayout.dragmode, fullLayout.hovermode);
23472347
}
23482348

23492349
subplotIds = Plots.getSubplotIds(fullLayout, 'gl2d');

‎src/plots/gl3d/scene.js

Copy file name to clipboardExpand all lines: src/plots/gl3d/scene.js
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ proto.plot = function(sceneData, fullLayout, layout) {
300300
this.spikeOptions.merge(fullSceneLayout);
301301

302302
// Update camera mode
303-
this.handleDragmode(fullLayout.dragmode);
303+
this.updateFx(fullSceneLayout.dragmode, fullSceneLayout.hovermode);
304304

305305
//Update scene
306306
this.glplot.update({});
@@ -586,16 +586,16 @@ proto.saveCamera = function saveCamera(layout) {
586586
return hasChanged;
587587
};
588588

589-
proto.handleDragmode = function(dragmode) {
590-
589+
proto.updateFx = function(dragmode, hovermode) {
591590
var camera = this.camera;
592-
if (camera) {
591+
592+
if(camera) {
593593
// rotate and orbital are synonymous
594-
if (dragmode === 'orbit') {
594+
if(dragmode === 'orbit') {
595595
camera.mode = 'orbit';
596596
camera.keyBindingMode = 'rotate';
597597

598-
} else if (dragmode === 'turntable') {
598+
} else if(dragmode === 'turntable') {
599599
camera.up = [0, 0, 1];
600600
camera.mode = 'turntable';
601601
camera.keyBindingMode = 'rotate';
@@ -606,6 +606,9 @@ proto.handleDragmode = function(dragmode) {
606606
camera.keyBindingMode = dragmode;
607607
}
608608
}
609+
610+
// to put dragmode and hovermode on the same grounds from relayout
611+
this.fullSceneLayout.hovermode = hovermode;
609612
};
610613

611614
proto.toImage = function(format) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.