@@ -816,7 +816,10 @@ describe('sankey tests', function() {
816816 it ( 'should show the correct hover labels when hovertemplate is specified' , function ( done ) {
817817 var gd = createGraphDiv ( ) ;
818818 var mockCopy = Lib . extendDeep ( { } , mock ) ;
819- mockCopy . data [ 0 ] . node . customdata = [ 0 , 0 , 0 , 0 , '15' ]
819+ mockCopy . data [ 0 ] . node . customdata = [ ] ;
820+ mockCopy . data [ 0 ] . node . customdata [ 4 ] = 'nodeCustomdata' ;
821+ mockCopy . data [ 0 ] . link . customdata = [ ] ;
822+ mockCopy . data [ 0 ] . link . customdata [ 61 ] = 'linkCustomdata' ;
820823
821824 Plotly . plot ( gd , mockCopy ) . then ( function ( ) {
822825 _hover ( 404 , 302 ) ;
@@ -838,22 +841,22 @@ describe('sankey tests', function() {
838841 . then ( function ( ) {
839842 return Plotly . restyle ( gd , {
840843 'node.hovertemplate' : 'hovertemplate<br>%{value}<br>%{value:0.2f}<br>%{customdata}<extra>%{fullData.name}</extra>' ,
841- 'link.hovertemplate' : 'hovertemplate<br>source: %{source.label}<br>target: %{target.label}<br>size: %{value:0.0f}TWh<extra>%{fullData.name}</extra>'
844+ 'link.hovertemplate' : 'hovertemplate<br>source: %{source.label}<br>target: %{target.label}<br>size: %{value:0.0f}TWh<br>%{customdata}< extra>%{fullData.name}</extra>'
842845 } ) ;
843846 } )
844847 . then ( function ( ) {
845848 _hover ( 404 , 302 ) ;
846849
847850 assertLabel (
848- [ 'hovertemplate' , '447TWh' , '447.48' , '15 ' , 'trace 0' ] ,
851+ [ 'hovertemplate' , '447TWh' , '447.48' , 'nodeCustomdata ' , 'trace 0' ] ,
849852 [ 'rgb(148, 103, 189)' , 'rgb(255, 255, 255)' , 13 , 'Arial' , 'rgb(255, 255, 255)' ]
850853 ) ;
851854 } )
852855 . then ( function ( ) {
853856 _hover ( 450 , 300 ) ;
854857
855858 assertLabel (
856- [ 'hovertemplate' , 'source: Solid' , 'target: Industry' , 'size: 46TWh' , 'trace 0' ] ,
859+ [ 'hovertemplate' , 'source: Solid' , 'target: Industry' , 'size: 46TWh' , 'linkCustomdata' , ' trace 0'] ,
857860 [ 'rgb(0, 0, 96)' , 'rgb(255, 255, 255)' , 13 , 'Arial' , 'rgb(255, 255, 255)' ]
858861 ) ;
859862 } )
0 commit comments