SyntenyColorsMixin
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
The colour settings every view drawing synteny tracks shares — the linear
synteny view, the dotplot and the circular view: TrackColorsMixin's colour
object and palette, the opacity object and the shortest alignment drawn,
over the tracks the view says it draws. A view supplies syntenyTracks(),
its opacity default and, optionally, the field it paints by until told
otherwise.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
opacityopacity: types.stripDefault(syntenyOpacityConfigSchema, {}) | The opacity every alignment draws at, a SyntenyOpacity object: a number for all of them, or a field each carries read into opacities, { field: "identity" } or a column the tracks declare. Unset, the view's default: low on the synteny view for dense whole-genome hairballs, opaque on the dotplot. | SyntenyColorsMixin |
| minAlignmentLength | Hide alignment blocks shorter than this many bp, which cuts whole-genome hairball noise. | SyntenyColorsMixin |
| color | The colour every track in the view paints with, a SyntenyColor object: { field: "strand" }, { field: "query" }, { field: "reference" }, { field: "track" }, a measurement (identity, mapq, dnds) or a column the tracks declare, with domain ordering a text column's labels, range colouring them and labels naming them in the key, and range or scheme, reverse and pinned ends reshaping a ramp; a colour string paints every alignment. Unset, the view's default paints: query on the circular view, the default scheme elsewhere. | TrackColorsMixin |
trackColorstrackColors: types.map(types.string) | trackId -> explicit color under color: { field: 'track' }. Absent means the track takes an automatic slot from the palette. | TrackColorsMixin |
hideUnlabelledhideUnlabelled: types.stripDefault(types.boolean, false) | Under a text-column mode, draw only the rows that carry a label. | TrackColorsMixin |
Volatiles
| Member | Description | Defined by |
|---|---|---|
seenAttributeRangesseenAttributeRanges: {} as Record<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. | TrackColorsMixin |
Getters
| Member | Description | Defined by |
|---|---|---|
defaultOpacitynumber | The constant opacity a reset returns to. | SyntenyColorsMixin |
opacitySettingSyntenyOpacitySnapshot | The opacity object as its snapshot holds it. | SyntenyColorsMixin |
opacityFadeSyntenyOpacitySnapshot | undefined | What the colour pass fades each alignment by: the field's mapping with its range as shares of opacityLevel, or undefined while opacity draws its constant, so the slider recolours nothing either way. | SyntenyColorsMixin |
opacityLevelnumber | The opacity every alignment draws at before a field's fade: the shader's uniform (opacityLevel). | SyntenyColorsMixin |
opacityFieldstring | The field opacity fades by, '' while it draws its constant. | SyntenyColorsMixin |
colorSettingSyntenyColorSnapshot | The color object as its snapshot holds it. | TrackColorsMixin |
colorRampDeclaredRamp | The ramp color declares over a preset's or a column's own: range or scheme for its stops, reverse, and its pinned ends and middle. Read off its own slots, so a key-only edit repaints no ramp. | TrackColorsMixin |
colorValuestring | undefined | color.value: the colour every alignment paints under the default mode in place of the view's own scheme, or undefined for that scheme. | TrackColorsMixin |
colorDomainreadonly string[] | color.domain, the order a text column's labels take. Read off its own slot, so a key-only edit (title, labels) recolours nothing. | TrackColorsMixin |
colorRangereadonly string[] | color.range, the colours a text column's labels take in domain order | TrackColorsMixin |
colorableAttributesstring[] | Distinct numeric columns across the overlaid tracks, in first-seen order — two tracks declaring dn offer one dn mode, not two. | TrackColorsMixin |
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.MONOTONIC, which is the point. 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 still says what the reader is looking at — the legend prints the actual numbers — and settles instead of oscillating. Monotonic 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 one legend lie about one of them. | TrackColorsMixin |
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. | TrackColorsMixin |
trackColorAssignmentsMap<string, string> | trackId -> the color it draws in under color: { field: 'track' }. Assigned across the whole view rather than per display, so an automatic slot can't duplicate a color pinned on a sibling. | TrackColorsMixin |
colorFieldstring | The field color paints by, '' for the default colour. | TrackColorsMixin |
hasLegendKeyboolean | Whether the mode has a key worth a box: a track palette, a ramp, a reader-named column, or strand wherever the shape does not show it (shapeShowsStrand), which leaves the colour the only strand cue. | TrackColorsMixin |
colorLegendChipsColorChip[] | Legend rows naming the overlaid tracks — one per track with its palette color, however many levels it is on, and only under color: { field: 'track' }, since every other mode has a fixed legend of its own. | TrackColorsMixin |
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. | TrackColorsMixin |
Methods
| Member | Description | Defined by |
|---|---|---|
syntenyTracks() => ComparativeTrackModel[] | Overridable hook: every synteny track in the view, in paint order. | SyntenyColorsMixin |
colorableTrackConfigs() => { trackId: string; name: string; }[] | SyntenyColorsMixin | |
colorableAttributeNames() => string[] | The columns the tracks declare in their adapter's attributeColumns (the ortholog-table adapter's slot), one colour mode each. | SyntenyColorsMixin |
legendAlpha() => number | The key's chips are composited by the plot's opacity, as the alignments are. | SyntenyColorsMixin |
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. | TrackColorsMixin |
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. | TrackColorsMixin |
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. | TrackColorsMixin |
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. | TrackColorsMixin |
shapeShowsStrand() => boolean | Overridable hook: whether an alignment's shape shows its strand, which spares the strand colours a key. A linear ribbon twists against its rows' directions, which their rulers show; a whole-genome dotplot is mostly dots with no slope to read. | TrackColorsMixin |
trackColorFor(trackId: string) => string | TrackColorsMixin |
Actions
| Member | Description | Defined by |
|---|---|---|
setOpacity(value: number) => void | The opacity slider: the constant, or under a field its range scaled so its most opaque end lands on value. | SyntenyColorsMixin |
setOpacityField(field: string) => void | Fade by field from the current opacity down to 0.3 of it, or with '' draw every alignment at the opacity the fade reached. | SyntenyColorsMixin |
setMinAlignmentLength(value: number) => void | SyntenyColorsMixin | |
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. | TrackColorsMixin |
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 is what calls it — the gesture a reader makes when the ramp is telling them nothing is to choose it again. | TrackColorsMixin |
setHideUnlabelled(value: boolean) => void | TrackColorsMixin | |
setColorField(field: string) => void | Set the field the view paints by over the color object ('' for the default colour), and rescale the ramp, which is the only way back from a domain one outlying window widened. | TrackColorsMixin |
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. | TrackColorsMixin |
setTrackColor(trackId: string, value: string | undefined) => void | Pin one track's color under color: { field: 'track' }, or release it back to an automatic palette slot. | TrackColorsMixin |
clearTrackColors() => void | TrackColorsMixin |
Related links
- Guide: URL query parameter API