MultiRegionDisplayMixin
Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the developer guide for concepts. Built into JBrowse core. View source.
Per-region fetch lifecycle for LGV-based GPU displays. Installs the fetch
autoruns in afterAttach and exposes overridable hooks (fetchNeeded,
rpcProps, zoomFetchArgs, regionHasData, gateEnabled) plus
the fetchRegions / loadedRegions machinery.
rpcProps() and zoomFetchArgs() are what the display's RPC is sent, and
the foundation stamps both beside every region a fetch loads. They differ in
what a move shows: an rpcProps move supersedes the in-flight fetch and
scrims the held data, while a zoomFetchArgs move lets the held regions draw
until the refetch lands, so a value that swings with zoom goes in
zoomFetchArgs. A zoom rule that is no worker argument, such as a payload
answering only the zoom it was fetched at, is a regionHasData answer. The
mixin looks both up rather than declaring them, so a display keeps its narrow
return types through MST's .views() chain.
Each section ends with the members a composed model contributes, linked to the page that documents them.
Volatiles
| Member | Description |
|---|---|
loadedRegionsObservableMap<number, LoadedRegion> |
The per-region store, keyed by displayedRegionIndex: the span a fetch asked for, the fetchInputs it was issued under and the payload it brought back, written as one record by ctx.commitRegion. Displays read payloads through regionPayloads. |
18 inherited volatiles from 3 models
From FetchMixin: activeSignal, fetchGeneration, reloadCounter, statusWindow, error, statusMessage, statusProgress, fetchCanceled, fetchRotation
From RenderLifecycleMixin: canvasDrawn, paintCount, currentRenderingBackend, renderTick, renderError, offScreen
From RegionTooLargeMixin: forceLoadTrack, byteEstimate, gateMeasuredViewportKey
Getters
| Member | Description |
|---|---|
hostRegionHost |
The view this display reads regions, viewport and scale from; see containingHost. |
canvasWidthPxnumber |
The CSS width of this display's on-screen canvas, in px; see trackCanvasWidthPx. |
settledSubPixelBinBpnumber |
Genomic bp one cell of a per-base pass stands for at the settled zoom: subPixelBinBp off the host's throttled coarseBpPerPx, and 1 until the view initializes. A per-base encode or fetch reads this rather than the live zoom so a wheel tick does not redo every region. |
canRenderboolean |
RenderLifecycleMixin's hook: the view has initialized. |
rendersCanvasboolean |
RenderLifecycleMixin's hook: a display that will not fetch shows a placeholder where its canvas would be. |
trackVisibleRegionsVisibleRegion[] |
The visible blocks on the track's own assemblies, the ones this display fetches and is judged against. A view of several genomes leaves a single-genome track's other regions blank. |
viewportWithinLoadedDataboolean |
Every visible block lies within a fetched region, so the viewport shows loaded data rather than the fringe a pan or zoom-out leaves. Spatial only: whether held data is still what a fetch would bring back is isCacheValid, which the export gate reads and the scrim must not, or the overlay would rise on every zoom. |
viewportEmptyboolean |
No content block is on screen, so there is nothing to fetch or paint; see viewportEmpty.ts. |
fetchSuspendedboolean |
Overridable hook (default false), read by the fetch plan: the display draws a stand-in and wants no fetch meanwhile, as CoarseTierMixin does while MAF's summary tier stands in. Not fetchInert, which also drops the scrim and ends the export wait while the stand-in still has to load. |
layoutReadyboolean |
Overridable hook (default false): a searchable feature layout exists. A display with searchFeatureByID must override it, so callers can tell "laid out, but off-display" from "no layout yet". False by default so a missing override drops overlays rather than pinning them to an edge. |
dataSupersededboolean |
Overridable hook (default false): the held data covers the viewport but a fetch input has moved past it in a way the key cannot see, so it is about to be refetched. Both the export gate (dataCurrent) and the scrim (displayPhase) read it. Only an inevitable change belongs here, since a true that never clears hangs the export; and never restate the stamp-versus-zoomFetchArgs compare, which isCacheValid already makes. Cases and rules: DISPLAY_KIT.md, "dataSuperseded covers what fetchInputs cannot state". |
fetchHeldboolean |
A user cancel or an error, both of which the fetch plan skips on. |
renderBlocksRenderBlock[] |
The blocks the canvas draws; one displayed region may make several, sharing a GPU buffer under different scissor clips. Override to return [] to suppress drawing, which clears the canvas. |
fetchInputsFetchInputs |
What a fetch issued now would stamp on a region: the settings tier (settingsFetchInputs) and the zoom tier (zoomFetchArgs()). fetchRegions captures it at issue; isCacheValid compares against it. |
regionPayloadsReadonlyMap<number, unknown> |
The store's payloads, keyed by displayedRegionIndex. A display narrows it once (get rpcDataMap() { return self.regionPayloads as ReadonlyMap<number, MyResult> }). The Map keeps its identity between store changes only while something observes it; the render lifecycle's upload autorun does for every display that draws (DISPLAY_KIT.md, "A hit test's index needs an observer"). |
hasRegionDataboolean |
At least one region's payload is in the store. The first-paint gate reads it, so a frame before any data cannot flip canvasDrawn. |
staleSettingsDrawnboolean |
A visible block's data was fetched under settings that have since moved, and is drawn until its refetch lands: the scrim's third staleness term. It compares the settings tier alone, so a zoom never raises it. |
dataCurrentboolean |
The held data is what a fetch now would bring back for every visible block: covered, non-empty, isCacheValid per block, and not dataSuperseded. The export gate reads it; the scrim does not take isCacheValid, which would raise it on every zoom. It cannot latch, because the planner reads the same isCacheValid tracked and refetches any block it fails. |
loadedAssemblyAssembly | undefined |
The assembly the loaded data is on, read off the first loaded region, and undefined until its refName aliases load: before then getCanonicalRefName2 and refNameToIndex answer wrongly rather than throw, so the caller writes its fallback. |
phaseViewportCurrentboolean |
The loading scrim's staleness argument: spatial coverage, not dataSuperseded, not staleSettingsDrawn. displayPhase and coarseTierDisplayPhase both read it. |
svgReadyboolean |
An SVG export can read this display's data; off-screen renderers wait on it through awaitSvgReady(model). See foundationSvgReady. |
paintInertboolean |
RenderLifecycleMixin's paintInert hook; see foundationPaintInert. Overridable for a further inert state. |
paintSupersededboolean |
RenderLifecycleMixin's hook: painted reads pending over a canvas drawn under the previous settings until the refetch lands. |
displayPhaseDisplayPhase |
The display's visual state, mapped by foundationDisplayPhase from this family's staleness argument, phaseViewportCurrent, passed as a thunk so a display that is not loading skips the viewport reads. Customize it through fetchInert, never by overriding it. |
28 inherited getters from 3 models
From FetchMixin: isLoading, isLoadingOrCanceled, fetchInert, awaitingPrerequisite, awaitingDependentData, settingsFetchInputs
From RenderLifecycleMixin: painted
From RegionTooLargeMixin: gateEnabled, byteGateAdapterConfig, densityTooLarge, byteGateAdapterPath, adapterFetchSizeLimit, gateViewportSpanBp, gateViewport, configuredFetchSizeLimit, configForceLoad, aboveForceLoadFloor, gateExempt, estimatedFetchBytes, gateByteLimit, gateActive, gateMeasurementStale, densityGateActive, tooLargeStatus, regionTooLarge, regionTooLargeReason, zoomCanReleaseGate, gateSkipsMeasuredViewport
Methods
| Member | Description |
|---|---|
regionHasData(displayedRegionIndex: number) => boolean |
Overridable hook: whether the display can draw what this region holds at the view's zoom. The default checks the stored payload against its zoomRange where the adapter declared one (BaseFeatureDataAdapter.getZoomRange). Override it where several held payloads compete, as MAF's summary and detail tiers do. A view, so its reads are dependencies of FetchVisibleRegions. |
isCacheValid(displayedRegionIndex: number) => boolean |
Whether the data held for a region still answers the current view: regionHasData, and the region's stamp equal to fetchInputs. Not a hook; a display states its rule through zoomFetchArgs and regionHasData. |
2 inherited methods from one model
Actions
| Member | Description |
|---|---|
| setLoadedRegion |
The raw write behind ctx.commitRegion, for tests staging a loaded display; a fetch commits through the context, which takes no span (see RegionFetchContext). It replaces the whole record, so the payload is named on every call. fetchInputs defaults to the key now, which is wrong for a caller resuming after an await. |
evictRegionStore(keep: ReadonlySet<number>) => void |
Once the store is over MAX_STORED_REGIONS, drop entries outside keep (the buffered viewport), oldest first. |
dropLoadedRegion(displayedRegionIndex: number) => void |
Forget one region, as evictRegionStore does past its cap. Tests use it to stage an evicted region. |
clearDisplaySpecificData() => void |
Overridable hook (no-op base): drop what this display holds beside the store. Called by clearAllRpcData: on a displayed-regions change and reload(). |
clearSettingsBakedData() => void |
Overridable hook (no-op base): drop what is wrong, not merely stale, under a changed setting, such as a payload whose shape the setting decides. Called by invalidateSettings; everything else stays drawn under the scrim until the refetch lands (ADR-006). |
lapseHeldFetch() => void |
FetchMixin's lapse, clearing the error with the cancel: the fetch plan skips on either, so the fetch autorun then asks for only what never landed. |
clearAllRpcData() => void |
Full reset: cancel the fetch and clear the error, loadedRegions, display-specific data and the canvas-drawn flag. The too-large verdict is derived, so it needs no clear. |
invalidateSettings() => void |
SettingsInvalidate's reset: supersede the in-flight fetch, clear a blocking error or cancel, and drop settings-baked data. loadedRegions stays, drawn under the scrim, since every held region already fails isCacheValid and is refetched. |
reload() => void |
FetchMixin.reload plus the full reset. An override chains to it, or the retry contract check goes off for that display. |
fetchNeeded(_needed: IndexedRegion[]) => void |
Overridable hook (no-op base): call one of the runners in fetchEachRegion.ts: fetchEachRegion (one RPC per region), fetchAllRegions (one per genome) or fetchRegionsBatched (one RPC, one payload for all). |
| fetchRegions |
Run a per-region fetch, called by the runners in fetchEachRegion.ts. work calls ctx.commitRegion as it stores each payload, which marks the region loaded under the span this fetch issued and the fetchInputs captured here at issue, never re-read after the await. |
afterAttach() => void |
Installs the fetch-lifecycle autoruns (DisplayedRegionsChange, FetchVisibleRegions, SettingsInvalidate, ClearBlockingStateOnViewportChange). |
22 inherited actions from 3 models
From FetchMixin: setError, setStatusMessage, stopActiveFetch, openStatusStream, cancelFetch, cancelFetchByUser, beforeDestroy, beginFetch, endFetch, runFetch
From RenderLifecycleMixin: markCanvasDrawn, resetCanvasDrawn, stopRenderingBackend, renderNow, setOffScreen, setRenderError, attachRenderingBackend
From RegionTooLargeMixin: clearByteEstimate, clearGateMeasurements, setForceLoadTrack, commitFetchBytes, forceLoad
Related links
- Developer guide: Pluggable elements