@@ -81,15 +81,14 @@ describe('@gl Test cone autorange:', function() {
81
81
82
82
it ( 'should add pad around cone position to make sure they fit on the scene' , function ( done ) {
83
83
var fig = Lib . extendDeep ( { } , require ( '@mocks/gl3d_cone-autorange.json' ) ) ;
84
+ var rng0 = [ 0.103 , 3.897 ] ;
84
85
85
86
function makeScaleFn ( s ) {
86
87
return function ( v ) { return v * s ; } ;
87
88
}
88
89
89
90
Plotly . plot ( gd , fig ) . then ( function ( ) {
90
- _assertAxisRanges ( 'base' ,
91
- [ - 0.66 , 4.66 ] , [ - 0.66 , 4.66 ] , [ - 0.66 , 4.66 ]
92
- ) ;
91
+ _assertAxisRanges ( 'base' , rng0 , rng0 , rng0 ) ;
93
92
94
93
// the resulting image should be independent of what I multiply by here
95
94
var trace = fig . data [ 0 ] ;
@@ -101,9 +100,7 @@ describe('@gl Test cone autorange:', function() {
101
100
return Plotly . restyle ( gd , { u : [ u ] , v : [ v ] , w : [ w ] } ) ;
102
101
} )
103
102
. then ( function ( ) {
104
- _assertAxisRanges ( 'scaled up' ,
105
- [ - 0.66 , 4.66 ] , [ - 0.66 , 4.66 ] , [ - 0.66 , 4.66 ]
106
- ) ;
103
+ _assertAxisRanges ( 'scaled up' , rng0 , rng0 , rng0 ) ;
107
104
108
105
// the resulting image should be independent of what I multiply by here
109
106
var trace = fig . data [ 0 ] ;
@@ -115,12 +112,9 @@ describe('@gl Test cone autorange:', function() {
115
112
return Plotly . restyle ( gd , { u : [ u ] , v : [ v ] , w : [ w ] } ) ;
116
113
} )
117
114
. then ( function ( ) {
118
- _assertAxisRanges ( 'scaled down' ,
119
- [ - 0.66 , 4.66 ] , [ - 0.66 , 4.66 ] , [ - 0.66 , 4.66 ]
120
- ) ;
115
+ _assertAxisRanges ( 'scaled down' , rng0 , rng0 , rng0 ) ;
121
116
122
117
var trace = fig . data [ 0 ] ;
123
-
124
118
var x = trace . x . slice ( ) ;
125
119
x . push ( 5 ) ;
126
120
var y = trace . y . slice ( ) ;
@@ -140,33 +134,29 @@ describe('@gl Test cone autorange:', function() {
140
134
} ) ;
141
135
} )
142
136
. then ( function ( ) {
143
- _assertAxisRanges ( 'after adding one cone outside range but with norm-0' ,
144
- [ - 0.72 , 6.72 ] , [ - 0.72 , 6.72 ] , [ - 0.72 , 6.72 ]
145
- ) ;
137
+ var rng = [ 0.041 , 5.959 ] ;
138
+ _assertAxisRanges ( 'after adding one cone outside range but with norm-0' , rng , rng , rng ) ;
146
139
147
140
return Plotly . restyle ( gd , 'sizeref' , 10 ) ;
148
141
} )
149
142
. then ( function ( ) {
150
- _assertAxisRanges ( 'after increasing sizeref' ,
151
- [ - 15.06 , 21.06 ] , [ - 15.06 , 21.06 ] , [ - 15.06 , 21.06 ]
152
- ) ;
143
+ var rng = [ - 15.808 , 21.808 ] ;
144
+ _assertAxisRanges ( 'after increasing sizeref' , rng , rng , rng ) ;
153
145
154
146
return Plotly . restyle ( gd , 'sizeref' , 0.1 ) ;
155
147
} )
156
148
. then ( function ( ) {
157
- _assertAxisRanges ( 'after decreasing sizeref' ,
158
- [ 0.72 , 5.28 ] , [ 0.72 , 5.28 ] , [ 0.72 , 5.28 ]
159
- ) ;
149
+ var rng = [ 0.708 , 5.292 ] ;
150
+ _assertAxisRanges ( 'after decreasing sizeref' , rng , rng , rng ) ;
160
151
161
152
return Plotly . restyle ( gd , {
162
153
sizemode : 'absolute' ,
163
154
sizeref : 2
164
155
} ) ;
165
156
} )
166
157
. then ( function ( ) {
167
- _assertAxisRanges ( 'with sizemode absolute' ,
168
- [ 0.63 , 5.37 ] , [ 0.63 , 5.37 ] , [ 0.63 , 5.37 ]
169
- ) ;
158
+ var rng = [ 0.614 , 5.386 ] ;
159
+ _assertAxisRanges ( 'with sizemode absolute' , rng , rng , rng ) ;
170
160
171
161
var trace = fig . data [ 0 ] ;
172
162
var m = makeScaleFn ( 2 ) ;
@@ -179,9 +169,8 @@ describe('@gl Test cone autorange:', function() {
179
169
} ) ;
180
170
} )
181
171
. then ( function ( ) {
182
- _assertAxisRanges ( 'after spacing out the x/y/z coordinates' ,
183
- [ 1.25 , 10.75 ] , [ 1.25 , 10.75 ] , [ 1.25 , 10.75 ]
184
- ) ;
172
+ var rng = [ 1.229 , 10.771 ] ;
173
+ _assertAxisRanges ( 'after spacing out the x/y/z coordinates' , rng , rng , rng ) ;
185
174
} )
186
175
. catch ( failTest )
187
176
. then ( done ) ;
@@ -268,7 +257,7 @@ describe('@gl Test cone interactions', function() {
268
257
269
258
it ( 'should display hover labels (multi-trace case)' , function ( done ) {
270
259
function _hover ( ) {
271
- mouseEvent ( 'mouseover' , 245 , 230 ) ;
260
+ mouseEvent ( 'mouseover' , 282 , 240 ) ;
272
261
return delay ( 20 ) ( ) ;
273
262
}
274
263
0 commit comments