Skip to content

Commit

Permalink
fixup(browser): appease eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed Oct 21, 2024
1 parent 2d1e4b7 commit 72dad5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
4 changes: 1 addition & 3 deletions browser/src/GenePage/GenePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import LeftArrow from '@fortawesome/fontawesome-free/svgs/solid/arrow-circle-left.svg'
// @ts-expect-error TS(2307) FIXME: Cannot find module '@fortawesome/fontawesome-free/... Remove this comment to see the full error message
import RightArrow from '@fortawesome/fontawesome-free/svgs/solid/arrow-circle-right.svg'
import React, { useState, Dispatch, SetStateAction, useEffect } from 'react'
import React, { useState, Dispatch, SetStateAction } from 'react'
import styled from 'styled-components'

// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module '@gno... Remove this comment to see the full error message
Expand All @@ -22,7 +22,6 @@ import {
isExac,
hasCopyNumberVariants,
isV2,
getTopLevelDataset,
} from '@gnomad/dataset-metadata/metadata'
import ConstraintTable from '../ConstraintTable/ConstraintTable'
import VariantCooccurrenceCountsTable, {
Expand Down Expand Up @@ -73,7 +72,6 @@ import {
} from '../ChartStyles'
import { logButtonClick } from '../analytics'
import { GtexTissueExpression } from './TranscriptsTissueExpression'
import { GTEX_TISSUES } from '../gtex'

export type Strand = '+' | '-'

Expand Down
15 changes: 5 additions & 10 deletions browser/src/GenePage/GeneTranscriptsTrack.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { max, mean } from 'd3-array'
import React, { useEffect, useRef, useState } from 'react'
import React, { useRef, useState } from 'react'
import styled from 'styled-components'

// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module '@gno... Remove this comment to see the full error message
Expand All @@ -8,19 +8,14 @@ import { Track } from '@gnomad/region-viewer'
import TranscriptsTrack from '@gnomad/track-transcripts'
import { Button, Modal, TooltipAnchor } from '@gnomad/ui'

import { ALL_GTEX_TISSUES, GtexTissueName, GtexTissues, TissueDetail } from '../gtex'
import { ALL_GTEX_TISSUES, GtexTissueName } from '../gtex'
import InfoButton from '../help/InfoButton'
import Link from '../Link'
import sortedTranscripts from './sortedTranscripts'
import TranscriptsTissueExpression from './TranscriptsTissueExpression'
import { Gene } from './GenePage'
import {
DatasetId,
getTopLevelDataset,
hasStructuralVariants,
} from '../../../dataset-metadata/metadata'
import { hasStructuralVariants } from '../../../dataset-metadata/metadata'
import { GtexTissueDetail, TranscriptWithTissueExpression } from './TissueExpressionTrack'
import { Transcript } from '../TranscriptPage/TranscriptPage'

const TranscriptsInfoWrapper = styled.div`
display: flex;
Expand Down Expand Up @@ -62,10 +57,10 @@ const GeneTranscriptsTrack = ({

const gtexTissues: Partial<Record<GtexTissueName, GtexTissueDetail>> = {}
if (isTissueExpressionAvailable) {
const transcript = (gene.transcripts as TranscriptWithTissueExpression[]).find(
const preferredTranscript = (gene.transcripts as TranscriptWithTissueExpression[]).find(
(transcript) => transcript.transcript_id === preferredTranscriptId
)
transcript!.gtex_tissue_expression.forEach((tissue) => {
preferredTranscript!.gtex_tissue_expression.forEach((tissue) => {
gtexTissues[tissue.tissue as GtexTissueName] = {
fullName: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].fullName || tissue.tissue,
color: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].color || '#888888',
Expand Down
10 changes: 4 additions & 6 deletions browser/src/GenePage/TissueExpressionTrack.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { max, mean } from 'd3-array'
import { scaleLinear } from 'd3-scale'
import React, { useEffect, useRef, useState } from 'react'
import React, { useRef, useState } from 'react'
import styled from 'styled-components'

// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module '@gno... Remove this comment to see the full error message
Expand All @@ -9,15 +9,13 @@ import { Track } from '@gnomad/region-viewer'
import { RegionsPlot } from '@gnomad/track-regions'
import { Badge, Button, Modal, SearchInput, Select, TooltipAnchor } from '@gnomad/ui'

import { ALL_GTEX_TISSUES, AllGtexTissues, GTEX_TISSUES, GtexTissueName } from '../gtex'
import { ALL_GTEX_TISSUES, AllGtexTissues, GtexTissueName } from '../gtex'

Check failure on line 12 in browser/src/GenePage/TissueExpressionTrack.tsx

View workflow job for this annotation

GitHub Actions / Checks

'"../gtex"' has no exported member named 'AllGtexTissues'. Did you mean 'GtexTissues'?

Check failure on line 12 in browser/src/GenePage/TissueExpressionTrack.tsx

View workflow job for this annotation

GitHub Actions / Checks

'"../gtex"' has no exported member named 'AllGtexTissues'. Did you mean 'GtexTissues'?
import InfoButton from '../help/InfoButton'

import { logButtonClick } from '../analytics'

import TranscriptsTissueExpression, { GtexTissueExpression } from './TranscriptsTissueExpression'
import { GeneTranscript } from './GenePage'
import { DatasetId, getTopLevelDataset } from '@gnomad/dataset-metadata/metadata'
import { ALL } from 'dns'

const getPlotRegions = (expressionRegions: any, getValueForRegion: any) => {
const roundedRegions = expressionRegions.map((region: any) => ({
Expand Down Expand Up @@ -375,7 +373,7 @@ const TissueExpressionTrack = ({
const gtexTissues: Partial<Record<GtexTissueName, GtexTissueDetail>> = {}
transcripts
.find((transcript) => transcript.transcript_id === preferredTranscriptId)
?.gtex_tissue_expression.map((tissue) => {
?.gtex_tissue_expression.forEach((tissue) => {
gtexTissues[tissue.tissue as GtexTissueName] = {
fullName: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].fullName || tissue.tissue,
color: ALL_GTEX_TISSUES[tissue.tissue as GtexTissueName].color || '#888888',
Expand Down Expand Up @@ -418,7 +416,7 @@ const TissueExpressionTrack = ({
(transcript) =>
transcript.gtex_tissue_expression.find((tissue) => tissue.tissue === tissueId)?.value
)
.filter((value): value is number => value != undefined)
.filter((value): value is number => value !== undefined)
)

return {
Expand Down

0 comments on commit 72dad5d

Please sign in to comment.