@@ -108,20 +108,20 @@ module.exports = function draw(gd) {
108108 traces . enter ( ) . append ( 'g' ) . attr ( 'class' , 'traces' ) ;
109109 traces . exit ( ) . remove ( ) ;
110110
111- traces . call ( style , gd )
112- . style ( 'opacity' , function ( d ) {
113- var trace = d [ 0 ] . trace ;
114- if ( Registry . traceIs ( trace , 'pie' ) ) {
115- return hiddenSlices . indexOf ( d [ 0 ] . label ) !== - 1 ? 0.5 : 1 ;
116- } else {
117- return trace . visible === 'legendonly' ? 0.5 : 1 ;
118- }
119- } )
120- . each ( function ( ) {
121- d3 . select ( this )
122- . call ( drawTexts , gd , maxLength )
123- . call ( setupTraceToggle , gd ) ;
124- } ) ;
111+ traces . style ( 'opacity' , function ( d ) {
112+ var trace = d [ 0 ] . trace ;
113+ if ( Registry . traceIs ( trace , 'pie' ) ) {
114+ return hiddenSlices . indexOf ( d [ 0 ] . label ) !== - 1 ? 0.5 : 1 ;
115+ } else {
116+ return trace . visible === 'legendonly' ? 0.5 : 1 ;
117+ }
118+ } )
119+ . each ( function ( ) {
120+ d3 . select ( this )
121+ . call ( drawTexts , gd , maxLength )
122+ . call ( setupTraceToggle , gd ) ;
123+ } )
124+ . call ( style , gd ) ;
125125
126126 Lib . syncOrAsync ( [ Plots . previousPromises ,
127127 function ( ) {
@@ -522,8 +522,7 @@ function computeTextDimensions(g, gd) {
522522 width = mathjaxBB . width ;
523523
524524 Drawing . setTranslate ( mathjaxGroup , 0 , ( height / 4 ) ) ;
525- }
526- else {
525+ } else {
527526 var text = g . select ( '.legendtext' ) ;
528527 var textLines = svgTextUtils . lineCount ( text ) ;
529528 var textNode = text . node ( ) ;
@@ -535,12 +534,10 @@ function computeTextDimensions(g, gd) {
535534 // to avoid getBoundingClientRect
536535 var textY = lineHeight * ( 0.3 + ( 1 - textLines ) / 2 ) ;
537536 svgTextUtils . positionText ( text , constants . textOffsetX , textY ) ;
538- legendItem . lineHeight = lineHeight ;
539537 }
540538
541- height = Math . max ( height , 16 ) + 3 ;
542-
543- legendItem . height = height ;
539+ legendItem . lineHeight = lineHeight ;
540+ legendItem . height = Math . max ( height , 16 ) + 3 ;
544541 legendItem . width = width ;
545542}
546543
0 commit comments