Function
getCommunityColor
(
communityAssignments: Record<string, number>,
communityColorMap: Map<number, string>,
nodeId: string,
)
Source from the content-addressed store, hash-verified
| 273 | * Look up the community color for a given node. |
| 274 | */ |
| 275 | export function getCommunityColor( |
| 276 | communityAssignments: Record<string, number>, |
| 277 | communityColorMap: Map<number, string>, |
| 278 | nodeId: string, |
| 279 | ): string { |
| 280 | const communityId = communityAssignments[nodeId]; |
| 281 | if (communityId === undefined) return FALLBACK_COLOR; |
| 282 | return communityColorMap.get(communityId) ?? FALLBACK_COLOR; |
| 283 | } |
Tested by
no test coverage detected