Get Offset when Jbrowse is horizontally scrolled #4979
-
|
Is there a way to get the current view state regarding the offset, bpperpx, binsize, etc, after scrolling in JBrowse tracks in any direction? I need it to sync with an existing app. Or is there a method to prevent horizontal scrolling, or hooking into the render of the tracks some how. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
this code example shows usage of an 'observer' to update when visible regions changes the code there looks like this so this component will re-render any time the 'coarsedynamicblocks' (which roughly corresponds to current visible regions) or staticBlocks (corresponds to rendered 'blocks') change you could also put and it would update whenever offsetPx or bpPerPx changed. again, offsetPx and bpPerPx are sort of low level but you can work with that if you want using mobx-react observer is the best way to say updated with things like this. we also have an 'onPatch' callback that notifies when any state has changed in the jbrowse app |
Beta Was this translation helpful? Give feedback.
Here is an example of making a plugin that effectively disables side scroll and zoom by nullifying the scrollTo and zoomTo actions https://github.com/GMOD/jbrowse-components/pull/4982/files#diff-387aa0fba3ffb3e9a8959746c1b43a3765ddb88dd8777a197595cfff51ff2b04R15-R32
Pros:
Cons: