# MarkSize

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

A mark's width in px, as `color` is its color: a point's `size`, its
diameter, or a stroked mark's `strokeWidth`, a rule's or a line's
thickness or a link's stroke. A number is the constant every instance
takes, and is written to `value`; a string is a feature field, and is
written to `field`, which a link's `strokeWidth` reads through `scale`, a
linear or log scale into a px range, so a score becomes a width the way a
ramp makes it a color.

## Example usage

```js
{ mark: 'point', encoding: { y: 'score', size: 7 } }
```

```js
{
  mark: 'link',
  encoding: {
    strokeWidth: { field: 'score', scale: { type: 'log', range: [1, 8] } },
  },
}
```

## Config slots

A setting written to it replaces it whole: a member left out returns to its default. 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 |
| --- | --- |
| **value**<br>[`maybeNumber`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | The px every instance takes: a point's diameter, a rule's or a line's thickness, a link's stroke where it reads no `field`. Unset is the mark's own, 4 for a point or a rule, 1 for a line and 2 for a link. Writing `size: 7` lands here. |
| **field**<br>[`featureField`](https://jbrowse.org/jb2/docs/config_guides/slot_types#featurefield) = <code>''</code> | The feature field a link's stroke width reads, or a jexl expression over `feature`. Empty draws every instance at `value`. Writing `strokeWidth: "score"` lands here. |
| **scale**<br>[MarkSizeScale sub-schema](#slot-scaletype) | How the field's values map to widths, Vega-Lite's scale object. |
| **scale.type**<br>[`stringEnum`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringenum) (linear, log) = <code>'linear'</code> | `linear` or `log` between `domainMin` and `domainMax`. |
| **scale.domainMin**<br>[`maybeNumber`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | The value the thinnest width stands at; unset, the loaded regions' own least. |
| **scale.domainMax**<br>[`maybeNumber`](https://jbrowse.org/jb2/docs/config_guides/slot_types#the-maybe-types) | The value the widest width stands at; unset, the loaded regions' own greatest. |
| **scale.range**<br>[`stringArray`](https://jbrowse.org/jb2/docs/config_guides/slot_types#stringarray) = <code>[]</code> | The px at each end of the domain, thinnest first. When empty, it is 1 to 6. |

