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) {
271271
272272var relayoutCallback = function ( scene ) {
273273
274- var update = { } ,
275- xrange = scene . xaxis . range ,
274+ var xrange = scene . xaxis . range ,
276275 yrange = scene . yaxis . range ;
277276
278277 // Update the layout on the DIV
279278 scene . graphDiv . layout . xaxis . range = xrange . slice ( 0 ) ;
280279 scene . graphDiv . layout . yaxis . range = yrange . slice ( 0 ) ;
281280
282281 // 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)
287284 } ;
285+ update [ scene . xaxis . _name ] = xrange . slice ( ) ;
286+ update [ scene . yaxis . _name ] = yrange . slice ( ) ;
288287
289288 scene . graphDiv . emit ( 'plotly_relayout' , update ) ;
290289} ;
Original file line number Diff line number Diff line change @@ -310,7 +310,15 @@ describe('Test gl plot interactions', function() {
310310
311311 setTimeout ( function ( ) {
312312
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+ } ) ) ;
314322
315323 done ( ) ;
316324
You can’t perform that action at this time.
0 commit comments