From d48e1301193cf55e0d47e1649eab21ac170b51db Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 28 Jan 2025 02:18:23 -0500 Subject: [PATCH] Lint --- .../LinearVariantMatrixRenderer.ts | 1 - .../LinearVariantMatrixRendering.tsx | 18 +++--------------- .../makeImageData.ts | 1 - .../MultiVariantRenderer.ts | 10 +++++----- .../src/MultiLinearVariantRenderer/types.ts | 1 + 5 files changed, 9 insertions(+), 22 deletions(-) diff --git a/plugins/variants/src/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.ts b/plugins/variants/src/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.ts index 28e835d2e8..ac9910431b 100644 --- a/plugins/variants/src/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.ts +++ b/plugins/variants/src/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.ts @@ -40,7 +40,6 @@ export default class LinearVariantMatrixRenderer extends BoxRendererType { width, }) - console.log({ res }) return { ...results, ...res, diff --git a/plugins/variants/src/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.tsx b/plugins/variants/src/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.tsx index e05ba85cd3..9bfef37753 100644 --- a/plugins/variants/src/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.tsx +++ b/plugins/variants/src/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.tsx @@ -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(null) - console.log({ arr }) function getFeatureUnderMouse(eventClientX: number, eventClientY: number) { // calculates feature under mouse @@ -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) ] diff --git a/plugins/variants/src/MultiLinearVariantMatrixRenderer/makeImageData.ts b/plugins/variants/src/MultiLinearVariantMatrixRenderer/makeImageData.ts index c6923fb3b2..fa42cfd030 100644 --- a/plugins/variants/src/MultiLinearVariantMatrixRenderer/makeImageData.ts +++ b/plugins/variants/src/MultiLinearVariantMatrixRenderer/makeImageData.ts @@ -1,4 +1,3 @@ -import RBush from 'rbush' import { getColorAlleleCount, getColorPhased, diff --git a/plugins/variants/src/MultiLinearVariantRenderer/MultiVariantRenderer.ts b/plugins/variants/src/MultiLinearVariantRenderer/MultiVariantRenderer.ts index 67e229a8c2..65457a1776 100644 --- a/plugins/variants/src/MultiLinearVariantRenderer/MultiVariantRenderer.ts +++ b/plugins/variants/src/MultiLinearVariantRenderer/MultiVariantRenderer.ts @@ -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 @@ -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 diff --git a/plugins/variants/src/MultiLinearVariantRenderer/types.ts b/plugins/variants/src/MultiLinearVariantRenderer/types.ts index cc46600f8a..ab0f83abc4 100644 --- a/plugins/variants/src/MultiLinearVariantRenderer/types.ts +++ b/plugins/variants/src/MultiLinearVariantRenderer/types.ts @@ -20,4 +20,5 @@ export interface MultiRenderArgsDeserialized sources: Source[] rowHeight: number scrollTop: number + minorAlleleFrequencyFilter: number }