Merge branch 'master' of http://172.16.20.1:3000/duanhao/SocialNetworks_duan
This commit is contained in:
commit
9698f25da9
|
|
@ -469,8 +469,9 @@ export const useSocialGroupsStore = defineStore("socialGroups", {
|
|||
customStatisticsObj.hiddenInteractionCount == null
|
||||
) {
|
||||
customStatisticsObj.hiddenInteractionCount = 1
|
||||
|
||||
customStatisticsObj.groupCount = ids[0] === ids[1] ? 1 : 3
|
||||
// 创建一个Set来获取不重复的ids
|
||||
const uniqueIds = new Set(ids);
|
||||
customStatisticsObj.groupCount = uniqueIds.size;
|
||||
}
|
||||
|
||||
this.statisticsDetailList = this.statisticsDetailList.map((item) => ({
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
<script setup>
|
||||
import { defineEmits, onMounted, ref, onUnmounted, computed, watch, nextTick } from "vue"
|
||||
import { TansTimestamp } from "@/utils/transform"
|
||||
import { TansTimestamp, getAvatarUrl } from "@/utils/transform"
|
||||
import nodeHoverImg from "@/assets/images/nodeHover.png"
|
||||
import * as echarts from "echarts"
|
||||
import { storeToRefs } from "pinia"
|
||||
|
|
@ -302,10 +302,13 @@ const initChart = async () => {
|
|||
const links = []
|
||||
const nodes = []
|
||||
const edgeWidth = (interactionTime) => {
|
||||
if (interactionTime > 3) return 4
|
||||
else if (interactionTime > 10) return 6
|
||||
else if (interactionTime > 20) return 8
|
||||
else if (interactionTime > 30) return 10
|
||||
if(interactionTime === 0) return 1
|
||||
if(interactionTime === 1) return 2
|
||||
if(interactionTime <= 2) return 3
|
||||
if (interactionTime <= 3) return 4
|
||||
else if (interactionTime <= 10) return 6
|
||||
else if (interactionTime <= 20) return 8
|
||||
else if (interactionTime <= 30) return 10
|
||||
else return 1
|
||||
}
|
||||
// 添加边唯一标识集合,用于检测重复边
|
||||
|
|
@ -321,9 +324,9 @@ const initChart = async () => {
|
|||
// 头像
|
||||
avatarData: item.avatarData,
|
||||
// 节点的默认圆形头像
|
||||
defaultAvatar: item.defaultAvatar,
|
||||
defaultAvatar: getAvatarUrl(item.defaultAvatar),
|
||||
// 节点的高亮圆形头像
|
||||
activeAvatar: item.activeAvatar,
|
||||
activeAvatar: getAvatarUrl(item.activeAvatar),
|
||||
// 粉丝量
|
||||
fans: item.fans,
|
||||
symbolSize: 40,
|
||||
|
|
@ -558,7 +561,8 @@ const initChart = async () => {
|
|||
animationDurationUpdate: 3500, // 节点移动更平滑
|
||||
data: data.nodes.map((node) => ({
|
||||
...node,
|
||||
symbolSize: 40,
|
||||
symbol: node.defaultAvatar ? `image://${node.defaultAvatar}` : "circle",
|
||||
symbolSize: node.defaultAvatar ? 140 : 40,
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
|
||||
{ offset: 1, color: "#1a3860" }, // 最左侧
|
||||
|
|
@ -586,7 +590,6 @@ const initChart = async () => {
|
|||
links: data.links,
|
||||
lineStyle: {
|
||||
color: "#37ACD7",
|
||||
width: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -596,7 +599,39 @@ const initChart = async () => {
|
|||
|
||||
const highLightUserNodes = (newHiglightUserIdList) => {
|
||||
if (!newHiglightUserIdList) return
|
||||
chart.dispatchAction({
|
||||
// 只让高亮节点显示 activeAvatar,其他节点恢复默认头像或圆形
|
||||
chartsData.value.nodes.forEach((node) => {
|
||||
if (newHiglightUserIdList.includes(node.id) && node.activeAvatar) {
|
||||
node.symbol = `image://${node.activeAvatar}`
|
||||
node.symbolSize = 140
|
||||
} else {
|
||||
node.symbol = "circle"
|
||||
node.symbolSize = 40
|
||||
node.itemStyle = {
|
||||
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
|
||||
{ offset: 1, color: "#1a3860" }, // 最左侧
|
||||
{ offset: 0.5, color: "#38546b" }, // 中间
|
||||
{ offset: 0, color: "#5fb3b3" } // 最右侧
|
||||
]),
|
||||
|
||||
opacity: 1,
|
||||
borderColor: "#46C6AD",
|
||||
borderWidth: 1,
|
||||
shadowBlur: 4,
|
||||
borderType: "dashed",
|
||||
shadowColor: "rgba(19, 27, 114, 0.25)"
|
||||
}
|
||||
}
|
||||
})
|
||||
chart.setOption({
|
||||
series: [
|
||||
{
|
||||
data: chartsData.value.nodes
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
/* chart.dispatchAction({
|
||||
type: "downplay",
|
||||
seriesIndex: 0
|
||||
})
|
||||
|
|
@ -612,7 +647,7 @@ const highLightUserNodes = (newHiglightUserIdList) => {
|
|||
})
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
}, 1000) */
|
||||
}
|
||||
|
||||
const handleClickNode = () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user