-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Fix flickering of visualizations on refresh #20817
Conversation
💚 Build Succeeded |
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.
I've tested it and works correctly on OSX Chrome, Firefox and Safari using the Global Flight Dashboard
example dashboard.
I've see that the behaviour is correct for all the charts but the vega one where I can see a refresh of the tiles of the map. Seems to be present also into master, but I didn't tested in 6.3.
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.
LGTM. Tested on mac/chrome with gauge control using back/forward time navigation. Confirmed it flickers on master without this PR and that the flicker goes away with this PR.
👍
@markov00 I think the Vega map would be a separate issue, and I would like to fix this also separately, since I would like to backport this to 6.3 too ideally, but no need for an experimental visualization. |
This fixes #20240 where vislib visualizations with a legend are flickering on dashboard in case of auto refresh.
The waiting for one render cycle was earlier in
visualize
where it was used to make sure we first render the legend before we get the width/height of the remaining container, that we pass then to the vislib implementation. If we didn't do it, the chart assumed a wrong size and "overdraw" (or underdraw) the legend.Since the legend is now moved into the vislib vis type itself, we don't need to wait for it anymore, since the size calculation (that is passed to that class) isn't only for the chart area anymore, but for chart + legend beside each other, and drawing them beside each other works by the CSS styling of those two
divs
.Testing hint: Since currently auto refreshing visualizations isn't working on
master
, you can also just switch through the time ranges (using the arrows left and right of the time picker). Without that fix you should also experience the flickering, with that fix it should be gone.Testing: This should ideally not change anything beside getting rid of the flickering on auto-refresh or switching time ranges. Please make sure you test a couple of vislib charts with legends in different scenarios and also test expanding/collapsing of the legend. Everything should still work as expected.