TrackColorsMixin
Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the developer guide for concepts. Built into JBrowse core. View source.
The color-by state shared by every view that can draw more than one synteny track at once: the view-wide color object and the palette that tells overlaid tracks apart.
A view supplies only colorableTrackConfigs — the dotplot walks its flat
tracks, a linear synteny view flattens levels. Everything downstream of
that list (palette assignment, mode resolution, legend rows) is identical, so
it lives here rather than being copied into both models.
Each section ends with the members a composed model contributes, linked to the page that documents them.
Properties
| Member | Description |
|---|---|
encodingencoding: types.stripDefault(syntenyEncodingConfigSchema, {}) | The channels every track in the view paints with, a SyntenyEncoding object. Its color is a SyntenyColor channel: "strand", "query", "reference", "track", a measurement (identity, mapq, dnds) or a column the tracks declare, with scale.domain ordering a text column's labels, scale.range coloring them and scale.names naming them in the key, scale.range or scale.scheme, scale.reverse and pinned ends reshaping a ramp, scale.type: 'threshold' binning a number at scale.domain's cuts, and scale.type: 'ordinal' painting a column's numbers one color each; { value } paints every alignment. Unset, the view's default paints: query on the circular view, the default scheme elsewhere. Its opacity is a SyntenyOpacity channel. |
trackColorstrackColors: types.map(types.string) | trackId -> explicit color under encoding.color: 'track'. Absent means the track takes an automatic slot from the palette. |
2 inherited properties from 2 models
From ParkedColorMixin: parkedColors
From SyntenyFilterMixin: filter
Volatiles
| Member | Description |
|---|---|
seenAttributeRangesRecord<string, AttributeRange> | The widest span each numeric channel has been seen to cover, over every fetch this view has taken — what keeps a column's ramp from re-scaling under a pan. Widened by observeAttributeRanges, dropped by resetAttributeRanges, read through attributeRanges, which is where the reasoning is. |
Getters
| Member | Description |
|---|---|
colorSettingSyntenyColorSnapshot | encoding.color as its snapshot holds it, with the view's default field where it names neither a field nor a constant. |
impliedColorFieldstring | undefined | The field the view paints while encoding.color names neither a field nor a constant, undefined for its default scheme. |
colorPaintSyntenyColorPaint | What encoding.color.scale declares over a field's own scale: its type, domain, range or scheme for its colors, reverse, and a ramp's pinned ends and middle. Read from these slots alone, so a key-only edit repaints nothing. |
colorValuestring | undefined | encoding.color.value: the color every alignment paints under the default mode in place of the view's own scheme, or undefined for that scheme. |
colorDomainreadonly string[] | encoding.color.scale.domain, the order a text column's labels take. Read from that slot alone, so a key-only edit (legend.title, scale.names) recolors nothing. |
colorRangereadonly string[] | The colors a text column's labels take in domain order: encoding.color.scale.range, else its scheme sampled once per domain value |
colorableAttributesstring[] | Distinct numeric columns across the overlaid tracks, in first-seen order — two tracks declaring dn offer one dn mode, not two. |
attributeRangesRecord<string, AttributeRange> | The span each numeric channel covers: unioned over the loaded displays, and over every fetch this view has already taken (seenAttributeRanges). A column has no declared domain, so this is what its ramp scales to, what the legend labels it with, and — since it is the one domain — what the two cannot disagree about.The domain is monotonic. A fetch's payload reports the span of the slice it holds, and that slice is the snapped window: painting straight off it re-maps every feature onto the ramp each time a pan rolls the window over, so a ribbon in the middle of the ramp turns into one at the bottom while the reader is scrolling and its value has not changed. A domain that only ever widens stays accurate for what the reader is looking at (the legend prints the actual numbers) and settles instead of oscillating. The domain is monotonic only until a mode is picked, which is the way back: one window holding an outlier would otherwise compress the ramp for the rest of the session, and the union above is over the loaded spans, so resetAttributeRanges rescales to what is on screen there and then.View-wide rather than per display because the floating legend is one box for the whole view: two displays scaling the same ramp from different spans would make that legend wrong for one of them. |
colorableTracksColorableTrack[] | colorableTrackConfigs paired with whatever color the user pinned. This is the single definition of "the tracks that get colors" — the palette, the legend and the palette menu all read it, so they cannot disagree about which tracks are in play. |
trackColorAssignmentsMap<string, string> | trackId -> the color it draws in under encoding.color: 'track'. Assigned across the whole view rather than per display, so an automatic slot can't duplicate a color pinned on a sibling. |
colorFieldstring | undefined | The field encoding.color paints by, undefined for the default color. |
hideUnlabelledboolean | Whether the filter drops the alignments with no value for the field the view paints by, the "Hide unlabelled rows" box. |
hasLegendKeyboolean | Whether the mode has a key worth a box: a track palette, strand with the indel wedges it recolors, a ramp, or a reader-named column. |
colorLegendChipsColorChip[] | Legend rows naming the overlaid tracks — one per track with its palette color, however many levels it is on, and only under encoding.color: 'track', since every other mode has a fixed legend. |
colorScalesColorScale[] | The active mode's key, or none for a mode without one. View-wide rather than per display because the key is one box for the whole view, and the ramp domain it labels is the view's. |
3 inherited getters from 2 models
From ParkedColorMixin: parkedColor
Methods
| Member | Description |
|---|---|
colorableTrackConfigs() => { trackId: string; name: string; }[] | The tracks that can take a palette slot, in paint order. Overridden by the composing view; a method rather than a getter because that is the form MST overrides cleanly. |
colorableAttributeNames() => string[] | Columns the overlaid tracks declare (an ortholog table's attributeColumns), each of which the palette menu offers as a separate mode, less the reserved color column. Overridden by the composing view, which is the only thing that can reach the track configs.From the config rather than from loaded data: the menu has to be right before the first fetch, and a track that declares a column with no values paints the default color anyway. |
loadedAttributeRanges() => Record<string, AttributeRange>[] | One entry per loaded display: the span each numeric channel actually covered in the data that display fetched. Overridden by the composing view, which is the only thing that can reach the displays. From loaded data rather than from the config, unlike colorableAttributeNames — a column's observed span is not declared anywhere, so nothing before the first fetch can answer it. |
legendAlpha() => number | Overridable hook: the alpha the key's chips are composited with. The ribbon views draw at a global alpha over the band's ground; a view that draws opaque leaves it. |
legendCigarOps() => number | undefined | Overridable hook: the indel ops the key lists a chip for, so it names only what the eye can find. undefined is the static menu preview; the dotplot draws flat points and never a CIGAR op. |
colorSurface() => SyntenyColorSurface | Overridable hook: what draws each alignment, a ribbon with match and indel blocks or one flat point (the dotplot). The key, the menu's help text and which fields key at all read it. |
offersReferenceColor() => boolean | Overridable hook: whether the view has a shared reference for the reference field to anchor on. It needs a stack of two or more levels; below that it is query or target by another name. |
trackColorFor(trackId: string) => string |
2 inherited methods from 2 models
From ParkedColorMixin: parkedColorOf
From SyntenyFilterMixin: lowerBound
Actions
| Member | Description |
|---|---|
observeAttributeRanges(ranges: Record<string, AttributeRange>) => void | Fold one fetch's observed attribute spans into the domain this view paints and labels its ramps with. Called by each display as its fetch lands, because the accumulation has to outlive the payload it came from: the previous window's span is gone from loadedAttributeRanges the moment the next one commits. |
resetAttributeRanges() => void | Forget the accumulated domain, leaving attributeRanges reporting what the loaded fetches cover and nothing else.The way back from a monotonic domain, and the only one: a single window holding an outlier widens the ramp for the rest of the session, and attributeRanges unions the loaded spans over this, so a reset rescales to what is on screen without waiting for a refetch. Picking a mode calls it: a reader picks the mode again when the ramp shows nothing useful. |
setHideUnlabelled(value: boolean) => void | |
setColorField(field: string | undefined) => void | Set the field the view paints by over encoding.color, undefined unsetting it for the view's default, and rescale the ramp, which is the only way back from a domain one outlying window widened. |
setColorValue(value: string | undefined) => void | Paint every alignment value, undefined returning to the view's default. |
openSolidColorDialog() => void | The picker Color by's Solid color... opens. |
setColorDomain(domain: string[]) => void | Declare the order a text column's labels take. The labels listed lead, the rest follow sorted; an empty list gives back the order the fetches found them in. |
setTrackColor(trackId: string, value: string | undefined) => void | Pin one track's color under encoding.color: 'track', or release it back to an automatic palette slot. |
clearTrackColors() => void |
3 inherited actions from 2 models
From ParkedColorMixin: parkColor
Related links
- Docs: URL query parameter API