jbrowse-components
jbrowse-components copied to clipboard
Add canvas feature renderer
This is a draft PR for canvas feature rendering
I am observing that SVG feature rendering is pretty slow in some cases especially if we are moderately zoomed out. the process of creating a react component for every subfeature, with config callbacks, color emphasize routines, is labor intensive, and bloats the dom node count, and it runs basically the full render on both the worker (ssr) and client thread (hydrate also does a full render).
Also this PR has floating feature labels which is a good benefit.
Some todos include just a general code review and adding UTR
Fixes #674
one concern that could be brought up is that some users have created infrastructure around svg being the default renderer. possibly, in that case, we would need to fork stuff in a (very) similar way to jbrowse 1 and make a CanvasFeatures track and an SvgFeatures track, which FeatureTrack being the default with svg renderer.
just for the record, this is definitely way faster === more pleasant to use imo. if there are considerations before pushing forward on this, feel free to add, but could be worth pushing over the finish line
from meeting just now, thinking about how to allow pluggable Glyphs.
two ways of doing this I can think of:
- add a pluggable element type called a CanvasFeatureGlyphType, add it to the plugin manager, etc.
- add an extension point called CanvasFeatures-chooseGlyph that lets people modify the code that chooses what glyph class to use