ihh / tree-align-view

A multiple alignment viewer with integrated phylogeny and structure browsing.
MIT License
4 stars 1 forks source link

Smoother dragging #13

Closed ihh closed 4 years ago

ihh commented 4 years ago

I'd like to understand why the dragging is so jerky but when you scroll using the scrollbars (or mouse wheel), it's perfectly smooth. Happens to a different extent in all browsers. I think it is because pure horizontal and vertical scrolling are optimized in browsers, but diagonal (simultaneous horizontal+vertical) is not, except perhaps for big single images: I think the combination of a layout with many divs and diagonal scrolling are defeating it. There are a few different strategies one could try, including e.g. rendering everything on a big canvas, or simpler measures to reduce the number of divs on the page. A bit hard to predict which would work, without doing experiments and more prototyping.

ihh commented 4 years ago

This note on layout thrashing could be relevant https://gist.github.com/paulirish/5d52fb081b3570c81e3a

cmdcolin commented 4 years ago

Fixing scroll jank is the bane of a js perf engineers existence. Generally just profiling and careful stuff to make sure you get high FPS