-
Notifications
You must be signed in to change notification settings - Fork 187
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
Flickering tip #1805
Comments
Thanks for the test case. Yes, this is because the tip renders asynchronously — we need the tip to be attached to the DOM in order to compute exact text metrics as described here: Lines 217 to 218 in 63415aa
We can probably find a way to hide the tip text so that it’s not briefly visible before the tip finishes rendering. |
please paste this in your notebook to test #1826: Plot = import("https://esm.sh/gh/observablehq/plot@834810e5e05193191a97ab6d750c4f329a97bd55") It's not perfect in the sense that the tip doesn't have time to show, but at least it's not showing in the wrong place. |
* closes #1805 * tests * conditional postrender --------- Co-authored-by: Mike Bostock <mbostock@gmail.com>
I recently learned this trick from @mootari; the documentation at https://esm.sh is worth a read! |
* closes observablehq#1805 * tests * conditional postrender --------- Co-authored-by: Mike Bostock <mbostock@gmail.com>
I recently built a page that has some charts using
tip
s as chart annotations controlled by a range slider, and noticed that the tooltips sometimes "flicker" before being rendered at their final position. I was following along with tip development a while back and if I remember, there's some layout computation that happens post-initial render, so I wonder if it might have to do with that.I created a mini test case here. It's hard to get a screenshot, but in Chrome & Safari on macOS I see the tip text appear at the bottom right of the annotated datum for just a moment while I slide the slider, before re-appearing at the top left as requested by the
anchor
option, along with the rest of the tip.The text was updated successfully, but these errors were encountered: