Add JSDoc documentation and file headers to all source files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,16 @@
|
||||
</Sidebar>
|
||||
</template>
|
||||
<script setup>
|
||||
// The Lucia project.
|
||||
// Copyright 2023-2026 DSP, inc. All rights reserved.
|
||||
// Authors:
|
||||
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
|
||||
/**
|
||||
* @module components/Discover/Map/SidebarTraces
|
||||
* Traces sidebar showing path insights with
|
||||
* clickable trace lists for highlighting on the map.
|
||||
*/
|
||||
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useLoadingStore } from '@/stores/loading';
|
||||
@@ -150,8 +160,8 @@ watch(infiniteFirstCases, (newValue) => {
|
||||
|
||||
/**
|
||||
* Number to percentage
|
||||
* @param {number} val 原始數字
|
||||
* @returns {string} 轉換完成的百分比字串
|
||||
* @param {number} val - The raw ratio value.
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val){
|
||||
if((val * 100).toFixed(1) >= 100) return `100%`;
|
||||
@@ -160,8 +170,8 @@ function getPercentLabel(val){
|
||||
|
||||
/**
|
||||
* set progress bar width
|
||||
* @param {number} value 百分比數字
|
||||
* @returns {string} 樣式的寬度設定
|
||||
* @param {number} value - The percentage value.
|
||||
* @returns {string} The CSS width style string.
|
||||
*/
|
||||
function progressWidth(value){
|
||||
return `width:${value}%;`
|
||||
@@ -170,7 +180,7 @@ function progressWidth(value){
|
||||
/**
|
||||
* switch case data
|
||||
* @param {number} id case id
|
||||
* @param {number} count 總 case 數量
|
||||
* @param {number} count - The total number of cases.
|
||||
*/
|
||||
async function switchCaseData(id, count) {
|
||||
// 點同一筆 id 不要有動作
|
||||
@@ -184,7 +194,7 @@ async function switchCaseData(id, count) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 將 trace element nodes 資料彙整
|
||||
* Assembles the trace element nodes data for Cytoscape rendering.
|
||||
*/
|
||||
function setNodesData(){
|
||||
// 避免每次渲染都重複累加
|
||||
@@ -206,7 +216,7 @@ function setNodesData(){
|
||||
}
|
||||
|
||||
/**
|
||||
* 將 trace edge line 資料彙整
|
||||
* Assembles the trace edge line data for Cytoscape rendering.
|
||||
*/
|
||||
function setEdgesData(){
|
||||
processMap.value.edges = [];
|
||||
@@ -250,8 +260,8 @@ async function show() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 無限滾動: 監聽 scroll 有沒有滾到底部
|
||||
* @param {element} event 滾動傳入的事件
|
||||
* Infinite scroll: listens for scroll reaching the bottom.
|
||||
* @param {Event} event - The scroll event.
|
||||
*/
|
||||
function handleScroll(event) {
|
||||
if(infinitMaxItems.value || props.cases.length < 20 || infiniteFinish.value === false) return;
|
||||
@@ -263,7 +273,7 @@ function handleScroll(event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 無限滾動: 滾到底後,要載入數據
|
||||
* Infinite scroll: loads more data when the bottom is reached.
|
||||
*/
|
||||
async function fetchData() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user