From a0749261bfca3884d50641ffeb3a31a8d678f05c Mon Sep 17 00:00:00 2001 From: cocos02 Date: Mon, 8 Jun 2026 13:09:47 +0800 Subject: [PATCH] feat: highlight upstream/downstream edges when node selected --- editor/components/SceneGraph.vue | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/editor/components/SceneGraph.vue b/editor/components/SceneGraph.vue index 4904444..1411e8d 100644 --- a/editor/components/SceneGraph.vue +++ b/editor/components/SceneGraph.vue @@ -47,12 +47,22 @@ function makeNodes() { } function makeEdges() { - return props.sceneEdges.map((e) => ({ - id: e.id, - source: e.source, - target: e.target, - label: e.label ?? '', - })) + return props.sceneEdges.map((e) => { + const isUp = props.selectedNodeId != null && e.target === props.selectedNodeId + const isDown = props.selectedNodeId != null && e.source === props.selectedNodeId + return { + id: e.id, + source: e.source, + target: e.target, + label: e.label ?? '', + animated: isUp || isDown, + style: isUp + ? { stroke: '#ff9800', strokeWidth: 2 } + : isDown + ? { stroke: '#4fc3f7', strokeWidth: 2 } + : undefined, + } + }) } let prevNodeCount = -1