@@ -778,12 +778,14 @@ describe('bar hover', function() {
778
778
subplot = gd . _fullLayout . _plots . xy ,
779
779
xa = subplot . xaxis ,
780
780
ya = subplot . yaxis ,
781
- barDelta = 1 * 0.8 / 2 ;
781
+ barDelta = 1 * 0.8 / 2 ,
782
+ x0 = xa . c2p ( 0.5 , true ) ,
783
+ x1 = x0 ,
784
+ y0 = ya . c2p ( 0 - barDelta , true ) ,
785
+ y1 = ya . c2p ( 0 + barDelta , true ) ;
782
786
783
787
expect ( out . style ) . toEqual ( [ 0 , '#1f77b4' , 0.5 , 0 ] ) ;
784
- assertPos ( out . pos ,
785
- [ xa . c2p ( 0.5 , true ) , xa . c2p ( 0.5 , true ) ,
786
- ya . c2p ( 0 - barDelta , true ) , ya . c2p ( 0 + barDelta , true ) ] ) ;
788
+ assertPos ( out . pos , [ x0 , x1 , y0 , y1 ] ) ;
787
789
} ) ;
788
790
789
791
it ( 'should return the correct hover point data (case closest)' , function ( ) {
@@ -792,12 +794,14 @@ describe('bar hover', function() {
792
794
xa = subplot . xaxis ,
793
795
ya = subplot . yaxis ,
794
796
barDelta = 1 * 0.8 / 2 / 2 ,
795
- barPos = 0 - 1 * 0.8 / 2 + barDelta ;
797
+ barPos = 0 - 1 * 0.8 / 2 + barDelta ,
798
+ x0 = xa . c2p ( 0.5 , true ) ,
799
+ x1 = x0 ,
800
+ y0 = ya . c2p ( barPos - barDelta , true ) ,
801
+ y1 = ya . c2p ( barPos + barDelta , true ) ;
796
802
797
803
expect ( out . style ) . toEqual ( [ 0 , '#1f77b4' , 0.5 , 0 ] ) ;
798
- assertPos ( out . pos ,
799
- [ xa . c2p ( 0.5 , true ) , xa . c2p ( 0.5 , true ) ,
800
- ya . c2p ( barPos - barDelta , true ) , ya . c2p ( barPos + barDelta , true ) ] ) ;
804
+ assertPos ( out . pos , [ x0 , x1 , y0 , y1 ] ) ;
801
805
} ) ;
802
806
} ) ;
803
807
0 commit comments