@@ -157,9 +157,6 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
157157 if ( isBlank && isHorizontal ) x1 = x0 ;
158158 if ( isBlank && ! isHorizontal ) y1 = y0 ;
159159
160- var spansHorizontal = isHorizontal && ( x0 !== x1 ) ;
161- var spansVertical = ! isHorizontal && ( y0 !== y1 ) ;
162-
163160 // in waterfall mode `between` we need to adjust bar end points to match the connector width
164161 if ( adjustPixel && ! isBlank ) {
165162 if ( isHorizontal ) {
@@ -194,7 +191,9 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
194191 d3 . round ( Math . round ( v ) - offset , 2 ) : v ;
195192 }
196193
197- function expandToVisible ( v , vc ) {
194+ function expandToVisible ( v , vc , hideZeroSpan ) {
195+ if ( hideZeroSpan && v === vc ) return v ;
196+
198197 // if it's not in danger of disappearing entirely,
199198 // round more precisely
200199 return Math . abs ( v - vc ) >= 2 ? roundWithLine ( v ) :
@@ -215,14 +214,10 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
215214 var op = Color . opacity ( mc ) ;
216215 var fixpx = ( op < 1 || lw > 0.01 ) ? roundWithLine : expandToVisible ;
217216
218- if ( spansHorizontal ) {
219- x0 = fixpx ( x0 , x1 ) ;
220- x1 = fixpx ( x1 , x0 ) ;
221- }
222- if ( spansVertical ) {
223- y0 = fixpx ( y0 , y1 ) ;
224- y1 = fixpx ( y1 , y0 ) ;
225- }
217+ x0 = fixpx ( x0 , x1 , isHorizontal ) ;
218+ x1 = fixpx ( x1 , x0 , isHorizontal ) ;
219+ y0 = fixpx ( y0 , y1 , ! isHorizontal ) ;
220+ y1 = fixpx ( y1 , y0 , ! isHorizontal ) ;
226221 }
227222
228223 var sel = transition ( Lib . ensureSingle ( bar , 'path' ) , fullLayout , opts , makeOnCompleteCallback ) ;
0 commit comments