LinearSyntenyViewHelper
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Provided by the linear-comparative-view plugin. View source.
Holds one level of a linear synteny comparison: its track list and height, composed with the shared rendering-lifecycle state.
Nested in LinearSyntenyView.levels, never in session.views: it is a track
container, not a view, and satisfies core's TrackContainer so the
track-selector and add-track widgets can write into it via the parent view's
trackContainerFor. The LinearSyntenyViewHelper name and type literal are
kept only because saved sessions persist them.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description |
|---|---|
idid: ElementId | |
typetype: 'LinearSyntenyViewHelper' | |
| tracks | |
heightheight: types.stripDefault(types.number, 100) |
Volatiles
| Member | Description | Defined by |
|---|---|---|
canvasDrawncanvasDrawn: false | flips true on first paint; read by test selectors to detect render | RenderLifecycleMixin |
paintCountpaintCount: 0 | bumped after every frame the backend painted, so a consumer that reads this display's canvas — the circular view's ring, which copies the strip into a texture — knows when the pixels moved | RenderLifecycleMixin |
currentRenderingBackendcurrentRenderingBackend: undefined | current backend reference, updated on context-loss recovery. Typed unknown (not generic B) on purpose: this mixin is composed by every display via a non-generic factory, so the per-display backend type B isn't known here — it's supplied at attachRenderingBackend<B> and narrowed with as B inside the autoruns. Don't "fix" the cast. | RenderLifecycleMixin |
renderTickrenderTick: 0 | counter the render autorun observes; bumped to force a re-render | RenderLifecycleMixin |
autorunsInstalledautorunsInstalled: false | guards attachRenderingBackend so the autorun pair spawns once per instance | RenderLifecycleMixin |
renderErrorrenderError: undefined | the render-backend (GPU/Canvas2D init or context-loss) error, or undefined. Single source of truth for the render-error terminal state: useRenderingBackend writes it from the canvas-init mechanism so the model — not React-local hook state — owns every terminal state. Read by displayPhase (whose renderError term outranks loading, suppressing the scrim) and by DisplayChrome (shows the retry overlay). | RenderLifecycleMixin |
Getters
| Member | Description | Defined by |
|---|---|---|
parentViewParentViewDuck | LinearSyntenyViewHelper | |
levelnumber | this level's place in the stack, and so which rows it draws between | LinearSyntenyViewHelper |
rowPairRowPair | undefined | The two rows this level draws between — the upper one is the query axis — or undefined for a level with no row below it. Ungated: whether those rows are ready to draw is connectedRows' question. | LinearSyntenyViewHelper |
connectedRowsRowPair | undefined | rowPair once both rows are initialized with regions, which is also when the view has a width to draw at. Gated on those two rows alone, so a row loading or failed elsewhere in the stack holds back only the bands beside it. The one gate the band's canvas and its displays' fetch share. | LinearSyntenyViewHelper |
assemblyNamesstring[] | the assemblies of rowPair, or [] without one | LinearSyntenyViewHelper |
linearSyntenyDisplaysLinearSyntenyDisplayModel[] | All synteny displays under this level's tracks. | LinearSyntenyViewHelper |
bandTransformKeystring | Every number that moves a ribbon under a stationary cursor — each connected row's offsetPx and bpPerPx, plus the band height — as one key, which installClearHoverOnSurfaceMove watches. Empty until both rows are there, which no viewport can produce. | LinearSyntenyViewHelper |
displayErrorstring | undefined | Every failed track's error in this level, joined into the one value the band has room to report. On-screen only — an SVG export has nowhere to float a banner, so it fails outright from awaitSvgReady. | LinearSyntenyViewHelper |
surfaceReadinessComparativeSurface | This level's band as the displays drawing onto it see it: first paint, plus the parent-view flags that mean what is on screen is not the answer yet. displayPhase and settled are both computed from it. | LinearSyntenyViewHelper |
displayPhaseDisplayStatusPhase | What the shared canvas publishes as data-display-phase: the ranking over the ribbons drawing onto it. settled below is the stricter question — see comparativeReadiness. | LinearSyntenyViewHelper |
settledboolean | The canvas has painted and no display is still fetching, so what is on screen is final. Drives synteny_canvas's data-display-drawn, which screenshot capture and the browser suites wait on — so it means "done", not "first paint". comparativeReadiness says why an error answers this and "is every display finished" differently. | LinearSyntenyViewHelper |
syntenyCellsMap<number, SyntenyCell> | Every cell the band's backend holds bytes for, in draw order: each display's ribbons, then its outline while a ribbon of it is selected. The upload autorun diffs this map — new entries upload, vanished entries evict — and the wrappers are the displays' own, so a refetch on one track re-uploads only that track. | LinearSyntenyViewHelper |
ribbonGeometryByDisplayKeyMap<number, SyntenyInstanceData> | Each track's ribbon geometry, in draw order — what the pick walks. The outline cells are left out: an outline is the selection's own silhouette, drawn over the ribbon it traces. | LinearSyntenyViewHelper |
syntenyBlocksRenderBlock[] | One canvas-wide block per cell, so a ribbon's outline draws over its own fill and a later track over an earlier one. | LinearSyntenyViewHelper |
syntenyRenderStateSyntenyRenderState | Aggregated per-frame render state, always resolved — "the view isn't measured yet" is canRender's precondition. An empty perTrack is a real frame rather than a skip: the frame clears before drawing, so painting zero tracks is what drops a hidden track's ribbons. | LinearSyntenyViewHelper |
groundColorstring | The band's ground — see bandGroundColor, which is the decision. Read here so the level's clear, its ribbons, its off-screen-mate strip and its SVG export all take it from one place. | LinearSyntenyViewHelper |
offscreenMateStripsOffscreenMateStrip[] | The off-screen mate strips this band draws, hit-tests and exports: one computed value for the overlay, the pointer handlers, the tooltip and the SVG export. | LinearSyntenyViewHelper |
hoveringFeatureboolean | The pointer is over a ribbon somewhere in this band. Drives the canvas cursor, which is the only thing that says a ribbon can be clicked at all — the hover shading is subtle at the default 0.2 opacity. | LinearSyntenyViewHelper |
canRenderboolean | Render-lifecycle precondition, overriding RenderLifecycleMixin's default-true hook: the render callback sizes the canvas off parentView.width, and a paint before both rows are up would mark the band drawn over ribbons that have not started to fetch. | LinearSyntenyViewHelper |
paintInertboolean | Overrides RenderLifecycleMixin's hook: a band with no synteny track on it paints its ground this tick and nothing is coming, so it has finished rather than being pending. renderBlocks answers "did content reach the canvas" off the blocks it drew, which is the right answer for a track still fetching and the wrong one for a band with nothing to draw on it.connectedRows is the other half: a band whose rows are not up has no tracks either and is not finished. This family carries a second guard one layer up — ComparativeSurface.initPending, for the level that exists from the moment its rows do while init adds its tracks several awaits later — but that one is about the init blob, not about the rows, so it does not stand in for this. | LinearSyntenyViewHelper |
rendersCanvasboolean | Overridable hook (default true): whether this display paints a canvas in its current configuration, as opposed to a deliberate static placeholder (LD with the triangle off, sequence past base resolution — both render a message where the <canvas> would go, so canvasRef is never called and canvasDrawn can never flip).Lives here, beside canvasDrawn, because every consumer of "has this display painted" needs the pair. Both LGV fetch foundations fill it with !fetchInert, so a display there states its placeholder once, through that hook; the raw default reaches only a display composing this mixin outside them. See painted below for the reader that was missed while the two were separate overrides. | RenderLifecycleMixin |
paintSupersededboolean | Overridable hook (default false): what is on the canvas was painted from data a later change has made wrong, so painted below should answer pending until the repaint lands even though canvasDrawn is still true. The per-region fetch foundation fills it with staleSettingsDrawn — held data drawn under settings that have since moved — which is the state clearAllRpcData used to express by resetting canvasDrawn on every settings change, blanking the display to do it. A capture waiting on data-display-drawn then waits for the refetch rather than snapshotting the previous setting's pixels.A hook and not a reset of the flag, because the flag is re-marked by any redraw — a pan between the settings change and the refetch would report the stale canvas drawn — and a derivation cannot be raced. | RenderLifecycleMixin |
paintedboolean | The first-paint answer every consumer outside the display should read, canvasDrawn being only the raw flag: a display that is deliberately not painting a canvas has finished, and reporting it unfinished leaves every waiter on it waiting forever.The two rendersCanvas: false states each had three of their four consumers wired by hand — the loading scrim (rendersCanvas / fetchInert) and the SVG export (fetchInert) — while the fourth, data-display-drawn, went on publishing "false" forever off the raw flag. That attribute is what PENDING_DISPLAYS (@jbrowse/browser-test-utils) selects on, so a zoomed-out reference sequence track made every waitForDisplaysDone on the page run to its full timeout, and that wait swallows its own timeout without reporting it. fetchInert on the comparative side has the same problem: the forgotten reader is the one outside the display, so the display has to publish one name for it.paintInert is the third term and the same argument once more, for the state where a display would paint a canvas and never gets to — a fetch that failed before first paint. paintSuperseded is the fourth, and the one that subtracts: a canvas painted from data a settings change has made wrong is drawn and not finished. See both hooks. | RenderLifecycleMixin |
Methods
| Member | Description |
|---|---|
displayFor(key: number) => LinearSyntenyDisplayModel | undefined | The display a pick hit belongs to. |
offscreenMateDestination(hit: OffscreenMateHit) => MateNavDestination | undefined | Where a click on a mark would send its row, which the hover prints as the click's promise; undefined for a row the stack no longer has. |
pickFeatureAt(x: number, y: number) => SyntenyPickResult | undefined | The ribbon under a canvas-relative point, topmost first — the band's hover, click and context menu all ask this. CPU picking rather than a GPU id buffer: ADR-019. |
Actions
| Member | Description | Defined by |
|---|---|---|
setHeight(n: number) => void | LinearSyntenyViewHelper | |
resizeHeight(distance: number) => void | Drag this band taller or shorter, clamped like every other band drag: the floor keeps the bar itself grabbable, and a band already thinner than the floor stays where it is rather than jumping up to it. The stack-wide drag (resizeAllLevelHeights) is this, per level, so the clamp is stated once. | LinearSyntenyViewHelper |
| showTrack | LinearSyntenyViewHelper | |
hideTrack(trackId: string) => boolean | LinearSyntenyViewHelper | |
toggleTrack(trackId: string) => boolean | LinearSyntenyViewHelper | |
| launchTrack | showTrack for a track whose display state model may be lazily loaded: loads it, then shows | LinearSyntenyViewHelper |
launchToggleTrack(trackId: string) => Promise<boolean> | toggleTrack with launchTrack's loading behavior | LinearSyntenyViewHelper |
| setHoveredFeature | LinearSyntenyViewHelper | |
| setClickedFeature | Clicked-state twin of setHoveredFeature. | LinearSyntenyViewHelper |
showOffscreenMateContig(hit: OffscreenMateHit) => void | What clicking a mark does: show where its alignments land on the facing row. The row scrolls to them, or gains the contig or a slice of it, and never loses a region it was showing. The click takes the follow anchor, and the Undo gives back the anchor and every row's viewport together. | LinearSyntenyViewHelper |
startRenderingBackend(backend: SyntenyRenderingBackend) => void | LinearSyntenyViewHelper | |
markCanvasDrawn() => void | RenderLifecycleMixin | |
resetCanvasDrawn() => void | RenderLifecycleMixin | |
stopRenderingBackend() => void | RenderLifecycleMixin | |
renderNow() => void | RenderLifecycleMixin | |
setRenderError(error: unknown) => void | set/clear the render-backend error. Called by useRenderingBackend: with the error when the canvas factory rejects (or context-loss re-init fails), and with undefined on successful (re)init and on retry. | RenderLifecycleMixin |
| attachRenderingBackend | attach a GPU/Canvas2D backend and install the upload + render autorun pair. Idempotent: re-calling swaps the backend and does not run setup again, so the callbacks and everything they close over are the first call's. | RenderLifecycleMixin |