@@ -694,8 +694,9 @@ describe('hover on fill', function() {
694
694
695
695
it ( 'should work for scatterternary too' , function ( done ) {
696
696
var mock = Lib . extendDeep ( { } , require ( '@mocks/ternary_fill.json' ) ) ;
697
+ var gd = createGraphDiv ( ) ;
697
698
698
- Plotly . plot ( createGraphDiv ( ) , mock . data , mock . layout ) . then ( function ( ) {
699
+ Plotly . plot ( gd , mock . data , mock . layout ) . then ( function ( ) {
699
700
// hover over a point when that's closest, even if you're over
700
701
// a fill, because by default we have hoveron='points+fills'
701
702
return assertLabelsCorrect ( [ 237 , 150 ] , [ 240.0 , 144 ] ,
@@ -707,6 +708,16 @@ describe('hover on fill', function() {
707
708
return assertLabelsCorrect ( [ 237 , 218 ] , [ 266.75 , 265 ] , 'trace 1' ) ;
708
709
} ) . then ( function ( ) {
709
710
return assertLabelsCorrect ( [ 237 , 251 ] , [ 247.7 , 254 ] , 'trace 0' ) ;
711
+ } ) . then ( function ( ) {
712
+ // zoom in to test clipping of large out-of-viewport shapes
713
+ return Plotly . relayout ( gd , {
714
+ 'ternary.aaxis.min' : 0.5 ,
715
+ 'ternary.baxis.min' : 0.25
716
+ } ) ;
717
+ } ) . then ( function ( ) {
718
+ // this particular one has a hover label disconnected from the shape itself
719
+ // so if we ever fix this, the test will have to be fixed too.
720
+ return assertLabelsCorrect ( [ 295 , 218 ] , [ 275.1 , 166 ] , 'trace 2' ) ;
710
721
} ) . then ( function ( ) {
711
722
// trigger an autoscale redraw, which goes through dragElement
712
723
return doubleClick ( 237 , 251 ) ;
0 commit comments