SvInspectorView
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release —
see pluggable elements for concepts. Provided by the
sv-inspector plugin.
View source.
Example usage
Hand-authored under defaultSession.views. The init shorthand loads a
structural-variant file into the spreadsheet and mirrors the rows as arcs in the
paired circular view; assembly resolves coordinates for both:
{
type: 'SvInspectorView',
init: {
assembly: 'hg38',
uri: 'https://example.com/sv.vcf.gz',
fileType: 'VCF',
},
}
does not extend, but is a combination of a
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
idid: ElementId | SvInspectorView | |
typetype: types.literal('SvInspectorView') | SvInspectorView | |
heightheight: types.stripDefault(types.number, defaultHeight) | the height of the whole view in pixels, sheet and circle together | SvInspectorView |
| onlyDisplayRelevantRegionsInCircularView | restrict the circular half to the chromosomes the loaded rows actually touch, instead of drawing an arc for every one in the assembly | SvInspectorView |
spreadsheetWidthFractionspreadsheetWidthFraction: types.stripDefault(types.number, 0.66) | share of the view's width given to the spreadsheet, the rest goes to the circular view. Persisted so dragging the divider survives both a window resize and a session reload | SvInspectorView |
| spreadsheetView | SvInspectorView | |
| circularView | SvInspectorView | |
initinit: types.frozen<SvInspectorViewInit | undefined>() | used for initializing the view from a session snapshot | SvInspectorView |
displayNamedisplayName: types.maybe(types.string) | displayName is displayed in the header of the view, or assembly names being used if none is specified | BaseViewModel |
minimizedminimized: types.stripDefault(types.boolean, false) | collapse the view to its header bar, keeping it in the session rather than closing it | BaseViewModel |
Volatiles
| Member | Description | Defined by |
|---|---|---|
| SpreadsheetViewReactComponent | SvInspectorView | |
CircularViewReactComponentCircularViewReactComponent: CircularViewType.ReactComponent | SvInspectorView | |
widthwidth: 800 | BaseViewModel | |
bodyMountedbodyMounted: true | Whether the container has this view's body in the DOM.ViewContainer mounts a view's body only while an IntersectionObserver says it is on screen, to hold the app under the WebGL2 context ceiling (reference/GPU_CONTEXT_BUDGET.md). A view below the fold therefore has no canvas, so nothing ever calls markCanvasDrawn and the pre-first-paint term of displayPhase pins every display in it at loading with nothing left to resolve it — which parks [data-app-phase="ready"] for the whole app on a view the user cannot see.Defaults true so the containers that always mount a body — embedded views, workspace panels, and any test rendering a display directly — are unaffected and need not set it. The raw flag, written by this view's own container. A display asks effectiveBodyMounted instead, because a nested view has no container of its own. | BaseViewModel |
Getters
| Member | Description | Defined by |
|---|---|---|
| currentAssembly | SvInspectorView | |
assemblyNamestring | undefined | SvInspectorView | |
showCircularViewboolean | gated on the same condition the spreadsheet renders its grid on, so the circle never appears alongside the import form | SvInspectorView |
showLoadingboolean | Named to match the other views, which is what ViewContainer reads to publish data-view-phase. Folds in both halves because neither publishes its own: the child views are rendered directly by this component rather than through a ViewContainer, so a spreadsheet still parsing or a circle still waiting on its assembly was invisible to every readiness wait, and website/scripts/specs/sv.ts captures five figures of this view.The circular term is gated on showCircularView so a circle that isn't rendered can never hold the phase open — waitForViewPhases is deliberately not best-effort, so a phase that never clears is a hang rather than a degraded capture. | SvInspectorView |
featuresSimpleFeatureSerialized[] | SvInspectorView | |
featureRefNamesstring[] | every refName the features' chords land on, both ends included | SvInspectorView |
canonicalFeatureRefNameSetSet<string> | SvInspectorView | |
circularDisplayedRegionsBasicRegion[] | undefined | the regions the paired circular view should show, never narrowed to nothing: the relevant-set is empty until the features are parsed, and can also miss every region outright, since getCanonicalRefName2 hands back a refName the assembly doesn't know rather than dropping it. Both show everything rather than an empty circle | SvInspectorView |
subviewWidths{ spreadsheet: number; circular: number; } | the two subview widths, with the divider taken out of the total first: the two plus the divider have to add up to our own width, or the flex row overflows and squeezes the circle. The fraction is clamped on read as well as on write, so a session carrying an out-of-range one (hand-authored, or from a future default) can't drive the circle under the width floor it clamps itself to | SvInspectorView |
variantTrackIdstring | SvInspectorView | |
| featuresCircularTrackConfiguration | undefined until the sheet has an assembly to resolve coordinates against, which is also when the paired circular view has nothing to draw the chords on | SvInspectorView |
effectiveBodyMountedboolean | Whether this view's body is in the DOM, counting the views it is nested inside — which is the question a display's phase actually asks.bodyMounted alone answers it only for a view a container renders directly. A view nested in another view (a synteny row, a breakpoint panel) has no container writing its flag, so it reads true forever while its whole subtree is out of the DOM, and every display in it waits for a first paint that nothing will make — the hang this flag exists to prevent, one level down.An ancestor that does not carry the flag at all leaves the answer alone rather than excusing the paint: only an explicit false unmounts, so a duck-typed stand-in that forgot it keeps waiting, which is the failure that shows up as a slow test rather than as a picture of an empty view. | BaseViewModel |
Methods
| Member | Description |
|---|---|
Actions
| Member | Description | Defined by |
|---|---|---|
setHeight(newHeight: number) => number | SvInspectorView | |
setOnlyDisplayRelevantRegionsInCircularView(val: boolean) => void | SvInspectorView | |
resizeSpreadsheetWidth(distance: number) => void | move the divider between the two subviews. Stored as a fraction so the width binding can reapply it, rather than resizing the subviews directly and having the next parent resize overwrite it. The delta accumulates onto the fraction rather than being read back off spreadsheetView.width: the binding writes a rounded, divider-adjusted width there, so a round trip through it lost a pixel on every drag frame and the divider crept left even while the pointer was still | SvInspectorView |
setInit(init?: SvInspectorViewInit | undefined) => void | SvInspectorView | |
resizeHeight(distance: number) => number | SvInspectorView | |
setDisplayName(name: string) => void | BaseViewModel | |
setWidth(newWidth: number) => void | width is an important attribute of the view model, when it becomes set, it often indicates when the app can start drawing to it. certain views like lgv are strict about this because if it tries to draw before it knows the width it should draw to, it may start fetching data for regions it doesn't need to setWidth is updated by a ResizeObserver generally, the views often need to know how wide they are to properly draw genomic regions | BaseViewModel |
setBodyMounted(flag: boolean) => void | See bodyMounted. Written by the view's container, which is the only thing that knows whether it rendered the body. | BaseViewModel |
setMinimized(flag: boolean) => void | BaseViewModel |
Related links
- Guide: URL query parameter API