@@ -41,10 +41,10 @@ function overlappingDomain(xDomain, yDomain, domains) {
4141}
4242
4343exports . 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 ;
4848
4949 // clear axis line positions, to be set in the subplot loop below
5050 for ( i = 0 ; i < axList . length ; i ++ ) axList [ i ] . _linepositions = { } ;
@@ -79,11 +79,11 @@ exports.lsInner = function(gd) {
7979 return ;
8080 }
8181
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 = [ ] ;
8787
8888 if ( overlappingDomain ( xDomain , yDomain , lowerDomains ) ) {
8989 plotgroupBgData = [ 0 ] ;
@@ -128,8 +128,8 @@ exports.lsInner = function(gd) {
128128 subplotSelection . each ( function ( subplot ) {
129129 var plotinfo = fullLayout . _plots [ subplot ] ;
130130
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' ) ;
133133
134134 // reset scale in case the margins have changed
135135 xa . setScale ( ) ;
@@ -168,46 +168,46 @@ exports.lsInner = function(gd) {
168168 plotinfo . plot . call ( Drawing . setTranslate , xa . _offset , ya . _offset ) ;
169169 plotinfo . plot . call ( Drawing . setClipUrl , plotinfo . clipId ) ;
170170
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 ;
211211
212212 // save axis line positions for ticks, draggers, etc to reference
213213 // each subplot gets an entry:
@@ -241,9 +241,9 @@ exports.lsInner = function(gd) {
241241
242242 // translate all the extra stuff to have the
243243 // 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 ;
247247 if ( showfreex ) {
248248 originx = 'translate(' + xa . _offset + ',' + gs . t + ')' ;
249249 toppos += ya . _offset - gs . t ;
0 commit comments