sequenceTubeMap
sequenceTubeMap copied to clipboard
Scaling Issue of Drawn Bases when Zooming.
Hi There :) When I zoom (in or out), the scaling of the drawn bases usually does not fit anymore. They are drawn too wide.
Best, Simon
Thanks for bringing that up, I never noticed this before.
The extent of the imperfect scaling seems to be dependent on browser and OS.
Currently the node width is determined by the size in pixels when writing the node's sequence to the screen. The zooming is handled automatically by d3.js and I suppose lines/rectangles and long pieces of text do not scale with the exactly same factor.
One solution would be to write the sequence letter by letter and supplying the coordinates instead of writing it as one big string. I'll give it some more thought and then probably do this.
Yeah, it is really strange. Always this Browser and OS dependency Hell...
I am wondering what would be the most efficient solution here? On the one hand an efficient drawing and on the other hand it should still be responsive for a huge number of bases. Do you think from an efficiency point of view, there will be a difference between the two ways of drawing?
It just came to my mind that from a functional point of view it would make more sense to draw each base on its own: When hovering over the base you can draw the same two lines as you did when hovering over a SNP. This could be helpful when visualizing a huge number of samples so that one can better identify what SNPs, INDELs, etc. are at a certain position. What do you think?
I am working on an update for the interface which adds some kind of pagination so that you only see part of the graph and have to press a button to move left or right. This reduces the size of the image, so that I don't think the performance of writing each letter individually would be an issue.
I kind of like the hovering idea and since similar code is already there, it shouldn't be difficult to implement once the letters are written individually.
I'm still able to reproduce this. At certain zoom levels, the text of long nodes will get drawn past the end of the node, but it will fit inside the node at lower or higher zoom. We might be rounding our font sizes somehow.
For example, on the default demo visualization that loads when you open the page: