TrackHeightMixin
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
#crossCuttingMixin 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 |
|---|---|
scrollTopscrollTop: 0 |
Getters
| Member | Description |
|---|---|
heightnumber | |
resizingboolean | 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). 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. |
scrollContentHeightnumber | Overridable hook: the height of the content that scrolls, in px. |
scrollViewportHeightnumber | Overridable hook: the height of the window it scrolls behind, in px. |
scrollableHeightnumber | 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(scrollTop: number) => void | |
setHeight(displayHeight: number) => number | |
resizeHeight(distance: number) => number | |
expandToContentHeight() => number | 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. |