@@ -108,20 +108,20 @@ module.exports = function draw(gd) {
108
108
traces . enter ( ) . append ( 'g' ) . attr ( 'class' , 'traces' ) ;
109
109
traces . exit ( ) . remove ( ) ;
110
110
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 ) ;
125
125
126
126
Lib . syncOrAsync ( [ Plots . previousPromises ,
127
127
function ( ) {
@@ -522,8 +522,7 @@ function computeTextDimensions(g, gd) {
522
522
width = mathjaxBB . width ;
523
523
524
524
Drawing . setTranslate ( mathjaxGroup , 0 , ( height / 4 ) ) ;
525
- }
526
- else {
525
+ } else {
527
526
var text = g . select ( '.legendtext' ) ;
528
527
var textLines = svgTextUtils . lineCount ( text ) ;
529
528
var textNode = text . node ( ) ;
@@ -535,12 +534,10 @@ function computeTextDimensions(g, gd) {
535
534
// to avoid getBoundingClientRect
536
535
var textY = lineHeight * ( 0.3 + ( 1 - textLines ) / 2 ) ;
537
536
svgTextUtils . positionText ( text , constants . textOffsetX , textY ) ;
538
- legendItem . lineHeight = lineHeight ;
539
537
}
540
538
541
- height = Math . max ( height , 16 ) + 3 ;
542
-
543
- legendItem . height = height ;
539
+ legendItem . lineHeight = lineHeight ;
540
+ legendItem . height = Math . max ( height , 16 ) + 3 ;
544
541
legendItem . width = width ;
545
542
}
546
543
0 commit comments