Skip to content

Commit c0852ec

Browse files
authored
[hotfix] Category map legend color updates (#2060)
1 parent e154d43 commit c0852ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/map/src/helpers/applyColorToLegend.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ export const applyColorToLegend = (legendIdx: number, config: MapConfig, result:
4242
if (color.includes('qualitative')) return mapColorPalette[colorIdx]
4343

4444
// Determine color distribution
45-
const amt = Math.max(result.length - specialClasses.length, 1)
45+
const amt =
46+
Math.max(result.length - specialClasses.length, 1) < 10
47+
? Math.max(result.length - specialClasses.length, 1)
48+
: Object.keys(colorDistributions).length
4649
const distributionArray = colorDistributions[amt] ?? []
4750

4851
const specificColor =

0 commit comments

Comments
 (0)