MarkColor
Auto-generated config schema for the current JBrowse release — see the config guide for concepts. Provided by the marks plugin. View source.
Example usage
{ shape: 'bar', encoding: { y: 'score', color: 'steelblue' } }
{
shape: 'point',
encoding: { y: 'score', color: { field: 'strand', domain: ['1', '-1'] } },
}
{
shape: 'span',
encoding: {
color: {
field: 'score',
scale: 'log',
domainMin: 1,
domainMax: 1000,
range: ['white', 'red'],
},
},
}
{
shape: 'bar',
encoding: {
y: 'score',
color: {
field: 'score',
scale: 'linear',
domainMin: -2,
domainMax: 6,
domainMid: 0,
range: ['blue', 'white', 'red'],
},
},
}
{
shape: 'point',
encoding: {
y: 'score',
color: {
field: 'pip',
scale: 'threshold',
domain: [0.1, 0.5],
range: ['#357ebd', '#eea236', '#d43f3a'],
},
},
}
See the Config slots section below for all available configuration fields.
A mark's encoding.color: one CSS colour or jexl: callback for every
instance, or a field through a categorical scale (a range colour per
value), a linear or log scale (a ramp between domainMin and
domainMax, domainMid placing its middle stop where a diverging ramp
turns) or a threshold scale (a range colour per interval between the
cut points domain lists). A string is the constant; the object binds the
field, and a scale is what the legend describes.
Config slots
These slots go on a display entry: "displays": [{ "type": "MarkColor", ... }], or in the track's displayDefaults when this is its default display. 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 |
|---|---|
valuecolor = '#0068d1' | A CSS colour, or a jexl callback over feature returning one, for a mark whose colour is not a scale. Writing color: 'red' or color: 'jexl:…' directly on the encoding lands here.callback args: feature |
fieldfeatureField = '' | the feature field a scale reads, or a jexl expression over feature, which is slower per feature and so the opt-in |
scalemaybeStringEnum (none, categorical, linear, log, threshold) | how field becomes a colour: categorical hands out range colours per distinct value; linear and log read the value between domainMin and domainMax into a ramp; threshold cuts the value at the domain and hands each interval a range colour; none paints value, keeping a field for a switch back; unset beside a field, it is categorical |
domainstringArray = [] | for a categorical scale, the values in legend order, walking the range from the first entry and continuing into the default palette past its end (a value left out derives its colour from itself and never takes a listed value's, so every region agrees); for a threshold scale, the cut points in ascending order, a value taking the range entry for the number of them it is at or past, so range has one entry more than this; a linear or log scale reads domainMin and domainMax instead |
domainMinmaybeNumber | the bottom of a linear or log scale's domain; unset follows the loaded values |
domainMaxmaybeNumber | the top of a linear or log scale's domain; unset follows the loaded values |
rangecolorArray = [] | CSS colours a categorical scale hands its domain in order, a threshold scale its intervals, or a linear or log scale's ramp as evenly spaced stops; empty is the default palette, or the scheme |
schememaybeStringEnum (viridis) | a named ramp for a linear or log scale; range's colours, where it lists any, win over it |
reverseboolean = false | turns a linear or log scale's ramp round, so its last colour paints the bottom of the domain |
domainMidmaybeNumber | the value the ramp's middle stop sits at, so a diverging ramp centres somewhere other than the middle of the domain; unset, the stops are evenly spaced across it |