Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix heatmapgl point number event data #1884

Merged
merged 2 commits into from Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/traces/contourgl/convert.js
Expand Up @@ -77,7 +77,7 @@ proto.handlePick = function(pickResult) {
],
textLabel: this.textLabels[index],
name: this.name,
pointIndex: [xIndex, yIndex],
pointIndex: [yIndex, xIndex],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @dfcreative for that #1825 (comment)

hoverinfo: this.hoverinfo
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/traces/heatmapgl/convert.js
Expand Up @@ -63,7 +63,7 @@ proto.handlePick = function(pickResult) {
],
textLabel: this.textLabels[index],
name: this.name,
pointIndex: [xIndex, yIndex],
pointIndex: [yIndex, xIndex],
hoverinfo: this.hoverinfo
};
};
Expand Down
33 changes: 33 additions & 0 deletions test/jasmine/tests/gl2d_click_test.js
Expand Up @@ -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);

Expand Down