Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello I just found two issue in this project.
First is this file couldn't work on Windows Chrome (just test v40 stable and v41 beta), I guess clearRect seems doesn't work correctly some time, it will cause the heatmap become heater and heater, and finally all color became red. If you want to reproduce it, switch to Windows PC and Chrome, revert this patch, set a breakpoint on line 120, you will have a great chance to see colored circle still exist after clearRect. But if you set a breakpoint on line 119, you cannot reproduce it anymore.
I think it's a Chrome-side bug (and may related with OpenGL or other acculturate mechanism), but I can't reproduced it by using more clear way. So I can't fill a bug on Chrome issue tracker. But fortunately, this patch seems fixed this issue.
Second is rendering frequently will cause flicker, it's clearly that use double buffered canvas can fix this issue, so I added a in-memory canvas as a buffered canvas, test shows it works fine and even fixed previous issue, so I uploaded this patch and hope it can be merged it to main project.
Thanks!