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 |
followUnalignedfollowUnaligned: false | The follow found no alignment over the anchor row's window on its last pass, so the other rows are holding position. What the header's follow button reports; without it the rows simply stop tracking, which is the same picture as a broken follow. Volatile because it describes the current window, not the session. | LinearComparativeView |
followApproximatefollowApproximate: false | The follow placed a row by mapping the anchor window proportionally rather than by walking a CIGAR, so its position is close but not base-exact — a window wider than one alignment, or a tier carrying no CIGAR. What the header's follow tooltip reports; nothing else in the view distinguishes the two. | LinearComparativeView |
followPartialfollowPartial: undefined as FollowPartialReport | undefined | The follow had a multi-contig answer and refused it: placing a row on two regions that are not neighbours in its layout puts every contig between them on screen too, and past a point that is nearly all of what the reader is looking at. The rows are on one of the anchor's regions instead, and this names it and the ones whose answers are therefore off screen — enough for the header to say which region to scroll onto to see those instead. Read only by the header's follow tooltip. | 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 |
|---|---|---|
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 |
allSyntenyDisplaysany[] | 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 |
Methods
| Member | Description |
|---|---|
isViewCompact(idx: number) => boolean | |
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[] | items for the "Show..." submenu in the header. overridden by subclasses to add view-specific toggle options |
() => MenuItem[] | |
() => { label: string; onClick: () => void; }[] |
Actions
| Member | Description | Defined by |
|---|---|---|
setFollowUnaligned(arg: boolean) => 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. 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 |
setFollowApproximate(arg: boolean) => void | Same terms as setFollowUnaligned above: written by the autorun, read only by the header. | LinearComparativeView |
setFollowPartial(arg: FollowPartialReport | undefined) => void | Same terms again: written by the autorun, read only by the header. | 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 |
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. | LinearComparativeView |
setFollowAnchorIndex(idx: number) => void | LinearComparativeView | |
setFollowMatchOrientation(arg: boolean) => void | LinearComparativeView | |
setScrollZoom(arg: boolean) => void | LinearComparativeView | |
activateTrackSelector(level: number) => Widget | LinearComparativeView | |
toggleTrack(trackId: string, level?: any) => any | 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 |
hideTrack(trackId: string, level?: any) => void | LinearComparativeView | |
squareView() => void | 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 | |
toggleCompactView(idx: number) => void | LinearComparativeView | |
compactAllViews() => void | LinearComparativeView | |
expandAllViews() => void | 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. | 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