@@ -15,9 +15,9 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {
15
15
} ) ;
16
16
} ;
17
17
18
- function dfltLabelYanchor ( shapeType , labelTextPosition ) {
18
+ function dfltLabelYanchor ( isLine , labelTextPosition ) {
19
19
var dfltYanchor ;
20
- if ( shapeType === 'line' ) {
20
+ if ( isLine ) {
21
21
dfltYanchor = 'bottom' ;
22
22
} else {
23
23
if ( labelTextPosition . indexOf ( 'top' ) !== - 1 ) {
@@ -134,21 +134,13 @@ function handleShapeDefaults(shapeIn, shapeOut, fullLayout) {
134
134
}
135
135
136
136
// Label options
137
+ var isLine = shapeType === 'line' ;
137
138
coerce ( 'label.text' ) ;
138
- coerce ( 'label.textangle' , shapeType === 'line' ? 'auto' : 0 ) ;
139
- < << << << HEAD
140
- var labelTextPosition = coerce (
141
- 'label.textposition' ,
142
- shapeType === 'line' ? 'middle' : 'middle center'
143
- ) ;
139
+ coerce ( 'label.textangle' , isLine ? 'auto' : 0 ) ;
140
+ var labelTextPosition = coerce ( 'label.textposition' , isLine ? 'middle' : 'middle center' ) ;
144
141
coerce ( 'label.xanchor' ) ;
145
142
// Default yanchor value depends on shape type and label textposition
146
- coerce ( 'label.yanchor' , dfltLabelYanchor ( shapeType , labelTextPosition ) ) ;
147
- = === ===
148
- coerce ( 'label.textposition' , shapeType === 'line' ? 'middle' : 'middle center' ) ;
149
- coerce ( 'label.xanchor' ) ;
150
- coerce ( 'label.yanchor' ) ;
151
- > >>> >>> dfb608eb8a3a7a139b2f418edbc9e74c96782091
143
+ coerce ( 'label.yanchor' , dfltLabelYanchor ( isLine , labelTextPosition ) ) ;
152
144
coerce ( 'label.padding' ) ;
153
145
Lib . coerceFont ( coerce , 'label.font' , fullLayout . font ) ;
154
146
}
0 commit comments