MCPcopy
hub / github.com/opentrace/opentrace / getCommunityColor

Function getCommunityColor

ui/src/components/colors/communityColors.ts:275–283  ·  view source on GitHub ↗
(
  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 */
275export 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}

Callers 1

useGraphInstanceFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected