empress icon indicating copy to clipboard operation
empress copied to clipboard

Draw barplots on their own "layer" of the canvas

Open fedarko opened this issue 3 years ago • 2 comments

Came up in discussion with @gwarmstrong today. I imagine this would work similarly to the plans for #452. This would make the process of rendering barplot updates much faster, and will be really useful when barplots are refactored (we could conceivably do things like updating individual barplot layers in isolation?)

fedarko avatar Dec 03 '20 21:12 fedarko

I had originally looked into this when I split the tree into a color/coordinate buffers. The idea was to create a drawer for the tree and then overlay another drawer for the colored branches. However, I think it would be a lot more work than what its worth. The draw command itself is really fast even for large trees. For example, every time you move the tree, the draw command is called dozens of times (essentially every pixel it moves).

The expensive part is filling the buffers and associated code such as calculating the layout, determining what color to assign a node when coloring by feature/sample metadata and so on. That is why I split the tree buffer into two different buffers one for color and one for coordinates. So, now when we color by feature metadata, we only replace the color buffer instead of both the color and coordinate buffers.

In addition, creating multiple layer would make the convert to png function much more complicated.

kwcantrell avatar Dec 08 '20 02:12 kwcantrell

The expensive part is filling the buffers and associated code such as calculating the layout, determining what color to assign a node when coloring by feature/sample metadata and so on.

Is the expensive part about separating the buffers copying the content into the buffers or is it the compute associated with generating the data for the buffers?

ElDeveloper avatar Dec 09 '20 17:12 ElDeveloper