From 650027a40c14050003ae28e040839b0e6642ddda Mon Sep 17 00:00:00 2001 From: "qumeng039@126.com" <86925389+qumen@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:36:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9B=B8=E4=BC=BC=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E5=85=B3=E7=B3=BB=E5=BC=BA=E5=9B=BE=EF=BC=8C?= =?UTF-8?q?=E8=B4=B4=E6=96=87=E5=88=97=E8=A1=A8=EF=BC=8C=E8=AF=8D=E4=BA=91?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc | 4 +- Readme.md | 5 - jsconfig.json | 9 + .../linkPrediction/title/graph1-title.png | Bin 0 -> 34828 bytes .../title/interaction-strenth-title.png | Bin 0 -> 19190 bytes src/store/llinkPrediction/index.js | 287 +++++++++++++++++- .../characterInteraction/index.vue | 129 +++++++- .../LinkPrediction/components/cloudWords.vue | 286 ++++++++++++++++- src/views/LinkPrediction/components/graph.vue | 45 ++- .../LinkPrediction/components/postList.vue | 267 +++++++++++++++- .../LinkPrediction/components/userChart.vue | 145 ++++++++- .../LinkPrediction/components/userPanel.vue | 114 ++++++- 12 files changed, 1263 insertions(+), 28 deletions(-) delete mode 100644 Readme.md create mode 100644 jsconfig.json create mode 100644 src/assets/images/linkPrediction/title/graph1-title.png create mode 100644 src/assets/images/linkPrediction/title/interaction-strenth-title.png diff --git a/.prettierrc b/.prettierrc index 02fc07a..20047b2 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,9 +1,9 @@ { "semi": true, "singleQuote": false, - "printWidth":100, + "printWidth": 100, "trailingComma": "none", "tabWidth": 2, "endOfLine": "auto", "arrowParens": "always" -} \ No newline at end of file +} diff --git a/Readme.md b/Readme.md deleted file mode 100644 index 1511959..0000000 --- a/Readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# Vue 3 + Vite - -This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` +const props = defineProps({ + wordsCloudList: { + type: Array, + default: () => [] + } +}); + +const scanAngle = ref(0); +const scanTimer = ref(null); +const containerWidth = 370; +const containerHeight = 276; + +const words = ref(props.wordsCloudList); + +const prepareWords = () => { + const centerX = containerWidth / 2; + const centerY = containerHeight / 2; + words.value = words.value.map((word) => { + const wordCenterX = word.left + word.width / 2; + const wordCenterY = word.top + word.height / 2; + const vecX = wordCenterX - centerX; + const vecY = wordCenterY - centerY; + let angleRad = Math.atan2(vecY, vecX); + let angleDeg = angleRad * (180 / Math.PI); + let scanAngle = angleDeg + 90; + if (scanAngle < 0) { + scanAngle += 360; + } + return { + ...word, + angle: scanAngle, + visible: false + }; + }); +}; + +const startScan = () => { + const duration = 20000; + let startTime = null; + + const animate = (timestamp) => { + if (!startTime) { + startTime = timestamp; + } + const elapsedTime = timestamp - startTime; + const progress = (elapsedTime / duration) % 1; + const newScanAngle = progress * 360; + + if (newScanAngle < scanAngle.value) { + words.value.forEach((w) => (w.visible = false)); + startTime = timestamp; + } + scanAngle.value = newScanAngle; + + words.value.forEach((word) => { + if (!word.visible && scanAngle.value >= word.angle) { + word.visible = true; + } + }); + + scanTimer.value = requestAnimationFrame(animate); + }; + scanTimer.value = requestAnimationFrame(animate); +}; + +const getWordStyle = (word) => { + return { + top: `${word.top}px`, + left: `${word.left}px`, + width: `${word.width}px`, + height: `${word.height}px`, + borderRadius: `${word.height / 2}px`, + fontSize: `${word.fontSize}px`, + paddingLeft: `${word.fontSize * 0.8}px`, + paddingRight: "10px" + }; +}; + +onMounted(() => { + prepareWords(); + startScan(); +}); + +onBeforeUnmount(() => { + if (scanTimer.value) cancelAnimationFrame(scanTimer.value); +}); + + + diff --git a/src/views/LinkPrediction/components/graph.vue b/src/views/LinkPrediction/components/graph.vue index 74da15a..6eea0ee 100644 --- a/src/views/LinkPrediction/components/graph.vue +++ b/src/views/LinkPrediction/components/graph.vue @@ -1,7 +1,46 @@ - + - + diff --git a/src/views/LinkPrediction/components/postList.vue b/src/views/LinkPrediction/components/postList.vue index 1809db8..f26d872 100644 --- a/src/views/LinkPrediction/components/postList.vue +++ b/src/views/LinkPrediction/components/postList.vue @@ -1,7 +1,268 @@ - + + + diff --git a/src/views/LinkPrediction/components/userChart.vue b/src/views/LinkPrediction/components/userChart.vue index e0c1823..48ee0bf 100644 --- a/src/views/LinkPrediction/components/userChart.vue +++ b/src/views/LinkPrediction/components/userChart.vue @@ -1,7 +1,146 @@ - + - + diff --git a/src/views/LinkPrediction/components/userPanel.vue b/src/views/LinkPrediction/components/userPanel.vue index 0880b9f..b9556c5 100644 --- a/src/views/LinkPrediction/components/userPanel.vue +++ b/src/views/LinkPrediction/components/userPanel.vue @@ -1,12 +1,40 @@