@@ -69,7 +69,7 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts) {
6969 var isWaterfall = ( trace . type === 'waterfall' ) ;
7070 var isFunnel = ( trace . type === 'funnel' ) ;
7171 var isBar = ( trace . type === 'bar' ) ;
72- var shouldDisplayZeros = isBar || isFunnel ;
72+ var shouldDisplayZeros = ( isBar || isFunnel ) ;
7373
7474 var adjustPixel = 0 ;
7575 if ( isWaterfall && trace . connector . visible && trace . connector . mode === 'between' ) {
@@ -102,12 +102,19 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts) {
102102 var y0 = xy [ 1 ] [ 0 ] ;
103103 var y1 = xy [ 1 ] [ 1 ] ;
104104
105- var isBlank = di . isBlank = ! (
106- isNumeric ( x0 ) && isNumeric ( x1 ) &&
107- isNumeric ( y0 ) && isNumeric ( y1 ) &&
108- ( x0 !== x1 || ( shouldDisplayZeros && isHorizontal ) ) &&
109- ( y0 !== y1 || ( shouldDisplayZeros && ! isHorizontal ) )
105+ var isBlank = (
106+ x0 === x1 ||
107+ y0 === y1 ||
108+ ! isNumeric ( x0 ) ||
109+ ! isNumeric ( x1 ) ||
110+ ! isNumeric ( y0 ) ||
111+ ! isNumeric ( y1 )
110112 ) ;
113+ // display zeros if line.width > 0
114+ if ( isBlank && shouldDisplayZeros && helpers . getLineWidth ( trace , di ) && ( isHorizontal ? x1 - x0 === 0 : y1 - y0 === 0 ) ) {
115+ isBlank = false ;
116+ }
117+ di . isBlank = isBlank ;
111118
112119 // in waterfall mode `between` we need to adjust bar end points to match the connector width
113120 if ( adjustPixel ) {
@@ -130,8 +137,7 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts) {
130137 mc = cont . color ;
131138 }
132139 } else {
133- lw = ( di . mlw + 1 || trace . marker . line . width + 1 ||
134- ( di . trace ? di . trace . marker . line . width : 0 ) + 1 ) - 1 ;
140+ lw = helpers . getLineWidth ( trace , di ) ;
135141 mc = di . mc || trace . marker . color ;
136142 }
137143
0 commit comments