CircularView
Auto-generated from the @jbrowse/mobx-state-tree model in the source — see the developer guide for concepts. Provided by the circular-view plugin. View source.
Lays one or more assemblies' chromosomes around a circle, and draws structural variants as chords and synteny alignments as ribbons across it.
Example usage
Hand-authored under defaultSession.views, with every setting written
directly on the view object. assembly names the genome, a tracks entry may
include display config inline, and displayedRegionNames lists the regions
to draw, which keeps an assembly's alt/unplaced contigs off the circle:
{
type: 'CircularView',
assembly: 'hg38',
displayedRegionNames: ['chr1', 'chr2', 'chr3'],
tracks: [{ trackId: 'my-sv-vcf', encoding: { color: { value: 'red' } } }],
}assembly also takes a list, for a synteny ribbon plot: each
assembly lays its contigs out in turn, so the first genome takes one arc of
the circle and the second the next, and a SyntenyTrack covering both draws
a ribbon per alignment between them. displayedRegionNames keyed by assembly
restricts each genome separately, and autoDiagonalize reorders the second
to follow the first:
{
type: 'CircularView',
assembly: ['hg38', 'mm39'],
displayedRegionNames: { hg38: ['chr1', 'chr2'] },
tracks: ['hg38_vs_mm39'],
autoDiagonalize: true,
}Each section ends with the members a composed model contributes, linked to the page that documents them.
Properties
| Member | Description |
|---|---|
typetype: types.literal('CircularView') as unknown as string | |
| offsetRadians | the figure's rotation in radians, the linear view's offsetPx |
bpPerPxbpPerPx: types.stripDefault(types.number, defaultBpPerPx) | the zoom level, base-pairs per pixel. Capped by minimumRadiusPx, and refit over by the first resize unless autoFit is false. |
autoFitautoFit: types.stripDefault(types.boolean, true) | whether the view refits to its box on resize; a manual zoom or pan clears it |
| tracks | |
| hideVerticalResizeHandle | chrome switch, for an embed that drives the view itself |
| chrome switch, for an embed that drives the view itself | |
disableImportFormdisableImportForm: types.stripDefault(types.boolean, false) | never show the import form, even on an error, for an embed that picks the assembly itself (the SV inspector) |
legendlegend: types.stripDefault(hiddenLegendConfigSchema, {}) | the key naming each track's ring, chords or ribbons in the corner, a HiddenLegend object: { show: true } draws it |
heightheight: types.stripDefault(types.number, defaultHeight) | the view's height in px, which sizes the fitted circle. Left at its default in a multi-view session, the view opens square to its width |
| displayedRegions | the regions the circle lays out, one arc each, in this order. displayedRegionNames names the same thing by refName and is the shorter form. |
| minimumRadiusPx | how far out the circle may zoom, as the smallest radius it shrinks to; it is what caps bpPerPx |
spacingPxspacingPx: types.stripDefault(types.number, defaultSpacingPx) | the gap drawn between adjacent chromosome arcs |
paddingPxpaddingPx: types.stripDefault(types.number, defaultPaddingPx) | blank margin between the circle and the edge of the figure |
| minVisibleWidth | arcs thinner than this many pixels are elided instead of drawn, so a few thousand unplaced contigs do not become a ring of hairlines |
| trackSelectorType | ignored, kept because saved sessions carry it |
| launch | the launch keys still to apply, moved here by preProcessSnapshot and cleared once applied; not written by hand |
8 inherited properties from 5 models
From SyntenyFadeMixin: render
From TrackColorsMixin: encoding, trackColors
From ParkedColorMixin: parkedColors
From SyntenyFilterMixin: filter
From BaseViewModel: id, displayName, minimized
Volatiles
| Member | Description |
|---|---|
volatileWidthnumber | undefined | |
heightFollowsWidthboolean | |
volatileErrorunknown | |
panXnumber | |
panYnumber | |
ringHostRingHost | the strip every linear display in this view lays out along, and the rings drawn from it — see regionHost |
hoverPointerTarget | undefined | the chord or ribbon under the pointer, which the highlight paths and the tooltip read |
hoverClientXY[number, number] | undefined | where the pointer was on the page while it was on hover, which only the tooltip follows |
chordPassChordPass | the canvas the chords and ribbons of every chord display draw on |
10 inherited volatiles from 5 models
From SyntenyFadeMixin: fadeThinLatch
From TrackColorsMixin: seenAttributeRanges
From ImportFormSyntenyMixin: importFormSyntenyTrackSelections
From DiagonalizeProgressMixin: awaitingAutoDiagonalize, pendingAutoDiagonalize, diagonalizeStatus, diagonalizeCancel, diagonalizeError
From BaseViewModel: width, bodyMounted
Getters
| Member | Description |
|---|---|
showLegendboolean | legend.show: whether the key draws |
ownTracksany[] | the tracks this view holds itself, for the census |
widthnumber | |
| circleRegions | displayedRegions, each marked circular where it is a whole sequence its assembly lists in circularRefNames |
fitLayoutFitLayout | the circle that fills the box: its scale, radius and padding |
fitInputFitInput | what fitLayout measures the circle from |
namesFeaturesOutsideboolean | a circle of one contig is a map: its ring displays' features are named outside the circle with leaders, not along their rows |
effectivePaddingPxnumber | paddingPx, capped in a small box and floored at what the labels drawn at the fit or at this zoom reach |
ring{ spacingPx: number; radiusPx: number; } | the ring at this zoom: its gaps' spacing and the radius that closes it — see ringAt |
effectiveSpacingPxnumber | spacingPx, capped so the gaps take at most a quarter of the ring |
totalGapUnitsnumber | how many inter-slice gaps go round the circle, a genome boundary counting as several |
radiusPxnumber | |
circumferencePxnumber | |
bpPerRadiannumber | |
centerXY[number, number] | |
totalBpnumber | |
maxBpPerPxnumber | |
minBpPerPxnumber | |
atMaxBpPerPxboolean | |
atMinBpPerPxboolean | |
figureSizenumber | figure is always square, so width === height |
figureOriginXY[number, number] | the figure's top-left in the view's box, centered horizontally and placed by figureMiddleY vertically, plus the pan |
circleCenterXY[number, number] | the circle's centre in the view's box |
| polarFrame | what the ring and chord canvases both draw against: the view's box, the circle's centre in it and the figure's rotation |
elisionMaskstring | which displayed regions are too narrow at this zoom to draw as themselves, one character each |
elidedRegionsSliceRegion[] | displayedRegions with each run of too-narrow regions in one assembly folded into one elided slice |
| pendingLaunch | the launch state still to apply |
assemblyNamesstring[] | |
chordSyntenyDisplaysChordSyntenyDisplaySelf[] | the ribbon displays of syntenyTracks(); a chromosome reorder reads its alignments from these |
canDiagonalizeboolean | whether a reorder applies: a ribbon track, and exactly two genomes (ADR-121) |
paintedAssemblyNamestring | undefined | the genome whose ideogram a ribbon track paints by what aligns to it from the first, rather than in the colors of its chromosomes |
ideogramPaintReadonlyMap<string, PaintRun[]> | that genome's paint, by slice key |
launchAssemblyNamesstring[] | the assemblies a pending launch names, which the gates wait on before displayedRegions exist |
initializedboolean | |
assemblyErrorsstring | undefined | |
errorunknown | |
hasSomethingToShowboolean | |
showLoadingboolean | whether the loading screen stands in for the form or the figure |
loadingAssemblyAssembly | undefined | the assembly whose load the spinner waits on |
loadingViewLoading | undefined | the loading screen's text while showLoading |
showViewboolean | whether the figure draws: regions, and every assembly loaded |
showImportFormboolean | nothing to show or an error, unless disableImportForm, which an error does not override |
statusViewStatus | the lifecycle as one value, as the linear view answers it |
regionHostRingHost | the strip a linear display lays out along and draws its ring from (ADR-119) |
chordRadiusPxnumber | Where the chord displays start: inside the innermost ring, or at the ruler when the view holds none. |
chordDisplaysChordLayerDisplay[] | the displays drawing across the circle, in track order: every first display registered for this view rather than laid out as a ring |
hoveredChordChordHit | undefined | the chord or ribbon under the pointer |
hoveredBandAxisSlice | the chromosome whose band is under the pointer, on the chord axis |
chordFocusGapsnumber | that chromosome as the chord stage's focus: its slice's gap count, the name a foot gives it, or -1 for none |
bandComposition{ name: string; shares: PartnerShare[]; } | undefined | the hovered chromosome's name and the share of it each chromosome aligned to it covers, most first |
hoversChordboolean | whether the pointer is on a chord or ribbon, which only changes as it crosses onto one or off it |
chordAxisChordAxis | the circle's slices on the unrolled genome axis, unchanged by a zoom or rotation |
chordScalePolarScale | the scale from the unrolled axis to radians |
autoFadeWidthPxnumber | the narrowest capped mean ribbon span on screen, which the auto fade judges |
chordThinFadeFloor1 | 0.15 | the least alpha the thin fade leaves a ribbon, 1 while it is off |
staticSlicesSlice[] | the slices at this zoom, in radians |
legendSpecLegendSpec | one row per track: its name beside the color or ramp it paints with |
28 inherited getters from 6 models
From SyntenyFadeMixin: antialias, fadeThinAlignments
From SyntenyColorsMixin: defaultOpacity, opacitySetting, opacityFade, opacityLevel, opacityField
From TrackColorsMixin: colorSetting, impliedColorField, colorPaint, colorValue, colorDomain, colorRange, colorableAttributes, attributeRanges, colorableTracks, trackColorAssignments, colorField, hideUnlabelled, hasLegendKey, colorLegendChips, colorScales
From ParkedColorMixin: parkedColor
From SyntenyFilterMixin: predicates, minLength
From BaseViewModel: rendersDisplays, effectiveBodyMounted, ownViews
Methods
| Member | Description |
|---|---|
syntenyTracks() => ComparativeTrackModel[] | the tracks drawing ribbons, which the view's color settings paint |
loadedAttributeRanges() => Record<string, AttributeRange>[] | each ribbon display's attribute spans, over the alignments it holds |
legendCigarOps() => number | a ribbon draws no indel blocks, so the key lists none |
shapeShowsStrand() => boolean | a ribbon twists against its two arcs' directions, and nothing on the circle shows which way an arc runs |
chordAt(dx: number, dy: number) => ChordHit | undefined | the chord or ribbon under a point dx,dy CSS px from the circle's centre in the screen frame |
bandAt(dx: number, dy: number) => string | undefined | the place of the chromosome whose ideogram band holds a point dx,dy CSS px from the circle's centre in the screen frame |
bandCenter(key: string) => [number, number] | undefined | the middle of the ideogram band key names, CSS px from the circle's centre in the screen frame: the point bandAt answers key for |
linearTracksFor(assemblyName: string) => TrackInit[] | the tracks a linear view of one genome on this circle opens with: each track on that genome but the synteny tracks, a ring as its display and a chord track as the linear view's own |
() => MenuItem | each track's own menu, which on a linear view hangs off its label and on the circle has nowhere else to go |
legendSpecIn(palette?: JBrowsePalette | undefined) => LegendSpec | legendSpec in another theme, the SVG export's |
() => MenuItem[] | return the view menu items |
8 inherited methods from 4 models
From SyntenyColorsMixin: colorableTrackConfigs, colorableAttributeNames, legendAlpha
From TrackColorsMixin: colorSurface, offersReferenceColor, trackColorFor
From ParkedColorMixin: parkedColorOf
From SyntenyFilterMixin: lowerBound
Actions
| Member | Description |
|---|---|
fitToWindow() => void | size the figure so it exactly fills the smaller of the view's two dimensions |
setWidth(newWidth: number) => number | |
setHeight(newHeight: number) => number | |
setShowLegend(flag: boolean) => void | |
() => void | |
() => void | |
rotate(delta: number) => void | |
resetView() => void | reset rotation, pan, and zoom back to the default fit-to-window view |
() => void | |
() => void | |
zoomAboutViewMiddle(newBpPerPx: number) => void | zoom about the circle's middle while the figure sits where the fit put it, and about the view's middle once a zoom to the cursor has panned it, so what the user zoomed toward stays in view |
setBpPerPx(newVal: number) => void | |
zoomToPoint(newBpPerPx: number, cursorX: number, cursorY: number) => void | zoom toward/away from a point on the figure, keeping whatever is under it visually fixed. The point is its offset in screen px from the middle of the circle — what offsetFromCenter in the component hands back |
setDisplayedRegions(regions: Region[]) => void | |
activateTrackSelector() => Widget | undefined | |
toggleTrack(trackId: string) => boolean | |
setError(error: unknown) => void | |
| setHover | the pointer is on target, or on nothing, at client x,y. A move that stays on one target keeps it, so only the tooltip follows it |
setLaunch(launch?: LaunchInput<CircularViewCommands> | undefined) => void | |
clearView() => void | back to the import form: no regions, no tracks, no pending launch and no error from the one before |
| showTrack | |
| addTrackConf | |
hideTrack(trackId: string) => boolean | |
openExportDialog() => void | |
openReorderChromosomesDialog() => void | |
openInLinearSyntenyView() => void | a linear synteny view of this circle's genomes, a row each over the chromosomes the circle shows with the tracks it shows for that genome, its ribbon tracks between them, reordered, in this view's color and length filter. A self-alignment opens the genome against itself |
autoDiagonalize() => Promise<void> | The init-time reorder, behind the "Reordering chromosomes" screen withDiagonalizeProgress drives. |
exportSvg(opts?: ViewExportSvgOptions) => Promise<string> | renders the view to SVG markup, which it returns; saves it through FileSaver unless save: false |
| launchTrack | showTrack for a track whose display state model may be lazily loaded: loads it, then shows |
launchToggleTrack(trackId: string) => Promise<boolean> | toggleTrack with launchTrack's loading behavior |
| launchTrackConf | addTrackConf with launchTrack's loading behavior, for a track handed over inline rather than from a session list |
resizeHeight(distance: number) => number | |
resizeWidth(distance: number) => number |
27 inherited actions from 8 models
From SyntenyFadeMixin: setAntialias, setFadeThinLatch
From SyntenyColorsMixin: setOpacity, setOpacityField
From TrackColorsMixin: observeAttributeRanges, resetAttributeRanges, setHideUnlabelled, setColorField, setColorValue, openSolidColorDialog, setColorDomain, setTrackColor, clearTrackColors
From ParkedColorMixin: parkColor
From SyntenyFilterMixin: setFilter, setLowerBound
From ImportFormSyntenyMixin: setImportFormSyntenyTrack, clearImportFormSyntenyTracks
From DiagonalizeProgressMixin: setAwaitingAutoDiagonalize, beginAutoDiagonalize, finishAutoDiagonalize, setDiagonalizeError, setDiagonalizeCancel, cancelAutoDiagonalize
From BaseViewModel: setDisplayName, setBodyMounted, setMinimized
Related links
- Docs: URL query parameter API