Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ export function isMouseOnFeatureEdge(
const { refName, regionNumber, x } = mousePosition
const { lgv } = stateModel
const { offsetPx } = lgv
const minPxInfo = lgv.bpToPx({ refName, coord: feature.min, regionNumber })
const maxPxInfo = lgv.bpToPx({ refName, coord: feature.max, regionNumber })
const minPxInfo = lgv.bpToPx({
refName,
coord: feature.min,
displayedRegionIndex: regionNumber,
})
const maxPxInfo = lgv.bpToPx({
refName,
coord: feature.max,
displayedRegionIndex: regionNumber,
})
if (minPxInfo !== undefined && maxPxInfo !== undefined) {
const minPx = minPxInfo.offsetPx - offsetPx
const maxPx = maxPxInfo.offsetPx - offsetPx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export function renderingModelFactory(
const locationStartPxInfo = self.lgv.bpToPx({
refName: refSeq,
coord: start,
regionNumber: idx,
displayedRegionIndex: idx,
})
if (!locationStartPxInfo) {
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes'
import {
type AbstractSessionModel,
type Region,
getContainingView,
getSession,
} from '@jbrowse/core/util'
Expand Down Expand Up @@ -95,8 +94,9 @@ export function baseModelFactory(
.views((self) => ({
get expandedRegions() {
const regions = self.lgv.dynamicBlocks.contentBlocks.map((block) => {
const { assemblyName, end, refName, start } = block
const { parentRegion } = block as unknown as { parentRegion: Region }
const { assemblyName, displayedRegionIndex, end, refName, start } =
block
const parentRegion = self.lgv.displayedRegions[displayedRegionIndex]
const expandedStart = Math.round(
Math.max(start - 5, parentRegion.start),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const LinearApolloSixFrameDisplay = observer(
(lgv.bpToPx({
refName: region.refName,
coord: checkResult.start,
regionNumber: idx,
displayedRegionIndex: idx,
})?.offsetPx ?? 0) - lgv.offsetPx
const [feature] = checkResult.featureIds
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function draw(
(lgv.bpToPx({
refName,
coord: min,
regionNumber: displayedRegionIndex,
displayedRegionIndex,
})?.offsetPx ?? 0) - offsetPx
const topLevelFeatureWidthPx = topLevelFeature.length / bpPerPx
const topLevelFeatureStartPx = reversed
Expand Down Expand Up @@ -275,7 +275,7 @@ function draw(
(lgv.bpToPx({
refName,
coord: exon.min,
regionNumber: displayedRegionIndex,
displayedRegionIndex,
})?.offsetPx ?? 0) - offsetPx
const widthPx = exon.length / bpPerPx
const startPx = reversed ? minX - widthPx : minX
Expand Down Expand Up @@ -341,7 +341,7 @@ function draw(
(lgv.bpToPx({
refName,
coord: cds.min,
regionNumber: displayedRegionIndex,
displayedRegionIndex,
})?.offsetPx ?? 0) - offsetPx
cdsStartPx = reversed ? minX - cdsWidthPx : minX
ctx.fillStyle = theme.palette.text.primary
Expand Down Expand Up @@ -525,7 +525,7 @@ function drawOverlay(
(lgv.bpToPx({
refName,
coord: cds.min,
regionNumber: layoutIndex,
displayedRegionIndex: layoutIndex,
})?.offsetPx ?? 0) - offsetPx
const cdsStartPx = reversed ? minX - cdsWidthPx : minX
const frame = getFrame(cds.min, cds.max, strand ?? 1, cds.phase)
Expand Down Expand Up @@ -788,7 +788,7 @@ function drawTooltip(
(lgv.bpToPx({
refName,
coord: reversed ? max : min,
regionNumber: layoutIndex,
displayedRegionIndex: layoutIndex,
})?.offsetPx ?? 0) - offsetPx
const frame = getFrame(min, max, strand ?? 1, phase)
const frameOffsets = showFeatureLabels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function renderingModelFactory(
const locationStartPxInfo = self.lgv.bpToPx({
refName: refSeq,
coord: start,
regionNumber: idx,
displayedRegionIndex: idx,
})
if (!locationStartPxInfo) {
continue
Expand Down
4 changes: 2 additions & 2 deletions packages/jbrowse-plugin-apollo/src/util/glyphUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ export function getMinAndMaxPx(
const minPxInfo = lgv.bpToPx({
refName,
coord: feature.min,
regionNumber,
displayedRegionIndex: regionNumber,
})
const maxPxInfo = lgv.bpToPx({
refName,
coord: feature.max,
regionNumber,
displayedRegionIndex: regionNumber,
})
if (minPxInfo === undefined || maxPxInfo === undefined) {
return
Expand Down
Loading