Skip to content

Commit e3c0dd8

Browse files
committed
fix ternary + other sub plot type graphs:
- continue in calcdata loop in scatterternary trace isn't so that we don't attempt to fill calcdata[-1]
1 parent e4e1019 commit e3c0dd8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/traces/scatterternary/plot.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ module.exports = function plot(ternary, data) {
2121
};
2222

2323
var calcdata = new Array(data.length),
24-
fullCalcdata = ternary.graphDiv.calcdata,
25-
i, j;
26-
for(i = 0; i < fullCalcdata.length; i++) {
27-
j = data.indexOf(fullCalcdata[i][0].trace);
28-
if(j !== -1) calcdata[j] = fullCalcdata[i];
24+
fullCalcdata = ternary.graphDiv.calcdata;
25+
26+
for(var i = 0; i < fullCalcdata.length; i++) {
27+
var j = data.indexOf(fullCalcdata[i][0].trace);
28+
29+
if(j === -1) continue;
30+
31+
calcdata[j] = fullCalcdata[i];
2932

3033
// while we're here and have references to both the Ternary object
3134
// and fullData, connect the two (for use by hover)
3235
data[j]._ternary = ternary;
3336
}
37+
3438
scatterPlot(ternary.graphDiv, plotinfo, calcdata);
3539
};

0 commit comments

Comments
 (0)