-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Custom trace hover labels #1582
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
Changes from 1 commit
83cd8c8
258f1c7
fe50b6f
8d7ec16
ffde987
1d4930c
e609955
12954aa
27fb2d0
a96af57
abcf1b0
03554a5
efcb027
7907140
0d66e6e
3ac4c07
295659e
9d91e2c
add85d2
f986fd2
a8cc8b0
9ee8877
4ec88ef
b053629
92de017
7332d23
6bbfa65
28c2770
cda735b
ce27e10
be9e6b9
cf61dc2
9eeadcf
8321959
409b771
60bd4fc
e45bff9
e0be6cd
8d021e0
4d3ce92
e50886c
f8258cb
3f52a89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,6 +260,12 @@ describe('sankey tests', function() { | |
|
||
afterEach(destroyGraphDiv); | ||
|
||
function wait() { | ||
return new Promise(function(resolve) { | ||
setTimeout(resolve, 60); | ||
}); | ||
} | ||
|
||
it('Plotly.deleteTraces with two traces removes the deleted plot', function(done) { | ||
|
||
var gd = createGraphDiv(); | ||
|
@@ -313,30 +319,23 @@ describe('sankey tests', function() { | |
}); | ||
|
||
it('Plotly.plot shows and removes tooltip on node, link', function(done) { | ||
|
||
var gd = createGraphDiv(); | ||
var mockCopy = Lib.extendDeep({}, mock); | ||
|
||
Plotly.plot(gd, mockCopy) | ||
.then(function() { | ||
|
||
mouseEvent('mousemove', 400, 300); | ||
mouseEvent('mouseover', 400, 300); | ||
|
||
window.setTimeout(function() { | ||
expect(d3.select('.hoverlayer>.hovertext>text').node().innerHTML) | ||
.toEqual('447TWh', 'tooltip present'); | ||
|
||
mouseEvent('mousemove', 450, 300); | ||
mouseEvent('mouseover', 450, 300); | ||
|
||
window.setTimeout(function() { | ||
expect(d3.select('.hoverlayer>.hovertext>text').node().innerHTML) | ||
.toEqual('46TWh', 'tooltip jumped to link'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 sorry, missed that! |
||
done(); | ||
}, 60); | ||
}, 60); | ||
}); | ||
Plotly.plot(gd, mockCopy).then(function() { | ||
mouseEvent('mousemove', 400, 300); | ||
mouseEvent('mouseover', 400, 300); | ||
}) | ||
.then(wait) | ||
.then(function() { | ||
expect(d3.select('.hoverlayer>.hovertext>text').node().innerHTML) | ||
.toEqual('447TWh', 'tooltip present'); | ||
}) | ||
.then(function() { | ||
mouseEvent('mousemove', 450, 300); | ||
mouseEvent('mouseover', 450, 300); | ||
}) | ||
.then(done); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/plotly/plotly.js/blob/master/test/jasmine/assets/delay.js ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That thing got 🔪
I've been using this pattern lately. No need for timeouts 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice 🚀