1
This commit is contained in:
		
							parent
							
								
									4f1b893cd6
								
							
						
					
					
						commit
						d280a0e1b4
					
				| 
						 | 
				
			
			@ -91,10 +91,8 @@ const initChart = () => {
 | 
			
		|||
 | 
			
		||||
  //处理连边
 | 
			
		||||
  const links = []
 | 
			
		||||
  const newSet = new Set()
 | 
			
		||||
  nodes.forEach((communityNode) => {
 | 
			
		||||
    communityNode.neighbors.forEach((communityNei) => {
 | 
			
		||||
      if (newSet.has(communityNei.id)) return
 | 
			
		||||
      links.push({
 | 
			
		||||
        source: communityNode.id,
 | 
			
		||||
        target: communityNei.id,
 | 
			
		||||
| 
						 | 
				
			
			@ -107,7 +105,6 @@ const initChart = () => {
 | 
			
		|||
        }
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
    newSet.add(communityNode.id) // 添加当前社团节点id到集合中,避免重复添加
 | 
			
		||||
  })
 | 
			
		||||
  // 保存初始 links,用于后续切换
 | 
			
		||||
  originalLinks = JSON.parse(JSON.stringify(links))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user