Skip to content

How to get changes in location #2544

Answered by cmdcolin
guzmanvig asked this question in Q&A
Discussion options

You must be logged in to vote

we have an example here that does this with react and observer components (the "VisibleRegions" component "observes" the state of the view)

https://jbrowse.org/storybook/lgv/v1.5.1/?path=/story/linear-view--visible-regions-example

see https://github.com/GMOD/jbrowse-components/blob/607_stats_estimation_v2/products/jbrowse-react-linear-genome-view/stories/JBrowseLinearGenomeView.stories.tsx#L366-L393 for how this demo is implemented

you can also accomplish a similar thing with just onChange like this

export const VisibleRegionsExample2 = () => {
  const state = createViewState({
    assembly,
    tracks,
    defaultSession,
    location: 'ctgA:1105..1221',
    onChange: () => {
      conso…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@garrettjstevens
Comment options

Answer selected by guzmanvig
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants