Skip to content

Commit 8c83466

Browse files
committed
fix: use experiment-wide max for absolute mode, per-group for relative mode, had to add extra variables to include both absolute and relative
1 parent 5b38a60 commit 8c83466

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Eplant/views/eFP/svg.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export function getColor(
9696
colorMode: ColorMode,
9797
tissueStd?: number,
9898
maskThreshold?: number,
99-
maskingEnabled?: boolean
99+
maskingEnabled?: boolean,
100+
absoluteMax?: number
100101
): string {
101102
const extremum = Math.max(
102103
Math.abs(Math.log2(group.min / control)),
@@ -118,7 +119,7 @@ export function getColor(
118119
return mix(
119120
theme.palette.neutral.main,
120121
theme.palette.hot.main,
121-
value / group.max
122+
value / (absoluteMax ?? group.max)
122123
)
123124
}
124125

@@ -145,7 +146,8 @@ export function useStyles(
145146
colorMode,
146147
tissue.std,
147148
maskThreshold,
148-
maskingEnabled
149+
maskingEnabled,
150+
data.max
149151
)} !important; }`
150152
)
151153
)

0 commit comments

Comments
 (0)