# FeatureGateMixin

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 `features` plugin. [View source](https://github.com/GMOD/jbrowse-components/blob/main/plugins/features/src/shared/FeatureGateMixin.ts).

The density axis of the region-too-large gate, composed after
`MultiRegionDisplayMixin`. A display opts in by composing this, spreading
`featureGateConfigSchemaFields` into its config, and calling
`commitGateMeasurements` from its fetch's `onComplete`.

## Volatiles

| Member | Description |
| --- | --- |
| **densityStatsPerRegion**<br><code>ObservableMap&lt;number, RegionDensityStats&gt;</code> | Per-region feature counts, so the verdict is a live max at the current `bpPerPx`. |

## Getters

| Member | Description |
| --- | --- |
| **gateEnabled**<br><code>boolean</code> | `types.compose` resolves a collision to the later argument, so this mixin must follow the one declaring the byte-gate opt-in. |
| **visibleFeatureDensityPerPx**<br><code>number</code> | Density at the debounced `coarseBpPerPx`, so the verdict shares the layout cadence. |
| **configuredMaxFeatureScreenDensity**<br><code>number</code> | The `maxFeatureScreenDensity` slot. Overridable for a display that holds it under a sub-schema (the variant display's `records`). |
| **maxFeatureDensity**<br><code>number &#124; undefined</code> | Undefined when the axis may not act. |
| **densityTooLarge**<br><code>boolean</code> |  |

## Methods

| Member | Description |
| --- | --- |
| **observedMaxDensity**<br><code>(bpPerPx: number) =&gt; number</code> |  |

## Actions

| Member | Description |
| --- | --- |
| **setDensityStats**<br><code>(displayedRegionIndex: number, stats: RegionDensityStats) =&gt; void</code> |  |
| **clearGateMeasurements**<br><code>() =&gt; void</code> | `RegionTooLargeMixin`'s hook: the density axis drops its counts on the trigger that drops the byte estimate, so a gate's measurements always come from one file. |
| **commitGateMeasurements**<br><code>(measurements: RegionGateMeasurement[], issued: GateFetchState) =&gt; void</code> | Judged by the tier captured at issue. |

