File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -271,20 +271,19 @@ proto.updateFx = function(options) {
271
271
272
272
var relayoutCallback = function ( scene ) {
273
273
274
- var update = { } ,
275
- xrange = scene . xaxis . range ,
274
+ var xrange = scene . xaxis . range ,
276
275
yrange = scene . yaxis . range ;
277
276
278
277
// Update the layout on the DIV
279
278
scene . graphDiv . layout . xaxis . range = xrange . slice ( 0 ) ;
280
279
scene . graphDiv . layout . yaxis . range = yrange . slice ( 0 ) ;
281
280
282
281
// Make a meaningful value to be passed on to the possible 'plotly_relayout' subscriber(s)
283
- update [ scene . id ] = { // scene.camera has no many useful projection or scale information
284
- lastInputTime : scene . camera . lastInputTime , // helps determine which one is the latest input (if async)
285
- xrange : xrange . slice ( 0 ) ,
286
- yrange : yrange . slice ( 0 )
282
+ var update = { // scene.camera has no many useful projection or scale information
283
+ lastInputTime : scene . camera . lastInputTime // helps determine which one is the latest input (if async)
287
284
} ;
285
+ update [ scene . xaxis . _name ] = xrange . slice ( ) ;
286
+ update [ scene . yaxis . _name ] = yrange . slice ( ) ;
288
287
289
288
scene . graphDiv . emit ( 'plotly_relayout' , update ) ;
290
289
} ;
Original file line number Diff line number Diff line change @@ -310,7 +310,15 @@ describe('Test gl plot interactions', function() {
310
310
311
311
setTimeout ( function ( ) {
312
312
313
- expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 6 ) ; // X and back; Y and back; XY and back
313
+ // callback count expectation: X and back; Y and back; XY and back
314
+ expect ( relayoutCallback ) . toHaveBeenCalledTimes ( 6 ) ;
315
+
316
+ // a callback value structure and contents check
317
+ expect ( relayoutCallback ) . toHaveBeenCalledWith ( jasmine . objectContaining ( {
318
+ lastInputTime : jasmine . any ( Number ) ,
319
+ xaxis : [ jasmine . any ( Number ) , jasmine . any ( Number ) ] ,
320
+ yaxis : [ jasmine . any ( Number ) , jasmine . any ( Number ) ]
321
+ } ) ) ;
314
322
315
323
done ( ) ;
316
324
You can’t perform that action at this time.
0 commit comments