Merge branch 'master' of http://172.16.20.1:3000/duanhao/SocialNetworks_duan
This commit is contained in:
		
						commit
						e70c83736c
					
				
							
								
								
									
										
											BIN
										
									
								
								src/assets/images/icon/opinion-leader-normal-node.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/assets/images/icon/opinion-leader-normal-node.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 1.9 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 19 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 20 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 19 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB  | 
| 
						 | 
				
			
			@ -418,11 +418,11 @@ export const useKeyNodeStore1 = defineStore("keyNode1", () => {
 | 
			
		|||
      id: 3,
 | 
			
		||||
      timestamp: "2022-07-31 02:24:23",
 | 
			
		||||
      author: "bidishalolo",
 | 
			
		||||
      influence: 6636,
 | 
			
		||||
      influence: 7630,
 | 
			
		||||
      highlighted: false,
 | 
			
		||||
      like: 5013,
 | 
			
		||||
      comment: 247,
 | 
			
		||||
      transmit: 1376,
 | 
			
		||||
      like: 5010,
 | 
			
		||||
      comment: 244,
 | 
			
		||||
      transmit: 2376,
 | 
			
		||||
      content:
 | 
			
		||||
        "BREAKING: #Pelosi seen flying over #Taiwan. Stunning footage... https://t.co/8AOJ6yMPvl"
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			@ -465,11 +465,11 @@ export const useKeyNodeStore1 = defineStore("keyNode1", () => {
 | 
			
		|||
      id: 7,
 | 
			
		||||
      timestamp: "2022-7-31 16:11:53",
 | 
			
		||||
      author: "Mick Wallace",
 | 
			
		||||
      influence: 2473,
 | 
			
		||||
      influence: 1754,
 | 
			
		||||
      highlighted: false,
 | 
			
		||||
      like: 1923,
 | 
			
		||||
      comment: 124,
 | 
			
		||||
      transmit: 426,
 | 
			
		||||
      like: 999,
 | 
			
		||||
      comment: 101,
 | 
			
		||||
      transmit: 654,
 | 
			
		||||
      content:
 | 
			
		||||
        "As if the Warmongering #Pelosi hasn't done enough damage, it seems she's arrived in Taiwan already on her latest War promotion..."
 | 
			
		||||
    },
 | 
			
		||||
| 
						 | 
				
			
			@ -477,10 +477,10 @@ export const useKeyNodeStore1 = defineStore("keyNode1", () => {
 | 
			
		|||
      id: 8,
 | 
			
		||||
      timestamp: "2022-07-31 16:12:49",
 | 
			
		||||
      author: "Jiushiniya",
 | 
			
		||||
      influence: 2473,
 | 
			
		||||
      influence: 1226,
 | 
			
		||||
      highlighted: false,
 | 
			
		||||
      like: 1923,
 | 
			
		||||
      comment: 124,
 | 
			
		||||
      like: 630,
 | 
			
		||||
      comment: 170,
 | 
			
		||||
      transmit: 426,
 | 
			
		||||
      content:
 | 
			
		||||
        "@Dr_Mo2019 蓬佩奥在媒体上说拜登政府要有战略战术,说白了川普政府如果有战略战术,就不会有hk沦陷乌克兰战争台海危机三战川普也可能不会滚下台,蓬佩奥今天还用的着蹭佩洛西访台?蓬佩奥就直接自己率团去台湾了。川普支持蓬佩奥的话,今天就不会有佩洛西什么事,如果拜登软弱的话,今天更不会有佩洛西什么事。 https://t.co/g8VQLWoKRA"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -233,7 +233,7 @@ export const useKeyNodeStore2 = defineStore("keyNode2", () => {
 | 
			
		|||
      posts: "2.9万",
 | 
			
		||||
      followerCount: "531", // 关注数量
 | 
			
		||||
      interactionCount: "4", // 互动次数
 | 
			
		||||
      firstActiveTime: "2023-10-15 00:58:58", // 首次活跃时间
 | 
			
		||||
      firstActiveTime: "2023-10-15 00:00:00", // 首次活跃时间
 | 
			
		||||
      avatar: new URL("@/assets/images/Jackson.png", import.meta.url).toString(),
 | 
			
		||||
      default_avatar: new URL(
 | 
			
		||||
        "@/assets/images/avatar/2/blue_Jackson_Hinkle_🇺🇸.png",
 | 
			
		||||
| 
						 | 
				
			
			@ -352,7 +352,7 @@ export const useKeyNodeStore2 = defineStore("keyNode2", () => {
 | 
			
		|||
    },
 | 
			
		||||
    {
 | 
			
		||||
      id: 10,
 | 
			
		||||
      timestamp: "2023-10-15 00:58:58",
 | 
			
		||||
      timestamp: "2023-10-15 00:00:00",
 | 
			
		||||
      author: "Jackson Hinkle 🇺🇸",
 | 
			
		||||
      influence: 22546,
 | 
			
		||||
      highlighted: false,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										0
									
								
								src/views/GroupEvolution/component/groupGraph.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								src/views/GroupEvolution/component/groupGraph.vue
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -366,6 +366,7 @@ const initChart = async () => {
 | 
			
		|||
          coolingFactor: 0.1
 | 
			
		||||
        },
 | 
			
		||||
        roam: true,
 | 
			
		||||
        draggable: true, // ★ 允许用鼠标直接拖动节点
 | 
			
		||||
        label: {
 | 
			
		||||
          show: false
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			@ -379,18 +380,19 @@ const initChart = async () => {
 | 
			
		|||
            name: "普通节点",
 | 
			
		||||
            itemStyle: {
 | 
			
		||||
              // 节点颜色
 | 
			
		||||
              // 圆形背景色(使用ECharts的径向渐变配置)
 | 
			
		||||
              color: new echarts.graphic.RadialGradient(0.98, 0.38, 0.9, [
 | 
			
		||||
                { offset: 1, color: "#476996" }, // 最左侧
 | 
			
		||||
                { offset: 0.5, color: "#38546b" }, // 中间
 | 
			
		||||
                { offset: 0, color: "#5fb3b3" } // 最右侧
 | 
			
		||||
                { offset: 1, color: "#235D94" }, // 最左侧
 | 
			
		||||
                { offset: 0.5, color: "#266B8F" }, // 中间
 | 
			
		||||
                { offset: 0, color: "#56ABB2" } // 最右侧
 | 
			
		||||
              ]),
 | 
			
		||||
              // 边框样式(使用ECharts的线性渐变配置)
 | 
			
		||||
              borderColor: new echarts.graphic.LinearGradient(0, 0, 1, 1, [
 | 
			
		||||
                { offset: 0, color: "rgba(42,185,254,1)" },
 | 
			
		||||
                { offset: 1, color: "rgba(82,255,243,1)" }
 | 
			
		||||
              ]),
 | 
			
		||||
              opacity: 0.8,
 | 
			
		||||
              // 边框样式
 | 
			
		||||
              borderColor: "#2AB9FE",
 | 
			
		||||
              borderWidth: 1,
 | 
			
		||||
              borderType: "dashed",
 | 
			
		||||
              borderImageSource: "linear-gradient(90deg, #2AB9FE 12.25%, #52FFF3 100.6%)",
 | 
			
		||||
              borderImageSlice: 1
 | 
			
		||||
              borderType: "solid"
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,28 +9,19 @@
 | 
			
		|||
        <div class="userChart">
 | 
			
		||||
          <EventHeatmap
 | 
			
		||||
            @show-details="handleShowDetails"
 | 
			
		||||
            :panelTrendData="[32655, 29182, 55732, 1051]"
 | 
			
		||||
            :panelXAxisLabels="['2022.7.31', '2022.8.1', '2022.8.2', '2022.8.3']"
 | 
			
		||||
            :granularTrendData="[
 | 
			
		||||
              8959, 7460, 8334, 7902, 5753, 3070, 3481, 16878, 17819, 15296, 18883, 3734, 938, 101,
 | 
			
		||||
              12
 | 
			
		||||
            ]"
 | 
			
		||||
            :panelTrendData="[28545, 16651, 274, 315]"
 | 
			
		||||
            :panelXAxisLabels="['2023.10.09', '2023.10.15', '2023.10.21', '2023.10.25']"
 | 
			
		||||
            :granularTrendData="[28545, 13922, 13719, 16651, 18240, 2205, 274, 157, 318]"
 | 
			
		||||
            :granularXAxisLabels="[
 | 
			
		||||
              '7.31 00h',
 | 
			
		||||
              '7.31 06h',
 | 
			
		||||
              '7.31 12h',
 | 
			
		||||
              '7.31 18h',
 | 
			
		||||
              '8.1 00h',
 | 
			
		||||
              '8.1 06h',
 | 
			
		||||
              '8.1 12h',
 | 
			
		||||
              '8.1 18h',
 | 
			
		||||
              '8.2 00h',
 | 
			
		||||
              '8.2 06h',
 | 
			
		||||
              '8.2 12h',
 | 
			
		||||
              '8.2 18h',
 | 
			
		||||
              '8.3 00h',
 | 
			
		||||
              '8.3 06h',
 | 
			
		||||
              '8.3 12h'
 | 
			
		||||
              '10.09 13h',
 | 
			
		||||
              '10.11 14h',
 | 
			
		||||
              '10.13 16h',
 | 
			
		||||
              '10.15 17h',
 | 
			
		||||
              '10.17 18h',
 | 
			
		||||
              '10.19 20h',
 | 
			
		||||
              '10.21 21h',
 | 
			
		||||
              '10.23 22h',
 | 
			
		||||
              '10.25 23h'
 | 
			
		||||
            ]"
 | 
			
		||||
          />
 | 
			
		||||
        </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +69,6 @@ const graphPanelRef = ref(null)
 | 
			
		|||
// 添加 activeChartTab 状态---用于判断在事件热度图弹窗显示的图表类型
 | 
			
		||||
const activeChartTab = ref("trend") // 默认值设为 'trend'
 | 
			
		||||
const handleLeaderSelect = (leader) => {
 | 
			
		||||
  console.log("选中的领袖ID:", leader)
 | 
			
		||||
  if (graphPanelRef.value && leader.id) {
 | 
			
		||||
    graphPanelRef.value.highlightNode(leader.id)
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -102,18 +92,32 @@ const stopAutomaticPlay = () => {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
let timer = null
 | 
			
		||||
 | 
			
		||||
// 根据不同的时间间隔生成对应的延时数据
 | 
			
		||||
const intervalTimes = [500, 500, 1000, 1000, 1000, 1000, 1000, 1000, 4000, 2000]
 | 
			
		||||
const automaticPlay = () => {
 | 
			
		||||
  let index = 1
 | 
			
		||||
  if (timer) clearInterval(timer)
 | 
			
		||||
  timer = setInterval(() => {
 | 
			
		||||
 | 
			
		||||
  // 创建一个函数来处理定时逻辑
 | 
			
		||||
  const playNext = () => {
 | 
			
		||||
    store.setActiveTimePoint(index)
 | 
			
		||||
 | 
			
		||||
    if (index >= store.allLeaderData.length) {
 | 
			
		||||
      clearInterval(timer)
 | 
			
		||||
      timer = null
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 根据当前index获取对应的时间间隔,如果超出数组长度则使用默认值
 | 
			
		||||
    const interval = intervalTimes[index] || 1000
 | 
			
		||||
    timer = setTimeout(playNext, interval)
 | 
			
		||||
    index++
 | 
			
		||||
  }, 1500)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // 启动自动播放,使用第一个时间间隔
 | 
			
		||||
  const initialInterval = intervalTimes[0] || 1000
 | 
			
		||||
  timer = setTimeout(playNext, initialInterval)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 调用 store.initializeTimePoints() 初始化时间点
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -92,17 +92,22 @@ const calculatePositions = (timestamp) => {
 | 
			
		|||
  })
 | 
			
		||||
  // 计算每个点的原始位置
 | 
			
		||||
  const pointPositions = {}
 | 
			
		||||
  sortedPoints.forEach((point) => {
 | 
			
		||||
    const pointTime = new Date(point.timestamp).getTime()
 | 
			
		||||
    const position = ((pointTime - startTime) / timeRange) * 100
 | 
			
		||||
    pointPositions[point.id] = Math.max(0, Math.min(100, position))
 | 
			
		||||
  sortedPoints.forEach((point, index) => {
 | 
			
		||||
    // 如果是最后一个时间点,直接放在100%的位置
 | 
			
		||||
    if (index === sortedPoints.length - 1) {
 | 
			
		||||
      pointPositions[point.id] = 100
 | 
			
		||||
    } else {
 | 
			
		||||
      const pointTime = new Date(point.timestamp).getTime()
 | 
			
		||||
      const position = ((pointTime - startTime) / timeRange) * 100
 | 
			
		||||
      pointPositions[point.id] = Math.max(0, Math.min(100, position))
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
  // 处理重叠 (假设每个点宽度约为20px,时间轴总宽度为可用宽度)
 | 
			
		||||
  const pointWidthPercentage = 5 // 估算的点宽度百分比
 | 
			
		||||
  const minSpacing = pointWidthPercentage // 最小间距百分比
 | 
			
		||||
 | 
			
		||||
  // 调整重叠的点
 | 
			
		||||
  for (let i = 1; i < sortedPoints.length; i++) {
 | 
			
		||||
  // 调整重叠的点,但跳过最后一个点(已经固定在100%位置)
 | 
			
		||||
  for (let i = 1; i < sortedPoints.length - 1; i++) {
 | 
			
		||||
    const prevPoint = sortedPoints[i - 1]
 | 
			
		||||
    const currPoint = sortedPoints[i]
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ const chartData = ref([
 | 
			
		|||
    unit: "数量",
 | 
			
		||||
    max: 10,
 | 
			
		||||
    rows: [
 | 
			
		||||
      { label: "领袖", value: 6.4, type: "leader" },
 | 
			
		||||
      { label: "意见领袖", value: 6.4, type: "leader" },
 | 
			
		||||
      { label: "所有用户", value: 0.46, type: "user" }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
| 
						 | 
				
			
			@ -92,7 +92,7 @@ const chartData = ref([
 | 
			
		|||
    unit: "天",
 | 
			
		||||
    max: 10,
 | 
			
		||||
    rows: [
 | 
			
		||||
      { label: "领袖", value: 2.73, type: "leader" },
 | 
			
		||||
      { label: "意见领袖", value: 2.73, type: "leader" },
 | 
			
		||||
      { label: "所有用户", value: 2.32, type: "user" }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
| 
						 | 
				
			
			@ -102,7 +102,7 @@ const chartData = ref([
 | 
			
		|||
    unit: "万",
 | 
			
		||||
    max: 300,
 | 
			
		||||
    rows: [
 | 
			
		||||
      { label: "领袖", value: 290.4, type: "leader", highlight: false },
 | 
			
		||||
      { label: "意见领袖", value: 290.4, type: "leader", highlight: false },
 | 
			
		||||
      { label: "所有用户", value: 1.31, type: "user" }
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
				
			
			@ -93,18 +93,31 @@ const handleOpenPostDialog = (post) => {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
let timer = null
 | 
			
		||||
// 根据不同的时间间隔生成对应的延时数据
 | 
			
		||||
const intervalTimes = [1000, 500, 1000, 4000, 2000, 1000, 1000, 1000, 1000, 3000]
 | 
			
		||||
const automaticPlay = () => {
 | 
			
		||||
  let index = 1
 | 
			
		||||
  if (timer) clearInterval(timer)
 | 
			
		||||
  timer = setInterval(() => {
 | 
			
		||||
 | 
			
		||||
  // 创建一个函数来处理定时逻辑
 | 
			
		||||
  const playNext = () => {
 | 
			
		||||
    store.setActiveTimePoint(index)
 | 
			
		||||
 | 
			
		||||
    if (index >= store.allLeaderData.length) {
 | 
			
		||||
      clearInterval(timer)
 | 
			
		||||
      timer = null
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 根据当前index获取对应的时间间隔,如果超出数组长度则使用默认值
 | 
			
		||||
    const interval = intervalTimes[index] || 1000
 | 
			
		||||
    timer = setTimeout(playNext, interval)
 | 
			
		||||
    index++
 | 
			
		||||
  }, 1500)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // 启动自动播放,使用第一个时间间隔
 | 
			
		||||
  const initialInterval = intervalTimes[0] || 1000
 | 
			
		||||
  timer = setTimeout(playNext, initialInterval)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 添加停止自动播放的方法
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -122,7 +122,7 @@ import AnlysisPanle from "../components/anlysisPanle.vue"
 | 
			
		|||
import Graph from "../components/graph.vue"
 | 
			
		||||
import WordsCloud from "../components/cloudWords.vue"
 | 
			
		||||
import { useCharacterHiddenStore } from "@/store/linkPrediction/index"
 | 
			
		||||
import userPanelTitleImg from "@/assets/images/linkPrediction/title/user-title.png"
 | 
			
		||||
import userPanelTitleImg from "@/assets/images/linkPrediction/title/characters-hidden-interaction-user-title.png"
 | 
			
		||||
import graphTitleImg from "@/assets/images/linkPrediction/title/graph1-title.png"
 | 
			
		||||
import analysisTitleImg from "@/assets/images/linkPrediction/title/analysis-title.png"
 | 
			
		||||
import { storeToRefs } from "pinia"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,7 +62,6 @@ const handleUserItem = (index, group = {}) => {
 | 
			
		|||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
  .title {
 | 
			
		||||
    margin-top: vh(-8);
 | 
			
		||||
    margin-left: vw(-2);
 | 
			
		||||
  }
 | 
			
		||||
  .user-list {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -70,7 +70,6 @@ const handleUserItem = (index, group = {}) => {
 | 
			
		|||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
  .title {
 | 
			
		||||
    margin-top: vh(-7);
 | 
			
		||||
    margin-left: vw(-2);
 | 
			
		||||
  }
 | 
			
		||||
  .user-list {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -144,10 +144,10 @@ import Graph from "./components/graph.vue"
 | 
			
		|||
import WordsCloud from "./components/cloudWords.vue"
 | 
			
		||||
import { Icon } from "@iconify/vue"
 | 
			
		||||
import { useSocialGroupsStore } from "@/store/linkPrediction/index"
 | 
			
		||||
import userPanelTitleImg from "@/assets/images/linkPrediction/title/user-title.png"
 | 
			
		||||
import userPanelTitleImg from "@/assets/images/linkPrediction/title/social-group-user-title.png"
 | 
			
		||||
import userChartTitleImg from "@/assets/images/linkPrediction/title/interaction-strenth-title.png"
 | 
			
		||||
import graphTitleImg from "@/assets/images/linkPrediction/title/graph1-title.png"
 | 
			
		||||
import analysisTitleImg from "@/assets/images/linkPrediction/title/analysis-title.png"
 | 
			
		||||
import analysisTitleImg from "@/assets/images/linkPrediction/title/social-group-analysis-title.png"
 | 
			
		||||
import { getAvatarUrl } from "@/utils/transform"
 | 
			
		||||
import { storeToRefs } from "pinia"
 | 
			
		||||
const socialGroupsStore = useSocialGroupsStore()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user