This commit is contained in:
Andras Schmelczer 2026-03-12 22:11:00 +00:00
parent 14a3555cf1
commit 7e92bf112e
34 changed files with 1214437 additions and 224 deletions

View file

@ -143,6 +143,13 @@ export function useDeckLayers({
const colorFeatureMetaRef = useRef(colorFeatureMeta);
colorFeatureMetaRef.current = colorFeatureMeta;
// Track enum value count for discrete coloring (0 = numeric/continuous)
const enumCountRef = useRef(0);
enumCountRef.current =
colorFeatureMeta?.type === 'enum' && colorFeatureMeta.values
? colorFeatureMeta.values.length
: 0;
// --- Count ranges ---
const countRange = useMemo(() => {
if (data.length === 0) return { min: 0, max: 1 };
@ -360,7 +367,8 @@ export function useDeckLayers({
0,
densityGradientRef.current,
dark,
255
255,
enumCountRef.current
);
}
}
@ -433,7 +441,8 @@ export function useDeckLayers({
0,
densityGradientRef.current,
dark,
180
180,
enumCountRef.current
);
}
const cr = postcodeCountRangeRef.current;