Skip to content

Commit

Permalink
Update story to have static block listing
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Sep 21, 2022
1 parent 694c0d9 commit 4421462
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,18 @@ export const NextstrainExample = () => {
return <JBrowseLinearGenomeView viewState={state} />
}

function loc(r: Region) {
return `${r.refName}:${Math.floor(r.start)}-${Math.floor(r.end)}`
}
const VisibleRegions = observer(
({ state }: { state: ReturnType<typeof createViewState> }) => {
const locstrings = state.session.views[0].coarseDynamicBlocks
.map(
(region: Region) =>
`${region.refName}:${Math.floor(region.start)}-${Math.floor(
region.end,
)}`,
)
.join(',')
return <p>Visible region: {locstrings}</p>
const view = state.session.views[0]
return view.initialized ? (
<div>
<p>Visible region {view.coarseDynamicBlocks.map(loc).join(',')}</p>
<p>Static blocks {view.staticBlocks.map(loc).join(',')}</p>
</div>
) : null
},
)

Expand Down

0 comments on commit 4421462

Please sign in to comment.