@@ -7,6 +7,8 @@ import GraphAnimation from './animations/GraphAnimation';
77import HeapAnimation from './animations/HeapAnimation' ;
88import LinkedListAnimation from './animations/LinkedListAnimation' ;
99import RecursionAnimation from './animations/RecursionAnimation' ;
10+ import StackAnimation from './animations/StackAnimation' ;
11+ import QueueAnimation from './animations/QueueAnimation' ;
1012import PlaceholderAnimation from './animations/PlaceholderAnimation' ;
1113
1214/**
@@ -46,6 +48,16 @@ export class AnimationFactory {
4648 'fibonacci' : RecursionAnimation ,
4749 'factorial' : RecursionAnimation ,
4850
51+ // ✅ 스택
52+ 'stack' : StackAnimation ,
53+ 'stack-demo' : StackAnimation ,
54+ 'stack-visualization' : StackAnimation ,
55+
56+ // ✅ 큐
57+ 'queue' : QueueAnimation ,
58+ 'queue-demo' : QueueAnimation ,
59+ 'fifo-queue' : QueueAnimation ,
60+
4961 // 🚧 기타
5062 'variables' : PlaceholderAnimation ,
5163 'default' : PlaceholderAnimation
@@ -102,9 +114,32 @@ export class AnimationFactory {
102114 if ( vizType === 'graph' ) return 'graph' ;
103115 if ( vizType === 'list' || vizType === 'linkedlist' ) return 'linked-list' ;
104116 if ( vizType === 'recursion' || vizType === 'recursive' ) return 'recursion' ;
117+ if ( vizType === 'stack' ) return 'stack' ;
118+ if ( vizType === 'queue' || vizType === 'fifo' ) return 'queue' ;
105119 }
106120 }
107121
122+ const stackOp = events . find ( e =>
123+ e . kind === 'ds_op' &&
124+ e . target &&
125+ e . target . toLowerCase ( ) . includes ( 'stack' )
126+ ) ;
127+ if ( stackOp ) {
128+ console . log ( '✅ ds_op target으로 stack 감지' ) ;
129+ return 'stack' ;
130+ }
131+
132+ const queueOp = events . find ( e => {
133+ if ( e . kind !== 'ds_op' || ! e . target ) return false ;
134+ const target = e . target . toLowerCase ( ) . trim ( ) ;
135+ if ( target . includes ( 'queue' ) ) return true ;
136+ return target === 'q' || target === 'queue' ;
137+ } ) ;
138+ if ( queueOp ) {
139+ console . log ( '✅ ds_op target으로 queue 감지' ) ;
140+ return 'queue' ;
141+ }
142+
108143 // 2️⃣ ds_op의 target으로 자료구조 감지
109144 const heapOp = events . find ( e =>
110145 e . kind === 'ds_op' &&
0 commit comments