@@ -7396,49 +7396,14 @@ describe('hovermode: (x|y)unified', function () {
73967396 } ) ;
73977397
73987398 it ( 'should align item text with hoverlabel.align' , ( done ) => {
7399- // DEBUG: remove before merge
7400- let debugStep = 0 ;
74017399 const getItems = ( ) => {
74027400 const items = [ ] ;
74037401 getHoverLabel ( )
74047402 . selectAll ( 'g.traces text.legendtext' )
74057403 . each ( function ( ) {
74067404 const bBox = this . getBoundingClientRect ( ) ;
74077405 items . push ( { anchor : this . getAttribute ( 'text-anchor' ) , left : bBox . left , right : bBox . right } ) ;
7408-
7409- // DEBUG: compare the cached width that sized the box with fresh measurements
7410- const savedBBoxes = Drawing . savedBBoxes ;
7411- Drawing . savedBBoxes = { } ;
7412- const freshWidth = Drawing . bBox ( this ) . width ;
7413- Drawing . savedBBoxes = savedBBoxes ;
7414- const style = window . getComputedStyle ( this ) ;
7415- console . log (
7416- '[DEBUG 8104]' ,
7417- JSON . stringify ( {
7418- step : debugStep ,
7419- text : this . textContent ,
7420- anchor : this . getAttribute ( 'text-anchor' ) ,
7421- x : this . getAttribute ( 'x' ) ,
7422- cachedWidth : this . parentNode . __data__ [ 0 ] . width ,
7423- freshWidth,
7424- renderedWidth : bBox . width ,
7425- textLength : this . getComputedTextLength ( ) ,
7426- left : bBox . left ,
7427- right : bBox . right ,
7428- font : style . fontFamily + ' ' + style . fontSize
7429- } )
7430- ) ;
74317406 } ) ;
7432- const bg = getHoverLabel ( ) . select ( 'rect.bg' ) . node ( ) ;
7433- console . log (
7434- '[DEBUG 8104]' ,
7435- JSON . stringify ( {
7436- step : debugStep ++ ,
7437- boxWidth : bg && bg . getAttribute ( 'width' ) ,
7438- userAgent : navigator . userAgent ,
7439- fonts : [ ...document . fonts ] . map ( ( f ) => f . family + ' ' + f . weight + ' ' + f . status )
7440- } )
7441- ) ;
74427407 return items ;
74437408 } ;
74447409
0 commit comments