Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎨 애니메이션 시스템 최적화: Zoom 상태 유지 및 UI 통일
📋 요약
모든 애니메이션 컴포넌트에서 Zoom/Pan 상태가 단계 이동 시에도 유지되도록 개선하고, 초기 빈 상태 UI를 통일했습니다.
🔥 핵심 문제 및 해결
1. 컴포넌트 재마운트 문제
문제:
AnimationFactory에서Date.now()를 key로 사용해 매 단계마다 컴포넌트가 완전히 재생성됨결과: React가 컴포넌트를 재마운트하지 않고 props만 업데이트 → 상태 유지 가능
2. Zoom 상태 유지
구현: 모든 애니메이션에
useRef로 Transform 저장 및 복원3. 그래프 튀는 현상 해결
문제: D3 Force Simulation이 매 단계마다 재시작되어 노드들이 통통 튐
해결: Force Simulation 제거 → 정적 원형 레이아웃 사용
효과: 안정적이고 예측 가능한 그래프 표시
4. 초기 상태 UI 통일
변경 전: 컴포넌트마다 다른 빈 상태 (텍스트 메시지, 아무것도 없음 등)
변경 후: 모든 애니메이션이 빈 SVG 캔버스 + 비활성화된 Zoom 컨트롤 표시
📁 수정된 파일
핵심 파일
AnimationFactory.js- key 생성 로직 수정VisualizationModal.jsx- 컴포넌트 메모이제이션 개선애니메이션 컴포넌트 (6개 모두 수정)
SortAnimation.jsx- SVG 변환, Zoom 유지, 빈 캔버스GraphAnimation.jsx- Force Simulation 제거, 정적 레이아웃HeapAnimation.jsx- Zoom 유지, 빈 캔버스BinaryTreeAnimation.jsx- Zoom 유지, 빈 캔버스LinkedListAnimation.jsx- SVG 변환, Zoom 유지RecursionAnimation.jsx- 기존 양호 (참고용으로만 사용)✅ 개선 사항
기능
성능
UX
🧪 테스트 완료
📊 영향도
Type: Enhancement | Priority: High | Component: Visualization System