# TrackHeightMixin

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/TrackHeightMixin.tsx).

Internal vertical scroll. `scrollContentHeight` and `scrollViewportHeight` (both default 0 = doesn't scroll). Brings the derived `scrollableHeight`, the clamped `setScrollTop` and the autorun that re-clamps when content shrinks

The display height lives on the `height` config slot, so it survives a track
being unticked and reticked. Displays with an auto-fit mode override the
`height` getter.

It also owns the **internal vertical scroll** of every display that paints a
fixed canvas at `-scrollTop`: a display overrides the two height hooks, and
passes itself to `ScrollChrome` and the wheel hooks.

## Volatiles

| Member | Description |
| --- | --- |
| **scrollTop**<br><code>number</code> |  |
| **hostHeight**<br><code>number &#124; undefined</code> | The height a host draws the display at where it is not the slot's: a ring of the circular view sets its band. Never persisted. |

## Getters

| Member | Description |
| --- | --- |
| **configuredHeight**<br><code>number</code> | The height the `height` slot asks for, which a drag or a session sets. |
| **allottedHeight**<br><code>number</code> | The height the display lays itself out in: its host's where one sets it, else the slot's. |
| **height**<br><code>number</code> |  |
| **resizing**<br><code>boolean</code> | True for the duration of a height drag on this track, whichever handle is running it. A display whose row geometry is a function of the track height restretches every row per animation frame, and can use this to sit an expensive per-frame layer out of the drag (MAF's dense per-base letter overlay is a Canvas2D pass that scales with rows x columns).<br><br>The flag itself is the track's (`BaseTrackModel`), so the view brackets a drag without needing the active display to have opted into this mixin. This getter reads it so that a display that did opt in has `self.resizing`. |
| **scrollContentHeight**<br><code>number</code> | Overridable hook: the height of the content that scrolls, in px. |
| **scrollViewportHeight**<br><code>number</code> | Overridable hook: the height of the window it scrolls behind, in px. |
| **scrollableHeight**<br><code>number</code> | How far the content scrolls. A sub-pixel overflow is 0: a fit mode that divides the viewport across n rows multiplies back to a few ULPs over it, and an extent of 1e-14px still draws a scrollbar and holds the wheel away from the page. |

## Actions

| Member | Description |
| --- | --- |
| **setScrollTop**<br><code>(scrollTop: number) =&gt; void</code> |  |
| **setHostHeight**<br><code>(height: number &#124; undefined) =&gt; void</code> |  |
| **setHeight**<br><code>(displayHeight: number) =&gt; number</code> |  |
| **resizeHeight**<br><code>(distance: number) =&gt; number</code> |  |
| **expandToContentHeight**<br><code>() =&gt; number</code> | Grow the track by the content it is hiding, for the resize handle's double click. Goes through `resizeHeight` so grow mode's override leaves grow first. |

