@@ -321,6 +321,7 @@ function computeTraceBounds(scene, trace, bounds) {
321
321
}
322
322
323
323
proto . plot = function ( sceneData , fullLayout , layout ) {
324
+
324
325
// Save parameters
325
326
this . plotArgs = [ sceneData , fullLayout , layout ] ;
326
327
@@ -343,7 +344,8 @@ proto.plot = function(sceneData, fullLayout, layout) {
343
344
this . axesOptions . merge ( fullSceneLayout ) ;
344
345
this . spikeOptions . merge ( fullSceneLayout ) ;
345
346
346
- // Update camera mode
347
+ // Update camera and camera mode
348
+ this . setCamera ( fullSceneLayout . camera ) ;
347
349
this . updateFx ( fullSceneLayout . dragmode , fullSceneLayout . hovermode ) ;
348
350
349
351
// Update scene
@@ -564,18 +566,6 @@ proto.destroy = function() {
564
566
this . glplot = null ;
565
567
} ;
566
568
567
-
568
- // for reset camera button in mode bar
569
- proto . setCameraToDefault = function setCameraToDefault ( ) {
570
- // as in Gl3d.layoutAttributes
571
-
572
- this . setCamera ( {
573
- eye : { x : 1.25 , y : 1.25 , z : 1.25 } ,
574
- center : { x : 0 , y : 0 , z : 0 } ,
575
- up : { x : 0 , y : 0 , z : 1 }
576
- } ) ;
577
- } ;
578
-
579
569
// getOrbitCamera :: plotly_coords -> orbit_camera_coords
580
570
// inverse of getLayoutCamera
581
571
function getOrbitCamera ( camera ) {
@@ -604,13 +594,7 @@ proto.getCamera = function getCamera() {
604
594
605
595
// set camera position with a set of plotly coords
606
596
proto . setCamera = function setCamera ( cameraData ) {
607
-
608
- var update = { } ;
609
-
610
- update [ this . id ] = cameraData ;
611
-
612
597
this . glplot . camera . lookAt . apply ( this , getOrbitCamera ( cameraData ) ) ;
613
- this . graphDiv . emit ( 'plotly_relayout' , update ) ;
614
598
} ;
615
599
616
600
// save camera to user layout (i.e. gd.layout)
0 commit comments