Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0a12d8

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

File tree

Expand file treeCollapse file tree

1 file changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-1
lines changed

‎test/jasmine/tests/hover_label_test.js

Copy file name to clipboardExpand all lines: test/jasmine/tests/hover_label_test.js
+12-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.