66 * 🗂️ JSON 기반 Mock 데이터 매니저
77 */
88
9+ // 코드 예제 문자열 import
10+ import bubbleSortCode from './codeExamples/bubbleSort' ;
11+ import linkedListCode from './codeExamples/linkedList' ;
12+ import fibonacciCode from './codeExamples/fibonacci' ;
13+ import binaryTreeCode from './codeExamples/binaryTree' ;
14+ import heapCode from './codeExamples/heap' ;
15+ import graphCode from './codeExamples/graph' ;
16+
917// JSON 파일들 직접 import (DV-Flow v1.3 스키마)
10- import bubbleSortJson from './bubbleSort.json' ;
11- import graphJson from './graph.json' ;
18+ import binaryTreeJson from './jsonExamples/binaryTree.json' ;
19+ import bubbleSortJson from './jsonExamples/bubbleSort.json' ;
20+ import fibonacciJson from './jsonExamples/fibonacci.json' ;
21+ import graphJson from './jsonExamples/graph.json' ;
22+ import heapJson from './jsonExamples/heap.json' ;
23+ import linkedListJson from './jsonExamples/linkedList.json' ;
24+
25+ // 코드 예제 파일들을 객체 형태로 export
26+ export const codeExamples = [
27+ {
28+ name : 'bubble_sort.c' ,
29+ type : 'code' ,
30+ code : bubbleSortCode
31+ } ,
32+ {
33+ name : 'linked_list.c' ,
34+ type : 'code' ,
35+ code : linkedListCode
36+ } ,
37+ {
38+ name : 'fibonacci.c' ,
39+ type : 'code' ,
40+ code : fibonacciCode
41+ } ,
42+ {
43+ name : 'binary_tree.c' ,
44+ type : 'code' ,
45+ code : binaryTreeCode
46+ } ,
47+ {
48+ name : 'heap.c' ,
49+ type : 'code' ,
50+ code : heapCode
51+ } ,
52+ {
53+ name : 'graph.c' ,
54+ type : 'code' ,
55+ code : graphCode
56+ }
57+ ] ;
1258
1359// JSON 예제 파일들을 객체 형태로 export
1460export const jsonExamples = [
61+ {
62+ name : 'binaryTree.json' ,
63+ type : 'json' ,
64+ code : JSON . stringify ( binaryTreeJson , null , 2 )
65+ } ,
1566 {
1667 name : 'bubbleSort.json' ,
1768 type : 'json' ,
1869 code : JSON . stringify ( bubbleSortJson , null , 2 )
1970 } ,
71+ {
72+ name : 'fibonacci.json' ,
73+ type : 'json' ,
74+ code : JSON . stringify ( fibonacciJson , null , 2 )
75+ } ,
2076 {
2177 name : 'graph.json' ,
2278 type : 'json' ,
2379 code : JSON . stringify ( graphJson , null , 2 )
80+ } ,
81+ {
82+ name : 'heap.json' ,
83+ type : 'json' ,
84+ code : JSON . stringify ( heapJson , null , 2 )
85+ } ,
86+ {
87+ name : 'linkedList.json' ,
88+ type : 'json' ,
89+ code : JSON . stringify ( linkedListJson , null , 2 )
2490 }
2591] ;
2692
2793// JSON 데이터 객체 매핑 (파일명 -> 원본 JSON 데이터)
2894const jsonDataMap = {
95+ binaryTree : binaryTreeJson ,
2996 bubbleSort : bubbleSortJson ,
30- graph : graphJson
97+ fibonacci : fibonacciJson ,
98+ graph : graphJson ,
99+ heap : heapJson ,
100+ linkedList : linkedListJson
31101} ;
32102
33103// JSON 파일들을 동적으로 import하는 함수 (호환성 유지)
@@ -48,7 +118,7 @@ const importJsonFile = async (filename) => {
48118
49119export class JsonVisualizationManager {
50120 // 📋 현재 사용 가능한 JSON 파일들 (확장자 제외)
51- static availableJsonFiles = [ 'bubbleSort' , 'graph' ] ;
121+ static availableJsonFiles = [ 'binaryTree' , ' bubbleSort', 'fibonacci' , ' graph' , 'heap' , 'linkedList '] ;
52122
53123 // 🗄️ 로드된 JSON 데이터 캐시
54124 static jsonCache = new Map ( ) ;
0 commit comments