节点字体消除
This commit is contained in:
parent
03393edb22
commit
a3fe33d53c
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
|||
">
|
||||
<div style="color:#fff;letter-spacing: 0.14px;">
|
||||
<div >用户ID:${params.data.id}</div>
|
||||
<div >用户名:${params.data.name}</div>
|
||||
<div >用户名:${params.data.nodeName}</div>
|
||||
</div>
|
||||
</div>`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
|||
">
|
||||
<div style="color:#fff;letter-spacing: 0.14px;">
|
||||
<div >用户ID:${params.data.id}</div>
|
||||
<div >用户名:${params.data.name}</div>
|
||||
<div >用户名:${params.data.nodeName}</div>
|
||||
</div>
|
||||
</div>`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user