Skip to content

Commit 572b218

Browse files
committed
bypass blanks on waterfalls to fix transform errors
1 parent 5abfe58 commit 572b218

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/traces/bar/plot.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ module.exports = function plot(gd, plotinfo, cdModule, traceLayer) {
107107
var prefix;
108108

109109
if(trace.type === 'waterfall') {
110-
var cont = trace[di.dir].marker;
111-
lw = cont.line.width;
112-
mc = cont.color;
113-
prefix = 'waterfall';
110+
if(!isBlank) {
111+
var cont = trace[di.dir].marker;
112+
lw = cont.line.width;
113+
mc = cont.color;
114+
prefix = 'waterfall';
115+
}
114116
} else {
115117
lw = (di.mlw + 1 || trace.marker.line.width + 1 ||
116118
(di.trace ? di.trace.marker.line.width : 0) + 1) - 1;

src/traces/waterfall/calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module.exports = function calc(gd, trace) {
9090
}
9191
}
9292

93-
cd[0].hasTotals = hasTotals;
93+
if(cd.length) cd[0].hasTotals = hasTotals;
9494

9595
mergeArray(trace.text, cd, 'tx');
9696
mergeArray(trace.hovertext, cd, 'htx');

src/traces/waterfall/style.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ function style(gd, cd) {
2525
var trace = d[0].trace;
2626

2727
gTrace.selectAll('.point > path').each(function(di) {
28-
var cont = trace[di.dir].marker;
29-
30-
d3.select(this)
31-
.call(Color.fill, cont.color)
32-
.call(Color.stroke, cont.line.color)
33-
.call(Drawing.dashLine, cont.line.dash, cont.line.width)
34-
.style('opacity', trace.selectedpoints && !di.selected ? 0.3 : 1);
28+
if(!di.isBlank) {
29+
var cont = trace[di.dir].marker;
30+
31+
d3.select(this)
32+
.call(Color.fill, cont.color)
33+
.call(Color.stroke, cont.line.color)
34+
.call(Drawing.dashLine, cont.line.dash, cont.line.width)
35+
.style('opacity', trace.selectedpoints && !di.selected ? 0.3 : 1);
36+
}
3537
});
3638

3739
styleTextPoints(gTrace, trace, gd);

0 commit comments

Comments
 (0)