# CoarseTierMixin

Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the [developer guide](https://jbrowse.org/jb2/docs/developer_guide/) for concepts. Built into JBrowse core. [View source](https://github.com/GMOD/jbrowse-components/blob/main/packages/display-kit/src/CoarseTierMixin.ts).

The zoomed-out tier a display draws in place of its detail past a threshold
the display sets: MAF's summary bars. This mixin adds the swap decision, the
per-region payloads and the read that fills them, through the shared fetch
skeleton on a separate rotation, so the detail fetch's cancel never reaches
it.
While the tier is up the byte gate measures the coarse read, so its refusal
is the banner and the detail fetch stands down.

The payloads live beside the foundation's per-region store, never in it,
and the read records a span for the coarse tier alone: the two tiers fetch
different widths of the same `displayedRegionIndex`, so one `loadedRegions`
entry stamped by both would narrow the coarse span to the detail's on every
zoom in and re-read the coarse adapter about an octave back out. The detail store keeps its
entries under the tier — a display masks them where it draws, and zooming
back in draws what it held.

A display states its tier through the hooks below: the adapter slot the
source sits on, the threshold, what the read depends on beyond the span, and
the read itself. Composed after `MultiRegionDisplayMixin`, so its
`displayPhase` and `svgReady` are the ones `types.compose` keeps.

## Volatiles

| Member | Description |
| --- | --- |
| **coarseTier**<br><code>ObservableMap&lt;number, P&gt;</code> | The coarse payload by `displayedRegionIndex`, over the regions the last read was issued for. Cleared on chromosome navigation. |
| **coarseTierRead**<br><code>CoarseTierRead &#124; undefined</code> | What the held payloads were read over — the buffered regions and the read key — so a pan or a zoom inside them re-reads nothing. Undefined until a read lands. |
| **coarseTierLoading**<br><code>boolean</code> |  |

## Getters

| Member | Description |
| --- | --- |
| **coarseAdapterSlot**<br><code>string &#124; undefined</code> | Overridable hook (default none): the slot on the track's adapter the coarse source sits in — `summaryAdapter` on MAF. With no slot there is no source and the tier never stands in. |
| **coarseTierPastThreshold**<br><code>boolean</code> | Overridable hook (default false): the display's own line past which the tier stands in — a bp/px slot, a span floor. |
| **coarseReadKey**<br><code>unknown</code> | Overridable hook (default `''`): what the read depends on beyond its span and its adapter — a zoom bucket, the settings axis. A value compared structurally, so a held read whose key differs re-reads. |
| **coarseSourceConfig**<br><code>unknown</code> | The coarse source's config, read off the live track config so a re-pointed adapter follows. |
| **hasCoarseSource**<br><code>boolean</code> |  |
| **coarseTierActive**<br><code>boolean</code> | Whether the coarse tier stands in for the detail right now. |
| **coarseTierStandsIn**<br><code>boolean</code> | Whether the tier is standing in for the detail on screen right now: the tier's verdict over a measured view. |
| **byteGateAdapterPath**<br><code>ByteGateAdapterPath</code> | `RegionTooLargeMixin`'s hook: measure the adapter of the fetch that is about to run, so the estimate and the budget describe one file. |
| **coarseTierIssueKey**<br><code>{ adapter: (Record&lt;string, unknown&gt; &amp; { type: string; }) &#124; undefined; read: unknown; }</code> | The whole key a read is held under: the coarse adapter and the display's own term. |
| **fetchSuspended**<br><code>boolean</code> | `MultiRegionDisplayMixin`'s hook: the coarse read is the measurement pass while the tier stands in, so the detail fetch has nothing to do. |
| **displayPhase**<br><code>DisplayPhase</code> | The foundation's phase with the too-large banner swapped for the tier — see `coarseTierDisplayPhase`. |
| **svgReady**<br><code>boolean</code> | The export gate under the same swap — see `coarseTierSvgReady`. |

## Actions

| Member | Description |
| --- | --- |
| **setCoarseTier**<br><code>(entries: CoarseTierEntry&lt;P&gt;[], read: CoarseTierRead) =&gt; void</code> |  |
| **clearCoarseTier**<br><code>() =&gt; void</code> |  |
| **setCoarseTierLoading**<br><code>(loading: boolean) =&gt; void</code> |  |
| **fetchCoarseTier**<br><code>(_read: CoarseTierRead, _ctx: FetchContext) =&gt; Promise&lt;CoarseTierResult&lt;P&gt;&gt;</code> | Overridable hook (no-op base): the coarse read over `read.regions`, returning one payload per region it covered, or a refusal. `ctx` is the skeleton's — its `callRpc` passes the signal and the status slot, and `isStale` guards any write the read makes for itself before it returns. |

