# LinearMarkDisplay

Auto-generated from the config schema in the source. See the [config guide](https://jbrowse.org/jb2/docs/config_guide) for concepts. Provided by the `marks` plugin. [View source](https://github.com/GMOD/jbrowse-components/blob/main/plugins/marks/src/LinearMarkDisplay/configSchema.ts).

A grammar-of-graphics display for feature, alignments or variant tracks. It
is experimental in v5, and its settings may change. A list of marks —
bars, points, rules, lines, rects, text or links — each with an encoding
naming which feature fields feed its channels and a transform list run
before it. One fetch per region evaluates every encoding in the worker; the
marks draw in order over one score axis.

## Example usage

A BED score column as bars, colored by strand, with the key on screen,
and a per-10 kb count in its place once the view is wider than 100 bp
per px:

```js
{
  type: 'FeatureTrack',
  trackId: 'scores',
  name: 'Scores',
  assemblyNames: ['hg38'],
  adapter: { type: 'BedTabixAdapter', uri: 'https://example.com/scores.bed.gz' },
  displays: [
    {
      type: 'LinearMarkDisplay',
      displayId: 'scores-LinearMarkDisplay',
      marks: [
        {
          mark: 'bar',
          encoding: {
            y: 'score',
            color: { field: 'strand', scale: { type: 'ordinal' } },
          },
          maxBpPerPx: 100,
        },
        {
          mark: 'bar',
          transform: [
            { type: 'bin', step: 10000 },
            { type: 'aggregate', groupby: ['start', 'end'], ops: [{ op: 'count' }] },
          ],
          minBpPerPx: 100,
        },
      ],
    },
  ],
}
```

## Related links

- **Adapter:** [BedAdapter](../bedadapter)
- **Adapter:** [BedTabixAdapter](../bedtabixadapter)
- **Adapter:** [BigBedAdapter](../bigbedadapter)
- **Adapter:** [CrisprGuideAdapter](../crisprguideadapter)
- **Adapter:** [FromConfigAdapter](../fromconfigadapter)
- **Adapter:** [Gff3Adapter](../gff3adapter)
- **Adapter:** [Gff3TabixAdapter](../gff3tabixadapter)
- **Adapter:** [GtfAdapter](../gtfadapter)
- **Adapter:** [GtfTabixAdapter](../gtftabixadapter)
- **Adapter:** [NCListAdapter](../nclistadapter)
- **Adapter:** [SequenceSearchAdapter](../sequencesearchadapter)
- **Adapter:** [SPARQLAdapter](../sparqladapter)
- **Extended by:** [LinearManhattanDisplay](../linearmanhattandisplay)
- **Extended by:** [LinearMultiRowFeatureDisplay](../linearmultirowfeaturedisplay)
- **State model:** [runtime API](../../models/linearmarkdisplay)

## Color channels

| Setting | Page | `scale.type` | Preset fields |
| --- | --- | --- | --- |
| `marks.encoding.color` | [MarkColor](https://jbrowse.org/jb2/docs/config/markcolor#preset-fields) | ordinal, linear, log, symlog, threshold, identity | `strand`, `svType`, `impact`, `score` |
| `encoding.color` | [MarkColor](https://jbrowse.org/jb2/docs/config/markcolor#preset-fields) | ordinal, linear, log, symlog, threshold, identity | `strand`, `svType`, `impact`, `score` |

## Config slots

Display slots go on a display entry: `"displays": [{ "type": "LinearMarkDisplay", ... }]`, or in the track's [`displayDefaults`](https://jbrowse.org/jb2/docs/config_guides/tracks#configuring-displays) when this is its default display. Slot types (`fileLocation`, `frozen`, ...) are explained in the [config slot types reference](https://jbrowse.org/jb2/docs/config_guides/slot_types). Slots a base configuration contributes are listed here too, so this table is the whole surface.

| Slot | Description |
| --- | --- |
| **marks.encoding.shape.value**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) (circle, triangle-down, diamond, square) = <code>'circle'</code> | `circle`, `triangle-down`, `diamond` or `square`, or a jexl callback over `feature` returning one, for a point mark whose shape is not a scale.<br>_callback args:_ `feature` |
| **marks.encoding.shape.field**<br>[`featureField`](https://jbrowse.org/jb2/docs/config_guides/slot_types#featurefield) = <code>''</code> | The feature field an ordinal scale reads, or a jexl expression over `feature`, which is slower per feature. |
| **marks.encoding.shape.scale**<br>[MarkShapeScale sub-schema](#slot-marksencodingshapescaletype) | How the field's values map to shapes, Vega-Lite's scale object. |
| **marks.encoding.shape.scale.type**<br>[`maybeStringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) (ordinal) | `ordinal` assigns each distinct value of `field` a shape from `range`. Unset beside a `field`, it is `ordinal`. |
| **marks.encoding.shape.scale.range**<br>[`stringEnumArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenumarray) (circle, triangle-down, diamond, square) = <code>[]</code> | The shape names an ordinal scale assigns, in order. When empty, the scale uses `circle`, `triangle-down` and `diamond`. `square` is used only if listed. |
| **marks.encoding.shape.scale.domain**<br>[`stringArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringarray) = <code>[]</code> | The values in legend order, walking `range` from the first entry; left empty, each value's shape is computed from the value, so every region agrees. |
| **marks.encoding.shape.scale.names**<br>[`stringArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringarray) = <code>[]</code> | The key's name for each `domain` value, one each in order; a value past the end of the list shows its name. |
| **marks.encoding.shape.legend**<br>[MarkShapeLegend sub-schema](#slot-marksencodingshapelegendtitle) | The key this channel's scale draws. |
| **marks.encoding.shape.legend.title**<br>[`maybeString`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | The heading of the key an ordinal scale draws, naming what the shape marks. Unset, the key is titled with `field`; `""` is a key with no title. |
| **marks.encoding.shape.legend.values**<br>[`stringArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringarray) = <code>[]</code> | The values the key lists, in this order; empty lists every value the loaded regions met. A value left out still takes its shape. |
| **marks.encoding.shape.legend.missingLabel**<br>[`maybeString`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | The key's name for a feature with nothing in `field`; unset is "(no value)". Vega-Lite's legend has no such member, so it keeps its JBrowse name. |
| **marks.encoding.x**<br>[`featureField`](https://jbrowse.org/jb2/docs/config_guides/slot_types#featurefield) = <code>'start'</code> | The feature field, or jexl expression over `feature`, giving the mark's left edge in bp. |
| **marks.encoding.x2**<br>[MarkLocus](../marklocus) | The feature field, or jexl expression, giving the mark's right edge in bp, or for a link its far foot: an object naming the field holding the foot's sequence beside the one holding its position, where a mate may lie on another sequence. Left at `end` behind a `mate` step, it is the other end the step found. |
| **marks.encoding.y**<br>[`featureField`](https://jbrowse.org/jb2/docs/config_guides/slot_types#featurefield) = <code>''</code> | The feature field, or jexl expression over `feature`, plotted on the score axis. A feature whose value is not a finite number is skipped. When empty, the field is the one the steps before this mark's encode produce: a `coverage` step's depth, or the single output of an `aggregate` with one op. A bar or point with neither draws nothing and the track shows a corner notice, while a text with neither stands at the apex of a link drawn between its two ends, or in the middle of its band where none is. The scale it is read through is the display's `encoding.y`. |
| **marks.encoding.row**<br>[`featureField`](https://jbrowse.org/jb2/docs/config_guides/slot_types#featurefield) = <code>''</code> | The feature field, or jexl expression, naming the band the mark stands in, an integer from 0; a feature with nothing there sits on band 0. Empty reads the field the last `pileup` before this mark's encode wrote, this mark's own, the facet's or the display's, and puts every mark on one band across the whole plot where none packs. |
| **marks.encoding.color**<br>[MarkColor](../markcolor) | The mark's color: a field through an ordinal or continuous `scale`, written bare or as an object, or a constant `{ value }`, a CSS color or a jexl callback returning one. `legend` shapes the key the scale draws. |
| **marks.encoding.shape**<br>[MarkShape sub-schema](#slot-marksencodingshapevalue) | For a point mark: a field through an ordinal scale over `circle`, `triangle-down` and `diamond`, written bare or as an object, or a constant `{ value }`, one of those names, `square`, or a jexl callback returning one. `legend` shapes the key the scale draws. |
| **marks.encoding.text**<br>[`featureField`](https://jbrowse.org/jb2/docs/config_guides/slot_types#featurefield) = <code>'name'</code> | For a text mark: the feature field, or jexl expression over `feature`, it prints, `name` unset. A feature with nothing there prints nothing. |
| **marks.encoding.size**<br>[MarkSize](../marksize) | A point's diameter in px. The track menu's Point size writes every point mark's number. It is a px diameter, not Vega-Lite's area. |
| **marks.encoding.strokeWidth**<br>[MarkSize](../marksize) | A stroked mark's width in px, Vega-Lite's stroke width: a rule's or a line's thickness, or a link's stroke; a field, which a link alone reads, goes through a linear or log `scale` into a width, `scale.range` the px at each end of the domain. |
| **marks.mark**<br>[MarkDef](../markdef) | What the mark draws, a [MarkDef](https://jbrowse.org/jb2/docs/config/markdef) object or its `type` alone: `bar`, `point`, `rule`, `line`, `rect`, `text` or `link`, with the members one type reads, a line's or a link's `interpolate`, a rect's `height` and a line's `gapBp`. |
| **marks.encoding**<br>[MarkEncoding sub-schema](#slot-marksencodingshapevalue) | The feature field each of the mark's channels reads. Every channel has a default, so `{}` draws a bar from `start` to `end` with no value. |
| **marks.transform**<br>[list of MarkTransform entries](../marktransform) | Steps over the region's features before this mark encodes them, in order, after the display's own `transform`, and over each section alone under a facet. A `bin` then an `aggregate` grouped by `start` and `end` is a density: `count` per bin, which the mark plots as `y` unless its encoding names another field. |
| **marks.minBpPerPx**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>0</code> | The mark draws when the view's bp per px is at least this value. 0 sets no bound. With `maxBpPerPx` on another mark, one config shows a density zoomed out and the features zoomed in. |
| **marks.maxBpPerPx**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>0</code> | The mark draws only when the view is zoomed in past this, in bp per px. 0 sets no bound. |
| **marks**<br>[list of Mark entries](#slot-marksencodingshapevalue) | The marks to draw, in order — a later one paints over an earlier one. Each is a `mark` and an `encoding`. |
| **transform**<br>[list of MarkTransform entries](../marktransform) | Steps over the region's features before the facet splits them and before any mark's own, after `filter`: where a field the facet reads is made, such as a formula lifting a read's tag. |
| **facet**<br>[MarkFacet](../markfacet) | Labelled sections, one per value of a field, each as tall as its steps pack it: `"tags.HP"`, or `{ field, sort, transform }` with the order the sections stack in and the steps each runs before any mark's, a per-section `pileup` among them. A chip names each section and hides it. Split after `transform` and before any mark's own steps. Beside `rows`, a facet on a row attribute, the `group` `rows.groups` writes, stacks the rows in labelled bands instead, each band's rows in their arranged order. |
| **rows**<br>[MarkRows](../markrows) | One row per value of a field: `"source"` over a multi-BigWig is one xyplot per file. The worker splits the features on the field as it does for `facet`, and the rows take the tree sidebar, the row labels, clustering and the arrangement dialog, whose order, labels, colors, tree and focus this object holds. A row's color, `rows.colors` pinned on it or `rows.color` mapped from an attribute, is the bar beside its label, and the color of a mark naming none, or of a mark colored by the rows' own field. A `facet` on a row attribute, the `group` `rows.groups` tags, stacks the rows in bands; a facet on a feature field draws its sections in place of the rows, and the display shows a notice.<br>example: <code>{ rows: 'source' }</code><code>{ rows: { field: 'source', sort: ['tumor', 'normal'], step: 12 } }</code> |
| **encoding**<br>[MarkDisplayEncoding](../markdisplayencoding) | The display-level [MarkDisplayEncoding](../markdisplayencoding), shared by all marks. `y` is the [YChannel](../ychannel) that every mark's `encoding.y` uses, and it names no field because each mark sets its own. `color` is the default color for any mark whose `encoding.color` is unset, as a ggplot2 layer inherits the plot's aesthetics. `encoding.y.axis` is the value axis; the row axis is `rows.axis`.<br>example: <code>{ encoding: { y: { scale: { type: 'log' }, axis: { title: 'depth' } } } }</code> |
| **origin**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>0</code> | The value bars grow from. The axis widens to include it whenever a bar mark is drawn. |
| **legend**<br>[Legend](../legend) | The key for every mark whose color or shape is a scale; `show` defaults to on. |
| **filter**<br>[list of FieldPredicate entries](../fieldpredicate) | The features the display draws, a list of [FieldPredicate](https://jbrowse.org/jb2/docs/config/fieldpredicate) entries a feature must all pass: a field of the feature's own (`{ field: "score", gte: 5 }`) or a `jexl:` expression that must hold. |
| **height**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>150</code> | default height for the track |
| **fetchSizeLimit**<br>[`number`](https://jbrowse.org/jb2/docs/config_guides/slot_types#number) = <code>1000000</code> | bytes a region may fetch before the display asks first; an adapter that sets its own limit takes precedence over this<br>_advanced_ |
| **forceLoad**<br>[`boolean`](https://jbrowse.org/jb2/docs/config_guides/slot_types#boolean) = <code>false</code> | Declarative equivalent of the "Force load" button on the "too much data" banner: when true the display always renders, however large the region or dense the features. Off by default (the gate guards against huge downloads). Set it on a view with no user interaction, such as an embedded or notebook view or a screenshot, where the region is known and should draw without a click.<br>_advanced_ |

## Retired keys

An older config may still write these. Each loads without an error, and `jbrowse validate` reports it as stale.

| Key | On load |
| --- | --- |
| `maxFeatureScreenDensity` | ignored |
| `maxDisplayedBpPerPx` | ignored |
| `mouseover` | ignored |
| `jexlFilters` | moved into a current slot |
| `renderer` | ignored |
| `color` | ignored |

