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 == null
|
||||||
) {
|
) {
|
||||||
customStatisticsObj.hiddenInteractionCount = 1
|
customStatisticsObj.hiddenInteractionCount = 1
|
||||||
|
// 创建一个Set来获取不重复的ids
|
||||||
customStatisticsObj.groupCount = ids[0] === ids[1] ? 1 : 3
|
const uniqueIds = new Set(ids);
|
||||||
|
customStatisticsObj.groupCount = uniqueIds.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.statisticsDetailList = this.statisticsDetailList.map((item) => ({
|
this.statisticsDetailList = this.statisticsDetailList.map((item) => ({
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { defineEmits, onMounted, ref, onUnmounted, computed, watch, nextTick } from "vue"
|
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 nodeHoverImg from "@/assets/images/nodeHover.png"
|
||||||
import * as echarts from "echarts"
|
import * as echarts from "echarts"
|
||||||
import { storeToRefs } from "pinia"
|
import { storeToRefs } from "pinia"
|
||||||
|
|
@ -302,10 +302,13 @@ const initChart = async () => {
|
||||||
const links = []
|
const links = []
|
||||||
const nodes = []
|
const nodes = []
|
||||||
const edgeWidth = (interactionTime) => {
|
const edgeWidth = (interactionTime) => {
|
||||||
if (interactionTime > 3) return 4
|
if(interactionTime === 0) return 1
|
||||||
else if (interactionTime > 10) return 6
|
if(interactionTime === 1) return 2
|
||||||
else if (interactionTime > 20) return 8
|
if(interactionTime <= 2) return 3
|
||||||
else if (interactionTime > 30) return 10
|
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
|
else return 1
|
||||||
}
|
}
|
||||||
// 添加边唯一标识集合,用于检测重复边
|
// 添加边唯一标识集合,用于检测重复边
|
||||||
|
|
@ -321,9 +324,9 @@ const initChart = async () => {
|
||||||
// 头像
|
// 头像
|
||||||
avatarData: item.avatarData,
|
avatarData: item.avatarData,
|
||||||
// 节点的默认圆形头像
|
// 节点的默认圆形头像
|
||||||
defaultAvatar: item.defaultAvatar,
|
defaultAvatar: getAvatarUrl(item.defaultAvatar),
|
||||||
// 节点的高亮圆形头像
|
// 节点的高亮圆形头像
|
||||||
activeAvatar: item.activeAvatar,
|
activeAvatar: getAvatarUrl(item.activeAvatar),
|
||||||
// 粉丝量
|
// 粉丝量
|
||||||
fans: item.fans,
|
fans: item.fans,
|
||||||
symbolSize: 40,
|
symbolSize: 40,
|
||||||
|
|
@ -558,7 +561,8 @@ const initChart = async () => {
|
||||||
animationDurationUpdate: 3500, // 节点移动更平滑
|
animationDurationUpdate: 3500, // 节点移动更平滑
|
||||||
data: data.nodes.map((node) => ({
|
data: data.nodes.map((node) => ({
|
||||||
...node,
|
...node,
|
||||||
symbolSize: 40,
|
symbol: node.defaultAvatar ? `image://${node.defaultAvatar}` : "circle",
|
||||||
|
symbolSize: node.defaultAvatar ? 140 : 40,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
|
color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
|
||||||
{ offset: 1, color: "#1a3860" }, // 最左侧
|
{ offset: 1, color: "#1a3860" }, // 最左侧
|
||||||
|
|
@ -586,7 +590,6 @@ const initChart = async () => {
|
||||||
links: data.links,
|
links: data.links,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: "#37ACD7",
|
color: "#37ACD7",
|
||||||
width: 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -596,7 +599,39 @@ const initChart = async () => {
|
||||||
|
|
||||||
const highLightUserNodes = (newHiglightUserIdList) => {
|
const highLightUserNodes = (newHiglightUserIdList) => {
|
||||||
if (!newHiglightUserIdList) return
|
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",
|
type: "downplay",
|
||||||
seriesIndex: 0
|
seriesIndex: 0
|
||||||
})
|
})
|
||||||
|
|
@ -612,7 +647,7 @@ const highLightUserNodes = (newHiglightUserIdList) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000) */
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClickNode = () => {
|
const handleClickNode = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user