GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
205 stars 61 forks source link

Changes default height for SVG rendering to maxHeight to fix blank track effect on slow CPU #4480

Closed carolinebridge closed 2 months ago

carolinebridge commented 2 months ago

Super minor adjustment to the SVG renderer as an interim fix to how scrolling SSR block tracks appears when CPU/Network throttling occurs.

Instead of the SVG height defaulting to 0 (effectively 100 with the svgHeightPadding const) and thus cutting off everything below it while waiting for the client to finish rendering, it defaults to the track's maxHeight, showing everything until the client updates the height with the layout.getTotalHeight().

Note that labels are still delayed by the client as rendering is happening -- some "loading" UI was attempted but felt cluttered / wrong.

Main vs. branch: image

Main (left) branch (right) https://github.com/GMOD/jbrowse-components/assets/83305007/87b03dfa-1652-41d5-b230-6cb661727b61

cmdcolin commented 2 months ago

seems reasonable :) good catch on seeing how it's 0+100 for the padding.

cmdcolin commented 2 months ago

(my bug-bear is that we might want to change svg features entirely away from rpc rendering at some point but we'll get there when we get there)