diff --git a/src/views/KeyNodeDiscern/anchorRecommendation/components/communityNode.vue b/src/views/KeyNodeDiscern/anchorRecommendation/components/communityNode.vue index f4f5f43..16a3d05 100644 --- a/src/views/KeyNodeDiscern/anchorRecommendation/components/communityNode.vue +++ b/src/views/KeyNodeDiscern/anchorRecommendation/components/communityNode.vue @@ -86,7 +86,7 @@ const initChart = async () => { //包含锚点的社团 (绿色闪烁的节点) const includeAnchorCommunity = Object.entries(anchorCommunityInfo).map( ([communityId, anchorList]) => ({ - name: parseInt(communityId), // 社团id + nodeName: parseInt(communityId), // 社团id anchorCount: anchorList.length, // 该社团包含锚点的个数 anchorList: anchorList, // 该社团包含的锚点id数组 symbol: `image://${new URL(predictionNodeImg, import.meta.url)}` @@ -94,19 +94,19 @@ const initChart = async () => { ) // 创建包含锚点的社团名称集合(提高查找效率) - const includedCommunityId = includeAnchorCommunity.map((node) => node.name.toString()) + const includedCommunityId = includeAnchorCommunity.map((node) => node.nodeName.toString()) //筛选出不包含锚点的社团(不闪烁的蓝色节点) const uncontainedAnchorCommunity = Object.keys(community) .filter((node) => !includedCommunityId.includes(node)) - .map((node) => ({ name: parseInt(node), anchorCount: 0, symbol: `image://${new URL(normalGroupNodeImg, import.meta.url)}` })) + .map((node) => ({ nodeName: parseInt(node), anchorCount: 0, symbol: `image://${new URL(normalGroupNodeImg, import.meta.url)}` })) //合并成功后,统一设置id,避免重复id出现导致echarts渲染失败,并且取出每个社团中有多少个节点 const nodes = includeAnchorCommunity.concat(uncontainedAnchorCommunity).map((node, index) => ({ id: index, fixed: false, - total: Object.values(community)[node.name].length, + total: Object.values(community)[node.nodeName].length, category: node.anchorCount > 0 ? 1 : 0, //(1:含有锚点的社团分类,0:不含锚点的社团) ...node })) @@ -278,7 +278,7 @@ const initChart = async () => { shadowBlur: 20, shadowColor: "#c4a651", borderColor: "#fcd267", - borderWidth: node.category == 0 ? 1 : 5, + borderWidth: node.category == 0 ? 50 : 100, borderType: "solid" } } diff --git a/src/views/LinkPrediction/components/communityNode.vue b/src/views/LinkPrediction/components/communityNode.vue index 2af4190..c8f5cf1 100644 --- a/src/views/LinkPrediction/components/communityNode.vue +++ b/src/views/LinkPrediction/components/communityNode.vue @@ -62,7 +62,7 @@ const initChart = () => { //处理社团节点 const nodes = Object.values(inject("communityNodeList") ?? []).map((item) => ({ id: item.id, - name: item.id, + nodeName: item.id, isIncludePredictNodes: item.isIncludePredictNodes, nodesNum: item.nodesNum, neighbors: item.neighbors, diff --git a/src/views/LinkPrediction/components/detailNode.vue b/src/views/LinkPrediction/components/detailNode.vue index 2b5e3ef..b202411 100644 --- a/src/views/LinkPrediction/components/detailNode.vue +++ b/src/views/LinkPrediction/components/detailNode.vue @@ -129,7 +129,7 @@ const initChart = async () => { //先处理节点 nodes = props.interactionStore.communityDetailNodeList.map((item) => ({ id: item.userId, - name: item.userName, + nodeName: item.userName, // 头像 avatarData: item.avatarData, //默认圆形头像 @@ -256,7 +256,7 @@ const initChart = async () => { ">
用户ID:${params.data.id}
-
用户名:${params.data.name}
+
用户名:${params.data.nodeName}
` } diff --git a/src/views/LinkPrediction/socialGroups/components/communityNode.vue b/src/views/LinkPrediction/socialGroups/components/communityNode.vue index ab35166..4c09f9e 100644 --- a/src/views/LinkPrediction/socialGroups/components/communityNode.vue +++ b/src/views/LinkPrediction/socialGroups/components/communityNode.vue @@ -45,12 +45,12 @@ const initChart = async () => { //处理社团节点 const nodes = Object.values(communityNodeList).map((item) => ({ id: (item.id), - name: (item.id), + nodeName: (item.id), symbol: imageSelect(item), symbolSize: 30, isIncludePredictNodes: item.isIncludePredictNodes, nodesNum: item.nodesNum, - neighbors: item.neighbors.map((nei) => ({ ...nei, name: parseInt(nei.id) })), + neighbors: item.neighbors.map((nei) => ({ ...nei, nodeName: parseInt(nei.id) })), category: item.isIncludePredictNodes ? 1 : 0, selfIncludeImplicitRelationship: item.neighbors.map((nei) => nei.id).includes(item.id) && //若该社团的id在该社团邻居中可以找到,说明自己这个社团中有社交紧密关系 @@ -62,7 +62,7 @@ const initChart = async () => { const edgeSet = new Set() //去除重复边 nodes.forEach((communityNode) => { communityNode.neighbors.forEach((communityNei) => { - const key = [communityNode.name, communityNei.name].sort().join("-") + const key = [communityNode.nodeName, communityNei.nodeName].sort().join("-") if (edgeSet.has(key)) return links.push({ source: communityNode.id, diff --git a/src/views/LinkPrediction/socialGroups/components/detailNode.vue b/src/views/LinkPrediction/socialGroups/components/detailNode.vue index 4ec0fee..caed2a7 100644 --- a/src/views/LinkPrediction/socialGroups/components/detailNode.vue +++ b/src/views/LinkPrediction/socialGroups/components/detailNode.vue @@ -350,7 +350,7 @@ const initChart = async () => { socialGroupsStore.communityAllNodeList.forEach((item) => { nodes.push({ id: item.userId, - name: item.userName, + nodeName: item.userName, // 头像 avatarData: item.avatarData, // 节点的默认圆形头像 @@ -500,7 +500,7 @@ const initChart = async () => { ">
用户ID:${params.data.id}
-
用户名:${params.data.name}
+
用户名:${params.data.nodeName}
` }