# BaseDisplay

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/core/src/pluggableElementTypes/models/BaseDisplayModel.tsx).

Holds a display's parent track, the adapter config read from that track, its
load status and error, and the component that draws it. Every display
composes this model.

## Properties

| Member | Description |
| --- | --- |
| **id**<br><code>id: ElementId</code> |  |
| **type**<br><code>type: types.string</code> |  |

## Volatiles

| Member | Description |
| --- | --- |
| **error**<br><code>unknown</code> |  |
| **statusMessage**<br><code>string &#124; undefined</code> |  |
| **statusProgress**<br><code>number &#124; undefined</code> | determinate progress fraction [0,1] for the current status, or undefined when the in-flight phase is indeterminate. Set alongside `statusMessage` by `setStatusMessage`; a display that never shows a bar simply leaves it undefined. |

## Getters

| Member | Description |
| --- | --- |
| **parentTrack**<br><code>AbstractTrackModel</code> |  |
| **RenderingComponent**<br><code>FC&lt;{ model: ModelInstanceTypeProps&lt;…&gt; &amp; { error: unknown; statusMessage: string &#124; undefined; statusProgress: number &#124; undefined; } &amp; { readonly parentTrack: AbstractTrackModel; } &amp; IStateTreeNode&lt;IModelType&lt;{ id: IOptionalIType&lt;ISimpleType&lt;string&gt;, [undefined]&gt;; type: ISimpleType&lt;string&gt;; }, { error: unknown; statusMessage: string &#124; undefined; statusProgress: number &#124; undefined; } &amp; { readonly parentTrack: AbstractTrackModel; }, _NotCustomized, _NotCustomized&gt;&gt;; onHorizontalScroll?: ((distance: number) =&gt; void) &#124; undefined; blockState?: Record&lt;string, unknown&gt; &#124; undefined; }&gt;</code> |  |
| **DisplayBlurb**<br><code>FC&lt;{ model: ModelInstanceTypeProps&lt;{ id: IOptionalIType&lt;ISimpleType&lt;string&gt;, [undefined]&gt;; type: ISimpleType&lt;string&gt;; }&gt; &amp; { error: unknown; statusMessage: string &#124; undefined; statusProgress: number &#124; undefined; } &amp; { readonly parentTrack: AbstractTrackModel; } &amp; IStateTreeNode&lt;IModelType&lt;{ id: IOptionalIType&lt;ISimpleType&lt;string&gt;, [undefined]&gt;; type: ISimpleType&lt;string&gt;; }, { error: unknown; statusMessage: string &#124; undefined; statusProgress: number &#124; undefined; } &amp; { readonly parentTrack: AbstractTrackModel; }, _NotCustomized, _NotCustomized&gt;&gt;; }&gt; &#124; null</code> |  |
| **adapterConfig**<br><code>Record&lt;string, unknown&gt;</code> |  |
| **isMinimized**<br><code>boolean</code> | Returns true if the parent track is minimized. Used to skip expensive operations like autoruns when track is not visible. |
| **hoveredFeature**<br><code>unknown</code> | Overridable hook (default `undefined`): what the pointer is currently over, for readers **outside** the display. `LinearGenomeViewContainer` publishes it to `session.hovered`, the view-wide "what is the user pointing at" channel a plugin can subscribe to.<br><br>Declared here because a cross-display consumer can only read a name the base declares — the same reason `FetchMixin.fetchInert` is a hook rather than a getter each display invents. The container used to read `featureUnderMouse`, which only the wiggle, alignments and Manhattan families spelled that way — canvas said `hoveredFeature`, variants `hoveredGenotype` — so the channel carried a hover from a third of the display types and nothing said which. It also asked only `displays[0]` of each track.<br><br>`unknown` because the payload genuinely differs — a read, a wiggle bin, a SNP, a genotype cell — and `session.hovered` is typed to match ("can be anything; code that wants to deal with this should examine it"). Narrow it in the override. |
| **featureNoun**<br><code>string</code> | Overridable hook (default `'feature'`): the SINGULAR word for one of the things this display draws, as a menu row or a chip says it — "Hide this read", "Showing 3 variants".<br><br>Declared here for the same reason as `hoveredFeature` above: it is read across the display boundary, by chrome that has no idea which display it is drawing for (`SoloSelectionChip`, alignments' group-label overlay), and a name only the base declares is a name every such consumer can rely on. Two displays declared it independently and one of those declarations WAS this default.<br><br>**A control keeps the generic word; content takes this one.** "Variant height" reads as a different setting from "Feature height" when it is the same one, so the shared menus stay on "feature" however the display answers here, and the noun varies where it names what the user is looking at — "Showing 3 variants", "Hide this read". A display drawing something the generic word already fits is right to leave this alone.<br><br>Distinct from the per-hit noun a context menu takes off the clicked item's own `type` ("mRNA", "gene"); that names one annotation, this names what the track holds. The hit noun falls back to this. |
| **featureWidgetType**<br><code>{ type: string; id: string; }</code> | The widget `openFeatureWidget` opens for one of this display's features. Displays may override it. The default is the generic feature widget, for displays drawing plain features.<br><br>Displays whose features are a specific kind (a read, a variant, a synteny block) override it, including the `id`: two displays naming one id share the drawer panel, which suits two displays showing the same kind of feature. |
| **plotKeys**<br><code>string[]</code> | The grammar settings this display's config declares, by slot name (`PLOT_VOCABULARY`): what "Edit plot..." edits. Empty on a display with none, which then offers no editor. |
| **plot**<br><code>Plot</code> | Those settings as declared, defaults left off and a shorthand written as a config file writes it. An agent edits a `structuredClone` of it, checks it with `plotProblems` and hands it to `applyPlot`. |
| **schemaNotices**<br><code>string[]</code> | What the config's color objects and `scales.y` say together that cannot be drawn as written: the lines `plotProblems` and `jbrowse validate` report, which a display's corner notice lists before what only it can tell. |
| **plotExamples**<br><code>readonly PlotExample[]</code> | The worked examples this display type declares, which "Edit plot..." offers as buttons. |
| **configDocsUrl**<br><code>string</code> | This display type's page in the config reference, which lists every setting it takes. |

## Methods

| Member | Description |
| --- | --- |
| **renderingProps**<br><code>() =&gt; { displayModel: ModelInstanceTypeProps&lt;…&gt; &amp; { error: unknown; statusMessage: string &#124; undefined; statusProgress: number &#124; undefined; } &amp; { readonly parentTrack: AbstractTrackModel; } &amp; { readonly RenderingComponent: FC&lt;…&gt;; readonly DisplayBlurb: FC&lt;…&gt; &#124; null; readonly adapterConfig: Record&lt;…&gt;; readonly isMinimized: boolean; readonly hoveredFeature: unknown; readonly featureNoun: string; readonly featureWidgetType: { type: string; id: string; }; } &amp; IStateTreeNode&lt;IModelType&lt;…&gt;&gt;; }</code> | props passed to the renderer's React "Rendering" component. these are client-side only and never sent to the worker. includes displayModel and callbacks |
| **trackMenuItems**<br><code>() =&gt; MenuItem[]</code> |  |
| **liftPlot**<br><code>(draft: Plot) =&gt; AnyConfigurationModel</code> | A draft as the config would hold it, merged over `plot`, throwing what a config file would be refused for. Nothing on the display changes. |
| **plotProblems**<br><code>(draft: Plot) =&gt; string[]</code> | What a draft would report once applied, throwing a refusal as `liftPlot` does: what its color objects and `scales.y` say together that cannot be drawn as written. A display with a rule list over its settings overrides it; the draft still applies, and draws what it can. |
| **plotWrites**<br><code>(draft: Plot) =&gt; Record&lt;string, unknown&gt;</code> | What applying a draft would write, by setting: the lifted value where it differs from `plot`, `null` where it resets one. Throws a refusal. |

## Actions

| Member | Description |
| --- | --- |
| **setStatusMessage**<br><code>(status?: RpcStatus &#124; undefined) =&gt; void</code> |  |
| **setError**<br><code>(error?: unknown) =&gt; void</code> |  |
| **clearHoveredFeature**<br><code>() =&gt; void</code> | Overridable hook (default no-op): drop whatever `hoveredFeature` reports. The writing twin of that getter, and what `installClearHoverOnViewportChange` calls.<br><br>A display that STORES its hover owes an override; one that derives it from the live pointer (Hi-C, LD) owes nothing, and the default costs it nothing. Declared here so the clear can be installed for every display rather than remembered per display — forgetting it is the failure ARCHITECTURE.md's stored-hover section is about, and it used to be six closures at six call sites, which is six chances to omit one. |
| **reload**<br><code>() =&gt; void</code> | base display reload does nothing, see specialized displays for details |
| **applyDisplaySettings**<br><code>(settings: Record&lt;string, unknown&gt;, options?: { allowSetters?: boolean &#124; undefined; } &#124; undefined) =&gt; { applied: string[]; unapplied: UnappliedSetting[]; failed: { key: string; error: string; }[]; }</code> | Apply a set of display settings to the live display, and report which were applied. Each key runs through the display config schema's `preProcessSnapshot` (shorthand expansions and legacy-key migrations, as `showTrackGeneric` applies to a session spec's inline track keys), then writes the matching config slot. A key naming a channel (`facet`, `color`, `rows`, any object with a one-value shorthand) replaces the whole object, its string shorthand lifted by that schema, and `null` clears it; `scales` names members inside it and leaves the rest. Keys that are not slots come back in `unapplied` as `{ key, reason }`, so a caller can tell a misspelling from a key that has an action instead of a slot.<br><br>`allowSetters` also routes a non-slot key to a single-argument action named `set<Key>`. It is off by default because session specs, share links and embeds pass untyped JSON here, and a default fallback would let them call internal setters (`setError`, `setScrollTop`, ...) and call multi-argument setters with one argument. A caller that wants a specific action can call it directly.<br><br>A key whose write threw is reported in `failed`. Only `failed` means the caller passed a bad value. `unapplied` needs the caller's own context to read: `showTrackGeneric` spreads the same settings into the display's snapshot, so a declared prop (`resolution`) has already landed by the time it reports here, while the restyle path spreads nothing and every entry there did nothing.<br><br>A per-key error does not abort the remaining keys. A caller mid-`showTrack` has already pushed the track, and one rejected value should not leave it half-configured. |
| **applyPlot**<br><code>(draft: Plot) =&gt; void</code> | Write a draft over `plot`: each setting it changes is replaced whole, so a member left out of an object goes back to its default, and `null` resets the setting. A draft the schema refuses, or naming a setting outside the plot, throws before anything is written. |

