fix(web): network colors bugfix
This commit is contained in:
@@ -81,12 +81,14 @@ const RelationshipNetwork:FC = () => {
|
|||||||
name: displayName,
|
name: displayName,
|
||||||
category: categoryIndex >= 0 ? categoryIndex : 0,
|
category: categoryIndex >= 0 ? categoryIndex : 0,
|
||||||
symbolSize: symbolSize, // 根据连接数调整节点大小
|
symbolSize: symbolSize, // 根据连接数调整节点大小
|
||||||
itemStyle: {
|
|
||||||
color: colors[categoryIndex % 8]
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 创建节点ID到标签的映射
|
||||||
|
const nodeIdToLabel: Record<string, string> = {}
|
||||||
|
nodes.forEach(node => {
|
||||||
|
nodeIdToLabel[node.id] = node.label
|
||||||
|
})
|
||||||
// 处理边数据
|
// 处理边数据
|
||||||
edges.forEach(edge => {
|
edges.forEach(edge => {
|
||||||
curEdges.push({
|
curEdges.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user