Skip to content

Commit 40d121f

Browse files
committed
fix: use experiment-wide min/max for eFP colour scale; before was using group max and heat scale max was wrong
1 parent e5de710 commit 40d121f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

Eplant/views/eFP/Viewer/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export default class EFPViewer
407407
borderRadius: 1,
408408
})}
409409
>
410-
{activeData.viewData[activeViewIndex].supported ? (
410+
{sortedViewData[activeViewIndex].supported ? (
411411
<>
412412
<div>
413413
<Typography
@@ -422,9 +422,9 @@ export default class EFPViewer
422422
{geneticElement?.id}
423423
</Typography>
424424

425-
{activeData.views[activeViewIndex].name !== 'cellEFP' && (
425+
{sortedViews[activeViewIndex].name !== 'cellEFP' && (
426426
<GeneDistributionChart
427-
data={{ ...activeData.viewData[activeViewIndex] }}
427+
data={{ ...sortedViewData[activeViewIndex] }}
428428
/>
429429
)}
430430
</div>
@@ -447,7 +447,7 @@ export default class EFPViewer
447447
zIndex: 10,
448448
})}
449449
data={{
450-
...activeData.viewData[activeViewIndex],
450+
...sortedViewData[activeViewIndex],
451451
}}
452452
maskThreshold={state.maskThreshold}
453453
colorMode={state.colorMode}

Eplant/views/eFP/svg.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { Theme, useTheme } from '@mui/material'
88
import {
99
ColorMode,
1010
EFPData,
11-
EFPGroup,
1211
EFPId,
1312
EFPSampleData,
1413
EFPSVGCache,
@@ -90,7 +89,7 @@ export const useEFPSVG = (
9089

9190
export function getColor(
9291
value: number,
93-
group: EFPSampleData | EFPGroup,
92+
group: EFPSampleData,
9493
control: number,
9594
theme: Theme,
9695
colorMode: ColorMode,
@@ -124,12 +123,13 @@ export function getColor(
124123

125124
export function useStyles(
126125
id: string,
127-
{ groups, control }: EFPData,
126+
data: EFPData,
128127
colorMode: ColorMode,
129128
maskThreshold?: number,
130129
maskingEnabled?: boolean
131130
) {
132131
const theme = useTheme()
132+
const { groups, control } = data
133133
const samples = groups
134134
.flatMap((group) =>
135135
group.tissues.map(
@@ -138,7 +138,7 @@ export function useStyles(
138138
tissue.id
139139
} { fill: ${getColor(
140140
tissue.mean,
141-
group,
141+
data,
142142
control ?? 1,
143143
theme,
144144
colorMode,

0 commit comments

Comments
 (0)