LinearComparativeView
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.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
idid: ElementId | LinearComparativeView | |
typetype: types.string | Abstract base: never registered or instantiated standalone, always composed into a concrete subclass (e.g. LinearSyntenyView) that overrides type with its own literal. Kept as types.string rather than a literal so subclass models stay assignable to this base type. | LinearComparativeView |
| trackSelectorType | vestigial: the hierarchical selector is the only one that exists, so this value is ignored. Retained because saved sessions and configs persist it. | LinearComparativeView |
linkViewslinkViews: types.stripDefault(types.boolean, false) | sync scroll and zoom across the genome rows, so panning one pans them all | LinearComparativeView |
followSyntenyfollowSynteny: types.stripDefault(types.boolean, false) | Move the non-anchor genome rows to whatever region aligns to the anchor row, re-resolved through the synteny data each time the anchor settles. The synteny-aware alternative to linkViews, which locks the rows in PIXELS and so drifts apart as soon as an indel accumulates — the two are mutually exclusive (see setRowSyncMode). | LinearComparativeView |
sameScalesameScale: types.stripDefault(types.boolean, false) | Hold every genome row on one bp/px — the coarsest row's fit — so the rows compare by drawn length instead of all filling their pane. A mode rather than a one-shot zoom because it is the rows' zoom-out LIMIT it moves (sharedFit), and a limit has to still be there on the next wheel tick. | LinearComparativeView |
followAnchorIndexfollowAnchorIndex: types.stripDefault(types.number, 0) | Which genome row drives the others while followSynteny is on. Every other row is placed by mapping this one's window outward one level at a time. Clamped to the views array by reconcileLevels. | LinearComparativeView |
followMatchOrientationfollowMatchOrientation: types.stripDefault(types.boolean, false) | While following, flip a row whose placing alignment runs the other way from the anchor's, so the two pan in the same direction. Off by default: the crossing ribbons are the picture of an inversion, and a row turning round under the reader is the loudest thing one can do. | LinearComparativeView |
levelslevels: types.array(LinearSyntenyLevel) | One synteny band per adjacent pair of views. Each holds its own track list, which is why the track-selector and add-track widgets address them through trackContainerFor — a level is not a view and cannot be the target of their view reference. | LinearComparativeView |
| views | N genome rows, with N-1 synteny levels between adjacent pairs. The views/levels invariant is maintained by reconcileLevels(). | LinearComparativeView |
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 |
|---|---|---|
widthwidth: undefined as number | undefined | LinearComparativeView | |
volatileErrorvolatileError: undefined as unknown | View-level failure (e.g. an init block that couldn't be applied). Volatile on purpose: a reload re-runs the init autorun from a clean slate, so a transient failure stays recoverable. | LinearComparativeView |
followReportfollowReport: EMPTY_FOLLOW_REPORT | What the follow's last settled pass has to say about itself, for the header's follow button: whether the rows are holding because nothing aligns under the anchor, whether a row was placed proportionally rather than by a CIGAR walk, whether a level has no synteny track to follow by, and which multi-contig answer was refused as mostly filler (naming the region followed and the ones whose answers are off screen). Without it a holding row is the same picture as a broken follow. Volatile because it describes the current window, not the session. | LinearComparativeView |
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 |
|---|---|---|
followUnalignedboolean | nothing aligns under the anchor's window, so the other rows are holding | LinearComparativeView |
followApproximateboolean | a row was placed proportionally rather than by a CIGAR walk | LinearComparativeView |
followPartialFollowPartialReport | undefined | the multi-contig answer refused as mostly filler, naming the region followed and the ones whose answers are off screen | LinearComparativeView |
scrollZoomboolean | scroll-to-zoom is a global, personal preference resolved from the session; toggling it in any view applies everywhere | LinearComparativeView |
initializedboolean | LinearComparativeView | |
errorunknown | LinearComparativeView | |
assemblyNamesstring[] | LinearComparativeView | |
SharedFit | The zoom-out limit every row shares while sameScale is on, and whether it can be answered at all. Each row PULLS this back through its own maxBpPerPx (sharedScaleContainerOf finds this view by the presence of this getter), so nothing here is copied onto the rows and nothing can go stale between a resize and the next layout. The dotplot's lockAspectRatio derives the same quantity the same way.The rule, and why the unanswered state is not a zero, are in sharedFit.ts. | LinearComparativeView |
allSyntenyDisplaysLinearSyntenyDisplayModel[] | Every synteny display across every level, flattened. One memoized getter for the view-wide aggregates that would otherwise each re-flatten the levels. | LinearComparativeView |
followPairs{…}[] | Each synteny level resolved into the pair of rows a follow would move it between: which row stays, which row moves, which axis the anchor window is read off, and the assembly naming the level's lane of an all-vs-all track. Levels whose rows are not both initialized are dropped, since there is nothing to place yet. A getter rather than a loop in each caller because the follow reads it from TWO autoruns — the exact one and the per-frame one — which had each resolved the direction, looked the two rows up and repeated the initialized guard. Those are the same question, and the answer changes only when the rows or the anchor do. ORDERED OUTWARD FROM THE ANCHOR rather than by level index, which is what makes a stack of three or more settle in one pass: a level's staying row is either the anchor or a row some nearer level places, so visiting them nearest-first means every level reads an input the same pass has already written. In level order that only holds when the anchor is the top row. | LinearComparativeView |
syntenyWarningsComparativeWarning[] | Data-quality warnings raised by every synteny display, e.g. a reversed assembly row order. What the header's warning button counts. | LinearComparativeView |
trackWarningsTrackWarning[] | The same warnings grouped under the track that raised each, which is what the dialog reports. A stacked view's levels raise swappedAssembliesWarning verbatim, and so does every overlaid track that hits it, so the flat list above was N identical rows with nothing to tell the user which file to go fix. Shared with the dotplot's table so the two reports say the same thing. | LinearComparativeView |
trackContainersTrackContainer[] | The same track lists, for a reader with no id to ask with. This view has no tracks of its own, so anything walking a session for displays — AppReadyMarker, the capture harness's busy probe — sees an empty view and reports a still-fetching synteny stack as idle unless it asks here too. | LinearComparativeView |
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 |
ownTracksAbstractTrackModel[] | Every track open on this view itself: its own tracks array plus any track containers it owns instead (the synteny view keeps one list per band on trackContainers and its own tracks empty). Tracks on nested views are allTracks's, not this getter's. | BaseViewModel |
allViewsAbstractViewModel[] | This view and every view nested inside it, to any depth — a synteny stack's genome rows, a breakpoint split view's panels. Each view answers for its own children, so a consumer never walks the nesting itself: before this getter, four consumers each carried a copy of the walk and two of them had drifted (one read levels, one read trackContainers, and each was blind to the other's spelling). | BaseViewModel |
allTracksAbstractTrackModel[] | Every track open on this view or any view nested inside it. | BaseViewModel |
Methods
| Member | Description |
|---|---|
trackContainerFor(id: string) => TrackContainer | undefined | The level that owns a given track list. This view holds one track list per synteny band rather than one of its own, so the track-selector and add-track widgets target a level through here instead of referencing this view directly. By id, not index: reconcileLevels pops levels when a genome row is removed, and an index would silently retarget a different pair. |
() => MenuItem[] | The view header's own hamburger, overridden by subclasses. A SEPARATE list from menuItems(), not a subset of it: that one is what the app menubar shows for any view, this one is what the view's own header offers, and a subclass fills them independently. |
() => MenuItem[] | |
() => { label: string; onClick: () => void; }[] |
Actions
| Member | Description | Defined by |
|---|---|---|
setFollowReport(report: Partial<FollowReport>) => void | Written by the follow's autorun and read only by the header, which is what keeps it from being a dependency of the very pass that writes it. A partial report merges, since a settled resolve can only raise a flag the plan could not see. In THIS block, ahead of afterAttach, rather than with the other follow actions below: a later block's actions are not on the self an earlier one sees, so anything afterAttach calls has to be declared before it — the same reason reconcileLevels is here. | LinearComparativeView |
setRowSyncMode(mode: "follow" | "independent" | "link") => void | The one way the UI changes how the rows track each other, so the two flags can't both be on. They fight if they are: linkViews replays the anchor's own scroll/zoom onto every row, which is precisely the pixel lock the follow then has to undo on the next settle, and the moving row visibly jumps twice.Here rather than beside setLinkViews for the reason above setFollowReport: the follow's own snackbar offers this as the way out of a row it moved back, so afterAttach's installSyntenyFollow has to see it on self. | LinearComparativeView |
setFollowAnchorIndex(idx: number) => void | Same terms as setRowSyncMode above, and offered beside it in that same snackbar: which row drives is otherwise a submenu away. | LinearComparativeView |
holdFollowAnchor<T>(fn: () => T) => T | Run a navigation of a row as the follow's own placement rather than as a gesture. While following, a gesture on any row makes that row the anchor, and the follow tells a gesture from its own work by root action alone: whatever fn navigates is a NESTED action of this one. The follow's passes and the explicit moves that take the anchor run their navigations through here. | LinearComparativeView |
reconcileLevels() => void | Reconcile the levels array to the views array: exactly one synteny level per gap between adjacent views (N views -> N-1 levels). Grows or shrinks from the end, preserving existing levels and their tracks. The single source of truth for the views/levels invariant. | LinearComparativeView |
setWidth(newWidth: number) => void | LinearComparativeView | |
setError(e: unknown) => void | LinearComparativeView | |
| setViews | LinearComparativeView | |
| addView | Push a new genome row. The new trailing level starts with no synteny tracks. | LinearComparativeView |
removeLastRow() => void | Drop the bottom genome row and its synteny level. Only terminal removal is supported: a level's level index addresses views[level]/[level+1], so removing a middle row would require reindexing every level below it. Growth and shrinkage both happen at the end of the chain. | LinearComparativeView |
setLinkViews(arg: boolean) => void | Kept for the plugin ABI; setRowSyncMode is what the UI calls. It still has to drop the follow, since the exclusion below is a property of the two flags rather than of the action that happens to set them. | LinearComparativeView |
setFollowMatchOrientation(arg: boolean) => void | LinearComparativeView | |
setScrollZoom(arg: boolean) => void | LinearComparativeView | |
activateTrackSelector(level: number) => Widget | LinearComparativeView | |
toggleTrack(trackId: string, level?: any) => boolean | LinearComparativeView | |
| showTrack | No-op for a level that doesn't exist, matching hideTrack/toggleTrack. reconcileLevels already materializes exactly one level per adjacent view pair, so a missing level means the caller named a gap that has no views (e.g. an init.tracks with more levels than init.views has gaps); creating one here would append a level whose views[level+1] is absent, which renders nothing and silently breaks the views/levels invariant. | LinearComparativeView |
| launchTrack | showTrack for a track whose display state model may be lazily loaded: loads it, then shows | LinearComparativeView |
hideTrack(trackId: string, level?: any) => void | LinearComparativeView | |
squareView() => void | Every row onto the rows' average bp/px, each staying where it is.zoomTo anchors at the row's centre — the same call applySharedScale below makes, and the same thing this used to spell as pxToBp at the midpoint, setNewView, and centerAt back onto that base. That spelling scrolled to the row's OLD pixel offset in between, which centerAt then undid; a row whose midpoint resolved to no refName (scrolled past its regions) kept it, and was left at the new scale on the old offset. | LinearComparativeView |
showAllRegionsAcrossRows(sameScale: boolean) => void | Every row onto its whole assembly, and the one choice about it: leave them all on ONE bp/px — the coarsest row's fit, so the largest genome fills its pane and every other row is drawn shorter in proportion to its size — or hand each row its own fit, so each fills its own pane. That difference is the point of offering the choice: rows fit individually to width all end up the same length, which silently stretches a small genome to look like a large one and misaligns every ribbon between them by the ratio. Distinct from squareView, which averages the rows' current scales (the average fits nobody, and each row's own zoom clamp pulls the small ones back to fit-to-width anyway). ONE ACTION FOR BOTH, because the menu offers them as one radio and a reader reads them as one sentence with one word changed. Written as two bodies they drifted: the same-scale half took its scale off whatever region subset a row happened to be displaying while the other half reset the rows first, so the pair was not a pair — switching between them did not land back where it started. sameScale LATCHES rather than firing once, because the shared scale is coarser than a small row's own fit: without the raised ceiling the first wheel tick or setDisplayedRegions clamps that row straight back to fit-to-width and the comparison is gone. | LinearComparativeView |
setSameScale(sameScale: boolean) => void | LinearComparativeView | |
() => void | Latch the mode and zoom every row onto the scale it implies, without touching any row's regions or its centre — init names a loc per row, and both a region reset and a re-centre would throw that away. zoomTo anchors at the centre, which is the difference. | LinearComparativeView |
clearView() => void | LinearComparativeView | |
compactAllViews() => void | LinearComparativeView | |
expandAllViews() => void | LinearComparativeView | |
resizeAllLevelHeights(distance: number) => void | Resize every synteny band by the same delta. The bars between the rows size the STACK: a multi-way view is read as one picture, and sizing its gaps one at a time to match is the tedium the user actually hits — the levels keep whatever differences they already have, since this moves each by the same px rather than setting them all to one height. Each level clamps its own drag ( LinearSyntenyViewHelper.resizeHeight), which is also what one band's Alt-drag goes through — so the floor that keeps a bar grabbable is stated once, for both. | LinearComparativeView |
autoScaleLevelHeights() => void | LinearComparativeView | |
| appendRow | Append an assembly to the bottom of the stack and optionally show a synteny track on the new level connecting it to the previous bottom row. A synteny dataset is an edge between two adjacent assemblies, so rows are only ever added at the chain's end. The new row is created with a LinearGenomeView init — its own afterAttach autorun loads the assembly regions and navigates (whole genome, or loc when given), so we don't reimplement that imperatively here.Returns launchTrack's promise rather than awaiting it, so this action stays synchronous and keeps action context while a caller still has something to await. | LinearComparativeView |
setDisplayName(name: string) => void | 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