Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c323bc

Browse files
committed
force x1=x0 and y1=y0 again but only with transition
1 parent c1ee8c2 commit 4c323bc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/traces/bar/plot.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
114114
}
115115

116116
var isHorizontal = (trace.orientation === 'h');
117+
var withTransition = hasTransition(opts);
117118

118119
var pointGroup = Lib.ensureSingle(plotGroup, 'g', 'points');
119120

@@ -156,6 +157,14 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
156157
}
157158
di.isBlank = isBlank;
158159

160+
if(isBlank && withTransition) {
161+
if(isHorizontal) {
162+
x1 = x0;
163+
} else {
164+
y1 = y0;
165+
}
166+
}
167+
159168
// in waterfall mode `between` we need to adjust bar end points to match the connector width
160169
if(adjustPixel && !isBlank) {
161170
if(isHorizontal) {
@@ -231,7 +240,7 @@ function plot(gd, plotinfo, cdModule, traceLayer, opts, makeOnCompleteCallback)
231240
.attr('d', 'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z')
232241
.call(Drawing.setClipUrl, plotinfo.layerClipId, gd);
233242

234-
if(!fullLayout.uniformtext.mode && hasTransition(opts)) {
243+
if(!fullLayout.uniformtext.mode && withTransition) {
235244
var styleFns = Drawing.makePointStyleFns(trace);
236245
Drawing.singlePointStyle(di, sel, trace, styleFns, gd);
237246
}

0 commit comments

Comments
 (0)