eweitz / ideogram

Chromosome visualization for the web
https://eweitz.github.io/ideogram
Other
287 stars 72 forks source link

Horizontal chromosome truncated moment before ending rotation back #109

Open mtwichan opened 5 years ago

mtwichan commented 5 years ago

The ideogram rotates and renders in a weird way on the rotation animation. This is evident in the sample examples as well, just click on a chromosome-> https://eweitz.github.io/ideogram/mouse

eweitz commented 5 years ago

By "on the rotation animation", do you mean during the rotation animation itself, or after it?

The animation itself was slightly degraded as a side-effect of https://github.com/eweitz/ideogram/pull/102, but that fixed a more significant issue with distortion after rotation. If that isn't the issue you're describing, could you elaborate?

mtwichan commented 5 years ago

Sure. This is more directed towards the animation itself. Sorry for not being so clear!

ideogram

eweitz commented 5 years ago

Thanks for the recording; very helpful.

I suspect the problem here has more to do with band labels than with horizontal orientation. Specifically, there is a brief but noticeable pause between when the rotation completes and when the chromosome and its labels are re-rendered. @matthewchan15, if you see a different issue, please further clarify.

That pause between rotation completion and re-rendering likely occurs because expensive calculations on label overlap and hiding are done at that time. When band labels are being restored to a previous state (e.g. rotating back to horizontal, or rotated vertically for a second time), perhaps the previous layout can be cached in memory and retrieved, rather than re-calculated from scratch.

eweitz commented 5 years ago

Oh, I see the issue now.

Steps to reproduce:

I welcome contributions to fix this; I probably won't get to it for a while.