-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some links, modularize a bit more
- Loading branch information
Showing
14 changed files
with
174 additions
and
175 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
products/jbrowse-react-linear-genome-view/stories/BasicUsage.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* eslint-disable no-console */ | ||
import React from 'react' | ||
import { createViewState, JBrowseLinearGenomeView } from '../src' | ||
import { getVolvoxConfig } from './util' | ||
|
||
export const OneLinearGenomeView = () => { | ||
const { assembly, tracks } = getVolvoxConfig() | ||
const state = createViewState({ | ||
assembly, | ||
tracks, | ||
// use 1-based coordinates for locstring | ||
location: 'ctgA:1105..1221', | ||
onChange: patch => { | ||
console.log('patch', patch) | ||
}, | ||
}) | ||
return ( | ||
<div> | ||
<JBrowseLinearGenomeView viewState={state} /> | ||
<a href="https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/BasicUsage.stories.tsx"> | ||
Source code | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export const UsingLocObject = () => { | ||
const { assembly, tracks } = getVolvoxConfig() | ||
const state = createViewState({ | ||
assembly, | ||
tracks, | ||
// use 0-based coordinates for "location object" here | ||
location: { refName: 'ctgA', start: 10000, end: 20000 }, | ||
}) | ||
return ( | ||
<div> | ||
<JBrowseLinearGenomeView viewState={state} /> | ||
<a href="https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/BasicUsage.stories.tsx"> | ||
Source code | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export const DisableAddTracks = () => { | ||
const { assembly, tracks } = getVolvoxConfig() | ||
const state = createViewState({ | ||
assembly, | ||
tracks, | ||
disableAddTracks: true, | ||
}) | ||
return ( | ||
<div> | ||
<JBrowseLinearGenomeView viewState={state} /> | ||
<a href="https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/BasicUsage.stories.tsx"> | ||
Source code | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export const WithShowTrack = () => { | ||
const { assembly, tracks } = getVolvoxConfig() | ||
const state = createViewState({ | ||
assembly, | ||
tracks, | ||
location: 'ctgA:1105..1221', | ||
}) | ||
// this is the 'showTrack' method on the linear genome view | ||
// full reference https://jbrowse.org/jb2/docs/models/lineargenomeview/#action-showtrack | ||
state.session.view.showTrack('volvox-long-reads-sv-bam') | ||
|
||
return ( | ||
<div> | ||
<JBrowseLinearGenomeView viewState={state} /> | ||
<a href="https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/BasicUsage.stories.tsx"> | ||
Source code | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export default { title: 'Source: Basic usage' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
products/jbrowse-react-linear-genome-view/stories/DefaultSessions.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React from 'react' | ||
import { createViewState, JBrowseLinearGenomeView } from '../src' | ||
import { getVolvoxConfig } from './util' | ||
|
||
export const WithLongReads = () => { | ||
// this default session loads an alignments track at startup | ||
const defaultSession = { | ||
id: 'wBejr9mPa', | ||
name: 'Integration test example 2/25/2021, 9:11:35 AM', | ||
view: { | ||
id: 'integration_test', | ||
type: 'LinearGenomeView', | ||
offsetPx: 2000, | ||
bpPerPx: 0.05, | ||
displayedRegions: [ | ||
{ | ||
refName: 'ctgA', | ||
start: 0, | ||
end: 50001, | ||
reversed: false, | ||
assemblyName: 'volvox', | ||
}, | ||
], | ||
tracks: [ | ||
{ | ||
id: 'mCKjn5ta9', | ||
type: 'AlignmentsTrack', | ||
configuration: 'volvox-long-reads-sv-bam', | ||
displays: [ | ||
{ | ||
id: 'CGblPB7sB0', | ||
type: 'LinearAlignmentsDisplay', | ||
configuration: 'volvox-long-reads-sv-bam-LinearAlignmentsDisplay', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
} | ||
const { assembly, tracks } = getVolvoxConfig() | ||
const state = createViewState({ | ||
assembly, | ||
tracks, | ||
defaultSession, | ||
location: 'ctgA:1105..1221', | ||
}) | ||
|
||
return ( | ||
<div> | ||
<JBrowseLinearGenomeView viewState={state} /> | ||
<a href="https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/DefaultSessions.stories.tsx"> | ||
Source code | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export default { title: 'Source: With default session' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.