DotplotView
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Provided by the dotplot-view plugin. View source.
Example usage
Hand-authored under defaultSession.views, with every setting written
directly on the view object. views lists the two assemblies on the axes and
tracks the synteny track(s) to plot (self-vs-self is allowed):
{
type: 'DotplotView',
views: [{ assembly: 'hg38' }, { assembly: 'mm10' }],
tracks: ['hg38_vs_mm10.paf'],
color: { field: 'query' },
}autoDiagonalize and a per-axis loc on each views entry are the other
launch keys; everything else is a property below.
Members a composed model contributes are listed here too, so these tables are the whole surface.
Properties
| Member | Description | Defined by |
|---|---|---|
idid: ElementId | DotplotView | |
typetype: types.literal('DotplotView') | DotplotView | |
heightheight: types.stripDefault(types.number, defaultHeight) | the height of the plot in pixels | DotplotView |
| trackSelectorType | vestigial: the hierarchical selector is the only one that exists, so this value is ignored. Retained because saved sessions and share links persist it. | DotplotView |
assemblyNamesassemblyNames: types.stripDefault(types.array(types.string), []) | the two assemblies being compared, horizontal axis first. A spec normally names these per axis instead, as views[0].assembly and views[1].assembly. | DotplotView |
drawCigardrawCigar: types.stripDefault(types.boolean, true) | resolve each alignment's CIGAR into the drawn shape rather than plotting it as a single straight segment | DotplotView |
showGridlinesshowGridlines: types.stripDefault(types.boolean, true) | carry each axis' ruler ticks across the plot as faint lines, the way LinearGenomeView's gridlines carry its own down over the tracks | DotplotView |
showTickLabelsshowTickLabels: types.stripDefault(types.boolean, true) | number each axis' major ticks; off keeps the tick marks and the chromosome names | DotplotView |
lockAspectRatiolockAspectRatio: types.stripDefault(types.boolean, false) | When true, hview and vview are kept at the same bpPerPx so the dotplot stays square. Wheel zoom already preserves the ratio; box-zoom and other independent ops trigger an autorun resync. | DotplotView |
lineWidthlineWidth: types.stripDefault(types.number, DEFAULT_LINE_WIDTH) | Line width in CSS pixels of every alignment in the plot | DotplotView |
| minIdentity | Hide alignments whose sequence identity is below this fraction (0-1), enforced per feature in buildLineSegments beside minAlignmentLength. A feature carrying no identity at all is kept at every threshold — the alternative blanks a plot whose adapter simply never reported one. | DotplotView |
hviewhview: types.optional(DotplotHView, {}) | the horizontal axis, as a full 1D view state. A spec writes views[0] instead, which the launcher resolves into this. | DotplotView |
vviewvview: types.optional(DotplotVView, {}) | the vertical axis, the counterpart to hview. A spec writes views[1]. | DotplotView |
trackstracks: types.array(pm.pluggableMstType('track', 'stateModel')) | DotplotView | |
| launch | transient launch state: the settings written on the view object that need resolving before they can be view state — the two axis assemblies, track recipes, highlights. preProcessSnapshot moves them here off the snapshot, the afterAttach autorun applies them and clears this, so a saved session never retains it. Not written by hand: author every setting directly on the view. | DotplotView |
displayNamedisplayName: types.maybe(types.string) | displayName is displayed in the header of the view, or assembly names being used if none is specified | BaseViewModel |
minimizedminimized: types.stripDefault(types.boolean, false) | collapse the view to its header bar, keeping it in the session rather than closing it | BaseViewModel |
| lodMode | Level-of-detail tier selection for PIF adapters. 'auto' uses the adapter's bpPerPx threshold; 'fine' forces the per-row CIGAR tier (t/q); 'coarse' forces the tier whose CIGAR is folded to its large indels (T/Q) when present. One value for the view, so every track draws at the same tier. | SyntenyViewMixin |
alphaalpha: types.stripDefault(types.number, defaultAlpha) | Opacity of every alignment, 0 to 1. The synteny view defaults it low for dense unfiltered hairballs (with minAlignmentLength set, ~0.4 gives stronger colour); the dotplot defaults it opaque. | 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 |
|---|---|---|
volatileWidthvolatileWidth: undefined as number | undefined | DotplotView | |
volatileErrorvolatileError: undefined as unknown | DotplotView | |
| cursorMode | these are 'personal preferences', stored in volatile and loaded/written to localStorage | DotplotView |
widthwidth: 800 | BaseViewModel | |
bodyMountedbodyMounted: true | Whether the container has this view's body in the DOM.ViewContainer mounts a view's body only while an IntersectionObserver says it is on screen, to hold the app under the WebGL2 context ceiling (reference/GPU_PORTABILITY.md). A view below the fold therefore has no canvas, so nothing ever calls markCanvasDrawn and the pre-first-paint term of displayPhase pins every display in it at loading with nothing left to resolve it — which parks [data-app-phase="ready"] for the whole app on a view the user cannot see.Defaults true so the containers that always mount a body — embedded views, workspace panels, and any test rendering a display directly — are unaffected and need not set it. The raw flag, written by this view's own container. A display asks effectiveBodyMounted instead, because a nested view has no container of its own. | BaseViewModel |
canvasDrawncanvasDrawn: false | flips true on first paint; read by test selectors to detect render | RenderLifecycleMixin |
paintCountpaintCount: 0 | bumped after every frame the backend painted, so a consumer that reads this display's canvas — the circular view's ring, which copies the strip into a texture — knows when the pixels moved | RenderLifecycleMixin |
currentRenderingBackendcurrentRenderingBackend: undefined | current backend reference, updated on context-loss recovery. Typed unknown (not generic B) on purpose: this mixin is composed by every display via a non-generic factory, so the per-display backend type B isn't known here — it's supplied at attachRenderingBackend<B> and narrowed with as B inside the autoruns. Don't "fix" the cast. | RenderLifecycleMixin |
renderTickrenderTick: 0 | counter the render autorun observes; bumped to force a re-render | RenderLifecycleMixin |
autorunsInstalledautorunsInstalled: false | guards attachRenderingBackend so the autorun pair spawns once per instance | RenderLifecycleMixin |
renderErrorrenderError: undefined | the render-backend (GPU/Canvas2D init or context-loss) error, or undefined. Single source of truth for the render-error terminal state: useRenderingBackend writes it from the canvas-init mechanism so the model — not React-local hook state — owns every terminal state. Read by displayPhase (whose renderError term outranks loading, suppressing the scrim) and by DisplayChrome (shows the retry overlay). | RenderLifecycleMixin |
offScreenoffScreen: false | the display's canvas has scrolled out of the page, so the render autorun skips pan and zoom redraws, still draws new data, and hands its GPU targets back after every tick. Written by useRenderingBackend, which watches the canvas element itself — false everywhere IntersectionObserver is absent, which is every unit test and every non-browser host.A whole view that scrolls away is already unmounted ( useViewVisibility) and a minimized track never mounts, so what this covers is the track below the fold of a view that IS mounted: the display list is not windowed, and each of those tracks holds a full-height multisampled target. | RenderLifecycleMixin |
awaitingAutoDiagonalizeawaitingAutoDiagonalize: false | True while the init autorun is waiting on the diagonalize RPC. Gates the canvas off — otherwise the user watches an undiagonalized hairball flash before the reorder kicks in. | DiagonalizeProgressMixin |
pendingAutoDiagonalizependingAutoDiagonalize: false | A reorder this init asked for that has not succeeded yet. Raised before any render can paint, and lowered only once the pass RESOLVES — a skipped or thrown reorder leaves it up, so the view's settled gate never reports done on an undiagonalized view and the capture fails loudly (times out) instead of committing a hairball.One flag rather than a requested/complete pair: the two only ever moved together, and every state a pair can drift into either wedges the gate shut or opens it on the wrong pass. | DiagonalizeProgressMixin |
diagonalizeStatusdiagonalizeStatus: createStatusChannel() | Live status from the auto-diagonalize RPC (download %, parse, algorithm phase) shown on the reordering spinner; blank outside that wait. A StatusChannel rather than a status field plus a setter: there is one operation to narrate here, and the channel is that pair with the message/fraction split already done, so the spinner reads { message, fraction } instead of calling statusMessageText / statusFraction at every render site. | DiagonalizeProgressMixin |
diagonalizeCanceldiagonalizeCancel: undefined as (() => void) | undefined | Aborts the in-flight auto-diagonalize, so the spinner's Cancel can reach it; undefined when none is running. | DiagonalizeProgressMixin |
diagonalizeErrordiagonalizeError: undefined as unknown | Why the last reorder failed, while its gate is still up; cleared by the next run, a finish or a cancel | DiagonalizeProgressMixin |
| importFormSyntenyTrackSelections | ImportFormSyntenyMixin | |
colorLegendDismissedForcolorLegendDismissedFor: undefined as string | undefined | The field whose legend the reader closed. The legend comes back with the next field that has one, so a dismissal is scoped to the field it was made in rather than being a setting to find again. | SyntenyViewMixin |
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 |
|---|---|---|
ownTracksany[] | The census entry for this view: the tracks it holds itself. Declared rather than derived — see BaseViewModel.ownTracks. | DotplotView |
widthnumber | DotplotView | |
borderXnumber | Left margin: fits the vertical (vview) axis labels. Derived purely from that axis's regions + zoom — never from viewWidth — so it can't feed back through viewWidth = width - borderX into a render loop. | DotplotView |
borderYnumber | Bottom margin: fits the horizontal (hview) axis labels. See borderX. | DotplotView |
| pendingLaunch | the launch state that still has something to apply — the gate every loading and import-form path below reads. | DotplotView |
assemblyErrorsstring | undefined | DotplotView | |
highlightsHighlightType[] | the session's highlights on either axis' assembly | DotplotView |
assembliesInitializedboolean | DotplotView | |
axisAssemblyErrorError | undefined | A dotplot plots one assembly against another, so anything but two names here cannot lay out. initializeDisplayedRegions walks the two axes in step with this array, so one name leaves the other axis with no regions and initialized never comes true — the view sat on its spinner saying "Loading" forever, with the assembly it was supposedly waiting for already loaded. Extra names fail the other way: nothing reads past the second, so a third assembly is not plotted and nothing says so.Only reachable from a hand-authored snapshot — setAssemblyNames writes both, and applyInit already rejects an init naming one — and that snapshot is the case this error reports. Zero names is not an error: it is the import form. | DotplotView |
errorunknown | The view's terminal state: whatever the import form's submit threw, else a pair of axes that cannot lay out, else whatever the assemblies did. Declared here rather than beside menuItems so every reader below is the same expression — showImportForm and showLoading each used to re-spell it, and showLoading spelled it as a two-term && that a third source of error would have to be added to in three places. | DotplotView |
initializedboolean | DotplotView | |
hasSomethingToShowboolean | DotplotView | |
initPendingboolean | An init blob that has not been applied yet — installInitAutorun clears it as the last thing an apply pass does. The plot is assembling itself: the axes can already exist, and be initialized, while the tracks or the region restriction are still to come, which is why the settled gate reads this.Read by settled, deliberately not by showLoading — a plot whose axes are up is worth showing while the rest lands. LGV's equivalent is awaitingInitNavigation, a narrower thing (init set and nothing on screen at all) that it does fold into showLoading; it used to share this name, and the two disagree exactly where a reader would assume they agree. | DotplotView |
showImportFormboolean | Whether to show the import form | DotplotView |
showLoadingboolean | Whether to show a loading indicator instead of the import form or view | DotplotView |
| loadingAssembly | The assembly whose load the spinner is waiting on. init names them before assemblyNames is materialized, so it is the source until then. | DotplotView |
loadingViewLoading | undefined | What the loading screen says while showLoading, read off the assembly whose load is the wait; undefined otherwise. | DotplotView |
statusViewStatus | The view's lifecycle as one value — ready, error, loading or noRegions — for a host that draws its own chrome and has to render all four. Same shape and same precedence as the linear view's, through computeViewStatus. | DotplotView |
viewWidthnumber | Plot area width. Floored at 0: the axis borders have their own MIN_BORDER floor, so a container narrower than that would otherwise yield a negative canvas dimension and a negative maxBpPerPx. | DotplotView |
viewHeightnumber | Plot area height. Floored at 0, see viewWidth. | DotplotView |
gridlinesEmptyboolean | The setting is on and neither axis has a ruler to cast — a ticked checkbox doing nothing observable, which the menu says out loud rather than looking broken. The whole-genome view is this. | DotplotView |
hasVisibleRegionsboolean | Both axes have a region on screen, so the plot has a grid to draw and a first block to anchor its backdrop rect on. The grid reads the two block lists' heads, which only this makes safe. | DotplotView |
| views | DotplotView | |
number | The zoom-out limit both axes share under lockAspectRatio: one bpPerPx has to fit the LONGER genome, so it is the larger of the two axes' own fits. Read back by each axis as its maxBpPerPx (see axisMaxBpPerPx), so every route to a zoom — the buttons, the wheel, box-zoom, showAllRegions — clamps against the same ceiling. | DotplotView |
dotplotDisplaysDotplotDisplayModel[] | Every DotplotDisplay under this view's tracks. Filtered by type rather than taken as tracks[i].displays[0]: showTrack only ever builds one view-compatible display, but a hand-written or legacy session snapshot is hydrated verbatim, and an empty or foreign displays array put an undefined into this list that every consumer below dereferences — settled and geometryByDisplayKey both crash the view on it. Same spelling as the synteny level's linearSyntenyDisplays.Not index-aligned with tracks, so a consumer that wants a display's track reads display.parentTrack rather than tracks[i]. | DotplotView |
trackWarningsTrackWarning[] | Every loaded track's render warnings, under the name to report them by. Shared with the synteny view's own report (see collectTrackWarnings for why the name has to come off the display's parentTrack), and a cached computed rather than a render-time flatMap: the header that reads it re-renders on every pointermove of a selection drag, and resolving a name is a getConf per track. | DotplotView |
surfaceReadinessComparativeSurface | The plot rect as the displays drawing onto it see it: first paint, plus the two flags that mean what is on screen is not the answer yet. Published here so a display reads one field, and so settled below and every display's displayPhase are computed from the same three values. | DotplotView |
displayPhaseDisplayStatusPhase | What the shared canvas publishes as data-display-phase: the ranking over the plots drawing onto it. Its twin settled below is the stricter question — see comparativeReadiness. | DotplotView |
settledboolean | Canvas has painted and no display is still fetching, so what's on screen is the final settled content. Drives the data-display-drawn on dotplot_webgl_canvas that screenshot capture and the browser-test suites wait on — so it must mean "done", not just "first paint".Not the same question as "is every display finished" — see comparativeReadiness, which holds both and says why an error answers them differently. | DotplotView |
hoveredDisplayDotplotDisplayModel | undefined | The one track that owns the plot's hover, or undefined. At most one can: setHoveredFeature points a single display at the hit and clears every other in the same batch.Resolved here so the two readers below — and the components — take the view they already have rather than looping the tracks themselves. | DotplotView |
hoveredTooltipLinesstring[] | undefined | The hovered alignment's tooltip lines, or undefined when nothing is hovered. | DotplotView |
hoveredHighlightDotplotHoverHighlight | undefined | The hovered alignment's restroke geometry — see DotplotDisplay.hoveredFeatureHighlight. | DotplotView |
geometryByDisplayKeyMap<number, DotplotGeometryData> | Per-display GPU geometry keyed by displayKey. The upload autorun diffs this map: new entries upload, vanished entries evict. Drawn in insertion order, so tracks paint bottom-of-the-list last. | DotplotView |
| plotTransform | The cumBp -> plot px reconstruction, as the numbers everything that draws or hit-tests this plot runs on: the viewport-start cumBp per axis, the inverse bpPerPx per axis, and the plot height the v axis is flipped through (it lays out bottom-up). Its own getter because three readers want exactly these and nothing else — the render state below, the pick's exact test, and DotplotDisplay.hoveredFeatureHighlight. Taking them off dotplotRenderState also subscribes to alpha, lineWidth and the display-key list, so an opacity drag rebuilt the hover path.viewHeight belongs in here and not beside it: this is also what setupClearHoverOnPlotMove watches to decide the plot has moved under a stationary cursor, and a height change slides every alignment down the canvas exactly as a pan does. Left out, it was the one way to move the plot that kept the hover pinned to the alignment it no longer pointed at. | DotplotView |
dotplotBlocksRenderBlock[] | One canvas-wide block per loaded display, in the map's insertion order, so tracks paint bottom-of-the-list last. An empty list is a real frame, not a skip: the backend clears before drawing, so painting zero displays is what wipes the plot when the last track is hidden. | DotplotView |
dotplotRenderStateDotplotRenderState | Aggregated per-frame render state — a resolved value, never undefined; "the view isn't measured yet" is the canRender precondition below. | DotplotView |
canRenderboolean | Render-lifecycle precondition (overrides RenderLifecycleMixin's default-true hook): before the axes have regions and a measured width there is nothing to paint against. Gating the autorun pair here lets dotplotRenderState stay a resolved getter. | DotplotView |
paintInertboolean | Overrides RenderLifecycleMixin's hook: a measured plot with no tracks on it paints nothing this tick and nothing is coming, so it has finished rather than being pending. The backend answers "did content reach the canvas" off the blocks it drew, which is the right answer for a track still fetching and the wrong one for a canvas with nothing to draw on it.initialized is the other half and is not redundant with canRender: an import form has no tracks either, and it is not finished — AppReadyMarkerComparative pins that its settled stays false, and the marker asks its displays rather than this. | DotplotView |
rendersDisplaysboolean | Overridable hook (default true): whether this view's mounted body renders its own displays. A linear genome view collapsed to its ruler mounts the scalebar and none of its tracks, so a display in it can no more paint than one in a view scrolled off screen. Views nested in this one are unaffected: they paint wherever their own body is. | BaseViewModel |
effectiveBodyMountedboolean | Whether this view's displays have a canvas to paint into: its body is in the DOM, counting the views it is nested inside, and the body renders them (rendersDisplays). This is the question a display's phase asks.bodyMounted alone answers the DOM half only for a view a container renders directly. A view nested in another view (a synteny row, a breakpoint panel) has no container writing its flag, so it reads true forever while its whole subtree is out of the DOM, and every display in it waits for a first paint that nothing will make — the hang this flag exists to prevent, one level down.An ancestor that does not carry the flag at all leaves the answer alone rather than excusing the paint: only an explicit false unmounts, so a duck-typed stand-in that forgot it keeps waiting, which is the failure that shows up as a slow test rather than as a picture of an empty view. | BaseViewModel |
ownViewsAbstractViewModel[] | The views nested directly inside this one, which the census counts as views in their own right — a synteny stack's genome rows, a breakpoint split view's panels. Empty here for the same reason, and the dotplot is why it has to be a declaration rather than a walk of views: that prop name holds its two 1D axis models, which are view-shaped and are not views the user opened. No structural test separates the two — only the view knows. | BaseViewModel |
rendersCanvasboolean | Overridable hook (default true): whether this display paints a canvas in its current configuration, as opposed to a deliberate static placeholder (LD with the triangle off, sequence past base resolution — both render a message where the <canvas> would go, so canvasRef is never called and canvasDrawn can never flip).Lives here, beside canvasDrawn, because every consumer of "has this display painted" needs the pair. Both LGV fetch foundations fill it with !fetchInert, so a display there states its placeholder once, through that hook; the raw default reaches only a display composing this mixin outside them. See painted below for the reader that was missed while the two were separate overrides. | RenderLifecycleMixin |
paintSupersededboolean | Overridable hook (default false): what is on the canvas was painted from data a later change has made wrong, so painted below should answer pending until the repaint lands even though canvasDrawn is still true. The per-region fetch foundation fills it with staleSettingsDrawn — held data drawn under settings that have since moved — which is the state clearAllRpcData used to express by resetting canvasDrawn on every settings change, blanking the display to do it. A capture waiting on data-display-drawn then waits for the refetch rather than snapshotting the previous setting's pixels.A hook and not a reset of the flag, because the flag is re-marked by any redraw — a pan between the settings change and the refetch would report the stale canvas drawn — and a derivation cannot be raced. | RenderLifecycleMixin |
paintedboolean | The first-paint answer every consumer outside the display should read, canvasDrawn being only the raw flag: a display that is deliberately not painting a canvas has finished, and reporting it unfinished leaves every waiter on it waiting forever.The two rendersCanvas: false states each had three of their four consumers wired by hand — the loading scrim (rendersCanvas / fetchInert) and the SVG export (fetchInert) — while the fourth, data-display-drawn, went on publishing "false" forever off the raw flag. That attribute is what PENDING_DISPLAYS (@jbrowse/browser-test-utils) selects on, so a zoomed-out reference sequence track made every capture wait on the page run to its full timeout, and that wait swallows its own timeout without reporting it. fetchInert on the comparative side has the same problem: the forgotten reader is the one outside the display, so the display has to publish one name for it.paintInert is the third term and the same argument once more, for the state where a display would paint a canvas and never gets to — a fetch that failed before first paint. paintSuperseded is the fourth, and the one that subtracts: a canvas painted from data a settings change has made wrong is drawn and not finished. See both hooks. | RenderLifecycleMixin |
hasLodCapableAdapterboolean | Whether any track's adapter has tiers to switch between, which gates the "Level of detail" setting. | SyntenyViewMixin |
showLegendboolean | The legend-host half of LegendMixin a view needs: whether the key draws, which is the mode having one and the reader not having closed it in this mode. ChromeLegend and SvgLegend read it. | SyntenyViewMixin |
legendSpecLegendSpec | The key ChromeLegend draws on screen and SvgLegend in the export. | SyntenyViewMixin |
defaultAlphanumber | The alpha a reset returns to. | 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[] | Annotated for the reason ComparativeTrackModel documents: the array is any. | DotplotView |
loadedAttributeRanges() => Record<string, AttributeRange>[] | Each loaded display's observed attribute spans, which the mixin unions into the domain the legend labels its ramp with. | DotplotView |
colorSurface() => "points" | Flat points, never a CIGAR op. | DotplotView |
svgLegendWidth() => number | The export parks the key beside the plot rather than over it: a diagonalized plot's alignments run into the top-right corner the key would otherwise cover. | DotplotView |
| getCoords | Both corners of a drag rect, in bp on each axis. Undefined for a drag too small to be a selection — the same threshold the interaction hook uses to tell a drag from a click. | DotplotView |
pickFeatureAt(x: number, y: number) => DotplotPlotPickHit | undefined | The alignment under a pointer position (plot px, y downward), across every track on the shared canvas, or undefined. Resolved on the model rather than through the rendering backend, which is where this departs from synteny's backend.pick(...): dotplot geometry is already here in absolute cumBp (display.instanceData), so this answers with NO backend attached at all — before the first paint, through a context loss that has not recovered, and in a test with no canvas. (Both of synteny's backends implement pick, so its hover is not GPU-only either despite gpuRenderingBackend's name; what it cannot do is answer while nothing is attached. It lives in the backend because the projected geometry it indexes does, which also means each backend builds its own index.)Nearest wins ACROSS tracks too, ties going to the later track (the one drawn on top) — see pickDotplotFeature for why a dotplot answers nearest where a ribbon answers topmost. | DotplotView |
| getHHighlightCoords | Map a highlight region to {left, width} px on the horizontal axis. left is already screen-offset. Returns undefined when the region isn't on hview's assembly/displayed regions. | DotplotView |
| getVHighlightCoords | Map a highlight region to {top, height} px on the vertical axis. Returns undefined when the region isn't on vview's assembly/displayed regions. | DotplotView |
| DotplotView | ||
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 |
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 |
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 |
|---|---|---|
startRenderingBackend(backend: DotplotRenderingBackend) => void | DotplotView | |
setHoveredFeature(hit: DotplotPlotPickHit | undefined) => void | Point the whole plot's hover state at one pick hit: the track whose geometry was hit takes the segment index, every other track clears, so undefined (a miss) clears the plot. An action rather than a loop in the pointer handler so the N writes land in one MobX batch — and so nothing outside the model has to resolve a displayKey to a display. Same shape as the synteny level's setHoveredFeature. | DotplotView |
setCursorMode(mode: CursorMode) => void | DotplotView | |
setDrawCigar(flag: boolean) => void | DotplotView | |
setShowGridlines(flag: boolean) => void | DotplotView | |
setShowTickLabels(flag: boolean) => void | DotplotView | |
setLockAspectRatio(flag: boolean) => void | DotplotView | |
setLineWidth(value: number) => void | DotplotView | |
setMinIdentity(value: number) => void | DotplotView | |
clearView() => void | returns to the import form | DotplotView |
setWidth(newWidth: number) => number | DotplotView | |
setHeight(newHeight: number) => number | DotplotView | |
setError(e: unknown) => void | DotplotView | |
setLaunch(launch?: LaunchInput<DotplotViewCommands> | undefined) => void | DotplotView | |
zoomOut() => void | DotplotView | |
zoomIn() => void | DotplotView | |
scrollXY(dx: number, dy: number) => void | Pan both axes one gesture step. Each delta is in its own axis' scroll direction, not screen px — the vertical axis lays out bottom-up, and both callers (wheel, drag) already hold the flipped value for their own reasons. One action rather than two scroll calls, because an MST action is a MobX action: unbatched, the render autorun ran twice per pointermove and drew a whole frame against a moved h axis and a stale v one. | DotplotView |
zoomAt(factor: number, [x, y]: Coord) => void | Zoom both axes by factor, holding the locus under a plot-area point still. The anchor is the same component-px Coord the drag handlers pass around, so each axis takes it through its own fromScreenPx, as getCoords does.Multiplying both axes by one factor keeps wheel zoom ratio-preserving, so the aspect lock never has to correct it. One action, for the reason scrollXY documents. | DotplotView |
activateTrackSelector() => Widget | DotplotView | |
| showTrack | initialSnapshot is annotated rather than inferred from its default. A bare {} accepts a number, so this signature satisfied applySyntenyTrackSelections' (trackId, level) => void callback — passing model.showTrack there typechecked and handed the pair index over as the new track's snapshot. | DotplotView |
hideTrack(trackId: string) => boolean | DotplotView | |
toggleTrack(trackId: string) => boolean | DotplotView | |
setAssemblyNames(x: string, y: string) => void | DotplotView | |
zoomInToMouseCoords(mousedown: Coord, mouseup: Coord) => void | zooms into clicked and dragged region. Under lockAspectRatio both axes take the larger of the two fits, so the whole box stays in view on the axis whose plot dimension is shorter. | DotplotView |
addHighlightFromMouseCoords(mousedown: Coord, mouseup: Coord) => void | highlights the clicked and dragged region: the x-span becomes a band on the horizontal axis and the y-span a band on the vertical axis, so the drag rect is their intersection | DotplotView |
showAllRegions() => void | DotplotView | |
initializeDisplayedRegions() => void | DotplotView | |
openInCircularSyntenyView() => void | a circular view of the two axes' genomes with this view's tracks as ribbons, the second genome reordered to follow the first, and this view's colour and length filter | DotplotView |
launchLinearSyntenyView(mousedown: Coord, mouseup: Coord) => void | opens a linear synteny view on the clicked and dragged region: the horizontal axis' span on the top row, the vertical axis' below, each fitted to this view's width, with every track that has a linear synteny display, painted and filtered by the settings the two views share | DotplotView |
| launchTrack | showTrack for a track whose display state model may be lazily loaded: loads it, then shows | DotplotView |
launchToggleTrack(trackId: string) => Promise<boolean> | toggleTrack with launchTrack's loading behavior | DotplotView |
exportSvg(opts?: ViewExportSvgOptions) => Promise<string> | renders the view to SVG markup, which it returns; saves it through FileSaver unless save: false | DotplotView |
applySquare(ratio: number) => void | Set both axes to the average bpPerPx (hview divided by ratio), re-anchoring each on the locus that was at its center. setBpPerPx alone would leave offsetPx untouched while bpPerPx changed under it, scrolling the plot; the centerAt calls are what hold it still. | DotplotView |
squareView() => void | Equalize both axes' bpPerPx. Also what the aspect-ratio lock applies to absorb divergence from box-zoom and other per-axis operations — deliberately not clamped to either axis's own maxBpPerPx, since a shared bpPerPx that fits the larger genome necessarily exceeds the smaller axis's limit, and it converges in one step where a clamped one would ping-pong between the two maxima. | DotplotView |
squareViewProportional() => void | DotplotView | |
setDisplayName(name: string) => void | BaseViewModel | |
setBodyMounted(flag: boolean) => void | See bodyMounted. Written by the view's container, which is the only thing that knows whether it rendered the body. | BaseViewModel |
setMinimized(flag: boolean) => void | BaseViewModel | |
markCanvasDrawn() => void | RenderLifecycleMixin | |
resetCanvasDrawn() => void | RenderLifecycleMixin | |
stopRenderingBackend() => void | RenderLifecycleMixin | |
renderNow() => void | RenderLifecycleMixin | |
setOffScreen(offScreen: boolean) => void | RenderLifecycleMixin | |
setRenderError(error: unknown) => void | set/clear the render-backend error. Called by useRenderingBackend: with the error when the canvas factory rejects (or context-loss re-init fails), and with undefined on successful (re)init and on retry. | RenderLifecycleMixin |
| attachRenderingBackend | attach a GPU/Canvas2D backend and install the upload + render autorun pair. Idempotent: re-calling swaps the backend and does not run setup again, so the callbacks and everything they close over are the first call's. | RenderLifecycleMixin |
setAwaitingAutoDiagonalize(arg: boolean) => void | DiagonalizeProgressMixin | |
beginAutoDiagonalize(requested: boolean) => void | Declare the gate at the top of one init apply pass: a reorder is pending iff THIS init asked for one. Assigning rather than raising is what hands the gate over cleanly — a superseded init that asked for a reorder and then skipped it would otherwise leave the flag up with nothing coming, wedging settled forever. | DiagonalizeProgressMixin |
finishAutoDiagonalize() => void | A reorder resolved, the init's or a manual one, so the view on screen is the diagonalized one — open the gate. | DiagonalizeProgressMixin |
setDiagonalizeError(error: unknown) => void | DiagonalizeProgressMixin | |
setDiagonalizeCancel(arg?: (() => void) | undefined) => void | DiagonalizeProgressMixin | |
cancelAutoDiagonalize() => void | Abort an in-flight auto-diagonalize; withDiagonalizeProgress's finally clears the wait flag, revealing the (undiagonalized) view.Lowers the gate too. The abort reaches the caller as a throw, which skips its finishAutoDiagonalize() — right for a reorder that failed on its own (settled stays false and a capture times out loudly rather than committing a hairball), wrong for one the user stopped: cancelling IS the user settling for this view, and a gate nothing will lower again leaves settled false forever. | DiagonalizeProgressMixin |
setImportFormSyntenyTrack(idx: number, val: ImportFormSyntenyTrack) => void | ImportFormSyntenyMixin | |
clearImportFormSyntenyTracks() => void | Drop the pending selections once a launch has applied them. Left in place they outlive the form: "Return to import form" would reopen on a finished upload from the previous launch, and a pair whose assemblies no longer match it reads as an unfinished upload and disables Launch. | ImportFormSyntenyMixin |
setLodMode(value: LodMode) => void | SyntenyViewMixin | |
setShowLegend(show: boolean) => void | The legend host's setter: closing the key hides it for this mode only, so picking another mode brings its key up. | SyntenyViewMixin |
dismissLegendSection() => void | One section is the whole key here. | SyntenyViewMixin |
setAlpha(value: number) => void | 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