Skip to content

Commit

Permalink
feat(browser): add more labels on transcript tissue expression plot
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed Nov 20, 2024
1 parent c4bb8df commit e0b2e7b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions browser/src/GenePage/TranscriptsTissueExpressionPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,15 @@ const TranscriptsTissueExpressionPlot = ({
const opacityScale = scaleLinear().domain([0, maxTissueExpression]).range([0, 1])

const transcriptsWidth = 150
const cellSize = 18
// hacky way to change width per GRCh37, or GRCh38. To properly do this, we
// should pass the dataset ID to this component, change the Modal from
// GBTK to be responsive, then change this component to also be responsive
const cellWidth = renderedTissues.length === 51 ? 20 : 18
const cellHeight = 18
const padding = 0.2
const gutterWidth = 9
const plotWidth = 1 + renderedTissues.length * cellSize + gutterWidth
const plotHeight = transcripts.length * cellSize * (1 + padding)
const plotWidth = 1 + renderedTissues.length * cellWidth + gutterWidth
const plotHeight = transcripts.length * cellHeight * (1 + padding)

const height = plotHeight + margin.top + margin.bottom
const width = plotWidth + margin.left + margin.right + transcriptsWidth
Expand Down Expand Up @@ -279,6 +283,7 @@ const TranscriptsTissueExpressionPlot = ({
// @ts-expect-error TS(2322) FIXME: Type 'ScaleOrdinal<string, unknown, never>' is not... Remove this comment to see the full error message
scale={xAxisScale}
stroke="#333"
numTicks={renderedTissues.length}
tickFormat={(tissue: GtexTissueName) => {
return gtexTissues[tissue] ? gtexTissues[tissue]!.fullName : tissue
}}
Expand Down

0 comments on commit e0b2e7b

Please sign in to comment.