Skip to content

Commit 0da3903

Browse files
committed
Documentation/Note: add TODO comment to legend for per-group control approximation
1 parent 4521ef7 commit 0da3903

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Eplant/views/eFP/Viewer/legend.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Box, styled, useTheme } from '@mui/material'
22

33
import { getColor } from '../svg'
4-
import { ColorMode, EFPData, EFPState } from '../types'
4+
import { ColorMode, EFPData } from '../types'
55

66
interface ILegendProps {
77
data: EFPData
@@ -18,6 +18,11 @@ export default styled(function Legend({
1818
...rest
1919
}: ILegendProps) {
2020
const theme = useTheme()
21+
// TODO: legend uses data.control (cross-group average) and data.min/max as a
22+
// global approximation. This can diverge from per-group colours when groups
23+
// have different controls. A per-group legend is out of scope for this fix.
24+
// I.e. The colours may not line up in this commit/PR due to group colours being different
25+
// than the global legend
2126
const control = data.control ?? 1
2227
const values = Array(GRADIENT_STEPS)
2328
.fill(0)

0 commit comments

Comments
 (0)