Skip to main content

Base1DView

Note: this document is automatically generated from mobx-state-tree objects in our source code. See Core concepts and intro to pluggable elements for more info

Source file

packages/core/util/Base1DViewModel.ts

used in non-lgv view representations of a 1d view e.g. the two axes of the dotplot use this

Base1DView - Properties

property: id

// type signature
IOptionalIType<ISimpleType<string>, [undefined]>
// code
id: ElementId

property: displayedRegions

// type signature
IArrayType<IModelType<{ refName: ISimpleType<string>; start: ISimpleType<number>; end: ISimpleType<number>; reversed: IOptionalIType<ISimpleType<boolean>, [...]>; } & { ...; }, { ...; }, _NotCustomized, _NotCustomized>>
// code
displayedRegions: types.array(Region)

property: bpPerPx

// type signature
number
// code
bpPerPx: 0

property: offsetPx

// type signature
number
// code
offsetPx: 0

property: interRegionPaddingWidth

// type signature
IOptionalIType<ISimpleType<number>, [undefined]>
// code
interRegionPaddingWidth: types.optional(types.number, 0)

property: minimumBlockWidth

// type signature
IOptionalIType<ISimpleType<number>, [undefined]>
// code
minimumBlockWidth: types.optional(types.number, 0)

Base1DView - Getters

getter: width

// type
number

getter: assemblyNames

// type
any[]

getter: displayedRegionsTotalPx

// type
number

getter: maxOffset

// type
number

getter: minOffset

// type
number

getter: totalBp

// type
number

getter: dynamicBlocks

// type
BlockSet

getter: staticBlocks

// type
BlockSet

getter: currBp

// type
any

Base1DView - Methods

method: pxToBp

// type signature
pxToBp: (px: number) => { coord: number; index: number; refName: string; oob: boolean; assemblyName: string; offset: number; start: number; end: number; reversed: boolean; }

method: bpToPx

// type signature
bpToPx: ({ refName, coord, regionNumber, }: { refName: string; coord: number; regionNumber?: number; }) => number

Base1DView - Actions

action: setDisplayedRegions

// type signature
setDisplayedRegions: (regions: Region[]) => void

action: setBpPerPx

// type signature
setBpPerPx: (val: number) => void

action: setVolatileWidth

// type signature
setVolatileWidth: (width: number) => void

action: setFeatures

// type signature
setFeatures: (features: Feature[]) => void

action: showAllRegions

this makes a zoomed out view that shows all displayedRegions that makes the overview bar square with the scale bar

// type signature
showAllRegions: () => void

action: zoomOut

// type signature
zoomOut: () => void

action: zoomIn

// type signature
zoomIn: () => void

action: zoomTo

// type signature
zoomTo: (bpPerPx: number, offset?: number) => number

action: scrollTo

// type signature
scrollTo: (offsetPx: number) => number

action: centerAt

// type signature
centerAt: (coord: number, refName: string, regionNumber: number) => void

action: scroll

note: the scroll is clamped to keep the view on the main screen

// type signature
scroll: (distance: number) => number

action: moveTo

offset is the base-pair-offset in the displayed region, index is the index of the displayed region in the linear genome view

// type signature
moveTo: (start?: BpOffset, end?: BpOffset) => void