# TriangleMatrixMixin

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/TriangleMatrixMixin.ts).

A matrix drawn as a triangle over the view's axis (Hi-C, LD): the fetched payload (`rpcData`), the canvas box (`canvasWidth`, `matrixHeight` under the `matrixTop` hook), the rotate-and-squash transform and its inverse (`cellToScreen`, `screenToCell`), the frame the marks read (`triangleFrame`), the one-cell region map and canvas-wide block the mark backend draws (`matrixRegions`, `matrixBlocks`), and the `heightMode` slot. Composes after `TrackHeightMixin`, `GlobalFetchMixin` and `LegendMixin`

## Volatiles

| Member | Description |
| --- | --- |
| **rpcData**<br><code>D &#124; null</code> |  |

## Getters

| Member | Description |
| --- | --- |
| **heightMode**<br><code>"fit" &#124; "fixed"</code> |  |
| **matrixTop**<br><code>number</code> | Overridable hook (default 0): px reserved above the matrix. |
| **depthFraction**<br><code>number</code> | Overridable hook (default 1): the share of the full triangle's depth the payload reaches, which a banded matrix sets below 1 so fit mode stretches its strip over the display. |
| **canvasWidth**<br><code>number</code> | The canvas spans the scrolled content, boundary padding included. |
| **viewTransform**<br><code>{ viewScale: number; viewOffsetX: number; }</code> |  |
| **matrixRegions**<br><code>ReadonlyMap&lt;number, D&gt;</code> | The one payload under key 0, absent until the fetch lands. An empty matrix keeps the key: the cleared canvas is its picture. |
| **matrixHeight**<br><code>number</code> |  |
| **matrixBlocks**<br><code>RenderBlock[]</code> |  |
| **yScalar**<br><code>number</code> | The squash takes the content's base, without the boundary padding a scroll past either end adds. |
| **triangleTransform**<br><code>{ yScalar: number; yOffsetPx: number; viewScale: number; viewOffsetX: number; }</code> |  |
| **triangleFrame**<br><code>TriangleFrame</code> |  |

## Methods

| Member | Description |
| --- | --- |
| **cellToScreen**<br><code>(x: number, y: number) =&gt; { x: number; y: number; }</code> | Pre-rotation cell coordinates to display px. |
| **screenToCell**<br><code>(x: number, y: number) =&gt; { x: number; y: number; }</code> | The exact inverse of `cellToScreen`. |

## Actions

| Member | Description |
| --- | --- |
| **setRpcData**<br><code>(data: D) =&gt; void</code> |  |
| **setHeightMode**<br><code>(mode: "fit" &#124; "fixed") =&gt; void</code> |  |

