@@ -78,10 +78,10 @@ function drawOne(gd, index) {
78
78
// the plot.
79
79
// axDomainRef: if true and axa defined, draws relative to axis domain,
80
80
// otherwise draws relative to data (if axa defined) or paper (if not).
81
- function shiftPosition ( axa , options , dAx , axLetter , gs ) {
81
+ function shiftPosition ( axa , dAx , axLetter , gs , options ) {
82
82
var optAx = options [ axLetter ] ;
83
83
var axRef = options [ axLetter + 'ref' ] ;
84
- var vertical = axLetter . includes ( 'y' ) ;
84
+ var vertical = axLetter . indexOf ( 'y' ) !== - 1 ;
85
85
var axDomainRef = Axes . getRefType ( axRef ) === 'domain' ;
86
86
var gsDim = vertical ? gs . h : gs . w ;
87
87
if ( axa ) {
@@ -615,19 +615,19 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
615
615
annTextGroupInner . call ( Drawing . setTranslate , xcenter , ycenter ) ;
616
616
617
617
modifyItem ( 'x' ,
618
- shiftPosition ( xa , options , dx , 'x' , gs ) ) ;
618
+ shiftPosition ( xa , dx , 'x' , gs , options ) ) ;
619
619
modifyItem ( 'y' ,
620
- shiftPosition ( ya , options , dy , 'y' , gs ) ) ;
620
+ shiftPosition ( ya , dy , 'y' , gs , options ) ) ;
621
621
622
622
// for these 2 calls to shiftPosition, it is assumed xa, ya are
623
623
// defined, so gsDim will not be used, but we put it in
624
624
// anyways for consistency
625
625
if ( options . axref === options . xref ) {
626
- modifyItem ( 'ax' , shiftPosition ( xa , options , dx , 'ax' , gs ) ) ;
626
+ modifyItem ( 'ax' , shiftPosition ( xa , dx , 'ax' , gs , options ) ) ;
627
627
}
628
628
629
629
if ( options . ayref === options . yref ) {
630
- modifyItem ( 'ay' , shiftPosition ( ya , options , dy , 'ay' , gs ) ) ;
630
+ modifyItem ( 'ay' , shiftPosition ( ya , dy , 'ay' , gs , options ) ) ;
631
631
}
632
632
633
633
arrowGroup . attr ( 'transform' , 'translate(' + dx + ',' + dy + ')' ) ;
@@ -666,13 +666,13 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
666
666
// defined, so gsDim will not be used, but we put it in
667
667
// anyways for consistency
668
668
if ( options . axref === options . xref ) {
669
- modifyItem ( 'ax' , shiftPosition ( xa , options , dx , 'ax' , gs ) ) ;
669
+ modifyItem ( 'ax' , shiftPosition ( xa , dx , 'ax' , gs , options ) ) ;
670
670
} else {
671
671
modifyItem ( 'ax' , options . ax + dx ) ;
672
672
}
673
673
674
674
if ( options . ayref === options . yref ) {
675
- modifyItem ( 'ay' , shiftPosition ( ya , options , dy , 'ay' , gs . w ) ) ;
675
+ modifyItem ( 'ay' , shiftPosition ( ya , dy , 'ay' , gs . w , options ) ) ;
676
676
} else {
677
677
modifyItem ( 'ay' , options . ay + dy ) ;
678
678
}
@@ -683,7 +683,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
683
683
if ( xa ) {
684
684
// shiftPosition will not execute code where xa was
685
685
// undefined, so we use to calculate xUpdate too
686
- xUpdate = shiftPosition ( xa , options , dx , 'x' , gs ) ;
686
+ xUpdate = shiftPosition ( xa , dx , 'x' , gs , options ) ;
687
687
} else {
688
688
var widthFraction = options . _xsize / gs . w ;
689
689
var xLeft = options . x + ( options . _xshift - options . xshift ) / gs . w - widthFraction / 2 ;
@@ -695,7 +695,7 @@ function drawRaw(gd, options, index, subplotId, xa, ya) {
695
695
if ( ya ) {
696
696
// shiftPosition will not execute code where ya was
697
697
// undefined, so we use to calculate yUpdate too
698
- yUpdate = shiftPosition ( ya , options , dy , 'y' , gs ) ;
698
+ yUpdate = shiftPosition ( ya , dy , 'y' , gs , options ) ;
699
699
} else {
700
700
var heightFraction = options . _ysize / gs . h ;
701
701
var yBottom = options . y - ( options . _yshift + options . yshift ) / gs . h - heightFraction / 2 ;
0 commit comments