Skip to content

Commit

Permalink
Revert "extend choropleth tests to include translate3d transform (plo…
Browse files Browse the repository at this point in the history
…tly#5525)"

This reverts commit c437006.
  • Loading branch information
LucaVazz committed May 26, 2021
1 parent 344fb91 commit a9da031
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions test/jasmine/tests/choropleth_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ describe('Test choropleth hover:', function() {

function run(hasCssTransform, pos, fig, content, style) {
gd = createGraphDiv();
var scale = 1;

style = style || {
bgcolor: 'rgb(68, 68, 68)',
Expand All @@ -176,8 +177,14 @@ describe('Test choropleth hover:', function() {
fontFamily: 'Arial'
};

function assertHoverLabel(posX, posY) {
mouseEvent('mousemove', posX, posY);
return Plotly.newPlot(gd, fig)
.then(function() {
if(hasCssTransform) {
scale = 0.5;
transformPlot(gd, 'translate(-25%, -25%) scale(0.5)');
}

mouseEvent('mousemove', scale * pos[0], scale * pos[1]);
assertHoverLabelContent({
nums: content[0],
name: content[1]
Expand All @@ -186,18 +193,6 @@ describe('Test choropleth hover:', function() {
d3Select('g.hovertext'),
style
);
}

return Plotly.newPlot(gd, fig)
.then(function() {
if(hasCssTransform) {
transformPlot(gd, 'translate3d(10px, 10px, 0) scale(1)');
assertHoverLabel(pos[0] + 10, pos[1] + 10);
transformPlot(gd, 'translate(-25%, -25%) scale(0.5)');
assertHoverLabel(0.5 * pos[0], 0.5 * pos[1]);
} else {
assertHoverLabel(pos[0], pos[1]);
}
});
}

Expand Down

0 comments on commit a9da031

Please sign in to comment.