Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0a12d8

Browse files
committed
test clipped positioning of hover labels for scatterternary fill
1 parent c45c074 commit a0a12d8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/jasmine/tests/hover_label_test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,9 @@ describe('hover on fill', function() {
694694

695695
it('should work for scatterternary too', function(done) {
696696
var mock = Lib.extendDeep({}, require('@mocks/ternary_fill.json'));
697+
var gd = createGraphDiv();
697698

698-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(function() {
699+
Plotly.plot(gd, mock.data, mock.layout).then(function() {
699700
// hover over a point when that's closest, even if you're over
700701
// a fill, because by default we have hoveron='points+fills'
701702
return assertLabelsCorrect([237, 150], [240.0, 144],
@@ -707,6 +708,16 @@ describe('hover on fill', function() {
707708
return assertLabelsCorrect([237, 218], [266.75, 265], 'trace 1');
708709
}).then(function() {
709710
return assertLabelsCorrect([237, 251], [247.7, 254], 'trace 0');
711+
}).then(function() {
712+
// zoom in to test clipping of large out-of-viewport shapes
713+
return Plotly.relayout(gd, {
714+
'ternary.aaxis.min': 0.5,
715+
'ternary.baxis.min': 0.25
716+
});
717+
}).then(function() {
718+
// this particular one has a hover label disconnected from the shape itself
719+
// so if we ever fix this, the test will have to be fixed too.
720+
return assertLabelsCorrect([295, 218], [275.1, 166], 'trace 2');
710721
}).then(function() {
711722
// trigger an autoscale redraw, which goes through dragElement
712723
return doubleClick(237, 251);

0 commit comments

Comments
 (0)