Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 28, 2025
1 parent 08927de commit d48e130
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default class LinearVariantMatrixRenderer extends BoxRendererType {
width,
})

console.log({ res })
return {
...results,
...res,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { useRef } from 'react'

import { PrerenderedCanvas } from '@jbrowse/core/ui'
import { observer } from 'mobx-react'
import RBush from 'rbush'
import { useMemo, useRef } from 'react'

const LinearVariantMatrixRendering = observer(function (props: {
width: number
height: number
rbush: any
displayModel: any
arr: string[]
}) {
const { arr, width, height, displayModel, rbush } = props
//const clickMap2 = useMemo(
// () => new RBush<{ genotype: string }>().fromJSON(rbush),
// [rbush],
//)
const { arr, width, height, displayModel } = props
const ref = useRef<HTMLDivElement>(null)
console.log({ arr })

function getFeatureUnderMouse(eventClientX: number, eventClientY: number) {
// calculates feature under mouse
Expand All @@ -30,12 +24,6 @@ const LinearVariantMatrixRendering = observer(function (props: {

const dimY = arr.length
const dimX = arr[0]?.length || 0
//console.log(arr, {
// w: Math.round((offsetX / width) * dimY),
// h: Math.round((offsetY / height) * dimX),
// dimX,
// dimY,
//})
return arr[Math.floor((offsetX / width) * dimY)]?.[
Math.floor((offsetY / height) * dimX)
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import RBush from 'rbush'
import {
getColorAlleleCount,
getColorPhased,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import FeatureRendererType from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType'
import { featureSpanPx, renderToAbstractCanvas } from '@jbrowse/core/util'

import { getCol, getFeaturesThatPassMinorAlleleFrequencyFilter } from '../util'

import type { Feature } from '@jbrowse/core/util'
import type { MultiRenderArgsDeserialized } from './types'
import {
getColorAlleleCount,
getColorPhased,
} from '../shared/multiVariantColor'
import { getFeaturesThatPassMinorAlleleFrequencyFilter } from '../util'

import type { MultiRenderArgsDeserialized } from './types'
import type { Feature } from '@jbrowse/core/util'

const fudgeFactor = 0.6
const f2 = fudgeFactor / 2
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class MultiVariantBaseRenderer extends FeatureRendererType {
features.values(),
minorAlleleFrequencyFilter,
)
for (const feature of features.values()) {
for (const feature of mafs) {
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx)
const w = Math.max(Math.round(rightPx - leftPx), 2)
const samp = feature.get('genotypes') as Record<string, string>
Expand Down
1 change: 1 addition & 0 deletions plugins/variants/src/MultiLinearVariantRenderer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface MultiRenderArgsDeserialized
sources: Source[]
rowHeight: number
scrollTop: number
minorAlleleFrequencyFilter: number
}

0 comments on commit d48e130

Please sign in to comment.