Skip to content

Commit 04a886b

Browse files
committed
use subplot ref in scatterternary hover pointData
... instead of hacky subplot ref punched during ScatterPolar.plot
1 parent da720aa commit 04a886b

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/traces/scatterternary/hover.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
5050
// TODO: nice formatting, and label by axis title, for a, b, and c?
5151

5252
var trace = newPointData.trace;
53-
var ternary = trace._ternary;
53+
var ternary = newPointData.subplot;
5454
var hoverinfo = cdi.hi || trace.hoverinfo;
5555
var parts = hoverinfo.split('+');
5656
var text = [];

src/traces/scatterternary/plot.js

-5
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,5 @@ module.exports = function plot(ternary, moduleCalcData) {
2626
layerClipId: ternary._hasClipOnAxisFalse ? ternary.clipIdRelative : null
2727
};
2828

29-
// add ref to ternary subplot object in fullData traces
30-
for(var i = 0; i < moduleCalcData.length; i++) {
31-
moduleCalcData[i][0].trace._ternary = ternary;
32-
}
33-
3429
scatterPlot(ternary.graphDiv, plotinfo, moduleCalcData);
3530
};

test/jasmine/tests/scatterternary_test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ describe('scatterternary hover', function() {
332332
cd: cd[0],
333333
trace: cd[0][0].trace,
334334
xa: ternary.xaxis,
335-
ya: ternary.yaxis
335+
ya: ternary.yaxis,
336+
subplot: ternary
336337
};
337338

338339
return ScatterTernary.hoverPoints(pointData, xval, yval, hovermode);

0 commit comments

Comments
 (0)