Skip to content

Commit 4fb5a2b

Browse files
committed
add comment to describe how trace._base is different than trace.base for funnel traces
1 parent aec946e commit 4fb5a2b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/traces/funnel/calc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ module.exports = function calc(gd, trace) {
3030
var serieslen = Math.min(pos.length, size.length);
3131
var cd = new Array(serieslen);
3232

33+
// Unlike other bar-like traces funnels do not support base attribute.
34+
// bases for funnels are computed internally in a way that
35+
// the mid-point of each bar are located on the axis line.
3336
trace._base = [];
3437

3538
// set position and size
@@ -50,7 +53,7 @@ module.exports = function calc(gd, trace) {
5053
cNext: connectToNext
5154
};
5255

53-
trace._base[i] = -0.5 * size[i];
56+
trace._base[i] = -0.5 * cdi.s;
5457

5558
if(trace.ids) {
5659
cdi.id = String(trace.ids[i]);

0 commit comments

Comments
 (0)