(node: SkillLineageNode, maxSelections: number)
| 37 | } |
| 38 | |
| 39 | function 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 | |
| 57 | export function useSkillEvolutionGraphData( |
| 58 | lineage: SkillLineage | null, |
no outgoing calls
no test coverage detected