MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / createGraphNode

Function createGraphNode

frontend/src/hooks/useSkillEvolutionGraphData.ts:39–55  ·  view source on GitHub ↗
(node: SkillLineageNode, maxSelections: number)

Source from the content-addressed store, hash-verified

37}
38
39function createGraphNode(node: SkillLineageNode, maxSelections: number): SkillGraphNode {
40 const usageRatio = maxSelections > 0 ? 0.25 + 0.75 * (node.total_selections / maxSelections) : 0.35;
41 return {
42 id: node.skill_id,
43 name: node.name || node.skill_id.slice(0, 8),
44 score: node.score,
45 origin: node.origin,
46 generation: node.generation,
47 created_at: node.created_at,
48 visibility: node.visibility,
49 totalSelections: node.total_selections,
50 effectiveRate: node.effective_rate,
51 isActive: node.is_active,
52 tags: node.tags,
53 usageRatio,
54 };
55}
56
57export function useSkillEvolutionGraphData(
58 lineage: SkillLineage | null,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected