-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit_diff.txt
More file actions
2174 lines (2135 loc) · 166 KB
/
commit_diff.txt
File metadata and controls
2174 lines (2135 loc) · 166 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
commit 425b375665fa200aaaf9b34db7c4317885c1a4ca
Author: Hoya <jungch@naver.com>
Date: Tue Feb 24 15:36:40 2026 +0900
feat(etf_one): Enhance ETF app with KIS API, new metrics & clear-all feature
diff --git a/dashboard/src/app/page.tsx b/dashboard/src/app/page.tsx
index 905f373..331f4e6 100644
--- a/dashboard/src/app/page.tsx
+++ b/dashboard/src/app/page.tsx
@@ -33,17 +33,65 @@ export default function Home() {
const [selectedDetailEtf, setSelectedDetailEtf] = useState<any>(null);
const [popupPeriod, setPopupPeriod] = useState<string>('1Y');
+ const [showIntro, setShowIntro] = useState(true);
+ const [isClient, setIsClient] = useState(false);
+
+ useEffect(() => {
+ setIsClient(true);
+ }, []);
+
+ useEffect(() => {
+ if (showIntro && isClient) {
+ const timer = setTimeout(() => setShowIntro(false), 2800);
+ return () => clearTimeout(timer);
+ }
+ }, [showIntro, isClient]);
+
+ const handleReset = () => {
+ setSlots([
+ { search: "", code: "" },
+ { search: "", code: "" },
+ { search: "", code: "" },
+ { search: "", code: "" },
+ { search: "", code: "" },
+ ]);
+ if (typeof window !== "undefined") {
+ localStorage.removeItem('etf_current_slots');
+ }
+ setGlobalSearch("");
+ setData(null);
+ setActiveTab('info');
+ setShowIntro(true);
+ };
+
useEffect(() => {
if (typeof window !== "undefined") {
- const saved = localStorage.getItem('etf_favorites');
- if (saved) {
- try { setFavorites(JSON.parse(saved)); } catch (e) { }
+ const savedFavs = localStorage.getItem('etf_favorites');
+ if (savedFavs) {
+ try { setFavorites(JSON.parse(savedFavs)); } catch (e) { }
} else {
setFavorites([{ id: 'default', name: '내 관심종목', items: [] }]);
}
+
+ const savedSlots = localStorage.getItem('etf_current_slots');
+ if (savedSlots) {
+ try {
+ const parsed = JSON.parse(savedSlots);
+ if (Array.isArray(parsed) && parsed.length === 5) {
+ setSlots(parsed);
+ }
+ } catch (e) { }
+ }
}
}, []);
+ useEffect(() => {
+ if (typeof window !== "undefined") {
+ // Don't save completely empty initial state if we just loaded
+ localStorage.setItem('etf_current_slots', JSON.stringify(slots));
+ }
+ }, [slots]);
+
const saveFavorites = (favs: FavGroup[]) => {
setFavorites(favs);
if (typeof window !== "undefined") {
@@ -98,6 +146,12 @@ export default function Home() {
{ search: "", code: "" },
{ search: "", code: "" },
]);
+ if (typeof window !== "undefined") {
+ localStorage.removeItem('etf_current_slots');
+ }
+ setGlobalSearch("");
+ setData(null);
+ setActiveTab('info');
};
const selectEtfGlobal = (code: string, name: string, isMulti: boolean = false) => {
@@ -442,10 +496,18 @@ export default function Home() {
let baseBench = 0;
let minYield = 0;
let maxYield = 0;
+ let lastBenchVal = 0;
oneYearGlimpse.forEach((d: any, idx: number) => {
const price = d[etfKey] || d[`${etfKey}_raw`] || 0;
- const benchVal = d[benchKey] || 0;
+ let benchVal = d[benchKey];
+
+ // Carry forward previous benchmark value on holidays where data is missing
+ if (benchVal === undefined || benchVal === null || benchVal === 0) {
+ benchVal = lastBenchVal;
+ } else {
+ lastBenchVal = benchVal;
+ }
if (price > 0) {
if (basePrice === 0) {
@@ -582,13 +644,76 @@ export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center p-4 md:p-8 md:pb-16 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-slate-900 via-[#0a0a0a] to-black text-gray-100 font-sans selection:bg-indigo-500/30 overflow-x-hidden relative">
+ {/* Elegant Deep Space Portal Intro */}
+ {showIntro && (
+ <div className="fixed inset-0 z-[1000] bg-[#030712] overflow-hidden pointer-events-none flex items-center justify-center transition-opacity duration-1000">
+ <style dangerouslySetInnerHTML={{
+ __html: `
+ @keyframes smooth-zoom {
+ 0% { transform: scale(0.5); opacity: 0; filter: blur(20px); }
+ 30% { opacity: 1; filter: blur(4px); }
+ 70% { opacity: 1; filter: blur(0px); }
+ 100% { transform: scale(30); opacity: 0; filter: blur(10px); }
+ }
+ @keyframes slow-spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+ }
+ @keyframes star-fly {
+ 0% { transform: translate(-50%, -50%) translateZ(-500px) scale(0); opacity: 0; }
+ 20% { opacity: 0.8; }
+ 100% { transform: translate(-50%, -50%) translateZ(1000px) scale(3); opacity: 0; }
+ }
+ .perspective-wrap { perspective: 800px; transform-style: preserve-3d; }
+ `}} />
+
+ {/* Elegant Starfield */}
+ <div className="absolute inset-0 perspective-wrap">
+ {isClient && Array.from({ length: 60 }).map((_, i) => {
+ const angle = Math.random() * Math.PI * 2;
+ const radius = 10 + Math.random() * 50;
+ const startX = 50 + Math.cos(angle) * radius;
+ const startY = 50 + Math.sin(angle) * radius;
+ return (
+ <div key={i} className="absolute rounded-full bg-white shadow-[0_0_8px_rgba(255,255,255,0.9)]"
+ style={{
+ left: `${startX}%`,
+ top: `${startY}%`,
+ width: `${Math.random() * 2 + 1}px`,
+ height: `${Math.random() * 2 + 1}px`,
+ opacity: 0,
+ animation: `star-fly ${1.5 + Math.random() * 1.5}s ease-in ${Math.random() * 0.5}s forwards`
+ }}
+ />
+ );
+ })}
+ </div>
+
+ {/* Elegant Expanding Portal */}
+ <div className="absolute flex items-center justify-center animate-[smooth-zoom_2.8s_cubic-bezier(0.5,0,0.1,1)_forwards]">
+ {/* Outer Nebula Glow */}
+ <div className="absolute w-[40vh] h-[40vh] sm:w-[50vh] sm:h-[50vh] rounded-full border border-indigo-500/10 blur-md animate-[slow-spin_15s_linear_infinite]"
+ style={{ boxShadow: '0 0 150px rgba(79,70,229,0.3), inset 0 0 150px rgba(79,70,229,0.3)' }}>
+ </div>
+
+ {/* Inner Ring */}
+ <div className="absolute w-[25vh] h-[25vh] sm:w-[30vh] sm:h-[30vh] rounded-full border border-cyan-400/20 mix-blend-screen animate-[slow-spin_10s_linear_infinite_reverse]"
+ style={{ boxShadow: '0 0 80px rgba(34,211,238,0.4), inset 0 0 80px rgba(34,211,238,0.4)' }}>
+ </div>
+
+ {/* Core Lens */}
+ <Aperture className="w-[8vh] h-[8vh] sm:w-[12vh] sm:h-[12vh] text-white/90 drop-shadow-[0_0_30px_rgba(255,255,255,0.8)] animate-[slow-spin_6s_linear_infinite]" />
+ </div>
+ </div>
+ )}
+
<header className="w-full max-w-[95vw] xl:max-w-[1400px] mb-6 flex flex-col md:flex-row justify-between items-center gap-4 relative z-10">
- <div className="flex flex-col items-start w-full md:w-auto">
- <h1 className="text-3xl md:text-4xl font-extrabold tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-indigo-400 via-purple-400 to-pink-400 drop-shadow-sm flex items-center gap-3">
- <Aperture className="w-8 h-8 md:w-10 md:h-10 text-indigo-400" />
+ <div className="flex flex-col items-start w-full md:w-auto cursor-pointer group" onClick={handleReset}>
+ <h1 className="text-3xl md:text-4xl font-extrabold tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-indigo-400 via-purple-400 to-pink-400 drop-shadow-sm flex items-center gap-3 group-hover:opacity-80 transition-opacity">
+ <Aperture className="w-8 h-8 md:w-10 md:h-10 text-indigo-400 group-hover:rotate-180 transition-transform duration-700" />
ETF Lens
</h1>
- <p className="text-xs md:text-sm text-gray-400 mt-1 font-medium tracking-wide">Understand ETFs, Through the Lens of Data.</p>
+ <p className="text-xs md:text-sm text-gray-400 mt-1 font-medium tracking-wide group-hover:text-gray-300 transition-colors">Understand ETFs, Through the Lens of Data.</p>
</div>
<div className="px-4 py-2 rounded-full border border-white/10 bg-white/5 backdrop-blur-md shadow-[0_0_15px_rgba(79,70,229,0.1)] text-xs font-semibold text-indigo-300 tracking-wider">
PRO EDITION
@@ -825,1038 +950,1044 @@ export default function Home() {
</section>
{/* Results Section */}
- {data && data.data_payload && (
- <div className="w-full max-w-[95vw] xl:max-w-[1400px] flex flex-col relative z-10 animate-in fade-in slide-in-from-bottom-5 duration-700">
-
- {/* Tab Navigation and Period Selector Row */}
- <div className="w-full z-40 relative">
- <div className="flex bg-white/5 rounded-t-2xl p-1.5 border border-white/10 border-b-0 w-full shadow-2xl backdrop-blur-md relative">
- <div className="flex w-full gap-1">
- {[
- { id: 'info', label: '기본정보' },
- { id: 'chart', label: '차트' },
- { id: 'holdings', label: '구성종목' }
- ].map(tab => (
- <div
- key={tab.id}
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- onClick={() => setActiveTab(tab.id as any)}
- role="button"
- tabIndex={0}
- className={`flex-1 py-3 px-4 text-sm md:text-base font-bold rounded-xl transition-all border border-transparent flex items-center justify-center relative cursor-pointer ${activeTab === tab.id
- ? 'bg-indigo-600 border-indigo-400 text-white shadow-[0_0_20px_rgba(79,70,229,0.5)]'
- : 'text-gray-400 hover:text-gray-200 hover:bg-white/5'
- }`}
- >
- {activeTab === 'chart' && tab.id === 'chart' ? (
- <>
- <span className="hidden xl:block absolute left-6">{tab.label}</span>
- <span className="xl:hidden">{tab.label}</span>
- <div className="absolute right-2 top-1/2 -translate-y-1/2 hidden xl:flex bg-black/40 rounded-lg p-1 border border-white/10 overflow-x-auto shadow-2xl backdrop-blur-md z-50">
- {['1D', '1W', '1M', '6M', '1Y', '3Y', 'MAX'].map(p => (
- <button
- key={p}
- onClick={(e) => { e.stopPropagation(); setPeriod(p); }}
- className={`px-2 py-1 text-[11px] font-bold rounded-md transition-all whitespace-nowrap ${period === p
- ? 'bg-indigo-500/80 text-white shadow-md'
- : 'text-gray-300 hover:text-white hover:bg-white/10'
- }`}
- >
- {p}
- </button>
- ))}
- </div>
- </>
- ) : (
- <span>{tab.label}</span>
- )}
- </div>
- ))}
- </div>
- </div>
-
- {/* Mobile Period Selector (shown below tabs on small screens) */}
- {activeTab === 'chart' && (
- <div className="xl:hidden w-full flex justify-end bg-white/5 px-2 pb-2 border-x border-white/10">
- <div className="flex bg-black/40 rounded-lg p-1 overflow-x-auto shadow-2xl backdrop-blur-md z-50 max-w-full">
- {['1D', '1W', '1M', '6M', '1Y', '3Y', 'MAX'].map(p => (
- <button
- key={p}
- onClick={() => setPeriod(p)}
- className={`px-3 py-1.5 text-xs font-bold rounded-md transition-all whitespace-nowrap ${period === p
- ? 'bg-indigo-500/80 text-white shadow-md'
- : 'text-gray-400 hover:text-white hover:bg-white/5'
+ {
+ data && data.data_payload && (
+ <div className="w-full max-w-[95vw] xl:max-w-[1400px] flex flex-col relative z-10 animate-in fade-in slide-in-from-bottom-5 duration-700">
+
+ {/* Tab Navigation and Period Selector Row */}
+ <div className="w-full z-40 relative">
+ <div className="flex bg-white/5 rounded-t-2xl p-1.5 border border-white/10 border-b-0 w-full shadow-2xl backdrop-blur-md relative">
+ <div className="flex w-full gap-1">
+ {[
+ { id: 'info', label: '기본정보' },
+ { id: 'chart', label: '차트' },
+ { id: 'holdings', label: '구성종목' }
+ ].map(tab => (
+ <div
+ key={tab.id}
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ onClick={() => setActiveTab(tab.id as any)}
+ role="button"
+ tabIndex={0}
+ className={`flex-1 py-3 px-4 text-sm md:text-base font-bold rounded-xl transition-all border border-transparent flex items-center justify-center relative cursor-pointer ${activeTab === tab.id
+ ? 'bg-indigo-600 border-indigo-400 text-white shadow-[0_0_20px_rgba(79,70,229,0.5)]'
+ : 'text-gray-400 hover:text-gray-200 hover:bg-white/5'
}`}
>
- {p}
- </button>
+ {activeTab === 'chart' && tab.id === 'chart' ? (
+ <>
+ <span className="hidden xl:block absolute left-6">{tab.label}</span>
+ <span className="xl:hidden">{tab.label}</span>
+ <div className="absolute right-2 top-1/2 -translate-y-1/2 hidden xl:flex bg-black/40 rounded-lg p-1 border border-white/10 overflow-x-auto shadow-2xl backdrop-blur-md z-50">
+ {['1D', '1W', '1M', '6M', '1Y', '3Y', 'MAX'].map(p => (
+ <button
+ key={p}
+ onClick={(e) => { e.stopPropagation(); setPeriod(p); }}
+ className={`px-2 py-1 text-[11px] font-bold rounded-md transition-all whitespace-nowrap ${period === p
+ ? 'bg-indigo-500/80 text-white shadow-md'
+ : 'text-gray-300 hover:text-white hover:bg-white/10'
+ }`}
+ >
+ {p}
+ </button>
+ ))}
+ </div>
+ </>
+ ) : (
+ <span>{tab.label}</span>
+ )}
+ </div>
))}
</div>
</div>
- )}
- </div>
- {activeTab === 'info' && (
- <div className="grid grid-cols-1 lg:grid-cols-4 gap-4 animate-in fade-in slide-in-from-bottom-2 duration-500 bg-white/[0.02] p-4 lg:p-5 border border-white/5 rounded-b-2xl backdrop-blur-3xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] mt-0">
- {/* Table Details */}
- <section className="col-span-1 lg:col-span-3 overflow-hidden flex flex-col relative group">
- <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/5 to-purple-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
- <h3 className="text-base md:text-lg font-bold mb-3 flex items-center gap-2 relative z-10">
- <span className="w-1.5 h-6 bg-gradient-to-b from-indigo-400 to-purple-500 rounded-full"></span>
- 종합 매트릭스
- </h3>
-
- <div className="overflow-x-auto pb-6 relative z-10">
- <table className="w-full text-left border-collapse whitespace-nowrap">
- <thead>
- <tr className="border-b border-white/10">
- {data.data_payload.header.map((h: string, i: number) => (
- <th key={i} className="py-2 px-3 text-[11px] font-semibold text-gray-400 uppercase tracking-wider">{h}</th>
- ))}
- </tr>
- </thead>
- <tbody className="divide-y divide-white/[0.05]">
- {data.data_payload.rows.map((row: string[], i: number) => {
- const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
- return (
- <tr key={i} className="hover:bg-white/[0.03] transition-colors group/row">
- {row.map((cell: string, j: number) => {
- const isNegative = cell.includes('-') && cell.includes('%');
- const isPositive = cell.includes('%') && !isNegative && parseFloat(cell) > 0;
- const matchedEtf = j === 0 && data.raw_data ? data.raw_data.find((e: any) => cell.includes(e.etf_name) || cell.includes(e.etf_code)) : null;
- return (
- <td key={j}
- className={`py-3 px-3 text-xs xl:text-sm font-medium transition-colors ${j === 0 ? `font-bold max-w-[200px] truncate ${matchedEtf ? 'cursor-pointer hover:underline underline-offset-4' : ''}` :
- isNegative ? 'text-rose-400' :
- isPositive ? 'text-emerald-400' : 'text-gray-200'
- }`}
- style={j === 0 ? { color: glowColors[i % glowColors.length] } : undefined}
- title={j === 0 ? cell : undefined}
- onClick={() => {
- if (matchedEtf) setSelectedDetailEtf(matchedEtf);
- }}
- >
- {cell}
- </td>
- )
- })}
- </tr>
- )
- })}
- </tbody>
- </table>
+ {/* Mobile Period Selector (shown below tabs on small screens) */}
+ {activeTab === 'chart' && (
+ <div className="xl:hidden w-full flex justify-end bg-white/5 px-2 pb-2 border-x border-white/10">
+ <div className="flex bg-black/40 rounded-lg p-1 overflow-x-auto shadow-2xl backdrop-blur-md z-50 max-w-full">
+ {['1D', '1W', '1M', '6M', '1Y', '3Y', 'MAX'].map(p => (
+ <button
+ key={p}
+ onClick={() => setPeriod(p)}
+ className={`px-3 py-1.5 text-xs font-bold rounded-md transition-all whitespace-nowrap ${period === p
+ ? 'bg-indigo-500/80 text-white shadow-md'
+ : 'text-gray-400 hover:text-white hover:bg-white/5'
+ }`}
+ >
+ {p}
+ </button>
+ ))}
+ </div>
</div>
+ )}
+ </div>
- <div className="mt-auto pt-4 border-t border-white/10 relative z-10">
- <div className="p-4 bg-gradient-to-r from-indigo-900/40 via-purple-900/20 to-transparent rounded-xl border border-indigo-500/20 shadow-[inset_0_0_20px_rgba(79,70,229,0.05)] backdrop-blur-sm">
- <h4 className="font-bold text-indigo-300 text-xs mb-2 flex items-center gap-2 uppercase tracking-wider">✨ Quant Insight</h4>
- <p className="text-indigo-50 text-sm leading-relaxed font-light block">{data.data_payload.insight_comment}</p>
+ {activeTab === 'info' && (
+ <div className="grid grid-cols-1 lg:grid-cols-4 gap-4 animate-in fade-in slide-in-from-bottom-2 duration-500 bg-white/[0.02] p-4 lg:p-5 border border-white/5 rounded-b-2xl backdrop-blur-3xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] mt-0">
+ {/* Table Details */}
+ <section className="col-span-1 lg:col-span-3 overflow-hidden flex flex-col relative group">
+ <div className="absolute inset-0 bg-gradient-to-br from-indigo-500/5 to-purple-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
+ <h3 className="text-base md:text-lg font-bold mb-3 flex items-center gap-2 relative z-10">
+ <span className="w-1.5 h-6 bg-gradient-to-b from-indigo-400 to-purple-500 rounded-full"></span>
+ 종합 매트릭스
+ </h3>
+
+ <div className="overflow-x-auto pb-6 relative z-10">
+ <table className="w-full text-left border-collapse whitespace-nowrap">
+ <thead>
+ <tr className="border-b border-white/10">
+ {data.data_payload.header.map((h: string, i: number) => (
+ <th key={i} className="py-2 px-3 text-[11px] font-semibold text-gray-400 uppercase tracking-wider">{h}</th>
+ ))}
+ </tr>
+ </thead>
+ <tbody className="divide-y divide-white/[0.05]">
+ {data.data_payload.rows.map((row: string[], i: number) => {
+ const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
+ return (
+ <tr key={i} className="hover:bg-white/[0.03] transition-colors group/row">
+ {row.map((cell: string, j: number) => {
+ const isNegative = cell.includes('-') && cell.includes('%');
+ const isPositive = cell.includes('%') && !isNegative && parseFloat(cell) > 0;
+ const matchedEtf = j === 0 && data.raw_data ? data.raw_data.find((e: any) => cell.includes(e.etf_name) || cell.includes(e.etf_code)) : null;
+ return (
+ <td key={j}
+ className={`py-3 px-3 text-xs xl:text-sm font-medium transition-colors ${j === 0 ? `font-bold max-w-[200px] truncate ${matchedEtf ? 'cursor-pointer hover:underline underline-offset-4' : ''}` :
+ isNegative ? 'text-rose-400' :
+ isPositive ? 'text-emerald-400' : 'text-gray-200'
+ }`}
+ style={j === 0 ? { color: glowColors[i % glowColors.length] } : undefined}
+ title={j === 0 ? cell : undefined}
+ onClick={() => {
+ if (matchedEtf) setSelectedDetailEtf(matchedEtf);
+ }}
+ >
+ {cell}
+ </td>
+ )
+ })}
+ </tr>
+ )
+ })}
+ </tbody>
+ </table>
</div>
- </div>
- </section>
-
- {/* Radar Chart */}
- <section className="bg-white/[0.02] backdrop-blur-3xl rounded-2xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-5 border border-white/5 flex flex-col justify-center min-h-[300px] relative group lg:col-span-1">
- <div className="absolute inset-0 bg-gradient-to-bl from-purple-500/5 to-pink-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
- <h3 className="text-lg md:text-xl font-bold mb-2 flex items-center gap-3 relative z-10">
- <span className="w-1.5 h-6 bg-gradient-to-b from-purple-400 to-pink-500 rounded-full"></span>
- 팩터 밸런스
- </h3>
- <div className="flex-1 w-full min-h-[220px] relative z-10">
- <ResponsiveContainer width="100%" height="100%">
- <RadarChart cx="50%" cy="50%" outerRadius="70%" data={radarData}>
- <PolarGrid stroke="rgba(255,255,255,0.05)" />
- <PolarAngleAxis dataKey="subject" tick={{ fill: '#a5b4fc', fontSize: 13, fontWeight: 500 }} />
- <PolarRadiusAxis angle={30} domain={[0, 10]} tick={false} axisLine={false} />
- {data.visual_data && data.visual_data.etf_keys && data.visual_data.etf_keys.map((etfName: string, idx: number) => {
- const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
- const c = glowColors[idx % glowColors.length];
- return (
- <Radar key={etfName} name={etfName} dataKey={etfName} stroke={c} strokeWidth={2} fill={c} fillOpacity={0.3} />
- );
- })}
- <Tooltip
- contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(255,255,255,0.1)', borderRadius: '16px', color: '#fff', boxShadow: '0 20px 40px -10px rgba(0,0,0,0.5)' }}
- itemStyle={{ fontWeight: 'bold' }}
- />
- </RadarChart>
- </ResponsiveContainer>
- </div>
- </section>
-
- {/* Detailed Basic Info Inverted Table */}
- <section className="bg-white/[0.02] backdrop-blur-3xl rounded-2xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-5 border border-white/5 lg:col-span-4 mt-2 overflow-x-auto">
- <h3 className="text-lg md:text-xl font-bold mb-4 flex items-center gap-3">
- <span className="w-1.5 h-6 bg-gradient-to-b from-teal-400 to-emerald-500 rounded-full"></span>
- 기본 정보
- </h3>
- <div className="w-full overflow-x-auto overflow-y-auto max-h-[65vh] border border-white/5 rounded-xl relative custom-scrollbar">
- <table className="w-full text-left border-collapse min-w-[800px]">
- <thead className="sticky top-0 z-30 backdrop-blur-xl bg-[#0B0F19]/95 shadow-md border-b border-white/10">
- <tr>
- <th className="py-3 px-4 text-sm font-bold text-gray-500 bg-white/5 w-48">항목</th>
- {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
- {data.raw_data && data.raw_data.map((etf: any, idx: number) => {
+
+ <div className="mt-auto pt-4 border-t border-white/10 relative z-10">
+ <div className="p-4 bg-gradient-to-r from-indigo-900/40 via-purple-900/20 to-transparent rounded-xl border border-indigo-500/20 shadow-[inset_0_0_20px_rgba(79,70,229,0.05)] backdrop-blur-sm">
+ <h4 className="font-bold text-indigo-300 text-xs mb-2 flex items-center gap-2 uppercase tracking-wider">✨ Quant Insight</h4>
+ <p className="text-indigo-50 text-sm leading-relaxed font-light block">{data.data_payload.insight_comment}</p>
+ </div>
+ </div>
+ </section>
+
+ {/* Radar Chart */}
+ <section className="bg-white/[0.02] backdrop-blur-3xl rounded-2xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-5 border border-white/5 flex flex-col justify-center min-h-[300px] relative group lg:col-span-1">
+ <div className="absolute inset-0 bg-gradient-to-bl from-purple-500/5 to-pink-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
+ <h3 className="text-lg md:text-xl font-bold mb-2 flex items-center gap-3 relative z-10">
+ <span className="w-1.5 h-6 bg-gradient-to-b from-purple-400 to-pink-500 rounded-full"></span>
+ 팩터 밸런스
+ </h3>
+ <div className="flex-1 w-full min-h-[220px] relative z-10">
+ <ResponsiveContainer width="100%" height="100%">
+ <RadarChart cx="50%" cy="50%" outerRadius="70%" data={radarData}>
+ <PolarGrid stroke="rgba(255,255,255,0.05)" />
+ <PolarAngleAxis dataKey="subject" tick={{ fill: '#a5b4fc', fontSize: 13, fontWeight: 500 }} />
+ <PolarRadiusAxis angle={30} domain={[0, 10]} tick={false} axisLine={false} />
+ {data.visual_data && data.visual_data.etf_keys && data.visual_data.etf_keys.map((etfName: string, idx: number) => {
const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
+ const c = glowColors[idx % glowColors.length];
return (
- <th key={etf.etf_code} className="py-3 px-4 text-sm font-bold text-center group cursor-pointer hover:bg-white/[0.05] transition-colors" onClick={() => setSelectedDetailEtf(etf)} style={{ color: glowColors[idx % glowColors.length] }}>
- <span className="group-hover:underline underline-offset-4">{etf.etf_name}</span>
- </th>
+ <Radar key={etfName} name={etfName} dataKey={etfName} stroke={c} strokeWidth={2} fill={c} fillOpacity={0.3} />
);
})}
- </tr>
- </thead>
- <tbody className="divide-y divide-white/[0.05]">
- {['운용사', '최초데이터(상장추정)', '순자산총액', '상장주식수', '52주 최고/최저', '거래량/거래대금', '20일평균 거래량/대금', '펀드보수', '최근 분배율(TTM)', '1M 수익률', '3M 수익률', '6M 수익률', '1Y 수익률'].map((key) => {
- const isNumericRow = !['운용사', '최초데이터(상장추정)'].includes(key);
- const isSplitRow = ['52주 최고/최저', '거래량/거래대금', '20일평균 거래량/대금'].includes(key);
- let maxVal1 = 1;
- let maxVal2 = 1;
-
- if (isNumericRow && data.raw_data) {
- const parsedVals = data.raw_data.map((e: any) => {
- const v = e.basic_info?.[key] || '';
- let raw = String(v).replace(/,/g, '');
- let n1 = 0;
- let n2 = 0;
-
- if (key === '순자산총액') {
- if (raw.includes("조") && raw.includes("억")) {
- const parts = raw.split("조");
- n1 = (parseFloat(parts[0]) || 0) * 10000 + (parseFloat(parts[1].replace("억", "")) || 0);
- } else if (raw.includes("조")) {
- n1 = (parseFloat(raw.replace("조", "")) || 0) * 10000;
+ <Tooltip
+ contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(255,255,255,0.1)', borderRadius: '16px', color: '#fff', boxShadow: '0 20px 40px -10px rgba(0,0,0,0.5)' }}
+ itemStyle={{ fontWeight: 'bold' }}
+ />
+ </RadarChart>
+ </ResponsiveContainer>
+ </div>
+ </section>
+
+ {/* Detailed Basic Info Inverted Table */}
+ <section className="bg-white/[0.02] backdrop-blur-3xl rounded-2xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-5 border border-white/5 lg:col-span-4 mt-2 overflow-x-auto">
+ <h3 className="text-lg md:text-xl font-bold mb-4 flex items-center gap-3">
+ <span className="w-1.5 h-6 bg-gradient-to-b from-teal-400 to-emerald-500 rounded-full"></span>
+ 기본 정보
+ </h3>
+ <div className="w-full overflow-x-auto overflow-y-auto max-h-[65vh] border border-white/5 rounded-xl relative custom-scrollbar">
+ <table className="w-full text-left border-collapse min-w-[800px]">
+ <thead className="sticky top-0 z-30 backdrop-blur-xl bg-[#0B0F19]/95 shadow-md border-b border-white/10">
+ <tr>
+ <th className="py-3 px-4 text-sm font-bold text-gray-500 bg-white/5 w-48">항목</th>
+ {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
+ {data.raw_data && data.raw_data.map((etf: any, idx: number) => {
+ const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
+ return (
+ <th key={etf.etf_code} className="py-3 px-4 text-sm font-bold text-center group cursor-pointer hover:bg-white/[0.05] transition-colors" onClick={() => setSelectedDetailEtf(etf)} style={{ color: glowColors[idx % glowColors.length] }}>
+ <span className="group-hover:underline underline-offset-4">{etf.etf_name}</span>
+ </th>
+ );
+ })}
+ </tr>
+ </thead>
+ <tbody className="divide-y divide-white/[0.05]">
+ {['운용사', '최초데이터(상장추정)', '순자산총액', '상장주식수', '52주 최고/최저', '거래량/거래대금', '20일평균 거래량/대금', '펀드보수', '최근 분배율(TTM)', '1M 수익률', '3M 수익률', '6M 수익률', '1Y 수익률'].map((key) => {
+ const isNumericRow = !['운용사', '최초데이터(상장추정)'].includes(key);
+ const isSplitRow = ['52주 최고/최저', '거래량/거래대금', '20일평균 거래량/대금'].includes(key);
+ let maxVal1 = 1;
+ let maxVal2 = 1;
+
+ if (isNumericRow && data.raw_data) {
+ const parsedVals = data.raw_data.map((e: any) => {
+ const v = e.basic_info?.[key] || '';
+ let raw = String(v).replace(/,/g, '');
+ let n1 = 0;
+ let n2 = 0;
+
+ if (key === '순자산총액') {
+ if (raw.includes("조") && raw.includes("억")) {
+ const parts = raw.split("조");
+ n1 = (parseFloat(parts[0]) || 0) * 10000 + (parseFloat(parts[1].replace("억", "")) || 0);
+ } else if (raw.includes("조")) {
+ n1 = (parseFloat(raw.replace("조", "")) || 0) * 10000;
+ } else {
+ n1 = parseFloat(raw.replace("억", "")) || 0;
+ }
+ } else if (isSplitRow && raw.includes('/')) {
+ const parts = raw.split('/');
+ n1 = parseFloat(parts[0].replace(/[^0-9.]/g, '')) || 0;
+ n2 = parseFloat(parts[1].replace(/[^0-9.]/g, '')) || 0;
} else {
- n1 = parseFloat(raw.replace("억", "")) || 0;
+ n1 = parseFloat(raw.replace(/[^0-9.-]/g, '')) || 0;
}
- } else if (isSplitRow && raw.includes('/')) {
- const parts = raw.split('/');
- n1 = parseFloat(parts[0].replace(/[^0-9.]/g, '')) || 0;
- n2 = parseFloat(parts[1].replace(/[^0-9.]/g, '')) || 0;
- } else {
- n1 = parseFloat(raw.replace(/[^0-9.-]/g, '')) || 0;
- }
- return [Math.abs(n1), Math.abs(n2)];
- });
+ return [Math.abs(n1), Math.abs(n2)];
+ });
- maxVal1 = Math.max(...parsedVals.map((p: any) => p[0])) || 1;
- maxVal2 = Math.max(...parsedVals.map((p: any) => p[1])) || 1;
+ maxVal1 = Math.max(...parsedVals.map((p: any) => p[0])) || 1;
+ maxVal2 = Math.max(...parsedVals.map((p: any) => p[1])) || 1;
- // Shared maximum for same-unit metrics to preserve left > right proportions
- if (key === '52주 최고/최저') {
- const absoluteMax = Math.max(maxVal1, maxVal2);
- maxVal1 = absoluteMax;
- maxVal2 = absoluteMax;
+ // Shared maximum for same-unit metrics to preserve left > right proportions
+ if (key === '52주 최고/최저') {
+ const absoluteMax = Math.max(maxVal1, maxVal2);
+ maxVal1 = absoluteMax;
+ maxVal2 = absoluteMax;
+ }
}
- }
- return (
- <tr key={key} className="hover:bg-white/[0.03] transition-colors">
- <td className="py-3 px-4 text-xs font-semibold text-gray-400 bg-white/5 align-middle">{key}</td>
- {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
- {data.raw_data && data.raw_data.map((etf: any, idx: number) => {
- const val = etf.basic_info?.[key] || '-';
- const isYield = key.includes('수익률');
- const isPositive = isYield && typeof val === 'string' && val.includes('%') && !val.includes('-');
- const isNegative = isYield && typeof val === 'string' && val.includes('%') && val.includes('-');
- const textColor = isPositive ? 'text-rose-400' : isNegative ? 'text-blue-400' : 'text-gray-100';
-
- let num1 = 0;
- let num2 = 0;
- let val1Str = val;
- let val2Str = "";
-
- if (isNumericRow) {
- let raw = String(val).replace(/,/g, '');
- if (key === '순자산총액') {
- if (raw.includes("조") && raw.includes("억")) {
- const parts = raw.split("조");
- num1 = (parseFloat(parts[0]) || 0) * 10000 + (parseFloat(parts[1].replace("억", "")) || 0);
- } else if (raw.includes("조")) {
- num1 = (parseFloat(raw.replace("조", "")) || 0) * 10000;
+ return (
+ <tr key={key} className="hover:bg-white/[0.03] transition-colors">
+ <td className="py-3 px-4 text-xs font-semibold text-gray-400 bg-white/5 align-middle">{key}</td>
+ {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
+ {data.raw_data && data.raw_data.map((etf: any, idx: number) => {
+ const val = etf.basic_info?.[key] || '-';
+ const isYield = key.includes('수익률');
+ const isPositive = isYield && typeof val === 'string' && val.includes('%') && !val.includes('-');
+ const isNegative = isYield && typeof val === 'string' && val.includes('%') && val.includes('-');
+ const textColor = isPositive ? 'text-rose-400' : isNegative ? 'text-blue-400' : 'text-gray-100';
+
+ let num1 = 0;
+ let num2 = 0;
+ let val1Str = val;
+ let val2Str = "";
+
+ if (isNumericRow) {
+ let raw = String(val).replace(/,/g, '');
+ if (key === '순자산총액') {
+ if (raw.includes("조") && raw.includes("억")) {
+ const parts = raw.split("조");
+ num1 = (parseFloat(parts[0]) || 0) * 10000 + (parseFloat(parts[1].replace("억", "")) || 0);
+ } else if (raw.includes("조")) {
+ num1 = (parseFloat(raw.replace("조", "")) || 0) * 10000;
+ } else {
+ num1 = parseFloat(raw.replace("억", "")) || 0;
+ }
+ } else if (isSplitRow && raw.includes('/')) {
+ const parts = String(val).split('/');
+ val1Str = parts[0].trim();
+ val2Str = parts[1].trim();
+ num1 = parseFloat(raw.split('/')[0].replace(/[^0-9.]/g, '')) || 0;
+ num2 = parseFloat(raw.split('/')[1].replace(/[^0-9.]/g, '')) || 0;
} else {
- num1 = parseFloat(raw.replace("억", "")) || 0;
+ num1 = parseFloat(raw.replace(/[^0-9.-]/g, '')) || 0;
}
- } else if (isSplitRow && raw.includes('/')) {
- const parts = String(val).split('/');
- val1Str = parts[0].trim();
- val2Str = parts[1].trim();
- num1 = parseFloat(raw.split('/')[0].replace(/[^0-9.]/g, '')) || 0;
- num2 = parseFloat(raw.split('/')[1].replace(/[^0-9.]/g, '')) || 0;
- } else {
- num1 = parseFloat(raw.replace(/[^0-9.-]/g, '')) || 0;
+ num1 = Math.abs(num1);
+ num2 = Math.abs(num2);
}
- num1 = Math.abs(num1);
- num2 = Math.abs(num2);
- }
-
- const formatVisHeight = (n: number, max: number) => {
- if (n === 0 || max === 0) return 0;
- const ratio = n / max;
- return Math.min(100, Math.max(4, Math.pow(ratio, 0.45) * 100));
- };
-
- const widthH1 = isNumericRow ? formatVisHeight(num1, maxVal1) : 0;
- const widthH2 = isNumericRow && isSplitRow ? formatVisHeight(num2, maxVal2) : 0;
- const glowColors = ["bg-indigo-500", "bg-emerald-500", "bg-amber-500", "bg-rose-500", "bg-purple-500", "bg-cyan-500"];
- const secColors = ["bg-indigo-400/50", "bg-emerald-400/50", "bg-amber-400/50", "bg-rose-400/50", "bg-purple-400/50", "bg-cyan-400/50"];
- return (
- <td key={etf.etf_code} className={`py-3 px-2 2xl:px-4 text-[13px] 2xl:text-sm font-medium ${textColor} h-full`}>
- {!isNumericRow ? (
- <div className="flex items-center justify-center h-full w-full">{val}</div>
- ) : (
- <div className="flex flex-col items-center justify-end w-full min-h-[50px] gap-2 pt-2">
- <div className="flex items-end justify-center w-full h-[46px] gap-2 px-1">
- <div className="w-full max-w-[80px] bg-black/40 rounded-t-md border-b border-white/10 flex flex-col justify-end overflow-hidden h-full">
- <div className={`w-full ${glowColors[idx % glowColors.length]} transition-all duration-700`} style={{ height: `${widthH1}%` }} />
- </div>
- {isSplitRow && val2Str && (
+ const formatVisHeight = (n: number, max: number) => {
+ if (n === 0 || max === 0) return 0;
+ const ratio = n / max;
+ return Math.min(100, Math.max(4, Math.pow(ratio, 0.45) * 100));
+ };
+
+ const widthH1 = isNumericRow ? formatVisHeight(num1, maxVal1) : 0;
+ const widthH2 = isNumericRow && isSplitRow ? formatVisHeight(num2, maxVal2) : 0;
+ const glowColors = ["bg-indigo-500", "bg-emerald-500", "bg-amber-500", "bg-rose-500", "bg-purple-500", "bg-cyan-500"];
+ const secColors = ["bg-indigo-400/50", "bg-emerald-400/50", "bg-amber-400/50", "bg-rose-400/50", "bg-purple-400/50", "bg-cyan-400/50"];
+
+ return (
+ <td key={etf.etf_code} className={`py-3 px-2 2xl:px-4 text-[13px] 2xl:text-sm font-medium ${textColor} h-full`}>
+ {!isNumericRow ? (
+ <div className="flex items-center justify-center h-full w-full">{val}</div>
+ ) : (
+ <div className="flex flex-col items-center justify-end w-full min-h-[50px] gap-2 pt-2">
+ <div className="flex items-end justify-center w-full h-[46px] gap-2 px-1">
<div className="w-full max-w-[80px] bg-black/40 rounded-t-md border-b border-white/10 flex flex-col justify-end overflow-hidden h-full">
- <div className={`w-full ${secColors[idx % secColors.length]} transition-all duration-700`} style={{ height: `${widthH2}%` }} />
+ <div className={`w-full ${glowColors[idx % glowColors.length]} transition-all duration-700`} style={{ height: `${widthH1}%` }} />
</div>
- )}
- </div>
- <div className="flex w-full items-center justify-center gap-2 text-center text-[11px] 2xl:text-xs">
- <span className="flex-1 min-w-[30px]">{val1Str}</span>
- {isSplitRow && val2Str && <span className="flex-1 opacity-70 min-w-[30px]">{val2Str}</span>}
+ {isSplitRow && val2Str && (
+ <div className="w-full max-w-[80px] bg-black/40 rounded-t-md border-b border-white/10 flex flex-col justify-end overflow-hidden h-full">
+ <div className={`w-full ${secColors[idx % secColors.length]} transition-all duration-700`} style={{ height: `${widthH2}%` }} />
+ </div>
+ )}
+ </div>
+ <div className="flex w-full items-center justify-center gap-2 text-center text-[11px] 2xl:text-xs">
+ <span className="flex-1 min-w-[30px]">{val1Str}</span>
+ {isSplitRow && val2Str && <span className="flex-1 opacity-70 min-w-[30px]">{val2Str}</span>}
+ </div>
</div>
- </div>
- )}
- </td>
- )
- })}
- </tr>
- );
- })}
- </tbody>
- </table>
- </div>
- </section>
-
- {/* Sub-Charts Section Moved to Info Tab per Request */}
- {additionalStatsData.length > 0 && (
- <div className="lg:col-span-4 grid grid-cols-1 lg:grid-cols-3 gap-4 mt-2">
- {/* AUM Chart */}
- <section className="bg-white/[0.02] backdrop-blur-3xl rounded-xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-4 border border-white/5 flex flex-col min-h-[200px] relative overflow-hidden group">
- <div className="absolute inset-0 bg-gradient-to-tr from-indigo-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
- <h3 className="text-sm font-bold mb-4 flex items-center gap-2 relative z-10 text-gray-200">
- <span className="w-1.5 h-4 bg-indigo-400 rounded-full"></span>
- 순자산총액 <span className="text-[10px] text-gray-500 font-normal">(단위: 억 원)</span>
- </h3>
- <div className="flex-1 w-full h-[180px] relative z-10">
- <ResponsiveContainer width="100%" height="100%">
- <BarChart data={additionalStatsData} layout="vertical" margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
- <CartesianGrid strokeDasharray="3 3" horizontal={false} stroke="rgba(255,255,255,0.03)" />
- <XAxis type="number" tick={{ fill: '#64748b', fontSize: 11 }} tickFormatter={(val) => Math.floor(val / 10000) > 0 ? `${Math.floor(val / 10000)}조` : val} stroke="rgba(255,255,255,0.05)" axisLine={false} />
- <YAxis dataKey="name" type="category" width={80} stroke="rgba(255,255,255,0.05)" axisLine={false} interval={0} tick={(props: any) => {
- const { x, y, payload } = props;
- const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
- const dataIndex = additionalStatsData.findIndex((d: any) => d.name === payload.value);
- const val = payload.value.length > 7 ? payload.value.substring(0, 6) + '..' : payload.value;
- return (
- <text
- onClick={() => {
- const matchedEtf = data.raw_data?.find((d: any) => d.etf_name === payload.value || d.etf_code === payload.value);
- if (matchedEtf) setSelectedDetailEtf(matchedEtf);
- }}
- style={{ cursor: 'pointer' }}
- x={x} y={y} dy={4} textAnchor="end" fill={glowColors[dataIndex >= 0 ? dataIndex % 5 : 0]} fontSize={11} fontWeight={600}
- >
- {val}
- </text>
- );
- }} />
- <Tooltip cursor={{ fill: 'rgba(255,255,255,0.02)' }} contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(79, 70, 229, 0.2)', borderRadius: '12px', fontSize: '12px' }} itemStyle={{ color: '#818cf8', fontWeight: 'bold' }} />
- <Bar dataKey="aum" name="순자산(억)" radius={[0, 4, 4, 0]}>
- {additionalStatsData.map((_: any, idx: number) => (
- <Cell key={`cell-${idx}`} fill={['#818cf8', '#34d399', '#fbbf24', '#f87171', '#c084fc'][idx % 5]} fillOpacity={0.8} />
- ))}
- </Bar>
- </BarChart>
- </ResponsiveContainer>
- </div>
- </section>
-
- {/* Dividend Chart */}
- <section className="bg-white/[0.02] backdrop-blur-3xl rounded-xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-4 border border-white/5 flex flex-col min-h-[200px] relative overflow-hidden group">
- <div className="absolute inset-0 bg-gradient-to-tr from-emerald-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
- <h3 className="text-sm font-bold mb-4 flex items-center gap-2 relative z-10 text-gray-200">
- <span className="w-1.5 h-4 bg-emerald-400 rounded-full"></span>
- 연간배당률(TTM) <span className="text-[10px] text-gray-500 font-normal">(단위: %)</span>
- </h3>
- <div className="flex-1 w-full h-[180px] relative z-10">
- <ResponsiveContainer width="100%" height="100%">
- <BarChart data={additionalStatsData} layout="vertical" margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
- <CartesianGrid strokeDasharray="3 3" horizontal={false} stroke="rgba(255,255,255,0.03)" />
- <XAxis type="number" tick={{ fill: '#64748b', fontSize: 11 }} tickFormatter={(val) => `${val}%`} stroke="rgba(255,255,255,0.05)" axisLine={false} />
- <YAxis dataKey="name" type="category" hide={true} axisLine={false} />
- <Tooltip cursor={{ fill: 'rgba(255,255,255,0.02)' }} contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(52, 211, 153, 0.2)', borderRadius: '12px', fontSize: '12px' }} itemStyle={{ color: '#34d399', fontWeight: 'bold' }} />
- <Bar dataKey="dividend" name="배당률(%)" radius={[0, 4, 4, 0]}>
- {additionalStatsData.map((_: any, idx: number) => (
- <Cell key={`cell-${idx}`} fill={['#818cf8', '#34d399', '#fbbf24', '#f87171', '#c084fc'][idx % 5]} fillOpacity={0.8} />
- ))}
- </Bar>
- </BarChart>
- </ResponsiveContainer>
- </div>
- </section>
-
- {/* Fee Chart */}
- <section className="bg-white/[0.02] backdrop-blur-3xl rounded-xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-4 border border-white/5 flex flex-col min-h-[200px] relative overflow-hidden group">
- <div className="absolute inset-0 bg-gradient-to-tr from-rose-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
- <h3 className="text-sm font-bold mb-4 flex items-center gap-2 relative z-10 text-gray-200">
- <span className="w-1.5 h-4 bg-rose-400 rounded-full"></span>
- 총보수율 <span className="text-[10px] text-gray-500 font-normal">(낮을수록 좋음, %)</span>
- </h3>
- <div className="flex-1 w-full h-[180px] relative z-10">
- <ResponsiveContainer width="100%" height="100%">
- <BarChart data={additionalStatsData} layout="vertical" margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
- <CartesianGrid strokeDasharray="3 3" horizontal={false} stroke="rgba(255,255,255,0.03)" />
- <XAxis type="number" tick={{ fill: '#64748b', fontSize: 11 }} tickFormatter={(val) => `${val}%`} stroke="rgba(255,255,255,0.05)" axisLine={false} />
- <YAxis dataKey="name" type="category" hide={true} axisLine={false} />
- <Tooltip cursor={{ fill: 'rgba(255,255,255,0.02)' }} contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(244, 63, 94, 0.2)', borderRadius: '12px', fontSize: '12px' }} itemStyle={{ color: '#f43f5e', fontWeight: 'bold' }} />
- <Bar dataKey="fee" name="수수료(%)" radius={[0, 4, 4, 0]}>
- {additionalStatsData.map((_: any, idx: number) => (
- <Cell key={`cell-${idx}`} fill={['#818cf8', '#34d399', '#fbbf24', '#f87171', '#c084fc'][idx % 5]} fillOpacity={0.8} />
- ))}
- </Bar>
- </BarChart>
- </ResponsiveContainer>
- </div>
- </section>
- </div>
- )}
+ )}
+ </td>
+ )
+ })}
+ </tr>
+ );
+ })}
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ {/* Sub-Charts Section Moved to Info Tab per Request */}
+ {additionalStatsData.length > 0 && (
+ <div className="lg:col-span-4 grid grid-cols-1 lg:grid-cols-3 gap-4 mt-2">
+ {/* AUM Chart */}
+ <section className="bg-white/[0.02] backdrop-blur-3xl rounded-xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-4 border border-white/5 flex flex-col min-h-[200px] relative overflow-hidden group">
+ <div className="absolute inset-0 bg-gradient-to-tr from-indigo-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
+ <h3 className="text-sm font-bold mb-4 flex items-center gap-2 relative z-10 text-gray-200">
+ <span className="w-1.5 h-4 bg-indigo-400 rounded-full"></span>
+ 순자산총액 <span className="text-[10px] text-gray-500 font-normal">(단위: 억 원)</span>
+ </h3>
+ <div className="flex-1 w-full h-[180px] relative z-10">
+ <ResponsiveContainer width="100%" height="100%">
+ <BarChart data={additionalStatsData} layout="vertical" margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
+ <CartesianGrid strokeDasharray="3 3" horizontal={false} stroke="rgba(255,255,255,0.03)" />
+ <XAxis type="number" tick={{ fill: '#64748b', fontSize: 11 }} tickFormatter={(val) => Math.floor(val / 10000) > 0 ? `${Math.floor(val / 10000)}조` : val} stroke="rgba(255,255,255,0.05)" axisLine={false} />
+ <YAxis dataKey="name" type="category" width={80} stroke="rgba(255,255,255,0.05)" axisLine={false} interval={0} tick={(props: any) => {
+ const { x, y, payload } = props;
+ const glowColors = ["#818cf8", "#34d399", "#fbbf24", "#f87171", "#c084fc"];
+ const dataIndex = additionalStatsData.findIndex((d: any) => d.name === payload.value);
+ const val = payload.value.length > 7 ? payload.value.substring(0, 6) + '..' : payload.value;
+ return (
+ <text
+ onClick={() => {
+ const matchedEtf = data.raw_data?.find((d: any) => d.etf_name === payload.value || d.etf_code === payload.value);
+ if (matchedEtf) setSelectedDetailEtf(matchedEtf);
+ }}
+ style={{ cursor: 'pointer' }}
+ x={x} y={y} dy={4} textAnchor="end" fill={glowColors[dataIndex >= 0 ? dataIndex % 5 : 0]} fontSize={11} fontWeight={600}
+ >
+ {val}
+ </text>
+ );
+ }} />
+ <Tooltip cursor={{ fill: 'rgba(255,255,255,0.02)' }} contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(79, 70, 229, 0.2)', borderRadius: '12px', fontSize: '12px' }} itemStyle={{ color: '#818cf8', fontWeight: 'bold' }} />
+ <Bar dataKey="aum" name="순자산(억)" radius={[0, 4, 4, 0]}>
+ {additionalStatsData.map((_: any, idx: number) => (
+ <Cell key={`cell-${idx}`} fill={['#818cf8', '#34d399', '#fbbf24', '#f87171', '#c084fc'][idx % 5]} fillOpacity={0.8} />
+ ))}
+ </Bar>
+ </BarChart>
+ </ResponsiveContainer>
+ </div>
+ </section>
+
+ {/* Dividend Chart */}
+ <section className="bg-white/[0.02] backdrop-blur-3xl rounded-xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-4 border border-white/5 flex flex-col min-h-[200px] relative overflow-hidden group">
+ <div className="absolute inset-0 bg-gradient-to-tr from-emerald-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
+ <h3 className="text-sm font-bold mb-4 flex items-center gap-2 relative z-10 text-gray-200">
+ <span className="w-1.5 h-4 bg-emerald-400 rounded-full"></span>
+ 연간배당률(TTM) <span className="text-[10px] text-gray-500 font-normal">(단위: %)</span>
+ </h3>
+ <div className="flex-1 w-full h-[180px] relative z-10">
+ <ResponsiveContainer width="100%" height="100%">
+ <BarChart data={additionalStatsData} layout="vertical" margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
+ <CartesianGrid strokeDasharray="3 3" horizontal={false} stroke="rgba(255,255,255,0.03)" />
+ <XAxis type="number" tick={{ fill: '#64748b', fontSize: 11 }} tickFormatter={(val) => `${val}%`} stroke="rgba(255,255,255,0.05)" axisLine={false} />
+ <YAxis dataKey="name" type="category" hide={true} axisLine={false} />
+ <Tooltip cursor={{ fill: 'rgba(255,255,255,0.02)' }} contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(52, 211, 153, 0.2)', borderRadius: '12px', fontSize: '12px' }} itemStyle={{ color: '#34d399', fontWeight: 'bold' }} />
+ <Bar dataKey="dividend" name="배당률(%)" radius={[0, 4, 4, 0]}>
+ {additionalStatsData.map((_: any, idx: number) => (
+ <Cell key={`cell-${idx}`} fill={['#818cf8', '#34d399', '#fbbf24', '#f87171', '#c084fc'][idx % 5]} fillOpacity={0.8} />
+ ))}
+ </Bar>
+ </BarChart>
+ </ResponsiveContainer>
+ </div>
+ </section>
+
+ {/* Fee Chart */}
+ <section className="bg-white/[0.02] backdrop-blur-3xl rounded-xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] p-4 border border-white/5 flex flex-col min-h-[200px] relative overflow-hidden group">
+ <div className="absolute inset-0 bg-gradient-to-tr from-rose-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500" />
+ <h3 className="text-sm font-bold mb-4 flex items-center gap-2 relative z-10 text-gray-200">
+ <span className="w-1.5 h-4 bg-rose-400 rounded-full"></span>
+ 총보수율 <span className="text-[10px] text-gray-500 font-normal">(낮을수록 좋음, %)</span>
+ </h3>
+ <div className="flex-1 w-full h-[180px] relative z-10">
+ <ResponsiveContainer width="100%" height="100%">
+ <BarChart data={additionalStatsData} layout="vertical" margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
+ <CartesianGrid strokeDasharray="3 3" horizontal={false} stroke="rgba(255,255,255,0.03)" />
+ <XAxis type="number" tick={{ fill: '#64748b', fontSize: 11 }} tickFormatter={(val) => `${val}%`} stroke="rgba(255,255,255,0.05)" axisLine={false} />
+ <YAxis dataKey="name" type="category" hide={true} axisLine={false} />
+ <Tooltip cursor={{ fill: 'rgba(255,255,255,0.02)' }} contentStyle={{ backgroundColor: 'rgba(9, 9, 11, 0.95)', borderColor: 'rgba(244, 63, 94, 0.2)', borderRadius: '12px', fontSize: '12px' }} itemStyle={{ color: '#f43f5e', fontWeight: 'bold' }} />
+ <Bar dataKey="fee" name="수수료(%)" radius={[0, 4, 4, 0]}>
+ {additionalStatsData.map((_: any, idx: number) => (
+ <Cell key={`cell-${idx}`} fill={['#818cf8', '#34d399', '#fbbf24', '#f87171', '#c084fc'][idx % 5]} fillOpacity={0.8} />
+ ))}
+ </Bar>
+ </BarChart>
+ </ResponsiveContainer>
+ </div>
+ </section>
+ </div>
+ )}
- </div>
- )}
-
- {activeTab === 'holdings' && (
- <div className={`grid gap-3 animate-in fade-in slide-in-from-bottom-2 duration-500 w-full bg-white/[0.02] p-4 lg:p-5 border border-white/5 rounded-b-2xl backdrop-blur-3xl shadow-[0_8px_32px_rgba(0,0,0,0.5)] mt-0 ${isLoadingHoldings || data.raw_data?.length === 1 ? 'grid-cols-1 max-w-2xl mx-auto' :
- data.raw_data?.length === 2 ? 'grid-cols-1 md:grid-cols-2' :
- data.raw_data?.length === 3 ? 'grid-cols-1 md:grid-cols-3' :
- data.raw_data?.length === 4 ? 'grid-cols-1 md:grid-cols-2 xl:grid-cols-4' :
- 'grid-cols-1 md:grid-cols-3 xl:grid-cols-5'
- }`}>
- {isLoadingHoldings ? (
- <div className="flex flex-col items-center justify-center p-12 text-center col-span-full w-full min-h-[300px]">
- <Loader2 className="w-10 h-10 text-emerald-400 animate-spin mb-4" />
- <h3 className="text-lg font-bold text-gray-200 mb-2">실시간 포트폴리오 데이터를 분석하고 있습니다</h3>
- <p className="text-sm text-gray-500 max-w-sm mx-auto">
- 각 ETF의 최신 구성종목 데이터를 KRX 서버에서 동기화 중입니다. 분석에는 평균 5~10초가 소요됩니다.
- </p>
- </div>
- ) : (
- <>
- {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
- {data.raw_data && data.raw_data.map((etf: any, idx: number) => {
- const glowColors = ["from-indigo-500", "from-emerald-500", "from-amber-500", "from-rose-500", "from-purple-500", "from-cyan-500"];