@@ -68,8 +68,8 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
6868 var ySizeMode = coerce ( 'ysizemode' ) ;
6969
7070 // positioning
71- var dflts = [ 0.25 , 0.75 ] ;
72- var pixelDflts = [ 0 , 10 ] ;
71+ const dflts = [ 0.25 , 0.75 ] ;
72+ const pixelDflts = [ 0 , 10 ] ;
7373
7474 [ 'x' , 'y' ] . forEach ( axLetter => {
7575 var attrAnchor = axLetter + 'anchor' ;
@@ -81,12 +81,12 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
8181
8282 // xref, yref - handle both string and array values
8383 var axRef ;
84- var refAttr = axLetter + 'ref' ;
85- var inputRef = shapeIn [ refAttr ] ;
84+ const refAttr = axLetter + 'ref' ;
85+ const inputRef = shapeIn [ refAttr ] ;
8686
8787 if ( Array . isArray ( inputRef ) && inputRef . length > 0 ) {
8888 // Array case: use coerceRefArray for validation
89- var expectedLen = helpers . countDefiningCoords ( shapeType , path , axLetter ) ;
89+ const expectedLen = helpers . countDefiningCoords ( shapeType , path , axLetter ) ;
9090 axRef = Axes . coerceRefArray ( shapeIn , shapeOut , gdMock , axLetter , undefined , 'paper' , expectedLen ) ;
9191 shapeOut [ '_' + axLetter + 'refArray' ] = true ;
9292 } else {
@@ -107,8 +107,8 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
107107
108108 if ( noPath ) {
109109 [ 0 , 1 ] . forEach ( function ( i ) {
110- var ref = axRef [ i ] ;
111- var refType = Axes . getRefType ( ref ) ;
110+ const ref = axRef [ i ] ;
111+ const refType = Axes . getRefType ( ref ) ;
112112 if ( refType === 'range' ) {
113113 ax = Axes . getFromId ( gdMock , ref ) ;
114114 pos2r = helpers . shapePositionToRange ( ax ) ;
@@ -120,8 +120,8 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
120120 pos2r = r2pos = Lib . identity ;
121121 }
122122
123- var attr = axLetter + i ;
124- var inValue = shapeIn [ attr ] ;
123+ const attr = axLetter + i ;
124+ const inValue = shapeIn [ attr ] ;
125125 shapeIn [ attr ] = pos2r ( shapeIn [ attr ] , true ) ;
126126
127127 if ( sizeMode === 'pixel' ) {
@@ -134,7 +134,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
134134 shapeIn [ attr ] = inValue ;
135135
136136 if ( i === 0 && sizeMode === 'pixel' ) {
137- var inAnchor = shapeIn [ attrAnchor ] ;
137+ const inAnchor = shapeIn [ attrAnchor ] ;
138138 shapeIn [ attrAnchor ] = pos2r ( shapeIn [ attrAnchor ] , true ) ;
139139 Axes . coercePosition ( shapeOut , gdMock , coerce , ref , attrAnchor , 0.25 ) ;
140140 shapeOut [ attrAnchor ] = r2pos ( shapeOut [ attrAnchor ] ) ;
@@ -143,7 +143,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
143143 } ) ;
144144 }
145145 } else {
146- var axRefType = Axes . getRefType ( axRef ) ;
146+ const axRefType = Axes . getRefType ( axRef ) ;
147147
148148 if ( axRefType === 'range' ) {
149149 ax = Axes . getFromId ( gdMock , axRef ) ;
@@ -164,10 +164,10 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
164164 // ranges to send to coerce, then put it back after
165165 // this is all to give reasonable default position behavior on log axes, which is
166166 // a pretty unimportant edge case so we could just ignore this.
167- var attr0 = axLetter + '0' ;
168- var attr1 = axLetter + '1' ;
169- var in0 = shapeIn [ attr0 ] ;
170- var in1 = shapeIn [ attr1 ] ;
167+ const attr0 = axLetter + '0' ;
168+ const attr1 = axLetter + '1' ;
169+ const in0 = shapeIn [ attr0 ] ;
170+ const in1 = shapeIn [ attr1 ] ;
171171 shapeIn [ attr0 ] = pos2r ( shapeIn [ attr0 ] , true ) ;
172172 shapeIn [ attr1 ] = pos2r ( shapeIn [ attr1 ] , true ) ;
173173
@@ -189,7 +189,7 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
189189 // Coerce xanchor and yanchor
190190 if ( sizeMode === 'pixel' ) {
191191 // Hack for log axis described above
192- var inAnchor = shapeIn [ attrAnchor ] ;
192+ const inAnchor = shapeIn [ attrAnchor ] ;
193193 shapeIn [ attrAnchor ] = pos2r ( shapeIn [ attrAnchor ] , true ) ;
194194
195195 Axes . coercePosition ( shapeOut , gdMock , coerce , axRef , attrAnchor , 0.25 ) ;
0 commit comments