SpreadsheetView
Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the developer guide for concepts. Provided by the spreadsheet-view plugin. View source.
Example usage
Hand-authored under defaultSession.views, with every setting written
directly on the view object. uri loads a tabular file (VCF/BED/CSV/etc)
straight into the grid, skipping the import form; assembly is used to
resolve genomic coordinates in the rows:
{
type: 'SpreadsheetView',
assembly: 'hg38',
uri: 'https://example.com/variants.vcf.gz',
fileType: 'VCF',
}Shows a tabular file, such as a VCF, BED or CSV, as a filterable table whose rows open their genomic location in a new view.
Each section ends with the members a composed model contributes, linked to the page that documents them.
Properties
| Member | Description |
|---|---|
typetype: types.literal('SpreadsheetView') | |
heightheight: types.stripDefault(types.number, defaultHeight) | the height of the sheet in pixels |
| hideVerticalResizeHandle | chrome switch, for an embed that sizes the view itself |
| drilldownTracks | trackIds the views a row opens start with, beside the loaded file's own track: the tumor and normal alignments, a coverage track, an assembly's synteny track |
| importWizard | |
spreadsheetspreadsheet: types.maybe(Spreadsheet()) | |
| launch | transient launch state: the settings written on the view object that need resolving before they can be view state — the file to load, the assembly its rows are read against, the filter to open it under. preProcessSnapshot moves them here off the snapshot, the afterAttach reaction applies them and clears this, so a saved session never retains it. Not written by hand: author every setting directly on the view. |
3 inherited properties from one model
From BaseViewModel: id, displayName, minimized
Volatiles
| Member | Description |
|---|---|
widthnumber |
1 inherited volatile from one model
From BaseViewModel: bodyMounted
Getters
| Member | Description |
|---|---|
| pendingLaunch | the launch state that still has something to apply — the gate the afterAttach reaction reads. |
showLoadingboolean | Named to match LGV/dotplot/synteny/circular/breakpoint-split, which is what ViewContainer reads to publish data-view-phase. Without it this view published ready for its whole load, so a capture or a browser test waiting on that attribute treated a spreadsheet still fetching and parsing its VCF as settled — and there is no display-level wait to fall back on here, since a spreadsheet mounts no displays at all.The one view whose loading state renders inside its import form rather than replacing it: the wizard keeps the chosen file, type and assembly on screen and puts a spinner above them, which is more useful than a bare loading screen that throws that context away. The phase is about the model, not about which component is mounted. |
drilldownTrackIdsstring[] | every track a row's drill-down opens with, the loaded file's first. That one is derived, not recorded: after registerImportedTrack the session holds a track pointing at the file, so the location match that decides whether to build one also finds it afterwards |
4 inherited getters from one model
From BaseViewModel: rendersDisplays, effectiveBodyMounted, ownTracks, ownViews
Methods
| Member | Description |
|---|---|
Actions
| Member | Description |
|---|---|
setHeight(newHeight: number) => number | |
resizeHeight(distance: number) => number | returns the distance actually applied, which is less than the requested one once the drag runs into minHeight — the ResizeHandle needs that to keep the bar under the pointer |
| displaySpreadsheet | load a new spreadsheet and set our mode to display it. When the incoming data has the same columns as what's shown (i.e. a session-cached URI being re-fetched on reload), carry over the user's column-visibility and SV-type filter — a fresh parse only supplies columns/rowSet, so a plain replace would reset them. The column match keeps this from leaking view state across different files. |
| setLaunch | |
setError(error: unknown) => void | Where a failed launch lands, which installInitAutorun requires of its host. Delegated rather than given a slot of its own: the import form is what is on screen before a sheet exists, and its banner is already the one place this view shows an error. |
setDrilldownTracks(trackIds: string[]) => void | |
registerImportedTrack(assemblyName: string) => void | Put the loaded file in the session as a track, so the linear and breakpoint views a row opens have the records the row came from. Without it every drill-down landed on an empty view and the reader had to add the same file again by hand. Idempotent on purpose, and cheaply so: the trackId is derived from the file's location and addSessionTrackConf dedupes against everything the session can already resolve, so a reloaded session re-importing its cached URI reuses the track rather than stacking a second one. trackConfForImportedFile declines outright when a track for the file already exists.Nothing takes the track back out — not returnToImportForm, not closing this view. The views that opened it are the reason it exists and they outlive the sheet, so removing it would empty a linear view the reader is still reading. It is an ordinary session track from that point on: it shows up in the track selector, it saves with the session, and the reader closes it there. Importing a second file adds a second track rather than replacing this one, which is the same answer — they loaded two files. |
| loadSpreadsheet | the single load funnel: fetch+parse via the import wizard, then display the result. Every entry point (declarative init, cached reload, the import form's Open button) routes through here so the view stays the sole owner of displaySpreadsheet |
returnToImportForm() => void | drop the loaded sheet and the cached location together: leaving the cache behind makes afterAttach re-fetch the dismissed file on the next session load, putting the user back where they left |
| applyInit | apply a declarative init (from addView / sv-inspector): point the import wizard at the file and load it. Without a uri there is nothing to load, so the wizard is only seeded — the import form then opens on the caller's assembly and file type instead of whichever assembly happens to sort first |
4 inherited actions from one model
From BaseViewModel: setDisplayName, setWidth, setBodyMounted, setMinimized
Related links
- Docs: URL query parameter API