File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ function createCamera(scene) {
32
32
plot = scene . glplot ,
33
33
result = new Camera2D ( element , plot ) ;
34
34
35
+ function unSetAutoRange ( ) {
36
+ scene . xaxis . autorange = false ;
37
+ scene . yaxis . autorange = false ;
38
+ }
39
+
35
40
result . mouseListener = mouseChange ( element , function ( buttons , x , y ) {
36
41
var xrange = scene . xaxis . range ,
37
42
yrange = scene . yaxis . range ,
@@ -84,7 +89,7 @@ function createCamera(scene) {
84
89
else if ( result . boxEnabled ) {
85
90
updateRange ( xrange , result . boxStart [ 0 ] , result . boxEnd [ 0 ] ) ;
86
91
updateRange ( yrange , result . boxStart [ 1 ] , result . boxEnd [ 1 ] ) ;
87
-
92
+ unSetAutoRange ( ) ;
88
93
result . boxEnabled = false ;
89
94
}
90
95
break ;
@@ -104,7 +109,7 @@ function createCamera(scene) {
104
109
yrange [ 1 ] += dy ;
105
110
106
111
result . lastInputTime = Date . now ( ) ;
107
-
112
+ unSetAutoRange ( ) ;
108
113
scene . cameraChanged ( ) ;
109
114
}
110
115
break ;
@@ -142,6 +147,7 @@ function createCamera(scene) {
142
147
yrange [ 1 ] = ( yrange [ 1 ] - cy ) * scale + cy ;
143
148
144
149
result . lastInputTime = Date . now ( ) ;
150
+ unSetAutoRange ( ) ;
145
151
scene . cameraChanged ( ) ;
146
152
break ;
147
153
}
Original file line number Diff line number Diff line change @@ -275,7 +275,9 @@ var relayoutCallback = function(scene) {
275
275
yrange = scene . yaxis . range ;
276
276
277
277
// Update the layout on the DIV
278
+ scene . graphDiv . layout . xaxis . autorange = scene . xaxis . autorange ;
278
279
scene . graphDiv . layout . xaxis . range = xrange . slice ( 0 ) ;
280
+ scene . graphDiv . layout . yaxis . autorange = scene . yaxis . autorange ;
279
281
scene . graphDiv . layout . yaxis . range = yrange . slice ( 0 ) ;
280
282
281
283
// Make a meaningful value to be passed on to the possible 'plotly_relayout' subscriber(s)
You can’t perform that action at this time.
0 commit comments