RowColor
Auto-generated from the config schema in the source. See the config guide for concepts. Built into JBrowse core. View source.
scale.unknown: '' colors no row but those rows.colors pins: the "None"
of the Color rows by menu and dialog.
rows.color, the row displays' rows colored by an attribute: one ordinal
color channel on the row axis. field names the row attribute whose values
take the colors, a samplesTsv column or a subtrack's group, and
scale.domain and scale.range pair its values with CSS colors, the rest
each taking a palette color. Under name, the default, each row is its
own value: the palette (scale.range, then the row palette) deals one
color per row, and only where the rows share one panel, a wiggle overlay,
since stacked rows are identified by their labels; scale.unknown is the
color every row takes instead, '' for none. A color pinned on one row is
rows.colors, which wins over this, so under name this takes no
scale.domain. A string is the field.
Each display paints a row's color on the element that identifies a row: the
quantitative display's plot, or the tint beside its label while a score
gradient paints; the multi-row feature display's blocks; the variant
display's label tint; the MAF display's label tint, over the adapter's
samples[].color; the mark display's label tint, over a listed source's
color. Not encoding.color, which on wiggle and the mark display paints by
value.
Example usage
{ type: 'LinearVariantDisplay', rows: { color: 'population' } }{
type: 'LinearVariantDisplay',
rows: {
color: {
field: 'population',
scale: { domain: ['EUR', 'AFR'], range: ['#1f77b4', '#ff7f0e'] },
},
},
}{
type: 'LinearMultiRowFeatureDisplay',
rows: { color: { scale: { unknown: '' } }, colors: { mom: '#b2182b' } },
}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. Slots a base configuration contributes are listed here too, so this table is the whole surface.
| Slot | Description |
|---|---|
scale.unknownmaybeColor |
The color every row the scale leaves out takes; '' for none. |
fieldstring = 'name' |
The row attribute whose values take the colors, or name, each row its own value. Under name with no scale.unknown, stacked rows keep only a file's own colors and the colors rows.colors pins, since the palette deals only where the rows share one panel. |
| scale RowColorScale sub-schema |
Which color each value of the field takes. Under name it takes no domain: a row's own color is rows.colors. |
| scale.domain |
The field's values that get a color, in order; none under name. |
| scale.range |
The CSS color each value in domain takes, in the same order; past them, the palette the other values deal from. |
Related links
- Developer guide: Upgrading to v5