# DotplotDisplay

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. Provided by the `dotplot-view` plugin. [View source](https://github.com/GMOD/jbrowse-components/blob/main/plugins/dotplot-view/src/DotplotDisplay/stateModelFactory.tsx).

Draws a `SyntenyTrack` as a dot plot inside a `DotplotView`.

The configuration slots for this model are documented on its [config schema page](../../config/dotplotdisplay).

Each section ends with the members a composed model contributes, linked to the page that documents them.

## Properties

| Member | Description |
| --- | --- |
| **type**<br><code>type: types.literal('DotplotDisplay')</code> |  |
| **configuration**<br><code>configuration: ConfigurationReference(configSchema)</code> |  |

1 inherited property from one model:

From [BaseDisplay](../basedisplay): [`id`](../basedisplay#property-id)


## Volatiles

| Member | Description |
| --- | --- |
| **rpcData**<br><code>DotplotRpcData &#124; undefined</code> | RPC-computed feature data |
| **instanceData**<br><code>DotplotInstanceData &#124; undefined</code> | GPU-instance positions produced from rpcData, self-describing via embedded bpPerPx, with no colors in them. Rebuilt only when the data or the zoom changes; the palette is joined on top by the `geometry` getter. |
| **geometryRegionSignature**<br><code>string &#124; undefined</code> | The `regionSignature` the fetch behind `rpcData` was laid out under — its positions are cumBp over the displayed regions' order, so they draw only while the axes still show it (`geometryCurrent`). The synteny twin stamps the same thing. |
| **fetchWarnings**<br><code>ComparativeWarning[]</code> | What the last completed fetch had to say about itself, written with the data it describes (see `setRpcData`). |
| **hoveredSegmentIdx**<br><code>number</code> | Index into `instanceData`'s per-SEGMENT arrays of the line the pointer is nearest, or -1.<br><br>The segment rather than the feature, even though the tooltip and the highlight are both about the feature: the feature index derives from this one (`hoveredFeatureIdx` below), and the CIGAR operator under the cursor derives from nothing else — a CIGAR-detailed alignment is a staircase of segments and the pointer is on one step of it. Same choice `LinearSyntenyDisplay.hoveredInstanceIdx` makes, where `getFeature` does the translating.<br><br>It addresses `instanceData`, so it is dropped by BOTH writers of that — a zoom rebuilds the geometry without refetching. |

12 inherited volatiles from 5 models:

From [BaseDisplay](../basedisplay): [`error`](../basedisplay#volatile-error), [`statusMessage`](../basedisplay#volatile-statusmessage), [`statusProgress`](../basedisplay#volatile-statusprogress)

From [ComparativeFetchMixin](../comparativefetchmixin): [`assembliesSwapped`](../comparativefetchmixin#volatile-assembliesswapped)

From [KeyedFetchMixin](../keyedfetchmixin): [`loadedFetchKey`](../keyedfetchmixin#volatile-loadedfetchkey)

From [FetchMixin](../fetchmixin): [`activeSignal`](../fetchmixin#volatile-activesignal), [`fetchGeneration`](../fetchmixin#volatile-fetchgeneration), [`reloadCounter`](../fetchmixin#volatile-reloadcounter), [`statusWindow`](../fetchmixin#volatile-statuswindow), [`fetchCanceled`](../fetchmixin#volatile-fetchcanceled), [`fetchRotation`](../fetchmixin#volatile-fetchrotation)

From [LodTierInfoMixin](../lodtierinfomixin): [`adapterHeaderRead`](../lodtierinfomixin#volatile-adapterheaderread)


## Getters

| Member | Description |
| --- | --- |
| **view**<br><code>DotplotViewModel</code> | The plot this display draws into. One getter rather than a `getContainingView` cast per reader, the same way `LinearSyntenyDisplay.view` answers it.<br><br>This names the view type even though the view names this display back (`dotplotDisplays`). That mutual reference resolves only because both model types are declared as `interface … extends Instance<…>` rather than `type … = Instance<…>` — see ADR-055. |
| **displayKey**<br><code>number</code> | Stable slot on the view-shared backend. Hashed from the node id, not taken from the track's index, so hiding or reordering a sibling can't hand this display another's buffer. |
| **fetchLanded**<br><code>boolean</code> | `ComparativeFetchMixin`'s hook: a fetch has completed (data is present, even if it mapped zero features). Not a feature-count test — an empty-but-finished fetch has landed, otherwise an empty plot spins the loading overlay forever. |
| **hasDrawable**<br><code>boolean</code> | `ComparativeFetchMixin`'s hook, answered with the instance geometry rather than `fetchLanded` or the `geometry` computed: `svgReady` is polled outside any reactive context, and a `geometry` read there recolors every segment per poll. |
| **computedColors**<br><code>Uint32Array&lt;ArrayBufferLike&gt; &#124; undefined</code> | Main-thread-computed per-segment colors — the gpuProps half of the rpcProps/gpuProps split. A color change recomputes this alone, without re-walking a single CIGAR.<br><br>The opacity level is NOT read here. It rides the shader's `alpha` uniform (and `drawDotplotInstances`' param) off `DotplotView.dotplotRenderState`, so the slider is a redraw, not a recolor — the same split synteny makes. A field's fade is (`opacityFade`). Baking it in made every drag frame recompute this array, re-pack every instance and re-upload the buffer. |
| **paintedRefNamePosition**<br><code>RefNamePosition &#124; undefined</code> | Where a refName sits in whichever axis' assembly `color` names — `Assembly.getRefNamePosition`, alias-aware — which the chromosome-painting modes hand the palette out by. Undefined for every other mode, and while the assembly is still loading — the color function falls back to its hash there.<br><br>It has to come from the assembly rather than from the features, because a color must not change with which chromosomes happen to be in view.<br><br>The dotplot twin of `LinearSyntenyDisplay.paintedRefNamePosition`, off the two axes instead of two stacked levels: 'query' is the horizontal axis (the feature's own refName lane) and 'target' the vertical (the mate's). |
| **paintedField**<br><code>string</code> | The view's `colorField` as this plot paints it. 'reference' is the horizontal axis, the one diagonalize orders the vertical against, so it paints as 'query' — the dotplot twin of `LinearSyntenyDisplay.paintedField`, which resolves it per level. |
| **trackColor**<br><code>string</code> | This track's slot in the plot's palette, used by the `track` field. Assigned by the view, not locally: pinning a color on one track shifts which automatic slots its siblings can take. |
| **trackId**<br><code>string</code> |  |
| **regionSignature**<br><code>string</code> | Both axes' region sets as one string, from each axis' own precomputed `regionSignature` — the dotplot twin of `LinearSyntenyDisplay.regionSignature`. |
| **geometryCurrent**<br><code>boolean</code> | The held positions were laid out under the regions the axes show now. Re-ordering the chromosomes moves every cumBp coordinate and nothing rebuilds them main-thread, so without this the canvas draws the old layout for the debounce plus the round trip — every alignment against the wrong chromosome. `LinearSyntenyDisplay.geometryCurrent` is the same call. |
| **geometry**<br><code>{ colors: Uint32Array&lt;ArrayBufferLike&gt;; x1: Float64Array&lt;ArrayBufferLike&gt;; y1: Float64Array&lt;ArrayBufferLike&gt;; x2: Float64Array&lt;ArrayBufferLike&gt;; y2: Float64Array&lt;ArrayBufferLike&gt;; instanceFeatureIdx: Uint32Array&lt;ArrayBufferLike&gt;; segmentOps: Uint8Array&lt;ArrayBufferLike&gt;; instanceCount: number; baseH: number; baseV: number; } &#124; undefined</code> | Instance positions joined with the computed colors: what the backends upload and what SVG export draws. The view's upload autorun reads this, so a palette change re-uploads without rebuilding geometry. Undefined while the geometry describes a region order the axes have left. |
| **hoveredFeatureIdx**<br><code>number</code> | Index into `rpcData`'s per-FEATURE arrays of the alignment the pointer is over, or -1. Derived rather than stored, so it cannot disagree with `hoveredSegmentIdx` about which alignment that is.<br><br>Not `instanceFeatureIdx[i] ?? i`: an out-of-range segment index reads `undefined` there, and falling back to the raw index would answer with a different feature rather than with nothing. Same reasoning as `LinearSyntenyDisplay.getFeature`.<br><br>Gated on `geometryCurrent` with the drawing: a reorder does not go through `setRpcData`, so a surviving index would name the wrong alignment over a canvas drawing nothing. |
| **tooltipLines**<br><code>string[] &#124; undefined</code> | The hovered feature's tooltip, as lines, or undefined when nothing is hovered. The dotplot twin of `LinearSyntenyDisplay.tooltipLines`; both feed `ComparativeTooltip`, which renders lines as text nodes — see `getDotplotTooltipLines`. |
| **hoveredFeatureHighlight**<br><code>DotplotHoverHighlight &#124; undefined</code> | The hovered feature redrawn over the canvas: an SVG path of its segments in plot px, plus its own packed color as CSS.<br><br>The hover shading is entirely this getter; neither renderer draws it. Synteny boosts alpha and darkens rgb per fragment from a `hoveredFeatureId` uniform, which costs an instance lane, a uniform, a hand-written Canvas2D twin of the same arithmetic, and a broken color run in `drawDotplotInstances`' batcher. Restroking one feature — a handful of segments — over the shared canvas needs none of that, and is backend-agnostic by construction: it draws the same over the GPU canvas and the Canvas2D fallback because it never asks which one painted. `renderSvg` deliberately does not draw it — an off-screen export has no pointer, and a transient hover has no business in a figure.<br><br>The cue is opacity + width, not hue: the plot's own `alpha` slider routinely sits at 0.2, so restroking opaque and a few px wider is exactly synteny's "the hovered one goes solid". Nothing here picks a highlight color, because every hue is already in use — category10 paints the chromosome modes, and red/blue/black are the strand and default schemes.<br><br>Recomputes on pan (through `plotTransform`'s `viewBpH`/`viewBpV`), so the highlight stays on its feature, and only while something is hovered. `plotTransform` rather than `dotplotRenderState`, which carries `alpha` and `lineWidth` too — an opacity drag would rebuild this path once a frame for a value it does not read. |
| **fetchRegions**<br><code>Region[]</code> | The h-axis fetch window: the visible content blocks expanded by the shared pan buffer and snapped outward to a buffer-sized grid, so a pan within the buffer neither refetches nor exposes an unfetched strip, and zoomed out it collapses to the whole displayed region. The v axis is deliberately not scoped: the fetch is one-dimensional (h regions in, every mate out), so a vertical pan needs no data the h window didn't already bring, and must never trigger a refetch.<br><br>Unlike synteny, nothing culls this window again in the worker — executeDotplotFeaturesAndPositions maps every feature it is handed — so the window's only job is to be a superset of what's on screen. |
| **viewSignature**<br><code>string</code> | `KeyedFetchMixin`'s hook, this display's half of `currentFetchKey`: the fetch-input signature (see fetchKey.ts) for the view's current state. The mixin appends the settings and adapter axes. Reactive: recomputes when either axis's zoom or displayed-region order/orientation changes, or when a pan carries the h axis into a new snapped fetch window. As a computed it only notifies when the string itself changes, which is what lets the fetch autorun track it and stay quiet through sub-buffer pans. |
| **lodTier**<br><code>LodTier</code> | The detail tier this plot's fetch asks the adapter for. Resolved here on the main thread, not adapter-side from `bpPerPx`, so it is part of `currentFetchKey` — see `resolveLodTier`. Both axes feed it: CIGAR detail is worth drawing when a block is wide on either one, so dropping to the no-CIGAR tier is only safe once both are past the threshold. The tier the adapter will serve once `lodTierInfo` has landed: a file with no coarse tier is 'fine' at any zoom, and the threshold is clamped up to the file's `--coarse` bound. |
| **displayPhase**<br><code>DisplayStatusPhase</code> | The display's own mutually-exclusive state, the way every LGV display publishes one — so `AppReadyMarker` counts this display's fetch, and the app stops reporting itself ready over a plot that is still working. Ranked by `comparativeDisplayPhase`, off the shared canvas's `surfaceReadiness` and this display's own fetch state.<br><br>`DisplayStatusPhase`, not `DisplayPhase`: the view owns the rendering backend, so this display can never be the one to report a backend failure. |
| **warnings**<br><code>ComparativeWarning[]</code> | Per-render fetch warnings, plus the load-time reversed-assembly hint. |

27 inherited getters from 5 models:

From [BaseDisplay](../basedisplay): [`parentTrack`](../basedisplay#getter-parenttrack), [`RenderingComponent`](../basedisplay#getter-renderingcomponent), [`DisplayBlurb`](../basedisplay#getter-displayblurb), [`adapterConfig`](../basedisplay#getter-adapterconfig), [`isMinimized`](../basedisplay#getter-isminimized), [`hoveredFeature`](../basedisplay#getter-hoveredfeature), [`featureNoun`](../basedisplay#getter-featurenoun), [`featureWidgetType`](../basedisplay#getter-featurewidgettype), [`plotKeys`](../basedisplay#getter-plotkeys), [`plot`](../basedisplay#getter-plot), [`schemaNotices`](../basedisplay#getter-schemanotices), [`plotExamples`](../basedisplay#getter-plotexamples), [`configDocsUrl`](../basedisplay#getter-configdocsurl)

From [ComparativeFetchMixin](../comparativefetchmixin): [`loading`](../comparativefetchmixin#getter-loading), [`refetching`](../comparativefetchmixin#getter-refetching), [`svgReady`](../comparativefetchmixin#getter-svgready)

From [KeyedFetchMixin](../keyedfetchmixin): [`dataSuperseded`](../keyedfetchmixin#getter-datasuperseded), [`currentFetchKey`](../keyedfetchmixin#getter-currentfetchkey), [`dataCurrent`](../keyedfetchmixin#getter-datacurrent)

From [FetchMixin](../fetchmixin): [`isLoading`](../fetchmixin#getter-isloading), [`isLoadingOrCanceled`](../fetchmixin#getter-isloadingorcanceled), [`fetchInert`](../fetchmixin#getter-fetchinert), [`awaitingPrerequisite`](../fetchmixin#getter-awaitingprerequisite), [`awaitingDependentData`](../fetchmixin#getter-awaitingdependentdata), [`settingsFetchInputs`](../fetchmixin#getter-settingsfetchinputs)

From [LodTierInfoMixin](../lodtierinfomixin): [`adapterHeader`](../lodtierinfomixin#getter-adapterheader), [`lodTierInfo`](../lodtierinfomixin#getter-lodtierinfo)


## Methods

| Member | Description |
| --- | --- |
| **renderSvg**<br><code>(opts: ViewExportSvgOptions &amp; { theme?: ThemeOptions &#124; undefined; }) =&gt; Promise&lt;Element &#124; null&gt;</code> |  |

5 inherited methods from one model:

From [BaseDisplay](../basedisplay): [`renderingProps`](../basedisplay#method-renderingprops), [`trackMenuItems`](../basedisplay#method-trackmenuitems), [`liftPlot`](../basedisplay#method-liftplot), [`plotProblems`](../basedisplay#method-plotproblems), [`plotWrites`](../basedisplay#method-plotwrites)


## Actions

| Member | Description |
| --- | --- |
| **setRpcData**<br><code>(data: DotplotRpcData, warnings: ComparativeWarning[], regionSignature: string) =&gt; void</code> | Commits a fetch result and the warnings it raised, tagged with the key it was fetched for. One action, not three: the warnings describe this result, so writing them separately let a failed refetch leave the last result's warnings standing over data they no longer describe, and each extra action is another round of the view's warning/upload observers per RPC completion. Same reason `LinearSyntenyDisplay.setRpcData` takes its feature and instance data together.<br><br>The loading flags are deliberately NOT touched here: this runs as `installComparativeFetchAutorun`'s `commit`, whose `finally` clears `isLoading` and the status line under the same staleness guard.<br><br>`setError` is not overridden either: the two callers that set one (the fetch skeleton's `catch`, `afterAttach`'s) already log it, so the override this display used to carry printed every fetch failure twice — and had to special-case `undefined` because the skeleton clears the error through the same setter before every fetch. |
| **setInstanceData**<br><code>(data: DotplotInstanceData &#124; undefined) =&gt; void</code> |  |
| **setHoveredSegmentIdx**<br><code>(idx: number) =&gt; void</code> | Written by the view's `setHoveredFeature`, which points the whole plot's hover at one hit — never per display from a component, so the N writes land in one MobX batch. |

17 inherited actions from 5 models:

From [BaseDisplay](../basedisplay): [`setStatusMessage`](../basedisplay#action-setstatusmessage), [`setError`](../basedisplay#action-seterror), [`clearHoveredFeature`](../basedisplay#action-clearhoveredfeature), [`reload`](../basedisplay#action-reload), [`applyDisplaySettings`](../basedisplay#action-applydisplaysettings), [`applyPlot`](../basedisplay#action-applyplot)

From [ComparativeFetchMixin](../comparativefetchmixin): [`setAssembliesSwapped`](../comparativefetchmixin#action-setassembliesswapped)

From [KeyedFetchMixin](../keyedfetchmixin): [`commitFetchResult`](../keyedfetchmixin#action-commitfetchresult)

From [FetchMixin](../fetchmixin): [`stopActiveFetch`](../fetchmixin#action-stopactivefetch), [`openStatusStream`](../fetchmixin#action-openstatusstream), [`cancelFetch`](../fetchmixin#action-cancelfetch), [`cancelFetchByUser`](../fetchmixin#action-cancelfetchbyuser), [`beforeDestroy`](../fetchmixin#action-beforedestroy), [`beginFetch`](../fetchmixin#action-beginfetch), [`endFetch`](../fetchmixin#action-endfetch), [`runFetch`](../fetchmixin#action-runfetch)

From [LodTierInfoMixin](../lodtierinfomixin): [`setAdapterHeader`](../lodtierinfomixin#action-setadapterheader)


