ScoreScaleMixin
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
#crossCuttingMixin Value scale, written in scales.y. valueScaleSchema / scalesSchema. Brings ScoreAxisMixin plus scaleType / scaleTypeChoices / autoscaleType / numStdDev / numQuantile / symlogConstant / manual* and their setters, i.e. the whole ScoreScaleModel interface the shared score menu and SetMinMaxDialog consume
The value scale of every quantitative display: wiggle, the multi-wiggle,
Manhattan, the alignments coverage band and the mark display each declare
scales.y through valueScaleSchema and compose this. It backs
ScoreAxisMixin's three overridable members off that object and adds
the setters that write it, so composing this is how a display satisfies
ScoreScaleModel in scoreMenuItems.ts — the interface the shared
Score menu, the scale and autoscale submenus and SetMinMaxDialog consume.
What a display's scale offers follows what it draws, so the members below
answer undefined where its factory call left them out: autoscaleType on
Manhattan, whose domain is plain min/max, and symlogConstant wherever
symlog is not among the scale types. scaleTypeChoices reads the declared
enum back, which is what the scale-type radio offers.
Deliberately just the scale. Colors, resolution, cross-hatches and the
autoscale computation stay in WiggleScoreConfigMixin / WiggleCommonMixin
— the alignments coverage band shares this scale but none of the rest.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Getters
| Member | Description | Defined by |
|---|---|---|
scaleTypestring | ScoreScaleMixin | |
scaleTypeChoicesstring[] | The scale types this display's own enum admits, which is what the scale-type radio offers; a display with one draws no radio. | ScoreScaleMixin |
autoscaleTypestring | undefined | undefined on a display whose domain consults no autoscale mode. | ScoreScaleMixin |
numStdDevnumber | ScoreScaleMixin | |
numQuantilenumber | ScoreScaleMixin | |
symlogConstantnumber | Raw slot; 0 means "derive from the domain". Resolve it with resolveSymlogConstant once the domain is known. | ScoreScaleMixin |
manualMinScorenumber | undefined | The lower bound the config pins, undefined where it pins none. | ScoreScaleMixin |
manualMaxScorenumber | undefined | The upper bound the config pins, undefined where it pins none. | ScoreScaleMixin |
scaleTitlestring | undefined | scales.y.title as written: undefined while unset, which leaves the caption to the display, and the empty string for an axis the author wants bare. Also undefined on a display whose scale declares no title. | ScoreScaleMixin |
scoreRulesDrawnboolean | Whether this display draws scales.y.rules, which is whether the score menu offers the reference lines: its scale declares them, and a scale it places y through rules a band for them to cross, which a density plot's colour-mapped rows and a colour ramp do not. | ScoreScaleMixin |
scoreRulesValueScaleRule[] | scales.y.rules, read off the live nodes: a snapshot strips a slot at its default, and a rule at 0 is one. Empty on a display whose scale declares no rules. | ScoreScaleMixin |
defaultScoreDomain[number | undefined, number | undefined] | Overridable hook: what each end of the domain falls back to where the config leaves its bound unset. [undefined, undefined] — the default — means autoscale both ends, which is right for a track whose scores have no absolute meaning (a bigwig's units are its own).A display whose scores are bounded by construction overrides it, so the axis stops being a function of what happens to be on screen: GC content is a fraction, so 0 and 1 are its real limits and mean the same thing at every locus. Autoscaled, the same GC value drew at different heights depending on where the user had panned, and the track could not be read across loci. A hook rather than a config default because the answer can depend on display state — GC's does, on gcMode — and rather than each display re-resolving the sentinels, which is the one thing that must not be duplicated: config bounds still win, precisely because they are checked before this is consulted. | ScoreAxisMixin |
valueScalesValueScale[] | Overridable hook (default none): the scales this display draws its y through. A display that answers it gets an axis per band of each, with its cross-hatches, placed by DisplayChrome and renderDisplaySvg, and the ticks derived below. | ScoreAxisMixin |
minScoreBoundnumber | undefined | Resolved lower bound; undefined means autoscale this end. | ScoreAxisMixin |
maxScoreBoundnumber | undefined | Resolved upper bound; undefined means autoscale this end. | ScoreAxisMixin |
hasManualScoreBoundsboolean | Whether the user has pinned either end, which is a different question from whether either end resolved to a number: defaultScoreDomain fills the unset ends in, so a GC content track answers yes to the second with nothing configured. The score menu asks this one — it gates the "Clear manual min/max" row, and a Clear that writes the nothing already there is a row that does nothing and never goes away. | ScoreAxisMixin |
axesYAxis[] | The axes, one per declared scale whose domain resolved: where each tick lands in the band's own pixel space, through computeYTicks unless the scale brought its own ladder, and where each of the scale's rules inside the domain lands in that same box, through the scale type the renderer places its values by. | ScoreAxisMixin |
Actions
| Member | Description |
|---|---|
setScaleType(scaleType: string) => void | |
setAutoscale(val?: string | undefined) => void | |
setMinScore(val?: number | undefined) => void | |
setMaxScore(val?: number | undefined) => void | |
setScoreRules(rules: (number | ValueScaleRule)[]) => void | Replaces scales.y.rules whole, each entry in a form the config takes: a number, or { value, color, label }. |