# LinearGenomeView

Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release —
see [pluggable elements](https://jbrowse.org/jb2-staging/docs/developer_guide/) for concepts. Provided by the
`linear-genome-view` plugin.
[View source](https://github.com/GMOD/jbrowse-components/blob/main/plugins/linear-genome-view/src/LinearGenomeView/model.ts).

## Example usage

A `LinearGenomeView` is what you hand-author under `defaultSession.views`. The
`init` shorthand fills in `displayedRegions`/`bpPerPx`/`offsetPx` for you:

```js
defaultSession: {
  name: 'My session',
  views: [
    {
      type: 'LinearGenomeView',
      // plain persisted props sit alongside init, not inside it
      colorByCDS: true,
      init: {
        assembly: 'hg38',
        loc: 'chr1:1,000,000-1,100,000',
        tracks: ['genes', 'alignments'],
      },
    },
  ],
}
```

`init` holds only keys that need on-attach resolution — also `tracklist`, `nav`,
`highlight` (see the `init` property below). Plain view props like `colorByCDS`,
`showAminoAcids`, `showCenterLine`, `trackLabels`, `showHighlightChips` are set
directly on the view (MST restores them natively). At runtime the same model is
driven imperatively — every property and action below is reachable on
`viewState.session.views[0]`:

```js
const view = viewState.session.views[0]
await view.navToLocString('chr1:2,000,000-2,100,000')
view.showTrack('alignments')
view.zoomTo(view.bpPerPx * 2) // zoom out 2x
```

Members a composed model contributes are listed here too, so these tables are
the whole surface.

## Properties

<!-- prettier-ignore -->
| Member | Description | Defined by |
| --- | --- | --- |
| <span id="property-id">**id**</span><br><code>id: ElementId</code> |  | LinearGenomeView |
| <span id="property-type">**type**</span><br><code>type: types.literal('LinearGenomeView') as unknown as string</code> | this is a string instead of the const literal 'LinearGenomeView' to reduce some typescripting strictness, but you should pass the string 'LinearGenomeView' to the model explicitly | LinearGenomeView |
| <span id="property-windowstartbp">**windowStartBp**</span><br><code>windowStartBp: types.stripDefault(types.number, 0)</code> | Left edge of the viewport, in linearized bp — the concatenated `displayedRegions` space that `offsetPx` indexes, which carries no inter-region padding, so the two differ only by `bpPerPx`. May be negative, which is the view scrolled past the left end.<br><br>The viewport is stored as the genomic WINDOW it frames rather than as the pixels that framed it, because pixels mean nothing without the width they were measured at and a snapshot does not carry one. Storing them anyway is why a session authored in a 1000px window used to open at 500px showing half the region its author was looking at, while the same location as a `&loc=` opened correctly — the two ways to share a view disagreed, and only the one that stores intent was right. | LinearGenomeView |
| <span id="property-windowwidthbp">**windowWidthBp**</span><br><code>windowWidthBp: types.stripDefault(types.number, 0)</code> | Width of the viewport in bp. Zero means "not established yet": no width has been measured, so there is nothing to divide by. The first measure fills it in, and `bpPerPx` is `windowWidthBp / width` from then on. | LinearGenomeView |
| <span id="property-legacybpperpx">**legacyBpPerPx**</span><br><code>legacyBpPerPx: types.stripDefault(types.number, 0)</code> | MIGRATION ONLY, and safe to delete once pre-window sessions are no longer in circulation.<br><br>A snapshot written before the window was stored carries `offsetPx` and `bpPerPx` but not the width they were measured at, so the window they framed cannot be recovered. `windowStartBp` can (it is `offsetPx * bpPerPx`, no width needed); the width in bp cannot. This carries the old `bpPerPx` to the first measure, which adopts it at whatever width arrives — exactly what the old code did — and clears this. So an old link keeps its old behavior rather than being reinterpreted, and everything authored since restores its window. | LinearGenomeView |
| <span id="property-displayedregions">**displayedRegions**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>displayedRegions: types.stripDefault(types.frozen&lt;Region[]&gt;(),…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>displayedRegions: types.stripDefault(types.frozen&lt;Region[]&gt;(), [])</code></pre></dialog></span> | currently displayed regions, can be a single chromosome, arbitrary subsections, or the entire set of chromosomes in the genome, but it not advised to use the entire set of chromosomes if your assembly is very fragmented | LinearGenomeView |
| <span id="property-tracks">**tracks**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>tracks: types.array( pluginManager.pluggableMstType('track', 's…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>tracks: types.array(&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pluginManager.pluggableMstType('track', 'stateModel'),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | array of currently displayed tracks state models instances | LinearGenomeView |
| <span id="property-hideheader">**hideHeader**</span><br><code>hideHeader: types.stripDefault(types.boolean, false)</code> | drop the header bar entirely — location box, navigation buttons and overview | LinearGenomeView |
| <span id="property-hideheaderoverview">**hideHeaderOverview**</span><br><code>hideHeaderOverview: types.stripDefault(types.boolean, false)</code> | keep the header, drop the whole-chromosome overview strip below it | LinearGenomeView |
| <span id="property-hidenotracksactive">**hideNoTracksActive**</span><br><code>hideNoTracksActive: types.stripDefault(types.boolean, false)</code> | suppress the "No tracks active" placeholder, for an embed that opens with no tracks on purpose | LinearGenomeView |
| <span id="property-trackselectortype">**trackSelectorType**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>trackSelectorType: types.stripDefault( types.enumeration(['hier…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>trackSelectorType: types.stripDefault(&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;types.enumeration(['hierarchical']),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'hierarchical',&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | vestigial: the hierarchical selector is the only one that exists, so this value is ignored. Retained because saved sessions and configs persist it. | LinearGenomeView |
| <span id="property-showcenterline">**showCenterLine**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>showCenterLine: types.optional(types.boolean, () =&gt; localStorag…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>showCenterLine: types.optional(types.boolean, () =&gt;&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;localStorageGetBoolean('lgv-showCenterLine', false),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | show the "center line" | LinearGenomeView |
| <span id="property-showcytobands">**showCytobands**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>showCytobands: types.optional(types.boolean, () =&gt; localStorage…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>showCytobands: types.optional(types.boolean, () =&gt;&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;localStorageGetBoolean('lgv-showCytobands', true),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | whether to show the "cytobands" in the overview scale bar (the resolved, capability-gated value is the `effectiveShowCytobands` getter) | LinearGenomeView |
| <span id="property-tracklabels">**trackLabels**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>trackLabels: types.optional( types.string, () =&gt; localStorageGe…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>trackLabels: types.optional(&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;types.string,&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;() =&gt; localStorageGetItem('lgv-trackLabels') ?? '',&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | how to display the track labels, can be "overlapping", "offset", or "hidden", or empty string "" (which results in the LinearGenomeViewPlugin config default being used). the resolved value is the `effectiveTrackLabels` getter. see LinearGenomeViewPlugin https://jbrowse.org/jb2/docs/config/lineargenomeviewplugin/ docs for how conf is used | LinearGenomeView |
| <span id="property-showgridlines">**showGridlines**</span><br><code>showGridlines: types.stripDefault(types.boolean, true)</code> | show the "gridlines" in the track area | LinearGenomeView |
| <span id="property-labelsvisible">**labelsVisible**</span><br><code>labelsVisible: types.stripDefault(types.boolean, true)</code> | controls whether highlight/bookmark chip labels are shown inline | LinearGenomeView |
| <span id="property-colorbycds">**colorByCDS**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>colorByCDS: types.optional(types.boolean, () =&gt; localStorageGet…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>colorByCDS: types.optional(types.boolean, () =&gt;&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;localStorageGetBoolean('lgv-colorByCDS', false),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | color CDS segments by reading frame | LinearGenomeView |
| <span id="property-showaminoacids">**showAminoAcids**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>showAminoAcids: types.optional(types.boolean, () =&gt; localStorag…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>showAminoAcids: types.optional(types.boolean, () =&gt;&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;localStorageGetBoolean('lgv-showAminoAcids', true),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | draw translated codons on coding features once zoomed in far enough: an alternating per-codon shading, and the amino acid letters on top of it at base-level zoom. Independent of `colorByCDS`, which only recolors the segments by frame. | LinearGenomeView |
| <span id="property-showtrackoutlines">**showTrackOutlines**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>showTrackOutlines: types.optional(types.boolean, () =&gt; localSto…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>showTrackOutlines: types.optional(types.boolean, () =&gt;&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;localStorageGetBoolean('lgv-showTrackOutlines', true),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | show the track outlines | LinearGenomeView |
| <span id="property-scalebaronly">**scalebarOnly**</span><br><code>scalebarOnly: types.stripDefault(types.boolean, false)</code> | when true, only the header and coordinate scalebar are rendered | LinearGenomeView |
| <span id="property-init">**init**</span><br><code>init: types.frozen&lt;InitState &#124; undefined&gt;()</code> | transient declarative launch spec: assembly + optional location, tracks, and highlights to apply once the view attaches. It is applied by the afterAttach autorun and then cleared (setInit(undefined)), so a saved session never retains it. Shared by all three launch surfaces — URL params, createViewState(), and session/config JSON. example: ```json { "assembly": "hg19", "loc": "chr1:1,000,000-2,000,000", "tracks": ["genes", "variants"] } ``` | LinearGenomeView |
| <span id="property-displayname">**displayName**</span><br><code>displayName: types.maybe(types.string)</code> | <span data-pagefind-ignore>displayName is displayed in the header of the view, or assembly names being used if none is specified</span> | [BaseViewModel](../baseviewmodel#property-displayname) |
| <span id="property-minimized">**minimized**</span><br><code>minimized: types.stripDefault(types.boolean, false)</code> | <span data-pagefind-ignore>collapse the view to its header bar, keeping it in the session rather than closing it</span> | [BaseViewModel](../baseviewmodel#property-minimized) |
| <span id="property-highlight">**highlight**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>highlight: types.stripDefault( types.array(types.frozen&lt;Highlig…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>highlight: types.stripDefault(&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;types.array(types.frozen&lt;HighlightType&gt;()),&#10;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[],&#10;&#160;&#160;&#160;&#160;&#160;&#160;)</code></pre></dialog></span> | <span data-pagefind-ignore>translucent highlight bands, seeded from URL params or session JSON and added interactively via the rubber-band menu</span> | [HighlightsMixin](../highlightsmixin#property-highlight) |
| <span id="property-showhighlightchips">**showHighlightChips**</span><br><code>showHighlightChips: types.stripDefault(types.boolean, false)</code> | <span data-pagefind-ignore>pins the interactive highlight chip (link icon + context menu) to every highlight band; off by default, where a band instead reveals its chip while the pointer is in it. This is what a screenshot needs, since nothing hovers in one</span> | [HighlightsMixin](../highlightsmixin#property-showhighlightchips) |

## Volatiles

<!-- prettier-ignore -->
| Member | Description | Defined by |
| --- | --- | --- |
| <span id="volatile-volatilewidth">**volatileWidth**</span><br><code>volatileWidth: undefined as number &#124; undefined</code> |  | LinearGenomeView |
| <span id="volatile-minimumblockwidth">**minimumBlockWidth**</span><br><code>minimumBlockWidth: 3</code> |  | LinearGenomeView |
| <span id="volatile-draggingtrackid">**draggingTrackId**</span><br><code>draggingTrackId: undefined as undefined &#124; string</code> |  | LinearGenomeView |
| <span id="volatile-lasttrackdragy">**lastTrackDragY**</span><br><code>lastTrackDragY: undefined as undefined &#124; number</code> |  | LinearGenomeView |
| <span id="volatile-volatileerror">**volatileError**</span><br><code>volatileError</code> |  | LinearGenomeView |
| <span id="volatile-trackrefs">**trackRefs**</span><br><code>trackRefs</code> |  | LinearGenomeView |
| <span id="volatile-coarsedynamicblocks">**coarseDynamicBlocks**</span><br><code>coarseDynamicBlocks: [] as ContentBlock[]</code> |  | LinearGenomeView |
| <span id="volatile-coarsetotalbp">**coarseTotalBp**</span><br><code>coarseTotalBp: 0</code> |  | LinearGenomeView |
| <span id="volatile-coarsebpperpx">**coarseBpPerPx**</span><br><code>coarseBpPerPx: self.legacyBpPerPx &#124;&#124; 1</code> |  | LinearGenomeView |
| <span id="volatile-leftoffset">**leftOffset**</span><br><code>leftOffset: undefined as undefined &#124; BpOffset</code> |  | LinearGenomeView |
| <span id="volatile-rightoffset">**rightOffset**</span><br><code>rightOffset: undefined as undefined &#124; BpOffset</code> |  | LinearGenomeView |
| <span id="volatile-isscalebarrefnamemenuopen">**isScalebarRefNameMenuOpen**</span><br><code>isScalebarRefNameMenuOpen: false</code> |  | LinearGenomeView |
| <span id="volatile-scalebarrefnameclickpending">**scalebarRefNameClickPending**</span><br><code>scalebarRefNameClickPending: false</code> |  | LinearGenomeView |
| <span id="volatile-volatileguides">**volatileGuides**</span><br><code>volatileGuides: [] as VolatileGuide[]</code> | temporary vertical guides that can be set by displays (e.g., LD display hover) | LinearGenomeView |
| <span id="volatile-width">**width**</span><br><code>width: 800</code> |  | [BaseViewModel](../baseviewmodel#volatile-width) |
| <span id="volatile-bodymounted">**bodyMounted**</span><br><code>bodyMounted: true</code> | <span data-pagefind-ignore>Whether the container has this view's body in the DOM.<br><br>`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.<br><br>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.<br><br>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.</span> | [BaseViewModel](../baseviewmodel#volatile-bodymounted) |

## Getters

<!-- prettier-ignore -->
| Member | Description | Defined by |
| --- | --- | --- |
| <span id="getter-bpperpx">**bpPerPx**</span><br><code>number</code> | corresponds roughly to the zoom level, base-pairs per pixel.<br><br>Zero before a width is measured, which is the same not-yet-measured sentinel `Base1DView` uses and which `displayedRegionsTotalPx` and the offset getters already guard for. Reads `volatileWidth` rather than the `width` getter on purpose: that one throws when unmeasured, and these are read from the first render. | LinearGenomeView |
| <span id="getter-offsetpx">**offsetPx**</span><br><code>number</code> | corresponds roughly to the horizontal scroll of the LGV | LinearGenomeView |
| <span id="getter-scrollzoom">**scrollZoom**</span><br><code>boolean</code> | scroll-to-zoom is a global, personal preference resolved from the session; toggling it in any view applies everywhere | LinearGenomeView |
| <span id="getter-pinnedtracks">**pinnedTracks**</span><br><code>any[]</code> |  | LinearGenomeView |
| <span id="getter-unpinnedtracks">**unpinnedTracks**</span><br><code>any[]</code> |  | LinearGenomeView |
| <span id="getter-effectivetracklabels">**effectiveTrackLabels**</span><br><code>any</code> | the effective track labels setting, resolving the stored `trackLabels` against the LinearGenomeViewPlugin config default | LinearGenomeView |
| <span id="getter-width">**width**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-trackwidthpx">**trackWidthPx**</span><br><code>number</code> | width minus track outline borders (1px each side when shown) | LinearGenomeView |
| <span id="getter-assemblynames">**assemblyNames**</span><br><code>string[]</code> |  | LinearGenomeView |
| <span id="getter-assemblydisplaynames">**assemblyDisplayNames**</span><br><code>string[]</code> |  | LinearGenomeView |
| <span id="getter-istoplevelview">**isTopLevelView**</span><br><code>boolean</code> | checking if lgv is a 'top-level' view is used for toggling pin track capability, sticky positioning | LinearGenomeView |
| <span id="getter-stickyviewheaders">**stickyViewHeaders**</span><br><code>boolean</code> | only uses sticky view headers when it is a 'top-level' view and session allows it | LinearGenomeView |
| <span id="getter-scalebardisplayprefix">**scalebarDisplayPrefix**</span><br><code>string &#124; undefined</code> | Assembly-name prefix for the scalebar refName labels, or undefined for none. A container view (e.g. LinearSyntenyView) opts its sub-views in by exposing showAssemblyNameInSubviewScalebar; duck-typed rather than matching a concrete view type so no upward plugin dependency is needed and any container can opt in. A wrong nesting depth simply yields no prefix — hence the hasParent guard, since getParent throws (rather than returning undefined) when the view sits shallower than depth 2. | LinearGenomeView |
| <span id="getter-assembliesnotfound">**assembliesNotFound**</span><br><code>string &#124; undefined</code> |  | LinearGenomeView |
| <span id="getter-assemblyerrors">**assemblyErrors**</span><br><code>string</code> |  | LinearGenomeView |
| <span id="getter-assembliesinitialized">**assembliesInitialized**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-initassembly">**initAssembly**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(ModelInstanceTypeProps&lt;…&gt; &amp; { error: unknown; loadingP: Promis…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(ModelInstanceTypeProps&lt;…&gt; &amp; { error: unknown; loadingP: Promise&lt;…&gt; &#124; undefined; ... 10 more ...; refNameMismatches: Map&lt;…&gt;; } &amp; ... 13 more ... &amp; IStateTreeNode&lt;...&gt;) &#124; undefined</code></pre></dialog></span> | the assembly named by a pending `init`, or undefined when no init is set. `init`'s assembly isn't in `assemblyNames` yet (that derives from displayedRegions, still empty pre-navigation), so init-phase readiness and error checks resolve it directly through here. | LinearGenomeView |
| <span id="getter-initialized">**initialized**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-hasdisplayedregions">**hasDisplayedRegions**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-loadingassembly">**loadingAssembly**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(ModelInstanceTypeProps&lt;…&gt; &amp; { error: unknown; loadingP: Promis…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(ModelInstanceTypeProps&lt;…&gt; &amp; { error: unknown; loadingP: Promise&lt;…&gt; &#124; undefined; ... 10 more ...; refNameMismatches: Map&lt;…&gt;; } &amp; ... 13 more ... &amp; IStateTreeNode&lt;...&gt;) &#124; undefined</code></pre></dialog></span> | The assembly whose load the spinner is waiting on: the one `init` names before navigation (it isn't in assemblyNames yet), else the first of the displayed assemblies that hasn't finished loading. | LinearGenomeView |
| <span id="getter-loadingmessage">**loadingMessage**</span><br><code>string &#124; undefined</code> | What the spinner says. The assembly reports which of its files it is downloading, so this is "Downloading chromosome aliases" rather than a bare "Loading" for the part of startup that actually takes time. Falls back once the assembly is loaded and the remaining wait is the init autorun's own navigation, which is local. | LinearGenomeView |
| <span id="getter-loadingprogress">**loadingProgress**</span><br><code>number &#124; undefined</code> | Determinate fraction for the spinner's bar, when the assembly load reports one (a whole-file download with a Content-Length) | LinearGenomeView |
| <span id="getter-loadingsource">**loadingSource**</span><br><code>string &#124; undefined</code> | The URL the assembly load is currently fetching, when the phase named one. Only the stalled-load notice reads it — see ViewLoadingScreen. | LinearGenomeView |
| <span id="getter-hassomethingtoshow">**hasSomethingToShow**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-awaitinginitnavigation">**awaitingInitNavigation**</span><br><code>boolean</code> | init is set but its async navigation (the afterAttach autorun) hasn't populated displayedRegions yet. `initialized` can already be true here (it only tracks assembly readiness), so without this the container would mount over empty regions and pxToBp/hover would throw.<br><br>**Not dotplot's or synteny's `initPending`**, which is the bare `!!self.init` — "an init blob has not been applied" — and which those views read from their `settled` gate rather than from `showLoading`. This one is narrower on purpose: it closes only the window where there is nothing on screen. Once navigation has produced regions the view is usable and gets shown, even though `init` is still set while the tracks and highlights land. Renamed away from the shared spelling because the two predicates disagree exactly there, and the bare name reads as theirs. | LinearGenomeView |
| <span id="getter-showloading">**showLoading**</span><br><code>boolean</code> | Whether to show a loading indicator instead of the import form or view | LinearGenomeView |
| <span id="getter-showimportform">**showImportForm**</span><br><code>boolean</code> | Whether to show the import form | LinearGenomeView |
| <span id="getter-ready">**ready**</span><br><code>boolean</code> | Is there anything to draw yet? The gate anything reading block geometry — a ruler, a scalebar, a display — has to pass first, because `width`/`staticBlocks` throw by design before the view has been measured and navigated.<br><br>**Not `initialized`**, which is the trap this getter exists to close. That one answers "have the assembly's regions loaded", which is only the first of two async steps: navigating then populates `displayedRegions`, and in the window between the two `initialized` is already true while there is still nothing on screen. `showLoading` folds in `awaitingInitNavigation`, the getter that exists for exactly that gap.<br><br>`error` is the third outcome and is why this is not a bare `!showLoading`: a failed assembly load also ends the loading state, so that alone would mount over the wreckage. Read `error` yourself if you want to draw it. | LinearGenomeView |
| <span id="getter-status">**status**</span><br><code>ViewStatus</code> | The same question as `ready` with the other three outcomes named, for a host that draws its own chrome and has to render all four. See `computeViewStatus`, whose precedence this defers to — and note its `ready` is narrower than the getter above, which is true when nothing has told the view where to look. | LinearGenomeView |
| <span id="getter-scalebarheight">**scalebarHeight**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-trackleadingchrome">**trackLeadingChrome**</span><br><code>number</code> | What TrackContainer puts *above* a track's rendering container: the gap over its Paper, and the Paper's own top border when outlines are on. | LinearGenomeView |
| <span id="getter-tracktrailingchrome">**trackTrailingChrome**</span><br><code>number</code> | ...and what it puts below: the resize divider, plus the matching bottom border. | LinearGenomeView |
| <span id="getter-trackchromeheight">**trackChromeHeight**</span><br><code>number</code> | A track's full cost beyond its display height.<br><br>The track *label* is not counted, and cannot be: an offset label is an in-flow box whose height is whatever the theme renders a Paper of icon buttons at — 31.140625px on the stock theme, and not a number this file can derive. So these getters are exact while labels are hidden or overlapping, and short by one label box per labelled track otherwise. Anything needing the offset to the pixel with labels showing measures the DOM; `BreakpointSplitViewOverlay` does, and falls back to this arithmetic only for a track with no mounted div. | LinearGenomeView |
| <span id="getter-headerheight">**headerHeight**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-rubberbandtop">**rubberbandTop**</span><br><code>number</code> | Where the scalebar pins when the view's chrome is sticky: everything stacked above it, which is the view's own title bar plus this view's header. Expressed from `headerHeight` rather than re-summing its constants — the two are the same box, and a second spelling of the sum is free to drift from the first while both typecheck. | LinearGenomeView |
| <span id="getter-pinnedtrackstop">**pinnedTracksTop**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-trackheights">**trackHeights**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-trackheightswithchrome">**trackHeightsWithChrome**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-height">**height**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-totalbp">**totalBp**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-fitbpperpx">**fitBpPerPx**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-maxbpperpx">**maxBpPerPx**</span><br><code>number</code> | The zoom-out limit. This view's own fit, except while a container holds it on a shared scale coarser than that — a small genome next to a large one, drawn short so the two compare by length.<br><br>Raising the LIMIT is what makes such a scale survive: written past the limit instead, it is undone by the first thing that clamps — a wheel tick, a rubberband, a `setDisplayedRegions` — which is how the dotplot's locked aspect ratio once turned "zoom out" into a zoom in (`axisMaxBpPerPx`). Here every route to a zoom clamps against the same ceiling, so full zoom-out LANDS on the shared scale. | LinearGenomeView |
| <span id="getter-sharedfitbpperpx">**sharedFitBpPerPx**</span><br><code>number</code> | The zoom-out ceiling a containing comparative view holds this row to, or 0 for a standalone view, a mode that is off, and a stack that cannot answer yet.<br><br>Pulled rather than pushed down into a volatile: the number is a function of every row's fit, all of which move on a resize, and a stored copy would be stale by the next layout. | LinearGenomeView |
| <span id="getter-minbpperpx">**minBpPerPx**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-error">**error**</span><br><code>unknown</code> |  | LinearGenomeView |
| <span id="getter-maxoffset">**maxOffset**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-minoffset">**minOffset**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-displayedregionsorientation">**displayedRegionsOrientation**</span><br><code>RegionsOrientation</code> | Whether the displayed regions read left-to-right, right-to-left, or some of each. `horizontallyFlip` reverses the order and flips every region at once, so a flipped row is uniformly `reversed` and `mixed` takes going out of your way — the scalebar label menu's per-region "Reverse region". Read off `displayedRegions` rather than off blocks because blocks cover the window and this is a fact about the row. | LinearGenomeView |
| <span id="getter-displayedregionstotalpx">**displayedRegionsTotalPx**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-trackmap">**trackMap**</span><br><code>Map&lt;string, any&gt;</code> |  | LinearGenomeView |
| <span id="getter-showswholechromosome">**showsWholeChromosome**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-canshowcytobands">**canShowCytobands**</span><br><code>boolean</code> | an ideogram only reads correctly against an entire chromosome: on a sub-region it is a meaningless slice of bands, and the centromere shows up as a lone half-triangle | LinearGenomeView |
| <span id="getter-effectiveshowcytobands">**effectiveShowCytobands**</span><br><code>boolean</code> | the `showCytobands` setting gated by whether cytobands can be shown at all (whole chromosome + data present) — i.e. actually on screen | LinearGenomeView |
| <span id="getter-anycytobandsexist">**anyCytobandsExist**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-cytobandoffset">**cytobandOffset**</span><br><code>number</code> | the cytoband is displayed to the right of the chromosome name, and that offset is calculated manually with this method | LinearGenomeView |
| <span id="getter-istrackselectoropen">**isTrackSelectorOpen**</span><br><code>boolean</code> |  | LinearGenomeView |
| <span id="getter-overviewlayout">**overviewLayout**</span><br><code>ViewLayout</code> | geometry of the overview scalebar — derived from displayedRegions, width, and cytobandOffset so it stays cached by MobX | LinearGenomeView |
| <span id="getter-staticblocks">**staticBlocks**</span><br><code>BlockSet</code> | static blocks are an important concept jbrowse uses to avoid re-rendering when you scroll to the side. when you horizontally scroll to the right, old blocks to the left may be removed, and new blocks may be instantiated on the right. tracks may use the static blocks to render their data for the region represented by the block | LinearGenomeView |
| <span id="getter-dynamicblocks">**dynamicBlocks**</span><br><code>BlockSet</code> | dynamic blocks represent the exact coordinates of the currently visible genome regions on the screen. they are similar to static blocks, but static blocks can go offscreen while dynamic blocks represent exactly what is on screen | LinearGenomeView |
| <span id="getter-overviewblocks">**overviewBlocks**</span><br><code>BaseBlock[]</code> | all overview scalebar blocks (content + elided), laid out on the overviewLayout. memoized so the scalebar doesn't recompute it per render | LinearGenomeView |
| <span id="getter-overviewregionpxspan">**overviewRegionPxSpan**</span><br><code>PxSpan &#124; undefined</code> | leading/trailing pixel span of the visible regions projected onto the overviewLayout — the geometry of the overview's "you are here" rectangle, and of the top edge of the polygon drawn under it. Elided regions count: at whole-genome zoom the tail of an assembly is all coalesced tiny contigs, and stopping at the last *content* block left the rectangle short of (or, scrolled onto that tail, absent from) the polygon it sits on. | LinearGenomeView |
| <span id="getter-staticblockstranslatex">**staticBlocksTranslateX**</span><br><code>number</code> | The x shift that maps the **staticBlocks frame** onto the viewport: `translateX(view.staticBlocksTranslateX)` on one container places every `gridlineTicks`, `scalebarLabels` and `paddingSpans` entry at once, and a pan then moves that single transform rather than each child.<br><br>The frame exists because those three are laid out across every displayed region rather than across the viewport — it overhangs on both sides — so their `x` values are stable under a scroll and only this number moves. `scalebarRefNameLabels` is the exception and says so: its `transform` is already a screen x, because a sticky label's position is a function of the scroll rather than of block geometry.<br><br>**The subtraction must happen here, in float64, and that is the load-bearing part.** `offsetPx` is a whole-genome pixel coordinate — hg38 chr1 at base resolution is already past 1e10 — and a length that size does not survive the trip through CSS: the transform matrix is float32 by the time it reaches the compositor, where consecutive representable values at 1e10 are ~1024px apart, and layout saturates sooner still (Blink's `LayoutUnit` is int32 at 1/64px, so ±33.5M px). So the shape that looks obvious — lay an overlay out in absolute genome pixels, write `translateX(-view.offsetPx)` — does not lose a subpixel, it puts the row somewhere else entirely, and only on large assemblies at high zoom, which is not where anyone tests. Both operands here are large and their difference is bounded by the overhang (a block or two), so what reaches CSS is small and exact. Same rule as the GPU side, one layer up — `agent-docs/reference/BP_PRECISION.md`.<br><br>Published because it is the one piece of coordinate arithmetic a host drawing its own chrome would otherwise have to know, and because having it written out at each call site is how the two in-tree copies came to disagree about rounding. Round it where the content is text (a fractional offset blurs a label); leave it alone for paths and boxes. | LinearGenomeView |
| <span id="getter-gridlineticks">**gridlineTicks**</span><br><code>{ x: number; major: boolean; }[]</code> | Gridline tick positions (x relative to the staticBlocks frame), derived from staticBlocks + bpPerPx. Computed once and shared by every Gridlines instance (scalebar, main view, each pinned track) rather than recomputing the makeTicks loop per component. | LinearGenomeView |
| <span id="getter-scalebarlabels">**scalebarLabels**</span><br><code>{ x: number; label: string; key: string; }[]</code> | Scalebar coordinate labels (x in the staticBlocks frame + display text). Sibling of gridlineTicks sharing the same makeBlockTicks formula, so labels line up exactly with their gridlines. staticBlocks chop a region into ~800px chunks; groupContiguousBlocks merges them back per region so a label on an internal chunk boundary isn't clipped away by both neighbors — only genuine region edges clip a label.<br><br>A run that can hold too few labels to make a ruler goes unnumbered (`tickLabelsWorthDrawing`), the same rule the overview scalebar and the dotplot axes apply: with a whole genome displayed each chromosome catches one lone coordinate, which conveys no scale by itself and reads as the same number repeated across the row. | LinearGenomeView |
| <span id="getter-scalebarrefnamelabels">**scalebarRefNameLabels**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>{ labels: ScalebarRefNameLabel[]; caption: string &#124; undefined;…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>{ labels: ScalebarRefNameLabel[]; caption: string &#124; undefined; captionSpanPx: number; }</code></pre></dialog></span> | The bold refName labels drawn along the scalebar, as plain data: `{key, refName, displayedRegionIndex, lastDisplayedRegionIndex, sticky, transform, maxWidth, paddingLeft, text}` each. One per run of same-refName regions, plus a "sticky" one pinned to the viewport's left edge naming the refName under it, so panning into a chromosome does not scroll its own name off the screen.<br><br>Three rules live in here that a host drawing region names will otherwise rediscover the hard way, and two of them are invisible until the data is awkward:<br><br>- the sticky label rides the rightmost run that has scrolled off the left, not the region's first block — that one is gone from staticBlocks entirely once you zoom into a region's interior, taking the chromosome name off screen at exactly the zoom where nothing else names it. - adjacent regions of the same refName (collapsed introns) get one label between them, not one each. That label names the whole run and is fitted to the whole run, and `displayedRegionIndex` / `lastDisplayedRegionIndex` bracket what it stands for. - a name is drawn whole or not at all, measured against the space its run leaves. Clipped to its own width, `chr16` reads as `chr1` — a different chromosome rather than a shortened name, which is why this is a fit test rather than an ellipsis.<br><br>**Viewport frame, unlike its siblings.** `transform` is a screen x, already net of `offsetPx`, where gridlineTicks / scalebarLabels / paddingSpans are all in the staticBlocks frame. The sticky label's position is a function of `offsetPx` rather than of block geometry, so it has no fixed position in that frame — and for the same reason this getter recomputes on every scroll frame where those three do not.<br><br>`caption` accompanies the labels: the chip at the row's left edge, saying which assembly the row is (a container view — synteny — opts into that through `scalebarDisplayPrefix`) and whether it is flipped. A ` [rev]` there is a fact about the ROW; the same marker on a chromosome name means that one region, which only happens under mixed orientation. `captionSpanPx` is the width it takes, which the coordinate numbers stay out from under. The SVG export deliberately calls `getScalebarRefNameLabels` itself with no prefix rather than reading this, since it draws its own assembly name above the ruler. | LinearGenomeView |
| <span id="getter-paddingspans">**paddingSpans**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>{ key: string; x: number; width: number; kind: "boundary" &#124; "el…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>{ key: string; x: number; width: number; kind: "boundary" &#124; "elided" &#124; "seam"; }[]</code></pre></dialog></span> | Every span along the row that is not track data, as plain geometry in the staticBlocks frame — the same frame as gridlineTicks and scalebarLabels, so one `translateX(staticBlocksTranslateX)` places all three. Three kinds, and a host drawing its own chrome needs all of them:<br><br>- `seam`: the 3px bar at a region's right edge. Displayed regions are laid out **contiguously** — calculateStaticBlocks emits boundary padding only before the first region and after the last — so this bar is the only thing separating two of them. Without it a two-region view reads as a one-region view scrolled somewhere strange. `isRightEndOfDisplayedRegion` is what marks it, and the right edge of the blocks currently *loaded* — which is what block geometry hands you — is not the same filter. - `elided`: a region too narrow to draw at this zoom. Whole-genome on a real assembly is mostly these — hg38 has 455 sequences and all but the 24 chromosomes land sub-pixel — so a host that skips them renders that tail as nothing at all. - `boundary`: past the start of the first region or the end of the last. Greying it is what makes the last region's seam read as the edge of a filled area rather than a rule floating in the track.<br><br>Elided blocks get no seam even though they carry the flag: at the zoom where regions elide, one bar per region is a solid grey wall.<br><br>PaddingBlocks is the in-tree consumer. The SVG export is deliberately NOT one: `SVGRegionSeparators` walks dynamicBlocks itself and draws only the seam, because `elided` and `boundary` are chrome for an interactive row rather than information a figure carries — striped grey saying "regions here are too narrow to draw" is noise in a static image, and at whole-genome zoom it would be most of the row. The seam is the one that must survive: regions lay out contiguously, so it is all that separates two of them. | LinearGenomeView |
| <span id="getter-totalwidthpx">**totalWidthPx**</span><br><code>number</code> | Integer-rounded sum of all visible block widths. Slightly less than view.width when the genome ends before the right edge; use view.width for SVG clip rects (display boundary) and this for paint canvas sizing (actual content width). | LinearGenomeView |
| <span id="getter-totalwidthpxwithoutborders">**totalWidthPxWithoutBorders**</span><br><code>number</code> | Like totalWidthPx but excluding inter-region boundary blocks. Used when column layout divides the canvas width by feature count. | LinearGenomeView |
| <span id="getter-visiblebp">**visibleBp**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-hasvisiblecontent">**hasVisibleContent**</span><br><code>boolean</code> | Whether any part of a displayed region actually falls inside the viewport. False both when the view holds no regions at all and when it holds some but is scrolled entirely off them; either way there is no visible span for the scalebar, ruler and refName labels to describe, which is what the SVG export's header checks before drawing one. Distinct from `hasDisplayedRegions`, which only asks whether the view has been given regions, not whether any are on screen. | LinearGenomeView |
| <span id="getter-visiblewholebaseregions">**visibleWholeBaseRegions**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>{ assemblyName: string; refName: string; start: number; end: nu…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>{ assemblyName: string; refName: string; start: number; end: number; }[]</code></pre></dialog></span> | What is on screen, as regions that address whole bases — what a reader means by "the visible region" when they ask to fetch it, bookmark it or read it back in a locString field. `visibleRegions` below is the other half: pixels, and fractional by design. | LinearGenomeView |
| <span id="getter-visibleregions">**visibleRegions**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>{ refName: string; start: number; end: number; assemblyName: st…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>{ refName: string; start: number; end: number; assemblyName: string; reversed: boolean &#124; undefined; displayedRegionIndex: number; screenStartPx: number; screenEndPx: number; }[]</code></pre></dialog></span> | Returns the currently visible content blocks with screen pixel positions and displayedRegionIndex guaranteed. Used by WebGL displays for per-region data fetching and rendering. | LinearGenomeView |
| <span id="getter-bufferedvisibleregions">**bufferedVisibleRegions**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>{ region: { refName: string; start: number; end: number; assemb…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>{ region: { refName: string; start: number; end: number; assemblyName: string; reversed: boolean &#124; undefined; }; displayedRegionIndex: number; }[]</code></pre></dialog></span> | visibleRegions expanded by a half-screen buffer on each side, clamped to displayedRegion bounds, with integer-rounded coordinates. Use this when fetching data that should extend slightly beyond the viewport for smooth scrolling. | LinearGenomeView |
| <span id="getter-visiblelocstrings">**visibleLocStrings**</span><br><code>string</code> | a single "combo-locstring" representing all the regions visible on the screen | LinearGenomeView |
| <span id="getter-settleddynamicblocks">**settledDynamicBlocks**</span><br><code>ContentBlock[]</code> | **What a debounced consumer clips to**: the coarse blocks once the view has settled at least once, the live ones before that.<br><br>The coarse blocks exist so a per-bp scan does not recompute on every animation frame during a pan or zoom — wiggle's autoscale domain, the alignments coverage scale and MAF's coverage band are the three — and while they are stale the answer is merely a frame or two old, which is what the debounce means. **Empty is different in kind.** A scan over no blocks yields no entries, and no entries is not a stale domain, it is the fallback one: `[0,1]`, which draws a line plot blank and a density plot saturated. That window is the 500ms between a view initializing and the coarse autorun's first run, and data can now land inside it — the per-region fetch used to be trailing-edge at 600ms, so it never did.<br><br>One recompute at that transition, against N per frame, which is the trade the guard was making anyway. | LinearGenomeView |
| <span id="getter-coarsevisiblelocstrings">**coarseVisibleLocStrings**</span><br><code>string</code> | same as visibleLocStrings, but only updated every 500ms | LinearGenomeView |
| <span id="getter-coarsetotalbpdisplaystr">**coarseTotalBpDisplayStr**</span><br><code>string</code> |  | LinearGenomeView |
| <span id="getter-effectivetotalbp">**effectiveTotalBp**</span><br><code>number</code> |  | LinearGenomeView |
| <span id="getter-effectivetotalbpdisplaystr">**effectiveTotalBpDisplayStr**</span><br><code>string</code> |  | LinearGenomeView |
| <span id="getter-centerlineinfo">**centerLineInfo**</span><br><code>PxToBpResult &#124; undefined</code> |  | LinearGenomeView |
| <span id="getter-effectivebodymounted">**effectiveBodyMounted**</span><br><code>boolean</code> | <span data-pagefind-ignore>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.<br><br>`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.<br><br>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.</span> | [BaseViewModel](../baseviewmodel#getter-effectivebodymounted) |

## Methods

<!-- prettier-ignore -->
| Member | Description |
| --- | --- |
| <span id="method-trackheight">**trackHeight**</span><br><code>(track: any) =&gt; any</code> | rendered height of a single track, collapsing to a fixed height when minimized. Shared by trackHeights and getTrackYOffset so the two can't disagree. Reads `activeDisplay` — the display TrackContainer actually mounts — rather than re-picking `displays[0]`, so the view's height math can't diverge from what is on screen. |
| <span id="method-gettrackyoffset">**getTrackYOffset**</span><br><code>(trackId: string) =&gt; number &#124; undefined</code> | Y offset (in pixels, from the top of the view) where a track's rendering container starts. Walks tracks in DOM render order (pinned first, then unpinned), from the same constants TrackContainer lays its Paper out with. Returns `undefined` if the track is not present.<br><br>Exact while track labels are hidden or overlapping. With an offset label the answer is short by one label box per labelled track above this one — see `trackChromeHeight` for why that box is not derivable here. |
| <span id="method-tracksection">**trackSection**</span><br><code>(id: string) =&gt; any[]</code> | the pinned or unpinned sibling list a track renders within; move up/down/top/bottom reorder inside this section rather than the full `tracks` array, since the two sections lay out independently |
| <span id="method-gettrack">**getTrack**</span><br><code>(id: string) =&gt; any</code> |  |
| <span id="method-getactivedisplayid">**getActiveDisplayId**</span><br><code>(trackId: string) =&gt; string &#124; undefined</code> | displayId of the active (shown) display for a track in this view, used by the config editor to expand the relevant display and collapse the track's other displays |
| <span id="method-getselectedregions">**getSelectedRegions**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(leftOffset?: BpOffset &#124; undefined, rightOffset?: BpOffset &#124; un…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(leftOffset?: BpOffset &#124; undefined, rightOffset?: BpOffset &#124; undefined) =&gt; { assemblyName: string; refName: string; start: number; end: number; }[]</code></pre></dialog></span> | Helper method for the fetchSequence. Retrieves the corresponding regions that were selected by the rubberband |
| <span id="method-exportsvg">**exportSvg**</span><br><code>(opts?: ExportSvgOptions) =&gt; Promise&lt;void&gt;</code> | creates an svg export and save using FileSaver |
| <span id="method-menuitems">**menuItems**</span><br><code>() =&gt; MenuItem[]</code> | return the view menu items |
| <span id="method-rubberbandlaunchmenuitems">**rubberBandLaunchMenuItems**</span><br><code>() =&gt; MenuItem[]</code> | what a plugin can start from the selected region — a synteny view, a consensus call. Extend this rather than `rubberBandMenuItems` so the entries collect under the menu's "Launch" submenu; that grouping is decided once here rather than by whichever contributor runs first, and keeps the rubberband menu itself short as plugins pile on. |
| <span id="method-rubberbandmenuitems">**rubberBandMenuItems**</span><br><code>() =&gt; MenuItem[]</code> |  |
| <span id="method-bptopx">**bpToPx**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>({ refName, coord, displayedRegionIndex, }: { refName: string;…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>({ refName, coord, displayedRegionIndex, }: { refName: string; coord: number; displayedRegionIndex?: number &#124; undefined; }) =&gt; { index: number; offsetPx: number; } &#124; undefined</code></pre></dialog></span> |  |
| <span id="method-gethighlightcoords">**getHighlightCoords**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(region: { assemblyName?: string &#124; undefined; refName: string;…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(region: { assemblyName?: string &#124; undefined; refName: string; start: number; end: number; }) =&gt; { width: number; left: number; } &#124; undefined</code></pre></dialog></span> | Map a highlight or bookmark region to its pixel position+width inside the tracks container. Falls back to the raw refName if the region's assemblyName is missing or unknown so highlights authored without an assembly still render in single-assembly views. |
| <span id="method-getoverviewhighlightcoords">**getOverviewHighlightCoords**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(region: { assemblyName?: string &#124; undefined; refName: string;…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(region: { assemblyName?: string &#124; undefined; refName: string; start: number; end: number; }) =&gt; { left: number; width: number; } &#124; undefined</code></pre></dialog></span> | like getHighlightCoords but laid out against the overview scalebar and shifted by the cytoband offset |
| <span id="method-centerat">**centerAt**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(coord: number, refName: string, displayedRegionIndex?: number…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(coord: number, refName: string, displayedRegionIndex?: number &#124; undefined) =&gt; void</code></pre></dialog></span> | scrolls the view to center on the given bp. if that is not in any of the displayed regions, does nothing |
| <span id="method-pxtobp">**pxToBp**</span><br><code>(px: number) =&gt; PxToBpResult</code> |  |
| <span id="method-rubberbandclickmenuitems">**rubberbandClickMenuItems**</span><br><code>(clickOffset: BpOffset) =&gt; MenuItem[]</code> |  |
| <span id="method-highlightmenuitems">**highlightMenuItems**</span><br><code>(_highlight: HighlightType) =&gt; MenuItem[]</code> | returns menu items for a highlight context menu. plugins can extend this via Core-extendPluggableElement to add their own items |

## Actions

<!-- prettier-ignore -->
| Member | Description | Defined by |
| --- | --- | --- |
| <span id="action-setshowtrackoutlines">**setShowTrackOutlines**</span><br><code>(arg: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setscrollzoom">**setScrollZoom**</span><br><code>(flag: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setcolorbycds">**setColorByCDS**</span><br><code>(flag: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setshowaminoacids">**setShowAminoAcids**</span><br><code>(flag: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setshowcytobands">**setShowCytobands**</span><br><code>(flag: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setwidth">**setWidth**</span><br><code>(newWidth: number) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-seterror">**setError**</span><br><code>(error: unknown) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setisscalebarrefnamemenuopen">**setIsScalebarRefNameMenuOpen**</span><br><code>(isOpen: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setscalebarrefnameclickpending">**setScalebarRefNameClickPending**</span><br><code>(pending: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-sethideheader">**setHideHeader**</span><br><code>(b: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-sethideheaderoverview">**setHideHeaderOverview**</span><br><code>(b: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setscalebaronly">**setScalebarOnly**</span><br><code>(b: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-sethidenotracksactive">**setHideNoTracksActive**</span><br><code>(b: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setshowgridlines">**setShowGridlines**</span><br><code>(b: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setlabelsvisible">**setLabelsVisible**</span><br><code>(arg: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setvolatileguides">**setVolatileGuides**</span><br><code>(guides: VolatileGuide[]) =&gt; void</code> | set temporary vertical guides (e.g., for LD display hover) | LinearGenomeView |
| <span id="action-scrollto">**scrollTo**</span><br><code>(offsetPx: number) =&gt; number</code> |  | LinearGenomeView |
| <span id="action-scrolltobp">**scrollToBp**</span><br><code>(startBp: number) =&gt; number</code> | `scrollTo`'s bp-space twin: place the window's left edge at a linearized bp coordinate, clamped to the same scroll limits.<br><br>It exists so a caller that already knows where it wants to be in bp — zoomTo, anchoring the base under the cursor — does not have to convert to pixels and let this convert back. That round trip is lossy once per frame, and a scroll-zoom burst is a few dozen frames, which is enough to walk the base out from under the cursor. | LinearGenomeView |
| <span id="action-zoomto">**zoomTo**</span><br><code>(bpPerPx: number, offset?: any) =&gt; number</code> |  | LinearGenomeView |
| <span id="action-setoffsets">**setOffsets**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(left?: BpOffset &#124; undefined, right?: BpOffset &#124; undefined) =&gt;…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(left?: BpOffset &#124; undefined, right?: BpOffset &#124; undefined) =&gt; void</code></pre></dialog></span> | sets offsets of rubberband, used in the get sequence dialog can call view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute the selected regions from the offsets | LinearGenomeView |
| <span id="action-setsearchresults">**setSearchResults**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(searchResults: BaseResult[], searchQuery: string, assemblyName…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(searchResults: BaseResult[], searchQuery: string, assemblyName: string) =&gt; void</code></pre></dialog></span> |  | LinearGenomeView |
| <span id="action-showtrack">**showTrack**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(trackId: string, initialSnapshot?: any, displayInitialSnapshot…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(trackId: string, initialSnapshot?: any, displayInitialSnapshot?: any, inlineConf?: Record&lt;string, unknown&gt; &#124; undefined) =&gt; any</code></pre></dialog></span> |  | LinearGenomeView |
| <span id="action-hidetrack">**hideTrack**</span><br><code>(trackId: string) =&gt; boolean</code> |  | LinearGenomeView |
| <span id="action-movetrackdown">**moveTrackDown**</span><br><code>(id: string) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-movetrackup">**moveTrackUp**</span><br><code>(id: string) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-movetracktotop">**moveTrackToTop**</span><br><code>(id: string) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-movetracktobottom">**moveTrackToBottom**</span><br><code>(id: string) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-movetrack">**moveTrack**</span><br><code>(movingId: string, targetId: string) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-toggletrack">**toggleTrack**</span><br><code>(trackId: string) =&gt; boolean</code> |  | LinearGenomeView |
| <span id="action-settracklabels">**setTrackLabels**</span><br><code>(setting: "hidden" &#124; "offset" &#124; "overlapping") =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setshowcenterline">**setShowCenterLine**</span><br><code>(b: boolean) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-activatetrackselector">**activateTrackSelector**</span><br><code>() =&gt; Widget</code> |  | LinearGenomeView |
| <span id="action-toggletrackselector">**toggleTrackSelector**</span><br><code>() =&gt; Widget</code> |  | LinearGenomeView |
| <span id="action-horizontalscroll">**horizontalScroll**</span><br><code>(distance: number) =&gt; number</code> |  | LinearGenomeView |
| <span id="action-setdraggingtrackid">**setDraggingTrackId**</span><br><code>(idx?: string &#124; undefined) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-setlasttrackdragy">**setLastTrackDragY**</span><br><code>(y: number) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-ontrackdragover">**onTrackDragOver**</span><br><code>(targetId: string, currentY: number) =&gt; void</code> | called while dragging a track over the track at `targetId`; reorders once the cursor has moved far enough (see shouldSwapTracks) to avoid jitter when a short track is dragged over a tall one | LinearGenomeView |
| <span id="action-setinit">**setInit**</span><br><code>(arg?: InitState &#124; undefined) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-slide">**slide**</span><br><code>(viewWidths: number) =&gt; void</code> | perform animated slide | LinearGenomeView |
| <span id="action-zoom">**zoom**</span><br><code>(targetBpPerPx: number) =&gt; void</code> | perform animated zoom | LinearGenomeView |
| <span id="action-cancelzoomanimation">**cancelZoomAnimation**</span><br><code>() =&gt; void</code> | cancel an in-flight animated zoom. The animation already yields to any other zoom on its own, so this is for stopping it *without* changing the zoom — the slider grabbing the thumb, before it has a value to commit. | LinearGenomeView |
| <span id="action-setcoarsedynamicblocks">**setCoarseDynamicBlocks**</span><br><code>(blocks: BlockSet, bpPerPx: number) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-settlecoarseblocks">**settleCoarseBlocks**</span><br><code>() =&gt; void</code> | Bring the coarse blocks to the viewport as it stands now, for a placement that JUMPED rather than travelled.<br><br>The coarse blocks are a 500ms throttle, and every consumer trades freshness for not recomputing per animation frame — the location box, canvas's on-screen feature set, and the two per-bp scans behind `settledDynamicBlocks`. That trade is only sound while the answer is a few frames old. **A jump makes it unrelated instead**, because there is nothing to coalesce: the viewport left behind is not an approximation of the new one, it is a different place. Unsettled, the location box reads as a navigation that didn't happen, and wiggle's autoscale domain is computed over the window the user just left — measured at `[0,200]` against a correct `[0,300]` when a 40bp coarse window survived a jump to 4040bp on screen. Only the per-region fetch moving to the leading edge made that reachable: at 600ms the data never landed inside the hole.<br><br>**The continuous paths deliberately do not come through here.** The spring zoom writes through `zoomTo` per frame and a drag through `scrollTo`, so this adds no per-frame work; the settle is idempotent (`setCoarseDynamicBlocks` compares block keys), so the debounced autorun's own follow-up run costs nothing.<br><br>Every placer calls it, and `placersSettleCoarseBlocks.test.ts` is what makes that true of the next one — it scans this file for the writes and fails on a placer that reaches neither the settle nor its named list of continuous paths. Two passes by hand missed four. | LinearGenomeView |
| <span id="action-moveto">**moveTo**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(start?: BpOffset &#124; undefined, end?: BpOffset &#124; undefined) =&gt; v…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(start?: BpOffset &#124; undefined, end?: BpOffset &#124; undefined) =&gt; void</code></pre></dialog></span> | offset is the base-pair-offset in the displayed region, index is the index of the displayed region in the linear genome view | LinearGenomeView |
| <span id="action-setnewview">**setNewView**</span><br><code>(bpPerPx: number, offsetPx: number) =&gt; void</code> | Place the viewport by the pair of PIXEL quantities it used to be stored as. Prefer `setWindow`: pixels mean nothing without the width they were measured at, so a round trip through here is only exact while the width holds still. Kept for callers that genuinely have pixels — a wheel gesture, a rubberband — and for reading old snapshots. | LinearGenomeView |
| <span id="action-setwindow">**setWindow**</span><br><code>(windowWidthBp: number, windowStartBp: number) =&gt; void</code> | Place the viewport by the pair it is actually STORED as: the window's width and left edge, both in bp. `setNewView`'s bp-space twin, and the right one for anything that captures a viewport and puts it back later (an Undo, a saved location) — those two moments can be a window resize apart, and this pair survives one where a pixel pair does not.<br><br>Still clamped, by the same zoom and scroll limits as every other mover: the regions may have changed under it, and a window the new set can't hold is not restorable however it was spelled. | LinearGenomeView |
| <span id="action-setwindowframe">**setWindowFrame**</span><br><code>(windowWidthBp: number, windowStartBp: number) =&gt; void</code> | `setWindow` without the settle, for a writer that runs per animation frame. Flushing the coarse blocks sixty times a second is the one thing such a writer must not do: they are a 500ms throttle that a synteny follow pass and two autoscale domains hang off, and settling each frame turns each of those into per-frame work — `positionViewOnSpans` states the same rule for the same reason. | LinearGenomeView |
| <span id="action-setdisplayedregions">**setDisplayedRegions**</span><br><code>(regions: Region[]) =&gt; void</code> | The worst jump of them to leave unsettled: the coarse blocks are keyed by `displayedRegionIndex`, so a set that outlives the region list has a consumer reading one contig's data against another's blocks. | LinearGenomeView |
| <span id="action-clampzoomtoceiling">**clampZoomToCeiling**</span><br><code>() =&gt; void</code> | Re-assert `maxBpPerPx` over the current zoom, for a container whose shared ceiling just fell — otherwise the view is stranded above it with zoom-out disabled and the slider's min past its value. Goes through `zoomTo` so the clamp keeps one definition, and settles because a ceiling drop moves the window in one step.<br><br>Requires an `initialized` view; the caller checks, since an MST action reads untracked and a guard here would never re-run once the row arrived. | LinearGenomeView |
| <span id="action-showallregions">**showAllRegions**</span><br><code>() =&gt; void</code> |  | LinearGenomeView |
| <span id="action-fitallregions">**fitAllRegions**</span><br><code>() =&gt; void</code> | Fit the displayed regions to the width exactly, edge to edge.<br><br>Not the same as `showAllRegions`, which goes to `maxBpPerPx` — the zoom-out LIMIT, where `SHOW_ALL_REGIONS_FILL` deliberately keeps a 10% margin so the whole genome doesn't sit flush against both edges. That margin is right for "show me everything" and wrong for a caller that named the regions it wants: it draws them at 1/0.9 of fit-to-width, centered, which is a silent 11% scale difference from the single-region path (`moveTo`, span/width) reached through the same location box.<br><br>The scale comes from `fitAllRegionsWindow`, which is where the rule is written — a snapshot builder that cannot call an action needs the same answer, and the two agreeing matters more than either being local. Where it clamps up to `minBpPerPx` the content is narrower than the view, and the centering is what frames it. | LinearGenomeView |
| <span id="action-horizontallyflip">**horizontallyFlip**</span><br><code>() =&gt; void</code> |  | LinearGenomeView |
| <span id="action-showallregionsinassembly">**showAllRegionsInAssembly**</span><br><code>(assemblyName?: string &#124; undefined) =&gt; void</code> |  | LinearGenomeView |
| <span id="action-clearview">**clearView**</span><br><code>() =&gt; void</code> | this "clears the view" and makes the view return to the import form | LinearGenomeView |
| <span id="action-navto">**navTo**</span><br><code>(query: NavLocation, grow?: number &#124; undefined) =&gt; void</code> | Navigate to a location based on its refName and optionally start, end, and assemblyName. Will not try to change displayed regions, use `navToLocations` instead. Only navigates to a location if it is entirely within a displayedRegion. Navigates to the first matching location encountered.<br><br>Throws an error if navigation was unsuccessful | LinearGenomeView |
| <span id="action-navtomultiple">**navToMultiple**</span><br><code>(locations: NavLocation[], grow?: number &#124; undefined) =&gt; void</code> | Navigate to a location based on its refName and optionally start, end, and assemblyName. Will not try to change displayed regions, use navToLocations instead. Only navigates to a location if it is entirely within a displayedRegion. Navigates to the first matching location encountered.<br><br>Throws an error if navigation was unsuccessful | LinearGenomeView |
| <span id="action-showregions">**showRegions**</span><br><code>(regions: Region[], location?: NavLocation &#124; undefined) =&gt; void</code> | Replace the region list and place the viewport in one step. The pair is the unit a coarse-block consumer can act on: called separately they publish the viewport in between, and post-await in `navToLocations` they are two transactions, so a per-bp scan runs over a window that was never on screen.<br><br>With no location named it fits the regions rather than going through `showAllRegions`: the caller named the regions it wants, so it gets the width, where showAllRegions goes to the zoom-out LIMIT and its 10% margin is dead frame for a named subset. | LinearGenomeView |
| <span id="action-navtolocstring">**navToLocString**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(input: string, optAssemblyName?: string &#124; undefined, grow?: nu…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(input: string, optAssemblyName?: string &#124; undefined, grow?: number &#124; undefined) =&gt; Promise&lt;boolean&gt;</code></pre></dialog></span> | Navigate to the given locstring, will change displayed regions if needed, and wait for assemblies to be initialized | LinearGenomeView |
| <span id="action-navtolocations">**navToLocations**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(regions: ParsedLocString[], assemblyName?: string &#124; undefined,…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(regions: ParsedLocString[], assemblyName?: string &#124; undefined, grow?: number &#124; undefined) =&gt; Promise&lt;void&gt;</code></pre></dialog></span> | Similar to `navToLocString`, but accepts a list of parsed location objects instead of a locstring. Will try to perform `setDisplayedRegions` if changing regions | LinearGenomeView |
| <span id="action-navtolocation">**navToLocation**</span><br><span class="cell-more"><button type="button" class="cell-more-trigger"><code>(parsedLocString: ParsedLocString, assemblyName?: string &#124; unde…</code></button><dialog class="cell-dialog"><form method="dialog"><button class="cell-dialog-close" aria-label="Close">✕</button></form><pre><code>(parsedLocString: ParsedLocString, assemblyName?: string &#124; undefined, grow?: number &#124; undefined) =&gt; Promise&lt;void&gt;</code></pre></dialog></span> | Similar to `navToLocString`, but accepts a parsed location object instead of a locstring. Will try to perform `setDisplayedRegions` if changing regions | LinearGenomeView |
| <span id="action-flyto">**flyTo**</span><br><code>(centerBp: number, windowWidthBp: number) =&gt; void</code> | Travel to a window rather than appear in it: the Van Wijk arc from where the view is to where it is going, played over its own duration.<br><br>WHAT LANDS IS WHAT `setWindow` WOULD HAVE LANDED — only the path in between is new. That is what lets a caller offer an Undo, a snackbar or a follow anchor around this exactly as it did around the instant move.<br><br>It YIELDS to anything else that moves the view, by reading back what it wrote and stopping the moment the view holds something else: a wheel zoom, a drag, a locstring nav, or the Undo on the very snackbar the flight was launched with. Compared against what was WRITTEN rather than what was asked for, because the write clamps — an arc that pulls back past `maxBpPerPx` reads its own clamped result back, and treating that as interference would end the flight one frame in. `springAnimate` defends the same value the same way. | LinearGenomeView |
| <span id="action-flytocenter">**flyToCenter**</span><br><code>(coord: number, refName: string) =&gt; void</code> | `centerAt`'s animated twin: the same destination, reached along the arc instead of jumped to, at the zoom the view is already on. | LinearGenomeView |
| <span id="action-setdisplayname">**setDisplayName**</span><br><code>(name: string) =&gt; void</code> |  | [BaseViewModel](../baseviewmodel#action-setdisplayname) |
| <span id="action-setbodymounted">**setBodyMounted**</span><br><code>(flag: boolean) =&gt; void</code> | <span data-pagefind-ignore>See `bodyMounted`. Written by the view's container, which is the only thing that knows whether it rendered the body.</span> | [BaseViewModel](../baseviewmodel#action-setbodymounted) |
| <span id="action-setminimized">**setMinimized**</span><br><code>(flag: boolean) =&gt; void</code> |  | [BaseViewModel](../baseviewmodel#action-setminimized) |
| <span id="action-addtohighlights">**addToHighlights**</span><br><code>(highlight: HighlightType) =&gt; void</code> |  | [HighlightsMixin](../highlightsmixin#action-addtohighlights) |
| <span id="action-sethighlight">**setHighlight**</span><br><code>(highlight?: HighlightType[] &#124; undefined) =&gt; void</code> |  | [HighlightsMixin](../highlightsmixin#action-sethighlight) |
| <span id="action-removehighlight">**removeHighlight**</span><br><code>(highlight: HighlightType) =&gt; void</code> |  | [HighlightsMixin](../highlightsmixin#action-removehighlight) |
| <span id="action-updatehighlight">**updateHighlight**</span><br><code>(old: HighlightType, updates: Partial&lt;HighlightType&gt;) =&gt; void</code> |  | [HighlightsMixin](../highlightsmixin#action-updatehighlight) |
| <span id="action-setshowhighlightchips">**setShowHighlightChips**</span><br><code>(arg: boolean) =&gt; void</code> |  | [HighlightsMixin](../highlightsmixin#action-setshowhighlightchips) |

