jbrowse-components icon indicating copy to clipboard operation
jbrowse-components copied to clipboard

Add canvas feature renderer

Open cmdcolin opened this issue 3 years ago • 6 comments

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

cmdcolin avatar Jan 24 '22 17:01 cmdcolin

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.

cmdcolin avatar Jan 24 '22 17:01 cmdcolin

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

cmdcolin avatar Jan 24 '22 23:01 cmdcolin

from meeting just now, thinking about how to allow pluggable Glyphs.

two ways of doing this I can think of:

  1. add a pluggable element type called a CanvasFeatureGlyphType, add it to the plugin manager, etc.
  2. add an extension point called CanvasFeatures-chooseGlyph that lets people modify the code that chooses what glyph class to use

rbuels avatar Jan 26 '22 18:01 rbuels