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

Redraw on window focus #2495

merged 1 commit into from Oct 26, 2018


None yet
3 participants
Copy link

kt3k commented Oct 1, 2018

This PR changes to redraw on focus event on window. This prevent empty chart rendering when the page is opened in background tabs.

closes #2458


This comment has been minimized.

Copy link

codecov-io commented Oct 1, 2018

Codecov Report

Merging #2495 into master will decrease coverage by 0.04%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2495      +/-   ##
- Coverage   80.49%   80.44%   -0.05%     
  Files          54       54              
  Lines        4280     4290      +10     
+ Hits         3445     3451       +6     
- Misses        835      839       +4
Impacted Files Coverage Δ
src/api.chart.js 11.53% <0%> (-0.47%) ⬇️
src/core.js 90.84% <66.66%> (-0.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 422c3ee...19a54ec. Read the comment docs.

@kt3k kt3k merged commit 6ebd6f2 into master Oct 26, 2018

3 checks passed

ci/circleci: docs Your tests passed on CircleCI!
ci/circleci: test Your tests passed on CircleCI!
circleci/htdocs preview build succes!

@kt3k kt3k deleted the feature/redraw-on-window-focus branch Oct 26, 2018


This comment has been minimized.

Copy link

jlhedric commented Dec 13, 2018

Fair warning, this fix doesn't work in firefox. You can repro on the c3 website using v63.0.3 and v64.0 (latest stable version). It works if you wrap the redraw around a timeout, which I see you've done, but it needs to be longer than 10ms. Not sure if it varies by application but I had to set it to 75 before it consistently worked.


This comment has been minimized.

Copy link
Member Author

kt3k commented Dec 24, 2018

@jlhedric Thanks for reporting. I confirmed that this happens in firefox (63.0.3 on macOS 10.13), but the rate is very low (like 5-10%). How often do you reproduce the behavior? I think it's ok to add 75 ms delay before redrawing, but if possible I'd like to know the root cause of this. Do you have any idea about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment