Skip to content
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

Merged
merged 1 commit into from
Jul 16, 2018

Conversation

timroes
Copy link
Contributor

@timroes timroes commented Jul 16, 2018

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.

@timroes timroes added bug Fixes for quality problems that affect the customer experience Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix v7.0.0 v6.4.0 labels Jul 16, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@markov00 markov00 left a 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.

Copy link
Contributor

@stacey-gammon stacey-gammon left a 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.

👍

@timroes
Copy link
Contributor Author

timroes commented Jul 16, 2018

@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.

@timroes timroes merged commit 61f50dd into elastic:master Jul 16, 2018
@timroes timroes deleted the fix-vis-flickering branch July 16, 2018 16:36
timroes added a commit to timroes/kibana that referenced this pull request Jul 16, 2018
timroes added a commit to timroes/kibana that referenced this pull request Jul 16, 2018
@timroes timroes added the v6.3.2 label Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix v6.3.2 v6.4.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualizations flicker on an auto-refreshed dashboard instead of being greyed out
4 participants