@@ -361,7 +361,7 @@ function appendBarText(gd, plotinfo, bar, calcTrace, i, x0, x1, y0, y1, opts) {
361
361
textSelection . attr ( 'transform' , transform ) ;
362
362
}
363
363
364
- function getRotationFromAngle ( angle ) {
364
+ function getRotateFromAngle ( angle ) {
365
365
return ( angle === 'auto' ) ? 0 : angle ;
366
366
}
367
367
@@ -402,9 +402,9 @@ function toMoveInsideBar(x0, x1, y0, y1, textBB, opts) {
402
402
lx = tmp ;
403
403
}
404
404
405
- var rotation = getRotationFromAngle ( angle ) ;
406
- var absSin = Math . abs ( Math . sin ( Math . PI / 180 * rotation ) ) ;
407
- var absCos = Math . abs ( Math . cos ( Math . PI / 180 * rotation ) ) ;
405
+ var rotate = getRotateFromAngle ( angle ) ;
406
+ var absSin = Math . abs ( Math . sin ( Math . PI / 180 * rotate ) ) ;
407
+ var absCos = Math . abs ( Math . cos ( Math . PI / 180 * rotate ) ) ;
408
408
409
409
// compute and apply text padding
410
410
var dx = Math . max ( lx * absCos , ly * absSin ) ;
@@ -438,15 +438,15 @@ function toMoveInsideBar(x0, x1, y0, y1, textBB, opts) {
438
438
var textY = ( textBB . top + textBB . bottom ) / 2 ;
439
439
440
440
// lastly apply auto rotation
441
- if ( isAutoRotated ) rotation += 90 ;
441
+ if ( isAutoRotated ) rotate += 90 ;
442
442
443
443
return {
444
444
textX : textX ,
445
445
textY : textY ,
446
446
targetX : targetX ,
447
447
targetY : targetY ,
448
448
scale : scale ,
449
- rotation : rotation
449
+ rotate : rotate
450
450
} ;
451
451
}
452
452
@@ -469,17 +469,17 @@ function toMoveOutsideBar(x0, x1, y0, y1, textBB, opts) {
469
469
textpad = ( lx > 2 * TEXTPAD ) ? TEXTPAD : 0 ;
470
470
}
471
471
472
- // compute rotation and scale
472
+ // compute rotate and scale
473
473
var scale = 1 ;
474
474
if ( constrained ) {
475
475
scale = ( isHorizontal ) ?
476
476
Math . min ( 1 , ly / textHeight ) :
477
477
Math . min ( 1 , lx / textWidth ) ;
478
478
}
479
479
480
- var rotation = getRotationFromAngle ( angle ) ;
481
- var absSin = Math . abs ( Math . sin ( Math . PI / 180 * rotation ) ) ;
482
- var absCos = Math . abs ( Math . cos ( Math . PI / 180 * rotation ) ) ;
480
+ var rotate = getRotateFromAngle ( angle ) ;
481
+ var absSin = Math . abs ( Math . sin ( Math . PI / 180 * rotate ) ) ;
482
+ var absCos = Math . abs ( Math . cos ( Math . PI / 180 * rotate ) ) ;
483
483
484
484
// compute text and target positions
485
485
var targetWidth = scale * ( isHorizontal ? textHeight : textWidth ) ;
@@ -504,7 +504,7 @@ function toMoveOutsideBar(x0, x1, y0, y1, textBB, opts) {
504
504
targetX : targetX ,
505
505
targetY : targetY ,
506
506
scale : scale ,
507
- rotation : rotation
507
+ rotate : rotate
508
508
} ;
509
509
}
510
510
@@ -514,7 +514,7 @@ function getTransform(opts) {
514
514
var targetX = opts . targetX ;
515
515
var targetY = opts . targetY ;
516
516
var scale = opts . scale ;
517
- var rotation = opts . rotation ;
517
+ var rotate = opts . rotate ;
518
518
519
519
var transformScale ;
520
520
var transformRotate ;
@@ -526,8 +526,8 @@ function getTransform(opts) {
526
526
transformScale = '' ;
527
527
}
528
528
529
- transformRotate = ( rotation ) ?
530
- 'rotate(' + rotation + ' ' + textX + ' ' + textY + ') ' : '' ;
529
+ transformRotate = ( rotate ) ?
530
+ 'rotate(' + rotate + ' ' + textX + ' ' + textY + ') ' : '' ;
531
531
532
532
// Note that scaling also affects the center of the text box
533
533
var translateX = ( targetX - scale * textX ) ;
0 commit comments