-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardcoded block width of 800px on static blocks #3207
Conversation
Note that changing it to something different than 800 changes a lot of hardcoded stuff in our tests, so changing it to 800 just happens to be convenient since our tests ran with window.innerWidth being 800... |
Codecov Report
@@ Coverage Diff @@
## main #3207 +/- ##
=======================================
Coverage 59.50% 59.50%
=======================================
Files 670 670
Lines 28748 28748
Branches 6971 6971
=======================================
Hits 17107 17107
Misses 11320 11320
Partials 321 321
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
4ca4b28
to
694c0d9
Compare
the only code diff is effectively this https://github.com/GMOD/jbrowse-components/pull/3207/files#diff-22192cd64978bb90dbcad1bd3799211b35599bf79de33ad06910ed11f4d85f76L26-L43 everything else is snapshot diff |
Tested this on the SKBR3 BAM file, it feels reasonably fast so I don't think we will hurt performance. 2-3 blocks will be onscreen at all times with a standard monitor |
this happens to fix #2278 by random chance |
maybe can try to merge for now |
(the reason it fixed #2278 is because the model.width is now used for the range of blocks to calculate whereas before it used window.innerWidth which is not "observable") |
* Hardcode static block widths * Updates * Update snaps * Add hardcoded width * Update story to have static block listing
This uses a hardcoded block width of 800px for static blocks
The current method uses the window.innerWidth for the width of static blocks. In the very early days, it was model.width (exactly the width of the view) but was changed to window.innerWidth to avoid the blocks being recalculated when e.g. the drawer opens. This stays with a hardcoded value, but smaller than window.innerWidth, and the appropriate number of 800px are calculated to cover the view width (view's model.width)
The sort of superstituous concern I have with using window.innerWidth is it could be very large for ultra-wide monitors, which would also load a large amount of off-screen data since our staticBlocks cover off-screen areas.
Using a hard coded block width of 800px, we would limit the amount of off-screen data loaded to a more reasonable amount, at the cost of doing more block loading. jbrowse 1 shows us that even small block sizes (jb1's blocks are quite small, no hard number off hand but it's like 200px or something) can be fast (jb1 beats jb2 in some benchmarks in jb2profile)