Closed rpadmanabhan closed 6 months ago
I don't think that's really possible because on every draw call the canvas is repainted and so you'd have to repaint the legend as well.
What I usually do is render the legend above the canvas using either SVG or standard HTML+CSS. Then during export, you can convert the legend to a bitmap using https://www.npmjs.com/package/html-to-image. Finally all you have to do is to blend the scatterplot and legend ImageDatas together.
Thanks I will give that a try.
Hi,
Thanks much for developing such an excellent library, it is really useful for visualizing large single-cell RNA-seq dimensional reduction plots.
Do you know if the canvas element can be re-used to draw other objects (for e.g. a legend) ? I could not see any objects that I drew on the canvas after the scatterplot has been rendered so just wondering if this was possible. The motivation for this is to make it easy to save both the plot and the legend together as a png image.
Thanks for any insight.