@@ -342,7 +342,7 @@ function appendBarText(gd, plotinfo, bar, calcTrace, i, x0, x1, y0, y1, opts) {
342
342
trace . constraintext === 'both' ||
343
343
trace . constraintext === 'outside' ;
344
344
345
- transform = getTransform ( toMoveOutsideBar ( x0 , x1 , y0 , y1 , textBB , {
345
+ transform = Lib . getTextTransform ( toMoveOutsideBar ( x0 , x1 , y0 , y1 , textBB , {
346
346
isHorizontal : isHorizontal ,
347
347
constrained : constrained ,
348
348
angle : trace . textangle
@@ -352,7 +352,7 @@ function appendBarText(gd, plotinfo, bar, calcTrace, i, x0, x1, y0, y1, opts) {
352
352
trace . constraintext === 'both' ||
353
353
trace . constraintext === 'inside' ;
354
354
355
- transform = getTransform ( toMoveInsideBar ( x0 , x1 , y0 , y1 , textBB , {
355
+ transform = Lib . getTextTransform ( toMoveInsideBar ( x0 , x1 , y0 , y1 , textBB , {
356
356
isHorizontal : isHorizontal ,
357
357
constrained : constrained ,
358
358
angle : trace . textangle ,
@@ -510,35 +510,6 @@ function toMoveOutsideBar(x0, x1, y0, y1, textBB, opts) {
510
510
} ;
511
511
}
512
512
513
- function getTransform ( opts ) {
514
- var textX = opts . textX ;
515
- var textY = opts . textY ;
516
- var targetX = opts . targetX ;
517
- var targetY = opts . targetY ;
518
- var scale = opts . scale ;
519
- var rotate = opts . rotate ;
520
-
521
- var transformScale ;
522
- var transformRotate ;
523
- var transformTranslate ;
524
-
525
- if ( scale < 1 ) transformScale = 'scale(' + scale + ') ' ;
526
- else {
527
- scale = 1 ;
528
- transformScale = '' ;
529
- }
530
-
531
- transformRotate = ( rotate ) ?
532
- 'rotate(' + rotate + ' ' + textX + ' ' + textY + ') ' : '' ;
533
-
534
- // Note that scaling also affects the center of the text box
535
- var translateX = ( targetX - scale * textX ) ;
536
- var translateY = ( targetY - scale * textY ) ;
537
- transformTranslate = 'translate(' + translateX + ' ' + translateY + ')' ;
538
-
539
- return transformTranslate + transformScale + transformRotate ;
540
- }
541
-
542
513
function getText ( fullLayout , calcTrace , index , xa , ya ) {
543
514
var trace = calcTrace [ 0 ] . trace ;
544
515
var texttemplate = trace . texttemplate ;
@@ -695,7 +666,6 @@ function calcTextinfo(calcTrace, index, xa, ya) {
695
666
696
667
module . exports = {
697
668
plot : plot ,
698
- getTransform : getTransform ,
699
669
toMoveInsideBar : toMoveInsideBar ,
700
670
toMoveOutsideBar : toMoveOutsideBar
701
671
} ;
0 commit comments