How to sync jbrowse scale with external scale #4948
-
|
I am trying to integrate jbrowse into an existing platform. The current platform provides me with values such as the bin size, bpperpixel and start and end position. Is there a way to adjust jbrowse scale to match this? i am currently doing this. Any help would be highly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
.I am presuming you basically want to navigate to a specific genomic location. there are a lot of low level utility actions like setDisplayedRegions, scalefactor, etc. but generally what you would use is That will navigate an existing instance to a new location If you just want to instantiate the initial location, you can use a different technique, such as passing the location to the createViewState constructor Here is a storybook example to illustrate. I made two examples, one using locstrings, and one with objects. same idea, just slightly different APIs Using location stringUsing a location objectlet me know if that helps |
Beta Was this translation helpful? Give feedback.
yes, tearing down and recreating the "view state" will be slow. in my examples that I showed above use a useState to only run createViewState once to initialize the "view state", and thenafter, calling the navToLocString to move around. this should be pretty fast.
if you are aiming to re-navigate to a specific genomic region, I recommend using the navToLocString function. manually fiddling with the bpPerPx and displayedRegions is generally a bit low level, when navToLocString automatically adjusts those variables as needed, but welcome to use whatever works :)
lemme know if you have any other issues