ideogram icon indicating copy to clipboard operation
ideogram copied to clipboard

Horizontal chromosome truncated moment before ending rotation back

Open mtwichan opened this issue 6 years ago • 4 comments

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

mtwichan avatar Nov 05 '18 23:11 mtwichan

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?

eweitz avatar Nov 06 '18 01:11 eweitz

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

ideogram

mtwichan avatar Nov 06 '18 09:11 mtwichan

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 avatar Nov 06 '18 12:11 eweitz

Oh, I see the issue now.

Steps to reproduce:

  • Go to https://eweitz.github.io/ideogram/mouse
  • Notice original state has horizontal orientation
  • Click chromosome 1, rotating it to vertical orientation
  • Click chromosome 1 again, rotating it back to horizontal
  • Notice how chromosome 1 is truncated at right the moment before ending its rotation back to its original horizontal orientation

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

eweitz avatar Nov 17 '18 16:11 eweitz