refactor: update QuestMap component to use new node structure and simplify DAG class

This commit is contained in:
Justin Lin committed 2025-04-22 18:58:23 +08:00
1 parent 1616f62755
commit a711e08328
3 files changed
+19 -15

No files matched your search

+3 -3
View File
@@ -69,14 +69,14 @@ async function computeGraphData() {
const nodesValues = dag.getNodes()
const nodes = nodesValues.map((node) => ({
id: node._id,
id: node.id,
title: node.title,
x: marginX * node.layer * 2,
y:
marginY * node.index -
(marginX * dag.getLayer(node._id)) / 2 +
(marginX * dag.getLayer(node.id)) / 2 +
svgHeight.value / 2,
completed: store.progress[node._id]?.completed || false,
completed: store.progress[node.id]?.completed || false,
unlocked: node.requirements.every(
(req: string) => store.progress[req]?.completed
),
+1 -4
View File
@@ -15,10 +15,7 @@
"jsx": "preserve",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"strict": true
},
"include": ["src/**/*.ts", "src/**/*.vue"],
"references": [