@@ -377,21 +377,21 @@ drawing.pattern = function(sel, gd, patternID, shape, bgcolor, fgcolor, scale, s
377377 var path = '' ;
378378 switch ( shape ) {
379379 case '/' :
380- width = baseSize * Math . sqrt ( 2 ) ;
380+ width = baseSize * Math . sqrt ( 2 ) ;
381381 height = baseSize * Math . sqrt ( 2 ) ;
382382 path = 'M-1,1l2,-2' +
383383 'M0,' + height + 'L' + width + ',0' +
384384 'M' + ( width - 1 ) + ',' + ( height + 1 ) + 'l2,-2' ;
385385 break ;
386386 case '\\' :
387- width = baseSize * Math . sqrt ( 2 ) ;
387+ width = baseSize * Math . sqrt ( 2 ) ;
388388 height = baseSize * Math . sqrt ( 2 ) ;
389389 path = 'M' + ( width - 1 ) + ',-1l2,2' +
390390 'M0,0L' + width + ',' + height +
391391 'M-1,' + ( height - 1 ) + 'l2,2' ;
392392 break ;
393393 case 'x' :
394- width = baseSize * Math . sqrt ( 2 ) ;
394+ width = baseSize * Math . sqrt ( 2 ) ;
395395 height = baseSize * Math . sqrt ( 2 ) ;
396396 path = 'M-1,1l2,-2' +
397397 'M0,' + height + 'L' + width + ',0' +
@@ -401,29 +401,23 @@ drawing.pattern = function(sel, gd, patternID, shape, bgcolor, fgcolor, scale, s
401401 'M-1,' + ( height - 1 ) + 'l2,2' ;
402402 break ;
403403 case '|' :
404- width = baseSize ;
404+ width = baseSize ;
405405 height = baseSize ;
406406 path = 'M' + ( width / 2 ) + ',0L' + ( width / 2 ) + ',' + height ;
407407 break ;
408408 case '-' :
409- width = baseSize ;
409+ width = baseSize ;
410410 height = baseSize ;
411411 path = 'M0,' + ( height / 2 ) + 'L' + width + ',' + ( height / 2 ) ;
412412 break ;
413413 case '+' :
414- width = baseSize ;
415- height = baseSize ;
416- path = 'M' + ( width / 2 ) + ',0L' + ( width / 2 ) + ',' + height +
417- 'M0,' + ( height / 2 ) + 'L' + width + ',' + ( height / 2 ) ;
418- break ;
419- case '+' :
420- width = baseSize ;
414+ width = baseSize ;
421415 height = baseSize ;
422416 path = 'M' + ( width / 2 ) + ',0L' + ( width / 2 ) + ',' + height +
423417 'M0,' + ( height / 2 ) + 'L' + width + ',' + ( height / 2 ) ;
424418 break ;
425419 case '.' :
426- width = baseSize ;
420+ width = baseSize ;
427421 height = baseSize ;
428422 break ;
429423 }
@@ -440,10 +434,10 @@ drawing.pattern = function(sel, gd, patternID, shape, bgcolor, fgcolor, scale, s
440434 var el = d3 . select ( this ) ;
441435
442436 el . attr ( {
443- 'id' : fullID ,
444- 'width' : width + 'px' ,
445- 'height' : height + 'px' ,
446- 'patternUnits' : 'userSpaceOnUse'
437+ 'id' : fullID ,
438+ 'width' : width + 'px' ,
439+ 'height' : height + 'px' ,
440+ 'patternUnits' : 'userSpaceOnUse'
447441 } ) ;
448442
449443 var rects = el . selectAll ( 'rect' ) . data ( [ 0 ] ) ;
@@ -452,40 +446,40 @@ drawing.pattern = function(sel, gd, patternID, shape, bgcolor, fgcolor, scale, s
452446 rects . enter ( )
453447 . append ( 'rect' )
454448 . attr ( {
455- 'width' : width + 'px' ,
456- 'height' : height + 'px' ,
457- 'fill' : bgcolor
449+ 'width' : width + 'px' ,
450+ 'height' : height + 'px' ,
451+ 'fill' : bgcolor
458452 } ) ;
459453 }
460454
461- if ( shape == '.' ) {
455+ if ( shape === '.' ) {
462456 var circles = el . selectAll ( 'circle' ) . data ( [ 0 ] ) ;
463457 circles . exit ( ) . remove ( ) ;
464458 circles . enter ( )
465459 . append ( 'circle' )
466460 . attr ( {
467- 'cx' : width / 2 ,
468- 'cy' : height / 2 ,
469- 'r' : solidity ,
470- 'fill' : fgcolor
461+ 'cx' : width / 2 ,
462+ 'cy' : height / 2 ,
463+ 'r' : solidity ,
464+ 'fill' : fgcolor
471465 } ) ;
472466 } else {
473467 var paths = el . selectAll ( 'path' ) . data ( [ 0 ] ) ;
474468 paths . exit ( ) . remove ( ) ;
475469 paths . enter ( )
476470 . append ( 'path' )
477471 . attr ( {
478- 'd' : path ,
479- 'stroke' : fgcolor ,
480- 'stroke-width' : solidity + 'px'
472+ 'd' : path ,
473+ 'stroke' : fgcolor ,
474+ 'stroke-width' : solidity + 'px'
481475 } ) ;
482476 }
483477 } ) ;
484478
485479 sel . style ( prop , getFullUrl ( fullID , gd ) )
486480 . style ( prop + '-opacity' , null ) ;
487481
488- sel . classed ( " pattern_filled" , true ) ;
482+ sel . classed ( ' pattern_filled' , true ) ;
489483 var className2query = function ( s ) {
490484 return '.' + s . attr ( 'class' ) . replace ( / \s / g, '.' ) ;
491485 } ;
@@ -632,14 +626,14 @@ drawing.singlePointStyle = function(d, sel, trace, fns, gd) {
632626 }
633627
634628 var getPatternAttr = function ( mp , i , dflt ) {
635- if ( mp && Array . isArray ( mp ) ) {
636- if ( i < mp . length ) return mp [ i ] ;
637- else return dflt ;
629+ if ( mp && Array . isArray ( mp ) ) {
630+ if ( i < mp . length ) return mp [ i ] ;
631+ else return dflt ;
638632 }
639633 return mp ;
640634 } ;
641635 var markerPattern = marker . patternfill ;
642- var patternShape = markerPattern && getPatternAttr ( markerPattern . shape , d . i , '' ) ;
636+ var patternShape = markerPattern && getPatternAttr ( markerPattern . shape , d . i , '' ) ;
643637
644638 if ( gradientType && gradientType !== 'none' ) {
645639 var gradientColor = d . mgc ;
@@ -652,13 +646,13 @@ drawing.singlePointStyle = function(d, sel, trace, fns, gd) {
652646 drawing . gradient ( sel , gd , gradientID , gradientType ,
653647 [ [ 0 , gradientColor ] , [ 1 , fillColor ] ] , 'fill' ) ;
654648 } else if ( patternShape ) {
655- var patternBGColor = getPatternAttr ( markerPattern . bgcolor , d . i , null ) ;
656- var patternScale = getPatternAttr ( markerPattern . scale , d . i , 1 ) ;
657- var patternSolidity = getPatternAttr ( markerPattern . solidity , d . i , 1 ) ;
658- var perPointPattern = Array . isArray ( markerPattern . shape ) ||
659- Array . isArray ( markerPattern . bgcolor ) ||
660- Array . isArray ( markerPattern . scale ) ||
661- Array . isArray ( markerPattern . solidity ) ;
649+ var patternBGColor = getPatternAttr ( markerPattern . bgcolor , d . i , null ) ;
650+ var patternScale = getPatternAttr ( markerPattern . scale , d . i , 1 ) ;
651+ var patternSolidity = getPatternAttr ( markerPattern . solidity , d . i , 1 ) ;
652+ var perPointPattern = Array . isArray ( markerPattern . shape ) ||
653+ Array . isArray ( markerPattern . bgcolor ) ||
654+ Array . isArray ( markerPattern . scale ) ||
655+ Array . isArray ( markerPattern . solidity ) ;
662656
663657 var patternID = trace . uid ;
664658 if ( perPointPattern ) patternID += '-' + d . i ;
0 commit comments