maximilianh / cellBrowser

main repo: https://github.com/ucscGenomeBrowser/cellBrowser/ - Python pipeline and Javascript scatter plot library for single-cell datasets, http://cellbrowser.rtfd.org
https://github.com/ucscGenomeBrowser/cellBrowser/
GNU General Public License v3.0
104 stars 40 forks source link

Draw violin plot asynchronously, speeds up expression display #204

Closed mxposed closed 3 years ago

mxposed commented 3 years ago

On a big dataset (~350k cells) the violin plot chart js function takes ~3 seconds to draw. I put this in a setTimeout call, to speed up the refreshing of the UI.

On small datasets the delay is almost unnoticeable.

Please, let me know what you think

maximilianh commented 3 years ago

This looks like a super easy way to solve this speed problem, thanks!

I was wondering why you're not using Worker() but of course that would require a separate .js file so setTimeout looks like a much easier change to solve this problem....

maximilianh commented 3 years ago

By the way: could you PR future commits into the "develop" branch, rather the "master" branch? Or can I change the branch of PRs myself easily?

mxposed commented 3 years ago

Oh, sorry, of course, will use develop branch!

About the Worker: from what I (briefly) read it appears that Workers do not have access to DOM. And, well, yes, setTimeout change is just 2 lines : )

mxposed commented 3 years ago

It is possible to edit pull request base, but because of the differences between develop and master it's better for me to update the commits also. Will do for the other 2 pull requests