@@ -321,6 +321,7 @@ function computeTraceBounds(scene, trace, bounds) {
321321}
322322
323323proto . plot = function ( sceneData , fullLayout , layout ) {
324+
324325 // Save parameters
325326 this . plotArgs = [ sceneData , fullLayout , layout ] ;
326327
@@ -343,7 +344,8 @@ proto.plot = function(sceneData, fullLayout, layout) {
343344 this . axesOptions . merge ( fullSceneLayout ) ;
344345 this . spikeOptions . merge ( fullSceneLayout ) ;
345346
346- // Update camera mode
347+ // Update camera and camera mode
348+ this . setCamera ( fullSceneLayout . camera ) ;
347349 this . updateFx ( fullSceneLayout . dragmode , fullSceneLayout . hovermode ) ;
348350
349351 // Update scene
@@ -564,18 +566,6 @@ proto.destroy = function() {
564566 this . glplot = null ;
565567} ;
566568
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-
579569// getOrbitCamera :: plotly_coords -> orbit_camera_coords
580570// inverse of getLayoutCamera
581571function getOrbitCamera ( camera ) {
@@ -604,13 +594,7 @@ proto.getCamera = function getCamera() {
604594
605595// set camera position with a set of plotly coords
606596proto . setCamera = function setCamera ( cameraData ) {
607-
608- var update = { } ;
609-
610- update [ this . id ] = cameraData ;
611-
612597 this . glplot . camera . lookAt . apply ( this , getOrbitCamera ( cameraData ) ) ;
613- this . graphDiv . emit ( 'plotly_relayout' , update ) ;
614598} ;
615599
616600// save camera to user layout (i.e. gd.layout)
0 commit comments