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