@@ -669,10 +669,35 @@ describe('image hover:', function() {
669669 } ) ;
670670
671671 [
672- [ [ 0 , 512 ] , [ 0 , 512 ] ] ,
673- [ [ 0 , 512 ] , [ 512 , 0 ] ] , // the default image layout
674- [ [ 512 , 0 ] , [ 0 , 512 ] ] ,
675- [ [ 512 , 0 ] , [ 512 , 0 ] ]
672+ [ true , true ] ,
673+ [ true , 'reversed' ] , // the default image layout
674+ [ 'reversed' , true ] ,
675+ [ 'reversed' , 'reversed' ]
676+ ] . forEach ( function ( test ) {
677+ it ( 'should show correct hover info regardless of axis directions ' + test , function ( done ) {
678+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
679+ mockCopy . layout . xaxis . autorange = test [ 0 ] ;
680+ mockCopy . layout . yaxis . autorange = test [ 1 ] ;
681+ mockCopy . data [ 0 ] . colormodel = 'rgba' ;
682+ mockCopy . data [ 0 ] . hovertemplate = '%{z}<extra></extra>' ;
683+ Plotly . newPlot ( gd , mockCopy )
684+ . then ( function ( ) { _hover ( 205 , 125 ) ; } )
685+ . then ( function ( ) {
686+ assertHoverLabelContent ( {
687+ nums : '[202, 148, 125, 255]' ,
688+ name : ''
689+ } , 'variable `z` should be correct!' ) ;
690+ } )
691+ . catch ( failTest )
692+ . then ( done ) ;
693+ } ) ;
694+ } ) ;
695+
696+ [
697+ [ [ - 0.5 , 511.5 ] , [ - 0.5 , 511.5 ] ] ,
698+ [ [ - 0.5 , 511.5 ] , [ 511.5 , - 0.5 ] ] , // the default image layout
699+ [ [ 511.5 , - 0.5 ] , [ - 0.5 , 511.5 ] ] ,
700+ [ [ 511.5 , - 0.5 ] , [ 511.5 , - 0.5 ] ]
676701 ] . forEach ( function ( test ) {
677702 it ( 'should show correct hover info regardless of axis directions ' + test , function ( done ) {
678703 var mockCopy = Lib . extendDeep ( { } , mock ) ;
0 commit comments