diff --git a/src/traces/contourgl/convert.js b/src/traces/contourgl/convert.js index 182ec900b7f..4826783ca46 100644 --- a/src/traces/contourgl/convert.js +++ b/src/traces/contourgl/convert.js @@ -77,7 +77,7 @@ proto.handlePick = function(pickResult) { ], textLabel: this.textLabels[index], name: this.name, - pointIndex: [xIndex, yIndex], + pointIndex: [yIndex, xIndex], hoverinfo: this.hoverinfo }; }; diff --git a/src/traces/heatmapgl/convert.js b/src/traces/heatmapgl/convert.js index fbac9353f3e..b661670a2d1 100644 --- a/src/traces/heatmapgl/convert.js +++ b/src/traces/heatmapgl/convert.js @@ -63,7 +63,7 @@ proto.handlePick = function(pickResult) { ], textLabel: this.textLabels[index], name: this.name, - pointIndex: [xIndex, yIndex], + pointIndex: [yIndex, xIndex], hoverinfo: this.hoverinfo }; }; diff --git a/test/jasmine/tests/gl2d_click_test.js b/test/jasmine/tests/gl2d_click_test.js index ddd576d5ab4..c3c8035b184 100644 --- a/test/jasmine/tests/gl2d_click_test.js +++ b/test/jasmine/tests/gl2d_click_test.js @@ -326,6 +326,39 @@ describe('Test hover and click interactions', function() { .then(done); }); + it('should output correct event data for heatmapgl (asymmetric case) ', function(done) { + var _mock = { + data: [{ + type: 'heatmapgl', + z: [[1, 2, 0], [2, 3, 1]], + text: [['a', 'b', 'c'], ['D', 'E', 'F']], + hoverlabel: { + bgcolor: [['red', 'blue', 'green'], ['cyan', 'pink', 'black']] + } + }] + }; + + var run = makeRunner([540, 150], { + x: 2, + y: 1, + curveNumber: 0, + pointNumber: [1, 2], + bgColor: 'rgb(0, 0, 0)', + borderColor: 'rgb(255, 255, 255)', + fontSize: 13, + fontFamily: 'Arial', + fontColor: 'rgb(255, 255, 255)' + }, { + noUnHover: true, + msg: 'heatmapgl' + }); + + Plotly.plot(gd, _mock) + .then(run) + .catch(fail) + .then(done); + }); + it('should output correct event data for scattergl after visibility restyle', function(done) { var _mock = Lib.extendDeep({}, mock4);