LinearVariantDisplay
Auto-generated config schema for the current JBrowse release — see the config guide for concepts. Provided by the variants plugin. View source.
Example usage
Minimal VariantTrack config. See the
variant track guide for all options:
{
type: 'VariantTrack',
trackId: 'variants',
name: 'Variants',
assemblyNames: ['hg38'],
adapter: {
type: 'VcfTabixAdapter',
uri: 'https://example.com/variants.vcf.gz',
},
}Taller track. The displayDefaults object shorthand is equivalent to
displays: [{ type: 'LinearVariantDisplay', displayId: '...', ... }] — see
configuring displays:
{
type: 'VariantTrack',
trackId: 'variants',
name: 'Variants',
assemblyNames: ['hg38'],
adapter: {
type: 'VcfTabixAdapter',
uri: 'https://example.com/variants.vcf.gz',
},
displayDefaults: { height: 200 },
}See the Config slots section below for all available configuration fields.
Extends LinearCanvasBaseDisplay for GPU-accelerated variant rendering.
Related links
- Adapter: BedpeAdapter
- Adapter: SplitVcfTabixAdapter
- Adapter: StarFusionAdapter
- Adapter: VcfAdapter
- Adapter: VcfTabixAdapter
- State model: runtime API
- Base config: LinearCanvasBaseDisplay
- Guide: Custom track and display types
- Guide: Tracks
Config slots
These slots go on a display entry: "displays": [{ "type": "LinearVariantDisplay", ... }], or in the track's displayDefaults when this is its default display. Slot types (fileLocation, frozen, ...) are explained in the config slot types reference. Slots a base configuration contributes are listed here too, so this table is the whole surface.
| Slot | Description |
|---|---|
| Inherited from LinearCanvasBaseDisplay | 17 slots |
maxFeatureScreenDensitynumber = 1 | maximum features per pixel before showing a "too many features" message advanced |
showLegendboolean = true | show the display's color key when it has one: the key a color field derives, or a variant track's consequence-impact / SV-type presets. |
showLabelsstringEnum (auto, nameAndDescription, name, description, none) = 'auto' | Which label text is drawn beside each feature: "auto" adapts to zoom, dropping descriptions at maxDescriptionFeatureDensity and names at maxLabelFeatureDensity; "nameAndDescription", "name", "description", and "none" pin a choice at every zoom. Defaults to auto. Replaces the former showLabels on/off enum + showDescriptions boolean pair |
maxLabelFeatureDensitynumber = 0.2 | In "auto" showLabels mode, hide labels when visible feature density (features/pixel) exceeds this value advanced |
maxDescriptionFeatureDensitynumber = 0.1 | In "auto" showLabels mode, hide descriptions when visible feature density (features/pixel) exceeds this value. Lower than maxLabelFeatureDensity so descriptions drop before names advanced |
| color FeatureColor | The main fill of each feature: a CSS color or a jexl expression ("goldenrod", "jexl:…"), or { field, domain, range } to paint each value of a field its own range color, with a key. |
outlineColorcolor = '' | outline color for features (empty string = no outline) |
featureHeightnumber = 10 | height in pixels of the main body of each feature callback args: feature |
displayModestringEnum (normal, compact, superCompact, collapsed) = 'normal' | Feature height preset, normal by default; compact and superCompact shrink the rows, and collapsed packs every feature onto a single row with all labels hidden |
| facet Facet | One labelled section of the track per value of a field: "strand", or { field, domain } with the order its sections stack in. |
labels.namestring = 'jexl:get(feature,'name') || get(feature,'id')' | the primary name of the feature to show callback args: feature |
labels.descriptionstring = | the text description to show callback args: feature |
heightModestringEnum (fixed, grow, fit) = 'fit' | Track-sizing strategy — how the track responds when there are more features than fit (shared vocabulary with the alignments display, exposed in the "Track sizing" menu). fit (the default) keeps the track height and gives up descriptions, then isoforms, then names, then squeezes boxes down to 2px, and scrolls only what still overflows; fixed keeps a scrollable fixed height; grow expands the track to show all features. Orthogonal to the per-feature size set by displayMode, which fit never enlarges. |
growMaxHeightnumber = 800 | Ceiling in pixels for the "autogrow track height" sizing mode; a track with more content than this grows to the ceiling and scrolls the rest. Does not apply to the fixed or fit modes advanced |
densityTierstringEnum (auto, features, density) = 'auto' | when to draw the features-per-bin density band in place of features: "auto" swaps to it where the region is too large to fetch, "features" never does and keeps the banner, "density" always does. Needs a density source on the adapter (its densityAdapter slot) advanced |
densityTierBpPerPxnumber = 0 | in "auto" mode, also draw the density band from this many bp per pixel outward, before the region is too large to fetch; 0 leaves the swap to the fetch-size gate alone advanced |
filterexpressionArray = [] | jexl: expressions a feature must pass to be drawn |
| Inherited from BaseLinearDisplay | 4 slots |
heightnumber = 100 | default height for the track |
mouseoverstring = | text to display when the cursor hovers over a feature callback args: feature |
fetchSizeLimitnumber = 1_000_000 | maximum data to attempt to download for a given track, used if adapter doesn't specify one advanced |
forceLoadboolean = false | Declarative equivalent of the "Force load" button on the "too much data" banner: when true the display always renders, however large the region or dense the features. Off by default (the gate guards against huge downloads). Set it on a view no one can interact with — an embedded / notebook view, or a screenshot — where the region is known and you want it drawn without a click. advanced |