Skip to content

Commit 709ee2f

Browse files
committed
bar: set stroke-width to 0 when bar is blank
1 parent 16c88f8 commit 709ee2f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Diff for: src/components/drawing/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ drawing.singlePointStyle = function(d, sel, trace, fns, gd) {
442442
fill: 'none'
443443
});
444444
} else {
445-
sel.style('stroke-width', lineWidth + 'px');
445+
sel.style('stroke-width', (d.isBlank ? 0 : lineWidth) + 'px');
446446

447447
var markerGradient = marker.gradient;
448448

Diff for: src/traces/bar/plot.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
142142
if(isBlank && !isHorizontal) y1 = y0;
143143

144144
// in waterfall mode `between` we need to adjust bar end points to match the connector width
145-
if(adjustPixel) {
145+
if(adjustPixel && !isBlank) {
146146
if(isHorizontal) {
147147
x0 -= dirSign(x0, x1) * adjustPixel;
148148
x1 += dirSign(x0, x1) * adjustPixel;
@@ -204,10 +204,6 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
204204
var sel = transition(Lib.ensureSingle(bar, 'path'), opts, makeOnCompleteCallback);
205205
sel
206206
.style('vector-effect', 'non-scaling-stroke')
207-
.attr('display', function() {
208-
if(!isBlank) return null;
209-
if(isBlank && !hasTransition(opts)) return 'none';
210-
})
211207
.attr('d', 'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z')
212208
.call(Drawing.setClipUrl, plotinfo.layerClipId, gd);
213209

0 commit comments

Comments
 (0)