Skip to content

Commit

Permalink
Slightly thinner label if no color box
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 25, 2025
1 parent ede12d1 commit 9e217ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { makeStyles } from 'tss-react/mui'

import type { LinearGenomeViewModel } from '..'


const useStyles = makeStyles()(theme => ({
container: {
display: 'flex',
Expand Down
5 changes: 3 additions & 2 deletions plugins/variants/src/shared/ColorLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const ColorLegend = observer(function ({
const { canDisplayLabels, rowHeight, sources } = model
const svgFontSize = clamp(rowHeight, 8, 12)
const colorBoxWidth = 15
const legendWidth = labelWidth + colorBoxWidth + 5
const hasColors = sources?.some(s => s.color)
const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0)

return sources ? (
<>
Expand Down Expand Up @@ -49,7 +50,7 @@ const ColorLegend = observer(function ({
{canDisplayLabels ? (
<text
y={idx * rowHeight + svgFontSize}
x={colorBoxWidth + 2}
x={color ? colorBoxWidth + 2 : 0}
fontSize={svgFontSize}
>
{label || name}
Expand Down

0 comments on commit 9e217ea

Please sign in to comment.