@@ -616,11 +616,10 @@ describe('heatmap hover', function() {
616616 return hoverData ;
617617 }
618618
619- function assertLabels ( hoverPoint , xLabelVal , yLabelVal , zLabelVal , zLabel , text ) {
620- expect ( hoverPoint . xLabelVal ) . toEqual ( xLabelVal , 'have correct x label value' ) ;
621- expect ( hoverPoint . yLabelVal ) . toEqual ( yLabelVal , 'have correct y label value' ) ;
622- expect ( hoverPoint . zLabelVal ) . toEqual ( zLabelVal , 'have correct z label value' ) ;
623- expect ( hoverPoint . zLabel ) . toEqual ( zLabel , 'have correct z label' ) ;
619+ function assertLabels ( hoverPoint , xLabel , yLabel , zLabel , text ) {
620+ expect ( hoverPoint . xLabelVal ) . toEqual ( xLabel , 'have correct x label' ) ;
621+ expect ( hoverPoint . yLabelVal ) . toEqual ( yLabel , 'have correct y label' ) ;
622+ expect ( hoverPoint . zLabelVal ) . toEqual ( zLabel , 'have correct z label' ) ;
624623 expect ( hoverPoint . text ) . toEqual ( text , 'have correct text label' ) ;
625624 }
626625
@@ -641,14 +640,14 @@ describe('heatmap hover', function() {
641640 var pt = _hover ( gd , 0.5 , 0.5 ) [ 0 ] ;
642641
643642 expect ( pt . index ) . toEqual ( [ 1 , 0 ] , 'have correct index' ) ;
644- assertLabels ( pt , 1 , 1 , 4 , '4' ) ;
643+ assertLabels ( pt , 1 , 1 , 4 ) ;
645644 } ) ;
646645
647646 it ( 'should find closest point (case 2) and should' , function ( ) {
648647 var pt = _hover ( gd , 1.5 , 0.5 ) [ 0 ] ;
649648
650649 expect ( pt . index ) . toEqual ( [ 0 , 0 ] , 'have correct index' ) ;
651- assertLabels ( pt , 2 , 0.2 , 6 , '6' ) ;
650+ assertLabels ( pt , 2 , 0.2 , 6 ) ;
652651 } ) ;
653652 } ) ;
654653
@@ -674,47 +673,13 @@ describe('heatmap hover', function() {
674673 var pt = _hover ( gd , 0.5 , 0.5 ) [ 0 ] ;
675674
676675 expect ( pt . index ) . toEqual ( [ 0 , 0 ] , 'have correct index' ) ;
677- assertLabels ( pt , 1 , 1 , 10 , '10' , ' a') ;
676+ assertLabels ( pt , 1 , 1 , 10 , 'a' ) ;
678677
679678 Plotly . relayout ( gd , 'xaxis.range' , [ 1 , 2 ] ) . then ( function ( ) {
680679 var pt2 = _hover ( gd , 1.5 , 0.5 ) [ 0 ] ;
681680
682681 expect ( pt2 . index ) . toEqual ( [ 0 , 1 ] , 'have correct index' ) ;
683- assertLabels ( pt2 , 2 , 1 , 4 , '4' , 'b' ) ;
684- } )
685- . then ( done ) ;
686- } ) ;
687-
688- } ) ;
689-
690- describe ( 'for hovering with specific number format' , function ( ) {
691-
692- beforeAll ( function ( done ) {
693- gd = createGraphDiv ( ) ;
694-
695- Plotly . plot ( gd , [ {
696- type : 'heatmap' ,
697- x : [ 1 , 2 , 3 ] ,
698- y : [ 1 , 1 , 1 ] ,
699- z : [ 0.123456789 , 2.9999 , 4 ] ,
700- zhoverformat : '.2f'
701- } ] )
702- . then ( done ) ;
703- } ) ;
704-
705- afterAll ( destroyGraphDiv ) ;
706-
707- it ( 'should find closest point and should' , function ( done ) {
708- var pt = _hover ( gd , 0.5 , 0.5 ) [ 0 ] ;
709-
710- expect ( pt . index ) . toEqual ( [ 0 , 0 ] , 'have correct index' ) ;
711- assertLabels ( pt , 1 , 1 , 0.123456789 , '0.12' ) ;
712-
713- Plotly . relayout ( gd , 'xaxis.range' , [ 1 , 2 ] ) . then ( function ( ) {
714- var pt2 = _hover ( gd , 1.5 , 0.5 ) [ 0 ] ;
715-
716- expect ( pt2 . index ) . toEqual ( [ 0 , 1 ] , 'have correct index' ) ;
717- assertLabels ( pt2 , 2 , 1 , 2.9999 , '3.00' ) ;
682+ assertLabels ( pt2 , 2 , 1 , 4 , 'b' ) ;
718683 } )
719684 . then ( done ) ;
720685 } ) ;
0 commit comments