@@ -41,10 +41,10 @@ function overlappingDomain(xDomain, yDomain, domains) {
41
41
}
42
42
43
43
exports . lsInner = function ( gd ) {
44
- var fullLayout = gd . _fullLayout ,
45
- gs = fullLayout . _size ,
46
- axList = Plotly . Axes . list ( gd ) ,
47
- i ;
44
+ var fullLayout = gd . _fullLayout ;
45
+ var gs = fullLayout . _size ;
46
+ var axList = Plotly . Axes . list ( gd ) ;
47
+ var i ;
48
48
49
49
// clear axis line positions, to be set in the subplot loop below
50
50
for ( i = 0 ; i < axList . length ; i ++ ) axList [ i ] . _linepositions = { } ;
@@ -79,11 +79,11 @@ exports.lsInner = function(gd) {
79
79
return ;
80
80
}
81
81
82
- var xa = Plotly . Axes . getFromId ( gd , subplot , 'x' ) ,
83
- ya = Plotly . Axes . getFromId ( gd , subplot , 'y' ) ,
84
- xDomain = xa . domain ,
85
- yDomain = ya . domain ,
86
- plotgroupBgData = [ ] ;
82
+ var xa = Plotly . Axes . getFromId ( gd , subplot , 'x' ) ;
83
+ var ya = Plotly . Axes . getFromId ( gd , subplot , 'y' ) ;
84
+ var xDomain = xa . domain ;
85
+ var yDomain = ya . domain ;
86
+ var plotgroupBgData = [ ] ;
87
87
88
88
if ( overlappingDomain ( xDomain , yDomain , lowerDomains ) ) {
89
89
plotgroupBgData = [ 0 ] ;
@@ -128,8 +128,8 @@ exports.lsInner = function(gd) {
128
128
subplotSelection . each ( function ( subplot ) {
129
129
var plotinfo = fullLayout . _plots [ subplot ] ;
130
130
131
- var xa = Plotly . Axes . getFromId ( gd , subplot , 'x' ) ,
132
- ya = Plotly . Axes . getFromId ( gd , subplot , 'y' ) ;
131
+ var xa = Plotly . Axes . getFromId ( gd , subplot , 'x' ) ;
132
+ var ya = Plotly . Axes . getFromId ( gd , subplot , 'y' ) ;
133
133
134
134
// reset scale in case the margins have changed
135
135
xa . setScale ( ) ;
@@ -168,46 +168,46 @@ exports.lsInner = function(gd) {
168
168
plotinfo . plot . call ( Drawing . setTranslate , xa . _offset , ya . _offset ) ;
169
169
plotinfo . plot . call ( Drawing . setClipUrl , plotinfo . clipId ) ;
170
170
171
- var xlw = Drawing . crispRound ( gd , xa . linewidth , 1 ) ,
172
- ylw = Drawing . crispRound ( gd , ya . linewidth , 1 ) ,
173
- xp = gs . p + ylw ,
174
- xpathPrefix = 'M' + ( - xp ) + ',' ,
175
- xpathSuffix = 'h' + ( xa . _length + 2 * xp ) ,
176
- showfreex = xa . anchor === 'free' &&
177
- freefinished . indexOf ( xa . _id ) === - 1 ,
178
- freeposx = gs . h * ( 1 - ( xa . position || 0 ) ) + ( ( xlw / 2 ) % 1 ) ,
179
- showbottom =
180
- ( xa . anchor === ya . _id && ( xa . mirror || xa . side !== 'top' ) ) ||
181
- xa . mirror === 'all' || xa . mirror === 'allticks' ||
182
- ( xa . mirrors && xa . mirrors [ ya . _id + 'bottom' ] ) ,
183
- bottompos = ya . _length + gs . p + xlw / 2 ,
184
- showtop =
185
- ( xa . anchor === ya . _id && ( xa . mirror || xa . side === 'top' ) ) ||
186
- xa . mirror === 'all' || xa . mirror === 'allticks' ||
187
- ( xa . mirrors && xa . mirrors [ ya . _id + 'top' ] ) ,
188
- toppos = - gs . p - xlw / 2 ,
189
-
190
- // shorten y axis lines so they don't overlap x axis lines
191
- yp = gs . p ,
192
- // except where there's no x line
193
- // TODO: this gets more complicated with multiple x and y axes
194
- ypbottom = showbottom ? 0 : xlw ,
195
- yptop = showtop ? 0 : xlw ,
196
- ypathSuffix = ',' + ( - yp - yptop ) +
197
- 'v' + ( ya . _length + 2 * yp + yptop + ypbottom ) ,
198
- showfreey = ya . anchor === 'free' &&
199
- freefinished . indexOf ( ya . _id ) === - 1 ,
200
- freeposy = gs . w * ( ya . position || 0 ) + ( ( ylw / 2 ) % 1 ) ,
201
- showleft =
202
- ( ya . anchor === xa . _id && ( ya . mirror || ya . side !== 'right' ) ) ||
203
- ya . mirror === 'all' || ya . mirror === 'allticks' ||
204
- ( ya . mirrors && ya . mirrors [ xa . _id + 'left' ] ) ,
205
- leftpos = - gs . p - ylw / 2 ,
206
- showright =
207
- ( ya . anchor === xa . _id && ( ya . mirror || ya . side === 'right' ) ) ||
208
- ya . mirror === 'all' || ya . mirror === 'allticks' ||
209
- ( ya . mirrors && ya . mirrors [ xa . _id + 'right' ] ) ,
210
- rightpos = xa . _length + gs . p + ylw / 2 ;
171
+ var xlw = Drawing . crispRound ( gd , xa . linewidth , 1 ) ;
172
+ var ylw = Drawing . crispRound ( gd , ya . linewidth , 1 ) ;
173
+ var xp = gs . p + ylw ;
174
+ var xpathPrefix = 'M' + ( - xp ) + ',' ;
175
+ var xpathSuffix = 'h' + ( xa . _length + 2 * xp ) ;
176
+ var showfreex = xa . anchor === 'free' &&
177
+ freefinished . indexOf ( xa . _id ) === - 1 ;
178
+ var freeposx = gs . h * ( 1 - ( xa . position || 0 ) ) + ( ( xlw / 2 ) % 1 ) ;
179
+ var showbottom =
180
+ ( xa . anchor === ya . _id && ( xa . mirror || xa . side !== 'top' ) ) ||
181
+ xa . mirror === 'all' || xa . mirror === 'allticks' ||
182
+ ( xa . mirrors && xa . mirrors [ ya . _id + 'bottom' ] ) ;
183
+ var bottompos = ya . _length + gs . p + xlw / 2 ;
184
+ var showtop =
185
+ ( xa . anchor === ya . _id && ( xa . mirror || xa . side === 'top' ) ) ||
186
+ xa . mirror === 'all' || xa . mirror === 'allticks' ||
187
+ ( xa . mirrors && xa . mirrors [ ya . _id + 'top' ] ) ;
188
+ var toppos = - gs . p - xlw / 2 ;
189
+
190
+ // shorten y axis lines so they don't overlap x axis lines
191
+ var yp = gs . p ;
192
+ // except where there's no x line
193
+ // TODO: this gets more complicated with multiple x and y axes
194
+ var ypbottom = showbottom ? 0 : xlw ;
195
+ var yptop = showtop ? 0 : xlw ;
196
+ var ypathSuffix = ',' + ( - yp - yptop ) +
197
+ 'v' + ( ya . _length + 2 * yp + yptop + ypbottom ) ;
198
+ var showfreey = ya . anchor === 'free' &&
199
+ freefinished . indexOf ( ya . _id ) === - 1 ;
200
+ var freeposy = gs . w * ( ya . position || 0 ) + ( ( ylw / 2 ) % 1 ) ;
201
+ var showleft =
202
+ ( ya . anchor === xa . _id && ( ya . mirror || ya . side !== 'right' ) ) ||
203
+ ya . mirror === 'all' || ya . mirror === 'allticks' ||
204
+ ( ya . mirrors && ya . mirrors [ xa . _id + 'left' ] ) ;
205
+ var leftpos = - gs . p - ylw / 2 ;
206
+ var showright =
207
+ ( ya . anchor === xa . _id && ( ya . mirror || ya . side === 'right' ) ) ||
208
+ ya . mirror === 'all' || ya . mirror === 'allticks' ||
209
+ ( ya . mirrors && ya . mirrors [ xa . _id + 'right' ] ) ;
210
+ var rightpos = xa . _length + gs . p + ylw / 2 ;
211
211
212
212
// save axis line positions for ticks, draggers, etc to reference
213
213
// each subplot gets an entry:
@@ -241,9 +241,9 @@ exports.lsInner = function(gd) {
241
241
242
242
// translate all the extra stuff to have the
243
243
// same origin as the plot area or axes
244
- var origin = 'translate(' + xa . _offset + ',' + ya . _offset + ')' ,
245
- originx = origin ,
246
- originy = origin ;
244
+ var origin = 'translate(' + xa . _offset + ',' + ya . _offset + ')' ;
245
+ var originx = origin ;
246
+ var originy = origin ;
247
247
if ( showfreex ) {
248
248
originx = 'translate(' + xa . _offset + ',' + gs . t + ')' ;
249
249
toppos += ya . _offset - gs . t ;
0 commit comments